Codex.GovernedAuthority (Codex SDK v0.18.0)

Copy Markdown View Source

Exact, transient Codex launch materialization for a governed account.

The struct is the provider-family boundary between a credential materializer and Codex. It deliberately contains the secret-bearing child environment, so it is redacted from inspection and cannot be JSON encoded. Callers may not supplement any of its command, account, routing, root, or environment fields.

Summary

Types

t()

@type t() :: %Codex.GovernedAuthority{
  account_namespace: String.t(),
  auth_root: String.t(),
  authority_ref: String.t(),
  base_url: String.t(),
  clear_env?: true,
  command: String.t(),
  config_root: String.t(),
  connector_binding_ref: String.t(),
  connector_instance_ref: String.t(),
  credential_lease_ref: String.t(),
  cwd: String.t(),
  endpoint_ref: String.t(),
  env: %{required(String.t()) => String.t()},
  expires_at: DateTime.t(),
  fence: non_neg_integer(),
  generation: pos_integer(),
  issued_at: DateTime.t(),
  materialization_ref: String.t(),
  native_auth_assertion_ref: String.t(),
  operation_policy_ref: String.t(),
  operation_ref: String.t(),
  provider_account_ref: String.t(),
  target_ref: String.t()
}

Functions

child_cwd(governed_authority)

@spec child_cwd(t()) :: String.t()

child_env(governed_authority)

@spec child_env(t()) :: map()

command(governed_authority)

@spec command(t()) :: String.t()

fetch(attrs)

@spec fetch(map() | keyword()) :: {:ok, t() | nil} | {:error, term()}

governed_child_env(opts, surface)

@spec governed_child_env(
  keyword(),
  atom()
) :: {:ok, map()} | {:error, term()}

new(attrs)

@spec new(map() | keyword() | t()) :: {:ok, t()} | {:error, term()}

new(request, secret_material, launch)

@spec new(map() | struct(), map() | struct(), map() | keyword()) ::
  {:ok, t()} | {:error, term()}

Builds a Codex launch materialization from the frozen Jido request and secret material contracts plus provider-specific launch fields.

normalize(authority)

@spec normalize(term()) :: {:ok, t() | nil} | {:error, term()}

present?(arg1)

@spec present?(term()) :: boolean()

redacted(authority)

@spec redacted(t() | nil) :: map() | nil

reject_config_overrides(arg1, overrides, surface)

@spec reject_config_overrides(t() | nil, list() | nil, atom()) ::
  :ok | {:error, term()}

reject_option_supplementation(arg1, opts, surface)

@spec reject_option_supplementation(t() | nil, keyword(), atom()) ::
  :ok | {:error, term()}

to_cli_core(authority)

@spec to_cli_core(t() | nil) ::
  {:ok, CliSubprocessCore.GovernedAuthority.t() | nil} | {:error, term()}

Projects a validated Codex materialization into the narrower governed authority accepted by the shared CLI runtime.

Provider-specific identity, lifecycle, and account fields intentionally do not cross this boundary. Maps and unrelated structs must first pass through new/1; this function never treats them as CLI runtime authority.

validate_clear_env(arg1, clear_env?, surface)

@spec validate_clear_env(t() | nil, term(), atom()) :: :ok | {:error, term()}

validate_command_override(arg1, command, surface)

@spec validate_command_override(t() | nil, String.t() | nil, atom()) ::
  :ok | {:error, term()}

validate_current(authority)

@spec validate_current(t() | nil) :: :ok | {:error, term()}

validate_cwd(arg1, cwd, surface)

@spec validate_cwd(t() | nil, term(), atom()) :: :ok | {:error, term()}

validate_execution_surface(authority, arg2)

@spec validate_execution_surface(t() | nil, term()) :: :ok | {:error, term()}

validate_runtime_env(arg1, env)

@spec validate_runtime_env(t() | nil, map()) :: :ok | {:error, term()}