Skip to content

✨ Smartlink for second gen - #2824

Closed
Findeton wants to merge 4 commits into
mainfrom
feat/meta-12275b/main
Closed

✨ Smartlink for second gen#2824
Findeton wants to merge 4 commits into
mainfrom
feat/meta-12275b/main

Conversation

@Findeton

Copy link
Copy Markdown
Contributor

Findetonand others added 2 commits July 5, 2026 20:12
Port of feat/meta-12275/release/9.5 onto main. WASM tgz packages and
yarn.lock are regenerated in a follow-up commit.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
CopilotAI review requested due to automatic review settings July 5, 2026 20:56
@github-actions

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://docs.sequentech.io/docusaurus/pr-preview/pr-2824/

Built to branch doc-previews at 2026-07-05 20:59 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds second-generation Smart Link support by introducing a neutral Keycloak “login bridge” action-token module, exposing Keycloak realm-attribute management (with secret redaction) through Harvest/Hasura, and wiring admin-portal UI + permissions to configure Smart Link per election-event realm. Also updates Keycloak image build and CI/devcontainer workflows to optionally include the private beyond Keycloak extensions.

Changes:

  • Add Keycloak realm-attributes read/write API (Harvest route + Hasura action) with validation and server-side redaction semantics for sensitive keys.
  • Introduce action-token-login-bridge Keycloak extension and refactor existing Smart Link email/magic-link flows to use it.
  • Update admin-portal election-event settings UI, permissions, and translations to support viewing/editing realm attributes (including Smart Link config), plus update Keycloak container build to include optional beyond extensions.

Reviewed changes

Copilot reviewed 51 out of 56 changed files in this pull request and generated 3 comments.

