lib/twilio-ruby/jwt/access_token.rb in twilio-ruby-5.41.0 vs lib/twilio-ruby/jwt/access_token.rb in twilio-ruby-5.42.0
- old
+ new
@@ -18,21 +18,23 @@
:secret,
:identity,
:grants,
:nbf,
:ttl,
- :valid_until
+ :valid_until,
+ :region
def initialize(
account_sid,
signing_key_sid,
secret,
grants = [],
identity: nil,
nbf: nil,
ttl: 3600,
- valid_until: nil
+ valid_until: nil,
+ region: nil
)
super(secret_key: secret,
issuer: signing_key_sid,
subject: account_sid,
nbf: nbf,
@@ -44,10 +46,11 @@
@identity = identity
@nbf = nbf
@grants = grants
@ttl = ttl
@valid_until = valid_until
+ @region = region
end
def add_grant(grant)
@grants.push(grant)
end
@@ -73,9 +76,11 @@
def _generate_headers
headers = {
cty: 'twilio-fpa;v=1'
}
+
+ headers[:twr] = region unless region&.nil?
headers
end
class ChatGrant