# keystone.trust.backends.base module

class keystone.trust.backends.base.TrustDriverBase

  Bases: `object`

  abstractmethod consume_use(trust_id)

    Consume one use of a trust.

    One use of a trust is consumed when the trust was created with a limitation on its uses, provided there are still uses available.

    Raises:

      - keystone.exception.TrustUseLimitReached – If no remaining uses for trust.

      - keystone.exception.TrustNotFound – If the trust doesn’t exist.

  abstractmethod create_trust(trust_id, trust, roles)

    Create a new trust.

    Returns:

      a new trust

  abstractmethod delete_trust(trust_id)
  abstractmethod delete_trusts_for_project(project_id)

    Delete all trusts for a project.

    Parameters:

      project_id – ID of a project to filter trusts by.

  abstractmethod flush_expired_and_soft_deleted_trusts(project_id=None, trustor_user_id=None, trustee_user_id=None, date=None)

    Flush expired and non-expired soft deleted trusts from the backend.

    Parameters:

      - project_id – ID of a project to filter trusts by.

      - trustor_user_id – ID of a trustor_user_id to filter trusts by.

      - trustee_user_id – ID of a trustee_user_id to filter trusts by.

      - date (datetime) – date to filter trusts by.

  abstractmethod get_trust(trust_id, deleted=False)

    Get a trust by the trust id.

    Parameters:

      - trust_id (string) – the trust identifier

      - deleted (bool) – return the trust even if it is deleted, expired, or has no consumptions left

  abstractmethod list_trusts()
  abstractmethod list_trusts_for_trustee(trustee)
  abstractmethod list_trusts_for_trustor(trustor, redelegated_trust_id=None)

this page last updated: 2026-06-11 21:52:50

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.

found an error? report a bug