Ptolemy v0.2.0 Ptolemy.Server View Source

Ptolemy.Server is responsible for the management of a remote backend's server's data.

Data that Ptolemy.Server manages includes but not limited to:

  • Authentication Data to a remote vault server and its lifecycle
  • IAP authentication and its lifecyle

Link to this section Summary

Functions

Returns a specification to start this module under a supervisor

Dumps entire state within a specified server

Fetches access tokens needed to authenticate against a remote vault server

Get a specific key within a ptolemy state

Set a key within a specified server's state

Start a genserver pointing to a remote server

Link to this section Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

Link to this function

dump(server_name) View Source
dump(atom()) :: {:ok, any()}

Dumps entire state within a specified server.

Link to this function

fetch_credentials(server_name) View Source
fetch_credentials(atom()) :: [tuple(), ...] | {:error, String.t()}

Fetches access tokens needed to authenticate against a remote vault server.

Returns a list of tuple(s) containing the access tokens. If IAP is enabled its corresponding bearer token will also be returned as part of this list.

Link to this function

get_data(server_name, key) View Source
get_data(atom(), atom()) :: {:ok, any()} | {:error, String.t()}

Get a specific key within a ptolemy state.

Link to this function

set_data(server_name, key, payload) View Source
set_data(atom(), atom(), map()) :: :ok | {:error, String.t()}

Set a key within a specified server's state.

Link to this function

start_link(server_name, server_conf_name, opts \\ []) View Source
start_link(atom() | String.t(), atom(), keyword()) ::
  {:ok, pid()} | :ignore | {:error, any()}

Start a genserver pointing to a remote server.

When starting you may provide runtime configuration to Ptolemy by specifying a keyword list with the overiding values.