Class: Virgil::Jwt::TokenContext
- Inherits:
-
Object
- Object
- Virgil::Jwt::TokenContext
- Defined in:
- lib/virgil/jwt/token_context.rb
Overview
Provides payload for access token providers
Instance Attribute Summary collapse
-
#force_reload ⇒ TrueClass
readonly
You can set up token cache in CallbackJwtProvider#obtain_access_token_proc and reset cached token if True.
-
#identity ⇒ String
readonly
Identity that should be used in access token.
-
#operation ⇒ String
readonly
Operation for which token is needed.
-
#service ⇒ String
readonly
Service for which token is needed.
Instance Method Summary collapse
-
#initialize(operation:, identity:, service: nil, force_reload: false) ⇒ TokenContext
constructor
Initializes a new instance of the class If you set up token cache in CallbackJwtProvider#obtain_access_token_proc it should reset cached token and return new if TRUE.
Constructor Details
#initialize(operation:, identity:, service: nil, force_reload: false) ⇒ TokenContext
Initializes a new instance of the class If you set up token cache in CallbackJwtProvider#obtain_access_token_proc it should reset cached token and return new if TRUE.
64 65 66 67 68 69 |
# File 'lib/virgil/jwt/token_context.rb', line 64 def initialize(operation:, identity:, service: nil, force_reload: false) @operation = operation @identity = identity @service = service @force_reload = force_reload end |
Instance Attribute Details
#force_reload ⇒ TrueClass (readonly)
You can set up token cache in CallbackJwtProvider#obtain_access_token_proc and reset cached token if True.
56 57 58 |
# File 'lib/virgil/jwt/token_context.rb', line 56 def force_reload @force_reload end |
#identity ⇒ String (readonly)
Identity that should be used in access token.
47 48 49 |
# File 'lib/virgil/jwt/token_context.rb', line 47 def identity @identity end |
#operation ⇒ String (readonly)
Operation for which token is needed.
43 44 45 |
# File 'lib/virgil/jwt/token_context.rb', line 43 def operation @operation end |
#service ⇒ String (readonly)
Service for which token is needed.
51 52 53 |
# File 'lib/virgil/jwt/token_context.rb', line 51 def service @service end |