-
Notifications
You must be signed in to change notification settings - Fork 7
NFC-171 Validate signing cert chain, formats and configured origin #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: web-eid-mobile
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,11 +36,12 @@ | |
| import java.security.cert.TrustAnchor; | ||
| import java.security.cert.X509Certificate; | ||
| import java.util.Set; | ||
| import java.util.regex.Pattern; | ||
|
|
||
| class AuthTokenVersion1Validator implements AuthTokenVersionValidator { | ||
|
|
||
| private static final String V1_SUPPORTED_TOKEN_FORMAT_PREFIX = "web-eid:1"; | ||
|
|
||
| private static final Pattern V1_SUPPORTED_TOKEN_FORMAT_PATTERN = Pattern.compile("^web-eid:1(?:\\.\\d+)?$"); | ||
| private final SubjectCertificateValidatorBatch simpleSubjectCertificateValidators; | ||
| private final Set<TrustAnchor> trustedCACertificateAnchors; | ||
| private final CertStore trustedCACertificateCertStore; | ||
|
|
@@ -69,11 +70,7 @@ public AuthTokenVersion1Validator( | |
|
|
||
| @Override | ||
| public boolean supports(String format) { | ||
| return format != null && format.startsWith(getSupportedFormatPrefix()); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As documented in README.md, minor versions must be backward-compatible within the major version, this will reject future compatible web-eid:1.x tokens.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see, updated the code and tests. |
||
| } | ||
|
|
||
| protected String getSupportedFormatPrefix() { | ||
| return V1_SUPPORTED_TOKEN_FORMAT_PREFIX; | ||
| return format != null && V1_SUPPORTED_TOKEN_FORMAT_PATTERN.matcher(format).matches(); | ||
| } | ||
|
|
||
| @Override | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without
.fromCurrentContextPath()deploying the example under a non-root context path will no longer work. If this is intended, it should be documented in README.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be added to readme in different task: The mobile authentication and signing example uses the configured
web-eid-auth-token.validation.local-originvalue when constructing mobile callback URIs. The example assumes that the application is deployed under the root context path (/). If deploying under a non-root context path, adjust the callback URI construction accordingly.