Migrate privacy acceptance from FormAction to RequiredAction SPI#14
Merged
Conversation
- Replace FormAction-based privacy checkbox with a reusable RequiredAction SPI (helpwave-policy-acceptance). Privacy is the first concrete policy; adding more (terms, data-processing) is one factory class. Versioned via realm attribute — bumping the version re-prompts every user on next login. Removes the privacy checkbox from the registration form. - Footer imprint/privacy now link to helpwave.de/imprint and helpwave.de/privacy instead of the cdn .html pages. - Realm banner: drop the dark sub-border and switch the page outline from a 4-side inset to a top-only stripe. - Branding logo stays solid for 3s on initial mount before the loading animation starts. - Bump theme version 0.5.0 → 0.6.0 and SPI version 0.2.0 → 0.3.0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refactors the privacy policy acceptance mechanism from a registration-time
FormActionto a reusableRequiredActionSPI. This enables versioned policy consents that re-prompt users on login when the policy version changes, without requiring flow modifications.Key Changes
Backend (Keycloak SPI)
PrivacyAcceptanceFormAction+PrivacyAcceptanceFormActionFactorywith a newPolicyAcceptanceRequiredActionframeworkPolicyDefinitionimmutable configuration class to describe policies (id, provider id, URLs, i18n keys, attribute names)AbstractPolicyAcceptanceRequiredActionFactorybase class for easy addition of new policiesPrivacyPolicyRequiredActionFactoryas the first concrete policy using the new frameworkprivacy/topolicy-acceptance/to reflect broader scope0.3.0Frontend (React Login Theme)
Terms.tsxto detect policy-acceptance mode viapolicyIdcontext attributePolicyBodycomponent to render policy-specific UI (label + optional URL link)PolicyCheckboxLabelcomponent for inline policy acceptance checkbox with linkpolicyIdis present, otherwise shows traditional terms textpolicy-accepted) for policy variantRegister.tsx(now handled by RequiredAction on login)KcContext.tstype definitions to include policy-acceptance attributes0.6.0Documentation
Implementation Details
evaluateTriggers()compares stored version against realm-configured version; mismatch triggers re-prompt.helpwave.policy.<id>.urlandhelpwave.policy.<id>.version), allowing runtime changes without code deployment.PolicyDefinitionconstant and a factory class extendingAbstractPolicyAcceptanceRequiredActionFactory, then registering in SPI manifest.<id>_policy_accepted,<id>_policy_accepted_at, and<id>_policy_version.https://claude.ai/code/session_0195crFD3B3cfn6TQW4n9ACr