View Source Flowy.Support.OAuth.OAuthDynamicSupervisor (Flowy v0.1.0)

This supervisor is responsible for starting all the OAuthServer processes.

Configuration

config :flowy, :oauth,
  site: "https://hydra.mysite.net",
  clients: [
    %{
      client_id: System.get_env("APP_CLIENT_ID"),
      client_secret: System.get_env("APP_SECRET"),
      audience: System.get_env(" APP_AUDIENCE"),
      token_url: "/oauth2/token",
      scopes: []
    }
  ]

Summary

Functions

Returns a specification to start this module under a supervisor.

Start an OAuthServer process for a given client.

We want to starts all the existing GRPC connections when the supervisor starts. But we want to do it in a Task so we don't block the supervisor.

Start OAuthServer processes for each configured client.

Functions

Returns a specification to start this module under a supervisor.

See Supervisor.

@spec start_child(Flowy.Support.OAuth.Client.t()) :: {:ok, pid()} | {:error, any()}

Start an OAuthServer process for a given client.

@spec start_children() :: {:ok, [{:ok, pid()}]} | {:error, any()}

We want to starts all the existing GRPC connections when the supervisor starts. But we want to do it in a Task so we don't block the supervisor.

@spec start_children([Flowy.Support.OAuth.Client.t()]) ::
  {:ok, [{:ok, pid()}]} | {:error, any()}

Start OAuthServer processes for each configured client.

@spec start_link(any()) :: {:error, any()} | {:ok, pid()}