GroundPlane.Contracts.Lease (GroundPlane Contracts v0.1.0)

Copy Markdown View Source

Struct and validation helpers for lease records.

Summary

Types

t()

@type t() :: %GroundPlane.Contracts.Lease{
  attach_grant_ref: String.t() | nil,
  credential_handle_ref: String.t() | nil,
  credential_lease_ref: String.t() | nil,
  epoch: non_neg_integer(),
  expires_at: DateTime.t(),
  fence_token: String.t() | nil,
  holder: String.t(),
  installation_revision_ref: String.t() | nil,
  lease_id: String.t(),
  operation_class: String.t() | nil,
  operation_policy_ref: String.t() | nil,
  persistence_posture: map() | nil,
  policy_revision_ref: String.t() | nil,
  resource: String.t(),
  resource_account_ref: String.t() | nil,
  resource_family: String.t() | nil,
  resource_instance_ref: String.t() | nil,
  revocation_ref: String.t() | nil,
  revoked_at: DateTime.t() | nil,
  rotation_epoch: non_neg_integer() | nil,
  subject_ref: String.t() | nil,
  target_grant_revision: String.t() | nil,
  target_ref: String.t() | nil,
  tenant_id: String.t() | nil
}

Functions

active?(lease, now)

@spec active?(t(), DateTime.t()) :: boolean()

cleanup_event(lease, attrs)

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

credential_scope(lease)

@spec credential_scope(t()) :: map()

expired?(lease, now)

@spec expired?(t(), DateTime.t()) :: boolean()

new(attrs)

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

revoked?(lease)

@spec revoked?(t()) :: boolean()