Class: OCI::Auth::Signers::ServiceAccountTokenProvider::SuppliedServiceAccountTokenProvider

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/auth/signers/service_account_token_provider/sa_token_provider.rb

Overview

Class that takes in the service account token from the user

Instance Method Summary collapse

Constructor Details

#initialize(token_string) ⇒ SuppliedServiceAccountTokenProvider

Returns a new instance of SuppliedServiceAccountTokenProvider.



37
38
39
# File 'lib/oci/auth/signers/service_account_token_provider/sa_token_provider.rb', line 37

def initialize(token_string)
  @token_string = token_string
end

Instance Method Details

#service_account_tokenObject



41
42
43
44
45
46
# File 'lib/oci/auth/signers/service_account_token_provider/sa_token_provider.rb', line 41

def 
  is_sa_token_valid = OCI::Auth::Signers::ServiceAccountTokenProvider.valid_sa_token?(@token_string)
  raise 'The supplied service account token has expired.' if is_sa_token_valid == false

  @token_string
end