Class: Twilio::JWT::AccessToken
- Defined in:
- lib/twilio-ruby/jwt/access_token.rb
Defined Under Namespace
Classes: ChatGrant, ConversationsGrant, IpMessagingGrant, SyncGrant, TaskRouterGrant, VideoGrant, VoiceGrant
Instance Attribute Summary collapse
-
#account_sid ⇒ Object
Returns the value of attribute account_sid.
-
#grants ⇒ Object
Returns the value of attribute grants.
-
#identity ⇒ Object
Returns the value of attribute identity.
-
#nbf ⇒ Object
Returns the value of attribute nbf.
-
#secret ⇒ Object
Returns the value of attribute secret.
-
#signing_key_id ⇒ Object
Returns the value of attribute signing_key_id.
-
#ttl ⇒ Object
Returns the value of attribute ttl.
-
#valid_until ⇒ Object
Returns the value of attribute valid_until.
Instance Method Summary collapse
- #add_grant(grant) ⇒ Object
-
#initialize(account_sid, signing_key_sid, secret, grants = [], identity: nil, nbf: nil, ttl: 3600, valid_until: nil) ⇒ AccessToken
constructor
A new instance of AccessToken.
Methods inherited from BaseJWT
Constructor Details
#initialize(account_sid, signing_key_sid, secret, grants = [], identity: nil, nbf: nil, ttl: 3600, valid_until: nil) ⇒ AccessToken
Returns a new instance of AccessToken.
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/twilio-ruby/jwt/access_token.rb', line 23 def initialize( account_sid, signing_key_sid, secret, grants = [], identity: nil, nbf: nil, ttl: 3600, valid_until: nil ) super(secret_key: secret, issuer: signing_key_sid, subject: account_sid, nbf: nbf, ttl: ttl, valid_until: valid_until) @account_sid = account_sid @signing_key_sid = signing_key_sid @secret = secret @identity = identity @nbf = nbf @grants = grants @ttl = ttl @valid_until = valid_until end |
Instance Attribute Details
#account_sid ⇒ Object
Returns the value of attribute account_sid.
14 15 16 |
# File 'lib/twilio-ruby/jwt/access_token.rb', line 14 def account_sid @account_sid end |
#grants ⇒ Object
Returns the value of attribute grants.
14 15 16 |
# File 'lib/twilio-ruby/jwt/access_token.rb', line 14 def grants @grants end |
#identity ⇒ Object
Returns the value of attribute identity.
14 15 16 |
# File 'lib/twilio-ruby/jwt/access_token.rb', line 14 def identity @identity end |
#nbf ⇒ Object
Returns the value of attribute nbf.
14 15 16 |
# File 'lib/twilio-ruby/jwt/access_token.rb', line 14 def nbf @nbf end |
#secret ⇒ Object
Returns the value of attribute secret.
14 15 16 |
# File 'lib/twilio-ruby/jwt/access_token.rb', line 14 def secret @secret end |
#signing_key_id ⇒ Object
Returns the value of attribute signing_key_id.
14 15 16 |
# File 'lib/twilio-ruby/jwt/access_token.rb', line 14 def signing_key_id @signing_key_id end |
#ttl ⇒ Object
Returns the value of attribute ttl.
14 15 16 |
# File 'lib/twilio-ruby/jwt/access_token.rb', line 14 def ttl @ttl end |
#valid_until ⇒ Object
Returns the value of attribute valid_until.
14 15 16 |
# File 'lib/twilio-ruby/jwt/access_token.rb', line 14 def valid_until @valid_until end |
Instance Method Details
#add_grant(grant) ⇒ Object
49 50 51 |
# File 'lib/twilio-ruby/jwt/access_token.rb', line 49 def add_grant(grant) @grants.push(grant) end |