Download the PHP package phil/guardian-consent without Composer
On this page you can find all versions of the php package phil/guardian-consent. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download phil/guardian-consent
More information about phil/guardian-consent
Files in phil/guardian-consent
Package guardian-consent
Short Description Parental consent for members under the age of consent: age brackets per jurisdiction, consent per feature by signed email link, dated proofs and withdrawal.
License MIT
Homepage https://ph-il.ca
Informations about the package guardian-consent
phil/guardian-consent
Age brackets per jurisdiction, and parental consent feature by feature for members below the age of consent.
phil/guardian-consent reads a member's age from their date of birth against the rules of a jurisdiction — the age from which a person consents for themselves, the age of majority, the time zone in which a birthday begins, the day a person born on 29 February has one — and keeps only the day they reach the age of consent, never the date of birth. Quebec's rules are the default: 14 years for the consent, 18 for majority. Any other jurisdiction, such as a member state applying the GDPR, is configured by the application.
Below the age of consent, every feature the site declares — the messages, the public profile, the classified ads — is refused until the holder of parental authority grants it. A request is sent by e-mail with a confirmation link: signed by the application's key, stored only as its keyed hash, used once, and expiring after a configurable delay. The guardian grants some features and refuses the others, and may withdraw a consent at any time. A request left unanswered expires and is erased after a retention delay. Every decision is kept as a dated proof: who decided, what, when, on which version of the text, by which request.
On the day a member reaches the age of consent, the guardian's consents stop applying: the member is told, and confirms their own choices. Card transactions and identity documents are not used as proof: they collect more than the purpose needs.
It is a plain PHP library on the PSR clock and event dispatcher. Minors, requests and proofs are kept behind three ports, with stores in memory; the e-mail, the link to an adult who manages an account, and the access and erasure requests of the privacy tooling are ports too. Its events carry identifiers only. Its services keep no state between calls and are safe in a long-running worker.
Status
| Part | State |
|---|---|
| Calendar dates, whole years completed, 29 February by the jurisdiction's rule | Implemented and tested |
| Jurisdictions: age of consent, majority, time zone; Quebec by default | Implemented and tested |
| Age brackets from a date of birth that is not kept | Implemented and tested |
| Requests to a guardian, feature by feature, refused by default | Implemented and tested |
| Confirmation tokens: signed, hashed, single-use, expiring; key rotation | Implemented, tested and fuzzed |
| Withdrawal by a guardian, or by an adult a link names | Implemented and tested |
| Dated proofs of every decision | Implemented and tested |
| The handover at the age of consent, with a notice and the member's own confirmation | Implemented and tested |
| The daily sweep: unanswered requests erased, handover notices sent | Implemented and tested |
| Access and erasure, read as a member and as a guardian | Implemented and tested |
| Stores in memory | Implemented and tested |
| Stores in a database, the mailer, the pages and forms | Not part of the library: the application, or a bundle on it, provides them |
Documentation
| Document | What it covers |
|---|---|
| Installation | Requirements, installing, the services to build. |
| Concepts | Minors, features, requests, tokens, proofs, statuses, the handover and the sweep. |
| Jurisdictions | The rules of a jurisdiction, the default one, and how to configure others. |
| Security and privacy | What is kept, the tokens, access and erasure, the bounds on every input. |
| Extension points | The stores, the notifier, the guardian link, the events, and when they are stable. |
| Testing | The package's tests, and how to test code that uses the consents. |
| Reference | Every public type, with its role. |
Quick start
Requirements
PHP 8.5 or later with sodium.
Contributing
Contributions are welcome on the PHIL monorepo: read the contribution guide and the security policy explains, never in a public issue.
License
MIT, © Philippe Gamache, doing business as Le Gnome Archiviste; a Parler Haut Interagir Librement project. See LICENSE.
All versions of guardian-consent with dependencies
ext-sodium Version *
psr/clock Version ^1.0
psr/event-dispatcher Version ^1.0
symfony/service-contracts Version ^3.8