Class: Infisical::Models::MachineIdentityCredential
- Inherits:
-
Struct
- Object
- Struct
- Infisical::Models::MachineIdentityCredential
- Defined in:
- lib/infisical/models/machine_identity_credential.rb
Overview
Credential material issued by a machine identity login. Exposes the token's lifetime so callers can build their own refresh logic.
Instance Attribute Summary collapse
-
#access_token ⇒ String
Bearer token used to authenticate API requests.
-
#access_token_max_ttl ⇒ Integer
Hard ceiling in seconds on the token's total lifetime across renewals.
-
#expires_in ⇒ Integer
Seconds until the token expires, from issue time.
-
#token_type ⇒ String
Token scheme, e.g.
Class Method Summary collapse
-
.from_api(data) ⇒ Object
private
Builds a credential from an API response hash (camelCase keys).
Instance Attribute Details
#access_token ⇒ String
Returns bearer token used to authenticate API requests.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/infisical/models/machine_identity_credential.rb', line 17 MachineIdentityCredential = Struct.new( :access_token, :expires_in, :access_token_max_ttl, :token_type, keyword_init: true ) do # Builds a credential from an API response hash (camelCase keys). # # @api private def self.from_api(data) new( access_token: data["accessToken"], expires_in: data["expiresIn"], access_token_max_ttl: data["accessTokenMaxTTL"], token_type: data["tokenType"] ) end end |
#access_token_max_ttl ⇒ Integer
Returns hard ceiling in seconds on the token's total lifetime across renewals.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/infisical/models/machine_identity_credential.rb', line 17 MachineIdentityCredential = Struct.new( :access_token, :expires_in, :access_token_max_ttl, :token_type, keyword_init: true ) do # Builds a credential from an API response hash (camelCase keys). # # @api private def self.from_api(data) new( access_token: data["accessToken"], expires_in: data["expiresIn"], access_token_max_ttl: data["accessTokenMaxTTL"], token_type: data["tokenType"] ) end end |
#expires_in ⇒ Integer
Returns seconds until the token expires, from issue time.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/infisical/models/machine_identity_credential.rb', line 17 MachineIdentityCredential = Struct.new( :access_token, :expires_in, :access_token_max_ttl, :token_type, keyword_init: true ) do # Builds a credential from an API response hash (camelCase keys). # # @api private def self.from_api(data) new( access_token: data["accessToken"], expires_in: data["expiresIn"], access_token_max_ttl: data["accessTokenMaxTTL"], token_type: data["tokenType"] ) end end |
#token_type ⇒ String
Returns token scheme, e.g. "Bearer".
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/infisical/models/machine_identity_credential.rb', line 17 MachineIdentityCredential = Struct.new( :access_token, :expires_in, :access_token_max_ttl, :token_type, keyword_init: true ) do # Builds a credential from an API response hash (camelCase keys). # # @api private def self.from_api(data) new( access_token: data["accessToken"], expires_in: data["expiresIn"], access_token_max_ttl: data["accessTokenMaxTTL"], token_type: data["tokenType"] ) end end |
Class Method Details
.from_api(data) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Builds a credential from an API response hash (camelCase keys).
24 25 26 27 28 29 30 31 |
# File 'lib/infisical/models/machine_identity_credential.rb', line 24 def self.from_api(data) new( access_token: data["accessToken"], expires_in: data["expiresIn"], access_token_max_ttl: data["accessTokenMaxTTL"], token_type: data["tokenType"] ) end |