Repository navigation
feat: add sign-up and ORCID-at-sign-up use cases - #502
Draft
ChengShi-1 wants to merge 1 commit into
Draft
ChengShi-1 wants to merge 1 commit into
ChengShi-1 wants to merge 1 commit into
Conversation
Adds SignUp, GetOrcidSignUpAuthorizationUrl and ConnectOrcidForSignUp for POST /users/signup, GET /users/signup/orcid/authorize and POST /users/signup/orcid, which are called without authentication. AuthenticatedUser gains authenticatedOrcid. ReadError and WriteError now carry the HTTP statusCode and the server's fieldErrors, so clients can show validation errors next to form fields.
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.
What this PR does / why we need it:
Adds use cases for the new sign-up API, so the modern UI (and other clients) can let new users create a builtin account and optionally connect their ORCID iD while signing up.
signUpcallsPOST /users/signupwithout authentication and creates a builtin user.getOrcidSignUpAuthorizationUrlcallsGET /users/signup/orcid/authorizeand returns the ORCID URL to send the user to.connectOrcidForSignUpcallsPOST /users/signup/orcidwith thecodeandstateORCID returns. It gives back the ORCID iD, the details to pre-fill the form with, and theorcidTokento include insignUp.AuthenticatedUserhas an optionalauthenticatedOrcid.ReadErrorandWriteErrornow expose the HTTPstatusCodeand, when the API returns them, per-fieldfieldErrors. That lets a form show validation errors next to the right fields.ApiRepository.doPosttakes an optionalauthRequiredargument (defaulttrue), so a request can be sent without the configured credentials.This replaces
3f94643b, which was pushed todevelopby mistake and is being reverted in #501.Which issue(s) this PR closes:
Related Dataverse PRs:
Special notes for your reviewer:
dataverse.feature.api-builtin-user-signupfeature flag.unstableDataverse image with a 404. They need an image built from Add a sign-up API for the modern UI, with optional ORCID iD dataverse#12858.test/environment/docker-compose.ymlturns on the feature flag and turns off the sign-up rate limit for the integration tests.Suggestions on how to test this:
npm run test:unit.DATAVERSE_IMAGE_TAGintest/environment/.envto that image, then runnpm run test:integration.Is there a release notes or changelog update needed for this change?:
Yes, added under "Unreleased" in
CHANGELOG.md.Additional documentation:
The three new use cases are documented in
docs/useCases.md.