Show a summary per file
FileDescription
packages/yarn.lockUpdates sequent-core tarball hashes referenced by the monorepo lockfile.
packages/sequent-core/src/wasm/wasm_permissions.rsAdds realm-attributes permissions to the WASM/TS permission enum.
packages/sequent-core/src/types/permissions.rsAdds new keycloak-realm-attributes-* permission variants for Rust services.
packages/sequent-core/src/types/keycloak.rsDefines Smart Link realm-attribute keys and max-length constants.
packages/sequent-core/src/services/keycloak/realm_attributes.rsAdds get/update realm-attributes support, validation, and redaction helpers (plus tests).
packages/sequent-core/src/services/jwt.rsAdds optional x-hasura-election-event-id claim field to Hasura JWT claims.
packages/keycloak-extensions/pom.xmlAdds new module and optional beyond profile + spotless include updates.
packages/keycloak-extensions/message-otp-authenticator/src/main/java/sequent/keycloak/authenticator/smart_link/SmartLinkResource.javaSwitches Smart Link resource to use the new LoginBridge helpers.
packages/keycloak-extensions/message-otp-authenticator/src/main/java/sequent/keycloak/authenticator/smart_link/SmartLinkAuthenticator.javaSwitches Smart Link authenticator to use the new LoginBridge helpers.
packages/keycloak-extensions/message-otp-authenticator/src/main/java/sequent/keycloak/authenticator/smart_link/SmartLink.javaRemoves action-token creation/link-building logic now owned by the login-bridge module.
packages/keycloak-extensions/message-otp-authenticator/src/main/java/sequent/keycloak/authenticator/smart_link/AbstractAdminResource.javaUses shared CORS helper from the login-bridge module.
packages/keycloak-extensions/message-otp-authenticator/pom.xmlAdds dependency on action-token-login-bridge.
packages/keycloak-extensions/conditional-authenticators/src/test/java/sequent/keycloak/protocol/oidc/mappers/AuthorizedElectionsUserAttributeMapperTest.javaAdds tests for the new Hasura election-event-id claim injection.
packages/keycloak-extensions/conditional-authenticators/src/main/java/sequent/keycloak/protocol/oidc/mappers/AuthorizedElectionsUserAttributeMapper.javaUses RealmNames helper and injects x-hasura-election-event-id into Hasura claims.
packages/keycloak-extensions/conditional-authenticators/pom.xmlAdds dependency on action-token-login-bridge.
packages/keycloak-extensions/action-token-login-bridge/src/test/java/sequent/keycloak/realm/RealmNamesTest.javaAdds tests for realm-name parsing helper.
packages/keycloak-extensions/action-token-login-bridge/src/main/java/sequent/keycloak/realm/RealmNames.javaAdds reusable parser for tenant-...-event-... realm names.
packages/keycloak-extensions/action-token-login-bridge/src/main/java/sequent/keycloak/login_bridge/LoginBridgeActionTokenHandlerFactory.javaRenames/moves handler factory into login-bridge module/package.
packages/keycloak-extensions/action-token-login-bridge/src/main/java/sequent/keycloak/login_bridge/LoginBridgeActionTokenHandler.javaRenames/moves handler and improves boolean checks + logging level.
packages/keycloak-extensions/action-token-login-bridge/src/main/java/sequent/keycloak/login_bridge/LoginBridgeActionToken.javaIntroduces neutral token class while keeping token type compatibility.
packages/keycloak-extensions/action-token-login-bridge/src/main/java/sequent/keycloak/login_bridge/LoginBridge.javaAdds shared action-token creation, URL building, and redirect-uri validation helpers.
packages/keycloak-extensions/action-token-login-bridge/src/main/java/sequent/keycloak/login_bridge/CorsResource.javaMoves CORS preflight handling into shared module.
packages/keycloak-extensions/action-token-login-bridge/src/main/java/sequent/keycloak/login_bridge/BaseRealmResourceProvider.javaImproves OPTIONS handling with null-safe request method access.
packages/keycloak-extensions/action-token-login-bridge/pom.xmlAdds Maven module for the shared login-bridge extension.
packages/harvest/src/routes/realm_attributes.rsAdds get-realm-attributes route and updates update route auth/validation/errors.
packages/harvest/src/main.rsRegisters the new get_realm_attributes_route.
packages/Dockerfile.keycloak.dockerignoreAdds Dockerfile-specific ignore rules for Keycloak build context.
packages/Dockerfile.keycloakBuilds provider JARs generically and supports optional beyond build context.
packages/admin-portal/src/types/keycloak.tsAdds new realm-attributes permissions to admin-portal permissions enum.
packages/admin-portal/src/translations/tl.tsAdds realm-attributes UI strings and permission labels.
packages/admin-portal/src/translations/nl.tsAdds realm-attributes UI strings and permission labels.
packages/admin-portal/src/translations/gl.tsAdds realm-attributes UI strings and permission labels.
packages/admin-portal/src/translations/fr.tsAdds realm-attributes UI strings and permission labels.
packages/admin-portal/src/translations/eu.tsAdds realm-attributes UI strings and permission labels.
packages/admin-portal/src/translations/es.tsAdds realm-attributes UI strings and permission labels.
packages/admin-portal/src/translations/en.tsAdds realm-attributes UI strings and permission labels.
packages/admin-portal/src/translations/cat.tsAdds realm-attributes UI strings and permission labels.
packages/admin-portal/src/resources/ElectionEvent/EditElectionEventDataForm.tsxAdds realm-attributes accordion/editor + read/write gating and uses new query/mutation roles.
packages/admin-portal/src/queries/GetRealmAttributes.tsAdds GraphQL query for fetching redacted realm attributes.
hasura/metadata/actions.yamlAdds get_realm_attributes action and updates permissions for realm-attribute updates.
hasura/metadata/actions.graphqlAdds GraphQL types for get_realm_attributes output.
docs/permissions.mdDocuments new keycloak-realm-attributes-* permissions.
docs/docusaurus/docs/integrations/smart_link_integration_guide.mdAdds integrator-facing Smart Link SSO guide for second generation.
docs/docusaurus/docs/developers/06-Keycloak/smart_link_hmac_design_implementation.mdAdds developer design/implementation notes for Smart Link HMAC + login bridge.
.gitmodulesPoints beyond submodule branch to feat/meta-12275/main.
.github/workflows/reusable_build_push.ymlAdds submodule checkout + build contexts for Keycloak image builds.
.github/workflows/reusable_build_push_root.ymlAdds submodule checkout + build contexts for Keycloak image builds (root workflow).
.devcontainer/scripts/format-code.shMakes formatting script path-robust and optionally formats beyond extensions.
.devcontainer/keycloak/import/tenant-90505c8a-23a9-4cdf-a26b-4e19f6a097d5.jsonAdds the new permissions into the devcontainer Keycloak realm import.
.devcontainer/docker-compose.ymlAdds beyond as an additional build context for Keycloak service.
.devcontainer/docker-compose-remote.ymlAdds beyond as an additional build context for Keycloak service (remote).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +183 to +190
.map(|(key, value)| {
let value = if is_sensitive_attribute_key(key) {
REDACTED_ATTRIBUTE_VALUE.to_string()
} else {
value.clone()
};
(key.clone(), value)
})
Comment on lines 1406 to 1420
<SelectInput
source={"presentation.voter_certificate_policy"}
choices={VoterCertificatePolicyChoices()}
label={String(
t("electionEventScreen.field.VoterCertificatePolicy.policyLabel")
)}
defaultValue={EVoterCertificatePolicy.DISABLED}
emptyText={undefined}
validate={required()}
onChange={(e) =>
setVoterCertificatePolicy(e.target.value as EVoterCertificatePolicy)
setRealmAttributeDraftValue(
REALM_ATTR_VOTER_CERTIFICATE_POLICY,
e.target.value as EVoterCertificatePolicy
)
}
Comment on lines +152 to +155
`update_realm_attributes` in
`packages/sequent-core/src/services/keycloak/realm_attributes.rs` validates each
value (boolean enable flag; non-blank bounded secret; positive integer timeouts;
comma-separated required attribute names) and drops anything malformed.
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@Findeton