nat.data_models.authentication#
Attributes#
Classes#
Base configuration for authentication providers. |
|
Enum representing the location of credentials in an HTTP request. |
|
Enum representing different types of authentication flows. |
|
Represents an authenticated context for making requests. |
|
Enum representing different header authentication schemes. |
|
Enum representing HTTP methods used in requests. |
|
Enum representing different kinds of credentials used for authentication. |
|
Base class for credentials used in authentication. |
|
Represents a credential that is sent in the HTTP header. |
|
Represents a credential that is sent as a query parameter in the URL. |
|
Represents a credential that is sent as a cookie in the HTTP request. |
|
Represents credentials for HTTP Basic Authentication. |
|
Represents a credential for Bearer Token Authentication. |
|
Represents the result of an authentication process. |
Module Contents#
- class AuthProviderBaseConfig(/, **data: Any)#
Bases:
nat.data_models.common.TypedBaseModel
,nat.data_models.common.BaseModelRegistryTag
Base configuration for authentication providers.
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError
][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.self
is explicitly positional-only to allowself
as a field name.- model_config#
Configuration for the model, should be a dictionary conforming to [
ConfigDict
][pydantic.config.ConfigDict].
- AuthProviderBaseConfigT#
- class CredentialLocation#
-
Enum representing the location of credentials in an HTTP request.
Initialize self. See help(type(self)) for accurate signature.
- HEADER = 'header'#
- QUERY = 'query'#
- COOKIE = 'cookie'#
- BODY = 'body'#
- class AuthFlowType#
-
Enum representing different types of authentication flows.
Initialize self. See help(type(self)) for accurate signature.
- API_KEY = 'api_key'#
- OAUTH2_CLIENT_CREDENTIALS = 'oauth2_client_credentials'#
- OAUTH2_AUTHORIZATION_CODE = 'oauth2_auth_code_flow'#
- OAUTH2_PASSWORD = 'oauth2_password'#
- OAUTH2_DEVICE_CODE = 'oauth2_device_code'#
- HTTP_BASIC = 'http_basic'#
- NONE = 'none'#
- class AuthenticatedContext(/, **data: Any)#
Bases:
pydantic.BaseModel
Represents an authenticated context for making requests.
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError
][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.self
is explicitly positional-only to allowself
as a field name.- model_config#
Configuration for the model, should be a dictionary conforming to [
ConfigDict
][pydantic.config.ConfigDict].
- class HeaderAuthScheme#
-
Enum representing different header authentication schemes.
Initialize self. See help(type(self)) for accurate signature.
- BEARER = 'Bearer'#
- X_API_KEY = 'X-API-Key'#
- BASIC = 'Basic'#
- CUSTOM = 'Custom'#
- class HTTPMethod#
-
Enum representing HTTP methods used in requests.
Initialize self. See help(type(self)) for accurate signature.
- GET = 'GET'#
- POST = 'POST'#
- PUT = 'PUT'#
- DELETE = 'DELETE'#
- PATCH = 'PATCH'#
- HEAD = 'HEAD'#
- OPTIONS = 'OPTIONS'#
- class CredentialKind#
-
Enum representing different kinds of credentials used for authentication.
Initialize self. See help(type(self)) for accurate signature.
- HEADER = 'header'#
- QUERY = 'query'#
- COOKIE = 'cookie'#
- BASIC = 'basic_auth'#
- BEARER = 'bearer_token'#
- class _CredBase(/, **data: Any)#
Bases:
pydantic.BaseModel
Base class for credentials used in authentication.
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError
][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.self
is explicitly positional-only to allowself
as a field name.- kind: CredentialKind#
- model_config#
Configuration for the model, should be a dictionary conforming to [
ConfigDict
][pydantic.config.ConfigDict].
- class HeaderCred(/, **data: Any)#
Bases:
_CredBase
Represents a credential that is sent in the HTTP header.
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError
][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.self
is explicitly positional-only to allowself
as a field name.- kind: Literal[CredentialKind]#
- value: pydantic.SecretStr#
- class QueryCred(/, **data: Any)#
Bases:
_CredBase
Represents a credential that is sent as a query parameter in the URL.
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError
][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.self
is explicitly positional-only to allowself
as a field name.- kind: Literal[CredentialKind]#
- value: pydantic.SecretStr#
- class CookieCred(/, **data: Any)#
Bases:
_CredBase
Represents a credential that is sent as a cookie in the HTTP request.
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError
][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.self
is explicitly positional-only to allowself
as a field name.- kind: Literal[CredentialKind]#
- value: pydantic.SecretStr#
- class BasicAuthCred(/, **data: Any)#
Bases:
_CredBase
Represents credentials for HTTP Basic Authentication.
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError
][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.self
is explicitly positional-only to allowself
as a field name.- kind: Literal[CredentialKind]#
- username: pydantic.SecretStr#
- password: pydantic.SecretStr#
- class BearerTokenCred(/, **data: Any)#
Bases:
_CredBase
Represents a credential for Bearer Token Authentication.
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError
][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.self
is explicitly positional-only to allowself
as a field name.- kind: Literal[CredentialKind]#
- token: pydantic.SecretStr#
- Credential#
- class AuthResult(/, **data: Any)#
Bases:
pydantic.BaseModel
Represents the result of an authentication process.
Create a new model by parsing and validating input data from keyword arguments.
Raises [
ValidationError
][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.self
is explicitly positional-only to allowself
as a field name.- token_expires_at: datetime.datetime | None = None#
- model_config#
Configuration for the model, should be a dictionary conforming to [
ConfigDict
][pydantic.config.ConfigDict].