Inttegro.Keys (inttegro v0.2.0)

Copy Markdown View Source

Creates, rotates, inspects, and destroys application secret keys.

A newly generated token is returned once. Store it immediately in a secret manager and never expose it to browser or mobile code. Lookup and usage operations return metadata, not the original token.

Summary

Functions

Revokes a secret key owned by the authenticated application. A revoked key cannot authenticate future requests but remains visible as public metadata.

Generates a new active secret key for the authenticated application. The full bearer token is returned only in this response and cannot be retrieved later. Store it before returning success from your provisioning flow. Existing keys remain active, and this operation is not idempotent: retrying an uncertain request can create another key.

Retrieves public metadata for a secret key owned by the authenticated application. The bearer token is never returned.

Lists public metadata for secret keys that belong to the authenticated application, newest first. Bearer tokens are never returned.

Updates the label of a secret key owned by the authenticated application. Send an empty label to clear it. The bearer token is never returned.

Retrieves recent authentication outcomes for a secret key owned by the authenticated application. Each activity row contains only the key ID, event time, and outcome; bearer tokens are never returned.

Functions

destroy(client, request, options \\ [])

Revokes a secret key owned by the authenticated application. A revoked key cannot authenticate future requests but remains visible as public metadata.

Parameters

Returns

Returns {:ok, Inttegro.Keys.SecretKey.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.Keys.DestroySecretKeyRequest.new!(request_attributes)

case Inttegro.Keys.destroy(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end

generate(client, request, options \\ [])

Generates a new active secret key for the authenticated application. The full bearer token is returned only in this response and cannot be retrieved later. Store it before returning success from your provisioning flow. Existing keys remain active, and this operation is not idempotent: retrying an uncertain request can create another key.

Parameters

Returns

Returns {:ok, Inttegro.Keys.GeneratedSecretKey.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.Keys.GenerateSecretKeyRequest.new!(request_attributes)

case Inttegro.Keys.generate(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end

lookup(client, request, options \\ [])

Retrieves public metadata for a secret key owned by the authenticated application. The bearer token is never returned.

Parameters

Returns

Returns {:ok, Inttegro.Keys.SecretKey.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.Keys.LookupSecretKeyRequest.new!(request_attributes)

case Inttegro.Keys.lookup(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end

page(client, request, options \\ [])

Lists public metadata for secret keys that belong to the authenticated application, newest first. Bearer tokens are never returned.

Parameters

Returns

Returns {:ok, Inttegro.Keys.SecretKeyPage.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.Keys.PageSecretKeysRequest.new!(request_attributes)

case Inttegro.Keys.page(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end

update(client, request, options \\ [])

Updates the label of a secret key owned by the authenticated application. Send an empty label to clear it. The bearer token is never returned.

Parameters

Returns

Returns {:ok, Inttegro.Keys.SecretKey.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.Keys.UpdateSecretKeyRequest.new!(request_attributes)

case Inttegro.Keys.update(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end

usage(client, request, options \\ [])

Retrieves recent authentication outcomes for a secret key owned by the authenticated application. Each activity row contains only the key ID, event time, and outcome; bearer tokens are never returned.

Parameters

Returns

Returns {:ok, Inttegro.Keys.SecretKeyUsage.t()} when Inttegro accepts and decodes the operation. Returns {:error, exception} for API, transport, or decoding failures. A successful API response can still describe an asynchronous resource that has not reached its terminal state.

Example

request = Inttegro.Keys.SecretKeyUsageRequest.new!(request_attributes)

case Inttegro.Keys.usage(client, request) do
  {:ok, result} -> result
  {:error, error} -> {:error, error}
end