request.authorizationΒΆ

Initialization for the authorization step of the request pipeline.

SubmodulesΒΆ

ClassesΒΆ

AuthorizationComponent

Abstract base class for authorization components.

CertificateProfileAuthorization

Ensures the device is allowed to use the requested certificate profile.

CompositeAuthorization

Composite authorization handler for grouping and executing multiple authorization components.

DevOwnerIDAuthorization

Ensure that if this is an AOKI request, we have a matching DevOwnerID to the IDevID.

DomainScopeValidation

Ensures the request is within the authorized domain.

ProtocolAuthorization

Ensures the request is under the correct protocol: CMP or EST.

CmpAuthorization

Composite authorization handler for EST requests.

EstAuthorization

Composite authorization handler for EST requests.

Package ContentsΒΆ

class request.authorization.AuthorizationComponent[source]ΒΆ

Bases: abc.ABC

Abstract base class for authorization components.

abstractmethod authorize(context)[source]ΒΆ

Execute authorization logic.

Parameters:

context (request.request_context.BaseRequestContext)

Return type:

None

class request.authorization.CertificateProfileAuthorization[source]ΒΆ

Bases: AuthorizationComponent, trustpoint.logger.LoggerMixin

Ensures the device is allowed to use the requested certificate profile.

authorize(context)[source]ΒΆ

Authorize the request based on the certificate profile.

Parameters:

context (request.request_context.BaseRequestContext)

Return type:

None

class request.authorization.CompositeAuthorization[source]ΒΆ

Bases: AuthorizationComponent, trustpoint.logger.LoggerMixin

Composite authorization handler for grouping and executing multiple authorization components.

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

Add a new authorization component to the composite.

Parameters:

component (AuthorizationComponent)

Return type:

None

remove(component)[source]ΒΆ

Remove an authorization component from the composite.

Parameters:

component (AuthorizationComponent)

Return type:

None

authorize(context)[source]ΒΆ

Iterate through all child authorization components and execute their authorization logic.

Parameters:

context (request.request_context.BaseRequestContext)

Return type:

None

class request.authorization.DevOwnerIDAuthorization[source]ΒΆ

Bases: AuthorizationComponent, trustpoint.logger.LoggerMixin

Ensure that if this is an AOKI request, we have a matching DevOwnerID to the IDevID.

authorize(context)[source]ΒΆ

Authorize the request based on the DevOwnerID corresponding to the client certificate.

Parameters:

context (request.request_context.BaseRequestContext)

Return type:

None

class request.authorization.DomainScopeValidation[source]ΒΆ

Bases: AuthorizationComponent, trustpoint.logger.LoggerMixin

Ensures the request is within the authorized domain.

authorize(context)[source]ΒΆ

Authorize the request based on the domain scope.

Parameters:

context (request.request_context.BaseRequestContext)

Return type:

None

class request.authorization.ProtocolAuthorization(allowed_protocols)[source]ΒΆ

Bases: AuthorizationComponent, trustpoint.logger.LoggerMixin

Ensures the request is under the correct protocol: CMP or EST.

Parameters:

allowed_protocols (list[str])

allowed_protocolsΒΆ
authorize(context)[source]ΒΆ

Authorize the request based on the protocol.

Parameters:

context (request.request_context.BaseRequestContext)

Return type:

None

class request.authorization.CmpAuthorization(allowed_operations=None)[source]ΒΆ

Bases: request.authorization.base.CompositeAuthorization

Composite authorization handler for EST requests.

Parameters:

allowed_operations (list[str] | None)

class request.authorization.EstAuthorization(allowed_operations=None)[source]ΒΆ

Bases: request.authorization.base.CompositeAuthorization

Composite authorization handler for EST requests.

Parameters:

allowed_operations (list[str] | None)