# typed: ignore # frozen_string_literal: true module Setsuzoku module Service module WebService module AuthStrategies # The API OAuth Authentication Interface definition. # Any Plugin that implements this must implement all methods required for OAuth. # # Defines all necessary methods for handling authentication for any authentication strategy. class BasicAuthStrategy < WebService::AuthStrategy extend T::Sig extend T::Helpers def self.required_instance_methods [] end def self.credential_class Setsuzoku::Service::WebService::Credentials::BasicAuthCredential end # OAuth API authentication headers. # # @return [Hash(String)] the formatted authorization headers for an OAuth request sig { override.returns(T::Hash[Symbol, T.untyped]) } def auth_headers { basic_auth: { username: self.credential.username, password: self.credential.password } } end # if the auth credientials are valid # # # sig { override.returns(T::Boolean) } def auth_credential_valid? true end end end end end end