Sha256: 1498dfc7640d0df63bfef0716a8a5fc95fe6460d9fadbeb85bff0faf1b5f09ee

Contents?: true

Size: 1.43 KB

Versions: 26

Compression:

Stored size: 1.43 KB

Contents

# typed: strict
# frozen_string_literal: true

module Setsuzoku
  module Service
    module WebService
      module Credentials
        module CustomAuthCredential
          extend T::Sig
          extend T::Helpers
          include Setsuzoku::Credential
          include UsesTokenCredential
          abstract!

          #
          # uses_token?
          sig{ abstract.returns(T::Boolean) }
          #
          # If the credential uses a token.
          #
          # @return [Boolean] if the credential should request and store tokens.
          def uses_token?; end
          #
          # auth_headers
          sig{ abstract.returns(T::Hash[Symbol, T.untyped]) }
          # The custom auth_headers this credential provides for custom_auth_strategy.
          #
          # @return [Hash] the auth headers.
          def auth_headers; end

          #
          # self.stub_credential
          sig { returns(Struct) }
          #
          # Stub a custom_auth_credential-like instance.
          #
          # @return [Struct] a stubbed custom_auth_credential-like struct.
          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
        end
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
setsuzoku-0.15.7 lib/setsuzoku/service/web_service/credentials/custom_auth_credential.rb
setsuzoku-0.15.6 lib/setsuzoku/service/web_service/credentials/custom_auth_credential.rb
setsuzoku-0.15.5 lib/setsuzoku/service/web_service/credentials/custom_auth_credential.rb
setsuzoku-0.15.4 lib/setsuzoku/service/web_service/credentials/custom_auth_credential.rb
setsuzoku-0.15.3 lib/setsuzoku/service/web_service/credentials/custom_auth_credential.rb
setsuzoku-0.15.2 lib/setsuzoku/service/web_service/credentials/custom_auth_credential.rb
setsuzoku-0.15.1 lib/setsuzoku/service/web_service/credentials/custom_auth_credential.rb
setsuzoku-0.15.0 lib/setsuzoku/service/web_service/credentials/custom_auth_credential.rb
setsuzoku-0.14.9 lib/setsuzoku/service/web_service/credentials/custom_auth_credential.rb
setsuzoku-0.14.8 lib/setsuzoku/service/web_service/credentials/custom_auth_credential.rb
setsuzoku-0.14.7 lib/setsuzoku/service/web_service/credentials/custom_auth_credential.rb
setsuzoku-0.14.6 lib/setsuzoku/service/web_service/credentials/custom_auth_credential.rb
setsuzoku-0.14.5 lib/setsuzoku/service/web_service/credentials/custom_auth_credential.rb
setsuzoku-0.14.4 lib/setsuzoku/service/web_service/credentials/custom_auth_credential.rb
setsuzoku-0.14.3 lib/setsuzoku/service/web_service/credentials/custom_auth_credential.rb
setsuzoku-0.14.2 lib/setsuzoku/service/web_service/credentials/custom_auth_credential.rb
setsuzoku-0.14.1 lib/setsuzoku/service/web_service/credentials/custom_auth_credential.rb
setsuzoku-0.14.0 lib/setsuzoku/service/web_service/credentials/custom_auth_credential.rb
setsuzoku-0.13.1 lib/setsuzoku/service/web_service/credentials/custom_auth_credential.rb
setsuzoku-0.13.0 lib/setsuzoku/service/web_service/credentials/custom_auth_credential.rb