Pass provisionKeys to IdP registration flow#455
Merged
Conversation
The browser registration path called createPodStructure without the
provisionKeys option, so pods created via IdP never got owner keys
even when --provision-keys was enabled.
- Attach provisionKeysEnabled to the Fastify request object in the
onRequest hook so IdP handlers can access the config value.
- Pass { provisionKeys: request.provisionKeys } in the registration
handler's createPodStructure call.
There was a problem hiding this comment.
Pull request overview
This PR wires the server-level provisionKeys configuration into the IdP browser registration flow so pods created through registration can provision owner keys consistently with other pod creation paths.
Changes:
- Adds
request.provisionKeysassignment in the server request hook. - Passes the strict boolean provisioning option into
createPodStructureduring IdP registration.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/server.js |
Exposes the resolved provision-keys flag on incoming requests. |
src/idp/interactions.js |
Passes the provision-keys option when creating a pod during registration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| request.mashlibVersion = mashlibVersion; | ||
| request.mashlibModule = mashlibModule; | ||
| request.defaultQuota = defaultQuota; | ||
| request.provisionKeys = provisionKeysEnabled; |
Comment on lines
+546
to
+547
| await createPodStructure(username, webId, podUri, issuer, 0, | ||
| { provisionKeys: request.provisionKeys === true }); |
Register provisionKeys on the Fastify request prototype via decorateRequest to keep the request shape stable, matching the pattern used by all other request-attached config fields.
Comment on lines
+546
to
+547
| await createPodStructure(username, webId, podUri, issuer, 0, | ||
| { provisionKeys: request.provisionKeys === true }); |
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
Fixes #454
handleRegisterPostininteractions.js) calledcreatePodStructurewithout passing theprovisionKeysoption, so pods created via IdP registration never got owner keys — even when--provision-keys/"provisionKeys": truewas set in config.provisionKeysEnabledwas not attached to the Fastify request object, so IdP handlers had no way to access it.request.provisionKeysto theonRequesthook inserver.js, pass it through ininteractions.js.Test plan
provisionKeys: truein config/private/privkey.jsonldexists in the new pod/profile/card.jsonldcontains the verification methodPOST /.podsendpoint still works with provisionKeys