Module: Setsuzoku::Service::WebService::Credentials::CustomAuthCredential

Extended by:
T::Helpers, T::Sig
Includes:
Credential, UsesTokenCredential
Defined in:
lib/setsuzoku/service/web_service/credentials/custom_auth_credential.rb

Instance Attribute Summary

Attributes included from Credential

#auth_strategy

Class Method Summary collapse

Instance Method Summary collapse

Methods included from UsesTokenCredential

#auth_base_url, #expires_on, #expires_on=, #refresh_token, #refresh_token=, #set_token!, #token, #token=

Methods included from Credential

#auth_actions, #settings, #settings=, #status, #status=

Class Method Details

.stub_credentialStruct

Stub a custom_auth_credential-like instance.

Returns:

  • (Struct)

    a stubbed custom_auth_credential-like struct.



38
39
40
41
# File 'lib/setsuzoku/service/web_service/credentials/custom_auth_credential.rb', line 38

def self.stub_credential
  s = Struct.new(:auth_strategy, :status, :settings, :auth_headers, :uses_token?, :token, :refresh_token, :expires_on)
  s.new(nil, 'active', {}, { stubbed_auth_header: 'stubbed_auth_header' }, true, 'stubbed_token', 'stubbed_refresh_token', (Time.now + 30.days))
end

Instance Method Details

#auth_headersHash

The custom auth_headers this credential provides for custom_auth_strategy.

Returns:

  • (Hash)

    the auth headers.



29
# File 'lib/setsuzoku/service/web_service/credentials/custom_auth_credential.rb', line 29

def auth_headers; end

#uses_token?Boolean

If the credential uses a token.

Returns:

  • (Boolean)

    if the credential should request and store tokens.



22
# File 'lib/setsuzoku/service/web_service/credentials/custom_auth_credential.rb', line 22

def uses_token?; end