esgf_core_utils.models.auth
Models relating to Authorisation for the ESGF Next Gen Core Architecture.
Attributes
Exceptions
Raised when the caller is not authorised to perform an operation. |
|
Raised when a user does not possess a required permission. |
Classes
Model describing |
|
Model describing Permission auth info of a ESGF publisher. |
|
Model describing Permission store of a ESGF publisher. |
|
Model describing Nodes auth info of a ESGF publisher. |
|
Model describing Project auth info of a ESGF publisher. |
|
Model describing Authentication information of a ESGF publisher. |
Package Contents
- exception esgf_core_utils.models.auth.AuthorizationException
Bases:
RFC9457ExceptionRaised when the caller is not authorised to perform an operation.
- status_code: ClassVar[int] = 403
- type: ClassVar[str] = 'https://esgf.io/publication/errors/missing-permission'
- title: ClassVar[str] = 'You do not have permission'
- property detail: str
Details of exception.
- exception esgf_core_utils.models.auth.MissingPermissionException
Bases:
ExceptionRaised when a user does not possess a required permission.
- type: str
- target: str
- role: str = ''
- __str__() str
Exception message.
- class esgf_core_utils.models.auth.RequesterData(/, **data: Any)
Bases:
pydantic.BaseModelModel describing
Requests Datafor theAuthcomponent of a Kafka message in more detail.- client_id: str
- iss: str
- sub: str
- esgf_core_utils.models.auth.logger
- esgf_core_utils.models.auth.Role
- class esgf_core_utils.models.auth.Permission(/, **data: Any)
Bases:
pydantic.BaseModelModel describing Permission auth info of a ESGF publisher.
- id: str
- class esgf_core_utils.models.auth.PermissionStore(/, **data: Any)
Bases:
pydantic.BaseModelModel describing Permission store of a ESGF publisher.
- permissions: dict[str, Permission]
- add(permission: Permission | dict[str, Any]) None
Add a new project or update roles if project already exists.
- Args:
project (Permission | dict): project to be added
- class esgf_core_utils.models.auth.Nodes(/, **data: Any)
Bases:
PermissionStoreModel describing Nodes auth info of a ESGF publisher.
- class esgf_core_utils.models.auth.Projects(/, **data: Any)
Bases:
PermissionStoreModel describing Project auth info of a ESGF publisher.
- class esgf_core_utils.models.auth.Authorizer(/, **data: Any)
Bases:
pydantic.BaseModelModel describing Authentication information of a ESGF publisher.
- requester_data: esgf_core_utils.models.kafka.events.RequesterData
- regex: str
- authorize(collection_id: str, item: stac_pydantic.item.Item | stac_fastapi.extensions.transaction.request.PartialItem, role: Role, request_id: str, event_id: str) None
Check for appropriate authorisation.
- Args:
collection_id: collection id of request item (Item): item to be authorised role (Role): required role for auhroisation
- Raises:
AuthorizationException: Raised if either node or role permission is missing
- add(entitlements: list[str]) None
add entitlements to Authorizer.
- Args:
entitlements (list[str]): list of entitlements to be added