Class: Zitadel::Client::Auth::Authenticator

Inherits:
Object
  • Object
show all
Defined in:
lib/zitadel/client/auth/authenticator.rb,
sig/lib.rbs

Overview

Abstract base class for authenticators.

This class defines the basic structure for any authenticator by requiring the implementation of a method to retrieve authentication headers, and provides a way to store and retrieve the host.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(host) ⇒ Authenticator

Initializes the Authenticator with the specified host.

Parameters:

  • host (String)

    the base URL or endpoint for the service.

  • (String)


24
25
26
# File 'lib/zitadel/client/auth/authenticator.rb', line 24

def initialize(host)
  @host = host
end

Instance Attribute Details

#hostString (readonly)

Returns the value of attribute host.

Returns:

  • (String)


17
18
19
# File 'lib/zitadel/client/auth/authenticator.rb', line 17

def host
  @host
end

Instance Method Details

#auth_headersHash{String => String}

Retrieves the authentication headers to be sent with requests.

Subclasses must override this method to return the appropriate headers.

Returns:

  • (Hash{String => String})

Raises:

  • (NotImplementedError)

    Always raised to require implementation in a subclass.



37
38
39
40
41
42
# File 'lib/zitadel/client/auth/authenticator.rb', line 37

def auth_headers
  # :nocov:
  raise NotImplementedError,
        "#{self.class}#get_auth_headers is an abstract method. Please override it in a subclass."
  # :nocov:
end