Skip to content

Conversation

@u-veys
Copy link
Contributor

@u-veys u-veys commented Mar 27, 2025

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.

Copy link

@github-actions github-actions bot left a 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 paullatzelsperger self-requested a review March 27, 2025 12:37
@paullatzelsperger paullatzelsperger added the bug Something isn't working label Mar 27, 2025
Copy link
Member

@paullatzelsperger paullatzelsperger left a 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.

@u-veys u-veys requested a review from paullatzelsperger April 2, 2025 14:44
}

private JsonObject signPresentation(JsonObject presentationObject, SignatureSuite suite, String suiteIdentifier, PrivateKey pk, String publicKeyId, String controller) {
if (!publicKeyId.startsWith(controller)) {
Copy link
Member

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.

@u-veys u-veys requested a review from paullatzelsperger April 8, 2025 09:43
@paullatzelsperger
Copy link
Member

@u-veys we have another PR that must get merged first, otherwise the tests here will fail. Once #702 is merged, pls rebase your pr

@u-veys
Copy link
Contributor Author

u-veys commented Apr 14, 2025

@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?

@paullatzelsperger
Copy link
Member

@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 main. I usually do it like this:

git checkout your_feature_branch
git fetch origin main:main
git rebase main

resolve conflicts if there are any, then:

git push --force

@u-veys
Copy link
Contributor Author

u-veys commented Apr 14, 2025

Allright, thanks for the quick reply

@paullatzelsperger paullatzelsperger merged commit ca3e2a8 into eclipse-edc:main Apr 15, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LdpPresentationGenerator can cause an "Invalid Uri" error

2 participants