feat(jans-fido2): make Apple WebAuthn root CA subject DN configurable#13737
feat(jans-fido2): make Apple WebAuthn root CA subject DN configurable#13737imran-ishaq wants to merge 6 commits intomainfrom
Conversation
Signed-off-by: imran <imranishaq7071@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughFido2Configuration gains a new Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@jans-fido2/server/src/main/java/io/jans/fido2/service/processor/attestation/AppleAttestationProcessor.java`:
- Around line 189-195: The fallback in getAppleRootCaSubjectDn() only checks for
null and can return empty or whitespace DNs; update the method to treat
blank/whitespace as absent by checking the configured value (via
appConfiguration.getFido2Configuration().getAppleRootCaSubjectDn()) for
emptiness (e.g., use String.isBlank() or trim().isEmpty()) and return SUBJECT_DN
when the value is null or blank; keep the rest of the logic and references to
Fido2Configuration and appConfiguration unchanged.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: edd8288c-dbb9-4bfa-ba76-f44703f535ff
📒 Files selected for processing (2)
jans-fido2/model/src/main/java/io/jans/fido2/model/conf/Fido2Configuration.javajans-fido2/server/src/main/java/io/jans/fido2/service/processor/attestation/AppleAttestationProcessor.java
…ns-fido2-make-apple-root-ca-subject-dn-configurable
Signed-off-by: imran <imranishaq7071@gmail.com>
https://github.com/JanssenProject/jans into jans-fido2-make-apple-root-ca-subject-dn-configurable
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@jans-fido2/server/src/main/java/io/jans/fido2/service/processor/attestation/AppleAttestationProcessor.java`:
- Around line 189-194: In getAppleRootCaSubjectDn(), avoid calling
fido2Configuration.getAppleRootCaSubjectDn() multiple times; instead read
fido2Configuration into a local variable (already named fido2Configuration) then
cache fido2Configuration.getAppleRootCaSubjectDn() into a local String (e.g.,
appleDn) and use that for the null/blank checks and return, updating the method
to reference these locals rather than repeated calls to
getAppleRootCaSubjectDn().
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 692a6645-774b-43ba-ba9c-d2173aa389c2
📒 Files selected for processing (1)
jans-fido2/server/src/main/java/io/jans/fido2/service/processor/attestation/AppleAttestationProcessor.java
Signed-off-by: imran <imranishaq7071@gmail.com>



Description
This PR makes the Apple WebAuthn root CA subject DN configurable via Fido2Configuration,
replacing the hardcoded constant in AppleAttestationProcessor.
Changes
jans-fido2/model — Fido2Configuration.java
appleRootCaSubjectDnwith default value"st=california, o=apple inc., cn=apple webauthn root ca"(same as thepreviously hardcoded string)
getAppleRootCaSubjectDn()and settersetAppleRootCaSubjectDn()jans-fido2/server — AppleAttestationProcessor.java
AppConfigurationinto the processorgetAppleRootCaSubjectDn()that reads the value fromFido2Configurationat runtime, with a fallback to the hardcodedSUBJECT_DNconstant if config is null or the field is unset
SUBJECT_DNusage inprocess()withgetAppleRootCaSubjectDn()Backward Compatibility
the field default which is identical to the previously hardcoded string.
@JsonIgnoreProperties(ignoreUnknown = true)onFido2Configurationensuresexisting stored configs without
appleRootCaSubjectDndeserialize cleanly,falling back to the Java field default.
SUBJECT_DNconstant is retained as a final safety fallback.Target issue
The Apple WebAuthn root CA subject DN was hardcoded in AppleAttestationProcessor.java
with no way to override it without modifying and redeploying code. If Apple rotates
their root CA with a different subject DN, attestation would silently fail with no
configuration path to fix it.
closes #13736
Implementation Details
Test and Document the changes
Please check the below before submitting your PR. The PR will not be merged if there are no commits that start with
docs:to indicate documentation changes or if the below checklist is not selected.Summary by CodeRabbit