-
Notifications
You must be signed in to change notification settings - Fork 47
fix: prevent 'invalid Uri' error #689
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
Conversation
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.
We are always happy to welcome new contributors ❤️ To make things easier for everyone, please make sure to follow our contribution guidelines, check if you have already signed the ECA, and relate this pull request to an existing issue or discussion.
paullatzelsperger
left a comment
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.
please add a test for this.
| } | ||
|
|
||
| private JsonObject signPresentation(JsonObject presentationObject, SignatureSuite suite, String suiteIdentifier, PrivateKey pk, String publicKeyId, String controller) { | ||
| if (!publicKeyId.startsWith(controller)) { |
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.
please do not re-use and mutate input arguments. instead, assign a new variable inside the method. For reference, look at JwtPresentationGenerator.
|
@paullatzelsperger Unfortunately I'm not quite familiar with github yet, soI wanted to ask what exactly is meant by rebase PR? In the commits above I used the “update branch” function of Github, which automatically made a merge to synchronize my fork. By rebase PR, do you mean a git rebase to sync the fork? |
it means that your feature branch, on which the PR is based, needs to incorporate the latest changes from git checkout your_feature_branch
git fetch origin main:main
git rebase mainresolve conflicts if there are any, then: git push --force |
|
Allright, thanks for the quick reply |
What this PR changes/adds
Add an if-statement to check whether the keyId already contains the controller. If not, the publicKeyId is extended by controller + # publicKeyId.
Why it does that
If the controller is already included in the publicKeyId, and a uri is still created together with the controller and publicKeyId, an “invalid Uri” error occurs.
Further notes
List other areas of code that have changed but are not necessarily linked to the main feature. This could be method
signature changes, package declarations, bugs that were encountered and were fixed inline, etc.
Who will sponsor this feature?
Please @-mention the committer that will sponsor your feature.
Linked Issue(s)
Closes #688
Please be sure to take a look at the contributing guidelines and our etiquette for pull requests.