rs_server_common/authentication/authentication_to_external.md¶
Authentication to external stations module.
ServiceNotFound
¶
Bases: Exception
Raised if there are no existing service matching the provided domain
__read_configuration()
¶
Read the rs-server configuration for authentication to extenal stations.
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
A dictionary containing the configuration data |
Source code in docs/rs-server/services/common/rs_server_common/authentication/authentication_to_external.py
load_external_auth_config(station_id=None, service=None, domain=None)
¶
Load the external authentication configuration from a given station and service or from a domain. Args: station_id (Optional[str]): The ID of the station for which the authorization token is set. service (Optional[str]): The service name ("auxip" or "cadip") used to retrieve the token. domain (Optional[str]): The domain related to the station for the token.
Raises:
| Type | Description |
|---|---|
ValueError
|
If the station_id is None or an empty string. |
Exception
|
If token retrieval fails for any reason, a general exception will be logged. |
Source code in docs/rs-server/services/common/rs_server_common/authentication/authentication_to_external.py
load_external_auth_config_by_domain(domain)
¶
Load the external authentication configuration based on the domain from a YAML file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
domain
|
str
|
The domain to search for in the authentication configuration. |
required |
Returns:
| Type | Description |
|---|---|
StationExternalAuthenticationConfig | S3ExternalAuthenticationConfig | None
|
Optional[StationExternalAuthenticationConfig | S3ExternalAuthenticationConfig]: An object representing the |
StationExternalAuthenticationConfig | S3ExternalAuthenticationConfig | None
|
external authentication configuration, with a variation if it is for a regular external station or an external |
StationExternalAuthenticationConfig | S3ExternalAuthenticationConfig | None
|
S3 bucket, or None if the station or service is not found or if an error occurs. |
Source code in docs/rs-server/services/common/rs_server_common/authentication/authentication_to_external.py
load_external_auth_config_by_station_service(station_id, service=None)
¶
Load the external authentication configuration for a given station and service from a YAML file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
station_id
|
str
|
The ID of the station for which the authentication config is being loaded. |
required |
service
|
str
|
The name of the service ("auxip" or "cadip") to load the authentication configuration for. |
None
|
Returns:
| Type | Description |
|---|---|
StationExternalAuthenticationConfig | S3ExternalAuthenticationConfig | None
|
Optional[StationExternalAuthenticationConfig | S3ExternalAuthenticationConfig]: An object representing the |
StationExternalAuthenticationConfig | S3ExternalAuthenticationConfig | None
|
external authentication configuration, with a variation if it is for a regular external station or an external |
StationExternalAuthenticationConfig | S3ExternalAuthenticationConfig | None
|
S3 bucket, or None if the station or service is not found or if an error occurs. |