request.authenticationΒΆ

Initialization for the authentication step of the request pipeline.

SubmodulesΒΆ

ClassesΒΆ

AuthenticationComponent

Abstract base class for authentication components.

ClientCertificateAuthentication

Handles authentication via client certificates.

CompositeAuthentication

Composite authenticator for grouping and executing multiple authentication methods.

IDevIDAuthentication

Handles authentication via IDevID certificates.

CmpAuthentication

Composite authenticator specifically for CMP requests, combining various authentication methods.

EstAuthentication

Composite authenticator specifically for EST requests, combining various authentication methods.

Package ContentsΒΆ

class request.authentication.AuthenticationComponent[source]ΒΆ

Bases: abc.ABC

Abstract base class for authentication components.

abstractmethod authenticate(context)[source]ΒΆ

Authenticate a request using specific logic.

Parameters:

context (request.request_context.BaseRequestContext)

Return type:

devices.models.DeviceModel | None

class request.authentication.ClientCertificateAuthentication[source]ΒΆ

Bases: AuthenticationComponent, trustpoint.logger.LoggerMixin

Handles authentication via client certificates.

authenticate(context)[source]ΒΆ

Authenticate using the client certificate from the context.

Parameters:

context (request.request_context.BaseRequestContext)

Return type:

None

_raise_certificate_error(message, cause=None)[source]ΒΆ

Raise certificate authentication error with proper exception chaining.

Parameters:
  • message (str)

  • cause (Exception | None)

Return type:

Never

class request.authentication.CompositeAuthentication[source]ΒΆ

Bases: AuthenticationComponent, trustpoint.logger.LoggerMixin

Composite authenticator for grouping and executing multiple authentication methods.

components: list[AuthenticationComponent] = []ΒΆ
add(component)[source]ΒΆ

Add an authentication component to the composite.

Parameters:

component (AuthenticationComponent)

Return type:

None

remove(component)[source]ΒΆ

Remove an authentication component from the composite.

Parameters:

component (AuthenticationComponent)

Return type:

None

authenticate(context)[source]ΒΆ

Authenticate the request using all registered components.

Parameters:

context (request.request_context.BaseRequestContext)

Return type:

None

class request.authentication.IDevIDAuthentication[source]ΒΆ

Bases: AuthenticationComponent, trustpoint.logger.LoggerMixin

Handles authentication via IDevID certificates.

authenticate(context)[source]ΒΆ

Authenticate the request using the IDevID mechanism.

Parameters:

context (request.request_context.BaseRequestContext)

Return type:

None

_raise_idevid_error(message)[source]ΒΆ

Raise IDevID authentication error.

Parameters:

message (str)

Return type:

Never

class request.authentication.CmpAuthentication[source]ΒΆ

Bases: request.authentication.base.CompositeAuthentication

Composite authenticator specifically for CMP requests, combining various authentication methods.

class request.authentication.EstAuthentication[source]ΒΆ

Bases: request.authentication.base.CompositeAuthentication

Composite authenticator specifically for EST requests, combining various authentication methods.