Class: Infisical::Models::MachineIdentityCredential

Inherits:
Struct
  • Object
show all
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

Class Method Summary collapse

Instance Attribute Details

#access_tokenString

Returns bearer token used to authenticate API requests.

Returns:

  • (String)

    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_ttlInteger

Returns hard ceiling in seconds on the token's total lifetime across renewals.

Returns:

  • (Integer)

    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_inInteger

Returns seconds until the token expires, from issue time.

Returns:

  • (Integer)

    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_typeString

Returns token scheme, e.g. "Bearer".

Returns:

  • (String)

    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