Sha256: aeeb42549b0c050e315989bd72c93699531f78862ecef90079c1e9b8109cb517
Contents?: true
Size: 1.83 KB
Versions: 26
Compression:
Stored size: 1.83 KB
Contents
# typed: ignore # frozen_string_literal: true module Setsuzoku module Service module WebService module AuthStrategies # The API Custom Authentication Interface definition. # Any Plugin that implements this must implement all methods required for Custom auth. # # Defines all necessary methods for the custom auth strategy. class CustomAuthStrategy < WebService::AuthStrategy extend T::Sig extend T::Helpers include StrategyCanUseTokens def self.required_instance_methods [] end def self.credential_class Setsuzoku::Service::WebService::Credentials::CustomAuthCredential end # # auth_headers sig { override.returns(T::Hash[Symbol, T.untyped]) } # # Any custom auth headers required to perform authenticated requests. # # @return [Hash] the auth headers. def auth_headers self.credential.auth_headers end # # refresh_expired_token! sig { override.void } # # Construct the custom token_request_body and request a token. # # @return [void] def new_token! action = :new_token body = self.credential.auth_actions[action][:body] get_token!(body, action) end # # refresh_expired_token! sig { override.void } # # Construct the custom token_request_body and request a token. # # @return [void] def refresh_expired_token! action = :refresh_token body = self.credential.auth_actions[action][:body] get_token!(body, :refresh_token) end end end end end end
Version data entries
26 entries across 26 versions & 1 rubygems