Sha256: 22b4197ed27d5033edc8384dc9919596f1e5bf2d7f2b596dbcc678436ef9c459

Contents?: true

Size: 1.35 KB

Versions: 17

Compression:

Stored size: 1.35 KB

Contents

# 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

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
setsuzoku-0.11.9 lib/setsuzoku/service/web_service/auth_strategies/basic_auth_strategy.rb
setsuzoku-0.11.8 lib/setsuzoku/service/web_service/auth_strategies/basic_auth_strategy.rb
setsuzoku-0.11.7 lib/setsuzoku/service/web_service/auth_strategies/basic_auth_strategy.rb
setsuzoku-0.11.6 lib/setsuzoku/service/web_service/auth_strategies/basic_auth_strategy.rb
setsuzoku-0.11.5 lib/setsuzoku/service/web_service/auth_strategies/basic_auth_strategy.rb
setsuzoku-0.11.0 lib/setsuzoku/service/web_service/auth_strategies/basic_auth_strategy.rb
setsuzoku-0.10.12 lib/setsuzoku/service/web_service/auth_strategies/basic_auth_strategy.rb
setsuzoku-0.10.11 lib/setsuzoku/service/web_service/auth_strategies/basic_auth_strategy.rb
setsuzoku-0.10.10 lib/setsuzoku/service/web_service/auth_strategies/basic_auth_strategy.rb
setsuzoku-0.10.9 lib/setsuzoku/service/web_service/auth_strategies/basic_auth_strategy.rb
setsuzoku-0.10.8 lib/setsuzoku/service/web_service/auth_strategies/basic_auth_strategy.rb
setsuzoku-0.10.7 lib/setsuzoku/service/web_service/auth_strategies/basic_auth_strategy.rb
setsuzoku-0.10.6 lib/setsuzoku/service/web_service/auth_strategies/basic_auth_strategy.rb
setsuzoku-0.10.5 lib/setsuzoku/service/web_service/auth_strategies/basic_auth_strategy.rb
setsuzoku-0.10.4 lib/setsuzoku/service/web_service/auth_strategies/basic_auth_strategy.rb
setsuzoku-0.10.3 lib/setsuzoku/service/web_service/auth_strategies/basic_auth_strategy.rb
setsuzoku-0.10.1 lib/setsuzoku/service/web_service/auth_strategies/basic_auth_strategy.rb