Repository navigation
Conversation
Users can now pass CryptoSupport-protected passwords (`{...}` form) directly
to acl.createUser, acl.setPassword and acl.check.password without
unprotecting them from the script. Previously the encrypted string was
stored verbatim, so the alternative was decrypting ahead of time and
hardcoding the plaintext.
CodeContext resolves CryptoSupport through osgiContext.getService (same
pattern as NotificationManager) and passes it into Acl -> AclContext ->
AuthorizableManager. A small CryptoDecryptor wraps the service and is
applied on every password that flows through createUser, changePassword
and testPassword; blank or unprotected values pass through unchanged,
and CryptoException is surfaced as AclException. The granite-crypto API
is already on the classpath transitively via cq-replication, so no new
dependency is needed.
The set_password and create_user snippets explain in their tooltip that
only the password argument is auto-decrypted. A new osgi_crypto_protect
snippet shows how to generate a {...} value via cryptoSupport.protect(),
which works on any AEM including AEMaaCS where /system/console/crypto is
not reachable.
Closes wttech#335
dprzybyl
force-pushed
the
feature/issue-335-protected-password
branch
from
October 26, 2026 12:16
0b72f57 to
2e47e26
Compare
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
Closes #335.
Users can now pass CryptoSupport-protected passwords (
{...}form) directly toacl.createUser,acl.setPasswordandacl.check.passwordwithout unprotecting them from the script. Previously the encrypted string was stored verbatim, so the alternative was decrypting ahead of time and hardcoding the plaintext.Changes
CodeContextresolvesCryptoSupportthroughosgi.getService(...)(same pattern asNotificationManager) and passes it intoAcl → AclContext → AuthorizableManager.CryptoDecryptorwraps the service and is applied on every password that flows throughcreateUser,changePasswordandtestPassword; blank or unprotected values pass through unchanged,CryptoExceptionis surfaced asAclException.cq-replication, so no new dependency is needed.set_passwordandcreate_usersnippets explain in their tooltip that only thepasswordargument is auto-decrypted and point to the newosgi_crypto_protectsnippet, which generates the{...}value viacryptoSupport.protect(text)— works on any AEM (including AEMaaCS where/system/console/cryptois not reachable).Test plan
CryptoDecryptor(null service, blank input, plain text, encrypted, CryptoException wrapping) — 5 testscoretest suite — 43/43 passapi.json/api.md) — 0 diffs (new class is a private collaborator, not reachable from the script binding)acl.createUser(id: ..., password: "{...}")end-to-endacl.setPassword(user, "{...}")end-to-end