Search by

hryvinskyi / magento2-customer-sign-in-gdpr

hryvinskyi

A customer's sign-in methods as a data-subject entity: exported by name, and removed without a notice when the account is erased or anonymised.

Package info

github.com/hryvinskyi/magento2-customer-sign-in-gdpr

Type:magento2-module

pkg:composer/hryvinskyi/magento2-customer-sign-in-gdpr

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.0 2026-12-03 08:35 UTC

This package is auto-updated.

Last update: 2026-12-03 14:17:48 UTC


README

The bridge between the customer sign-in suite and the data-subject rights suite (hryvinskyi/magento2-gdpr). It makes a customer's sign-in methods (passkeys, authenticator apps, phone numbers, recovery codes) a kind of personal data that a GDPR request handles: an export lists them by name, and an erase or anonymise request removes them before the account is processed, so an anonymised account keeps no way to sign in. Neither suite names the other; only this package knows both. It works in the backend only: it has no page.

What it does for a store

  • A kind of data, customer_sign_in_methods. It appears in the GDPR admin's erasure rules and in every request under the label Sign-in methods, with sort order 670: before the addresses at 900 and the account at 1000, so the methods are exported and removed before the account goes and takes them with it. Its default method is delete, and it has no field to anonymise.

  • Export. The archive of a subject holds one section, customer_sign_in_methods, with one record for each factor, in the order they were enrolled. A subject with no sign-in method gets no section. The columns are:

    Column Holds
    method The method's name as the customer reads it, such as "Authenticator app"; its code when no installed package adds that method.
    name The name of the factor. A phone number is in it only in its masked form.
    created_at When the factor was added, in UTC, as an ISO 8601 date.
    last_used_at When it last finished a sign-in, in UTC, as an ISO 8601 date; empty when it never has.

    Nothing a sign-in could be made with leaves the store: no secret, code, key or credential id.

  • Erase and anonymise both remove. A sign-in method left on an account signs into it, so the methods are never kept in another form. An erase request deletes them, and an anonymise request deletes them too. Every method of the account goes at once, the recovery codes included.

  • No notice of its own. The removal sends the customer none of the sign-in suite's "sign-in method removed" e-mails: the GDPR request tells the person, when it tells them at all.

  • Guests and repeats. A guest has no sign-in methods. An account whose methods are already gone removes nothing, so a repeated run counts nothing.

Requirements

  • Magento Open Source or Adobe Commerce 2.4.x. The suites are built and tested on 2.4.9.
  • PHP 8.3 to 8.5, as the GDPR family.
  • hryvinskyi/magento2-customer-sign-in-api ^1.0, hryvinskyi/magento2-gdpr-api ^1.0 and hryvinskyi/magento2-gdpr ^1.0.
  • The sign-in engine, hryvinskyi/magento2-customer-sign-in ^1.0, which implements the contracts this package reads; Composer installs it with this package.

Installation

Run from the Magento root. The customer sign-in pack does not include this package.

composer require hryvinskyi/magento2-customer-sign-in-gdpr
bin/magento module:enable Hryvinskyi_Clock Hryvinskyi_RateLimit Hryvinskyi_VerificationCode Hryvinskyi_CustomerSignInApi Hryvinskyi_CustomerSignIn Hryvinskyi_GdprApi Hryvinskyi_DocumentExport Hryvinskyi_Logger Hryvinskyi_Gdpr Hryvinskyi_CustomerSignInGdpr
bin/magento setup:upgrade
bin/magento setup:di:compile  # production mode only
bin/magento cache:flush

Verify with a dry run, which changes nothing and lists each kind of data with its record count:

bin/magento gdpr:export --customer-id=<customer_id> --dry-run

Replace <customer_id> with the id of a customer account. The list holds customer_sign_in_methods, with the number of the customer's sign-in methods.

Configuration

None of its own. The method of the kind is set with the other erasure rules (hryvinskyi_gdpr/erasure/rules, or the GDPR admin screen), under the entity code customer_sign_in_methods. The only method it has is delete, which is also its default:

{"customer_sign_in_methods": {"method": "delete"}}

The GDPR package's README describes the rules, the delay, the formats and the e-mails.

Limits

  • No automatic clean-up by age. The kind has no aged-record anonymiser, so the retention setting of the GDPR package does nothing for it. A sign-in method stays until the customer or an administrator removes it, or a request erases or anonymises its account.
  • The kind cannot be kept. An anonymise request removes the sign-in methods whatever the erasure rules say, because an anonymised account must not be reachable by sign-in.
  • What goes with the factors. The request removes the factors through the engine. The passkey, authenticator-app and text-message packages keep their own data in tables tied to the factor, which the database deletes with it. The passkey package also keeps one random user handle per customer (hryvinskyi_customer_sign_in_passkey_user), tied to the account: the request leaves it, and it goes when the account is deleted.
  • One-time codes are left to their purge. Codes the e-mail and text-message methods issued stay in hryvinskyi_verification_code (the codes as keyed hashes; each row's subject holds, for the text-message method, the customer's id or the factor's id, and for the e-mail method the customer's id and a hash of their e-mail address) until that module's daily purge deletes them, a day or more after they expired or were used. The request does not delete them.

Registrations

Where What
Virtual type Hryvinskyi\CustomerSignInGdpr\Model\Provider\SignInMethodsProvider An entity provider (Hryvinskyi\Gdpr\Model\Entity\EntityProvider) with Model\Provider\SignInMethodDescription, Model\Provider\SignInMethodExporter and Model\Provider\SignInMethodDeleter.
Pool Hryvinskyi\Gdpr\Model\Entity\EntityProviderPool Argument providers: customer_sign_in_methods → the virtual type above, in the global di.xml.

The package registers no route, table, setting, ACL resource, cron job, command, event or plugin.

Versioning

The package follows Semantic Versioning. What changed in each version is in CHANGELOG.md.

Tests

Run from the Magento root.

  • Unit: vendor/bin/phpunit -c app/code/Hryvinskyi/CustomerSignInGdpr/phpunit.xml.dist.
  • Integration: the platform's harness in dev/tests/integration, one run at a time against its own database. cd dev/tests/integration && php -d memory_limit=4G ../../../vendor/bin/phpunit -c phpunit.xml ../../../app/code/Hryvinskyi/CustomerSignInGdpr/Test/Integration.
  • Static analysis: PHPStan 2.x at level 10 with the package's phpstan.neon.dist (phpstan analyse -c app/code/Hryvinskyi/CustomerSignInGdpr/phpstan.neon.dist --level=10, after bin/magento setup:di:compile), and vendor/bin/phpcs --standard=app/code/Hryvinskyi/CustomerSignInGdpr/phpcs.xml.dist app/code/Hryvinskyi/CustomerSignInGdpr.

Translations

The wording ships in en_US and 25 more locales: the official languages of the European Union, Norwegian Bokmål and Ukrainian. The translations are machine-made; have them read by a native speaker before a store relies on them, and override a phrase in a theme or a language pack.