Class: Twilio::JWT::AccessToken
- Defined in:
- lib/twilio-ruby/jwt/access_token.rb
Defined Under Namespace
Classes: ChatGrant, PlaybackGrant, 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.
-
#region ⇒ Object
Returns the value of attribute region.
-
#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, region: 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, region: nil) ⇒ AccessToken
Returns a new instance of AccessToken.
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/twilio-ruby/jwt/access_token.rb', line 26 def initialize( account_sid, signing_key_sid, secret, grants = [], identity: nil, nbf: nil, ttl: 3600, valid_until: nil, region: 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 @region = region end |
Instance Attribute Details
#account_sid ⇒ Object
Returns the value of attribute account_sid.
16 17 18 |
# File 'lib/twilio-ruby/jwt/access_token.rb', line 16 def account_sid @account_sid end |
#grants ⇒ Object
Returns the value of attribute grants.
16 17 18 |
# File 'lib/twilio-ruby/jwt/access_token.rb', line 16 def grants @grants end |
#identity ⇒ Object
Returns the value of attribute identity.
16 17 18 |
# File 'lib/twilio-ruby/jwt/access_token.rb', line 16 def identity @identity end |
#nbf ⇒ Object
Returns the value of attribute nbf.
16 17 18 |
# File 'lib/twilio-ruby/jwt/access_token.rb', line 16 def nbf @nbf end |
#region ⇒ Object
Returns the value of attribute region.
16 17 18 |
# File 'lib/twilio-ruby/jwt/access_token.rb', line 16 def region @region end |
#secret ⇒ Object
Returns the value of attribute secret.
16 17 18 |
# File 'lib/twilio-ruby/jwt/access_token.rb', line 16 def secret @secret end |
#signing_key_id ⇒ Object
Returns the value of attribute signing_key_id.
16 17 18 |
# File 'lib/twilio-ruby/jwt/access_token.rb', line 16 def signing_key_id @signing_key_id end |
#ttl ⇒ Object
Returns the value of attribute ttl.
16 17 18 |
# File 'lib/twilio-ruby/jwt/access_token.rb', line 16 def ttl @ttl end |
#valid_until ⇒ Object
Returns the value of attribute valid_until.
16 17 18 |
# File 'lib/twilio-ruby/jwt/access_token.rb', line 16 def valid_until @valid_until end |
Instance Method Details
#add_grant(grant) ⇒ Object
54 55 56 |
# File 'lib/twilio-ruby/jwt/access_token.rb', line 54 def add_grant(grant) @grants.push(grant) end |