OpenStax.Keystone v1.0.0 OpenStax.Keystone.Endpoint.Registry View Source
This module is responsible for storing registry of Keystone endpoints.
Link to this section Summary
Functions
Returns current auth token for the given endpoint
Returns current configuration for the given endpoint
Registers new endpoint that uses username/password for authentication
Registers new endpoint that uses token for authentication
Sets the auth token for the given endpoint
Starts a new registry for storing configuration and links it to the calling process
Link to this section Types
Endpoint identifier
Return value of starting registry
Options passed while starting registry
Link to this section Functions
get_auth_token(endpoint_id_t(), timeout()) :: {:ok, {OpenStax.Keystone.Endpoint.Config.auth_token_t(), OpenStax.Keystone.Endpoint.Config.expires_t()}} | {:error, any()}
Returns current auth token for the given endpoint.
It returns {:ok, {auth_token, expires}} on success, {:error, reason}
otherwise.
It is up to the application to check if auth token has not expired before usage.
Possible error reasons are:
:invalid_endpoint_id- endpoint with given ID is not registered
get_config(endpoint_id_t(), timeout()) :: {:ok, OpenStax.Keystone.Endpoint.Config.t()} | {:error, any()}
Returns current configuration for the given endpoint.
It returns {:ok, config} on success, {:error, reason} otherwise.
Possible error reasons are:
:invalid_endpoint_id- endpoint with given ID is not registered
register_password( endpoint_id_t(), OpenStax.Keystone.Endpoint.Config.endpoint_url_t(), OpenStax.Keystone.Endpoint.Config.tenant_id_t(), OpenStax.Keystone.Endpoint.Config.tenant_name_t(), OpenStax.Keystone.Endpoint.Config.username_t(), OpenStax.Keystone.Endpoint.Config.password_t() ) :: :ok | {:error, any()}
Registers new endpoint that uses username/password for authentication.
Endpoint URL is a URL to the authentication service, along with /v2.0 suffix.
According to the specification Tenant’s ID and Name are mutually exclusive so you have to specify only one of them (put nil as second one).
It returns :ok on success, {:error, reason} otherwise.
FIXME: currently in case of trying to register the two endpoints with the same ID the configuration of the existing endpoint will be overridden despite returning the error.
register_token( endpoint_id_t(), OpenStax.Keystone.Endpoint.Config.endpoint_url_t(), OpenStax.Keystone.Endpoint.Config.tenant_id_t(), OpenStax.Keystone.Endpoint.Config.tenant_name_t(), OpenStax.Keystone.Endpoint.Config.token_t() ) :: :ok | {:error, any()}
Registers new endpoint that uses token for authentication.
Endpoint URL is a URL to the authentication service, along with /v2.0 suffix.
According to the specification Tenant’s ID and Name are mutually exclusive so you have to specify only one of them (put nil as second one).
It returns :ok on success, {:error, reason} otherwise.
Possible error reasons are:
:already_registered- endpoint with given ID is already registered
FIXME: currently in case of trying to register the two endpoints with the same ID the configuration of the existing endpoint will be overridden despite returning the error.
set_auth_token( endpoint_id_t(), OpenStax.Keystone.Endpoint.Config.auth_token_t(), DateTime.t() | nil ) :: :ok | {:error, any()}
Sets the auth token for the given endpoint.
Starts a new registry for storing configuration and links it to the calling process.