Grants can carry an expiry (expires_at), but trusts - standing per-kind authorizations stored as pdv_consumer_authorization - cannot be time-boxed from the UI, even though the data model and enforcement already support it: the entity has an expires_at field, the active-trust predicate counts a trust only while expires_at is NULL or in the future, and the garbage collector reaps lapsed rows. The only gap is that TrustManager::trust() takes no expiry and the trust-granting forms offer no control, so every trust is permanent until revoked.

This adds an optional, owner-picked expiry to a trust, surfaced wherever an owner grants one.

Proposed change:
- Add an optional expires_at to TrustManager::trust(), set on a new trust and refreshed on re-trust (extend it, shorten it, or clear it back to permanent).
- A shared form fragment - a duration select (Never / 30 days / 90 days / 6 months / 1 year) plus a resolver - reused by the four trust-granting forms: TrustConsumerForm, RequestTrustForm, ConsentForm and RequestApproveForm. The Webform integration is covered transitively, since its save-back routes through these consent ceremonies.
- Default is Never, preserving today's permanent-until-revoked behaviour. On lapse the existing active-trust predicate simply re-prompts for consent; no new enforcement is needed.
- French translations and an owner-guide note.

A merge request with a kernel-test regression guard (future expiry active, past expiry lapses, no-expiry clears to permanent) is attached.

Issue fork pdv-3594030

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

mably created an issue. See original summary.

mably’s picture

Status: Active » Needs review

  • mably committed 7888a332 on 1.x
    feat: #3594030 Add an optional expiry to a trust (standing per-kind...
mably’s picture

Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.