feat: django-rest-framework + Person/Email API#8233
Merged
jennifer-richards merged 29 commits intoNov 20, 2024
Conversation
This reverts commit 03808dd.
At least for now...
rjsparks
reviewed
Nov 19, 2024
| for pat in settings.EXCLUDED_PERSONAL_EMAIL_REGEX_PATTERNS: | ||
| if re.search(pat, value): | ||
| raise ValidationError( | ||
| "This email address is not valid in a datatracker account" |
Member
There was a problem hiding this comment.
I realize this is old, but is it conflating User.username concerns with Email.address concerns? If so, we should clarify.
Member
Author
There was a problem hiding this comment.
I think this is doing things like preventing some-wg-list@ietf.org from being signed up as an email. I don't think it's for the username concerns.
rjsparks
approved these changes
Nov 19, 2024
Member
Author
|
The new API needs tests and some work on view naming / namespacing for URL reversing, but I'm going to leave those as separate work so we can move forward on the feat branch. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This adds django-rest-framework to the datatracker and implements the first few API endpoints using it. These allow a user to retrieve their set of email addresses, update them, and request new email addresses.
I've put the datatracker API under
/api/core/anticipating that we'll have other endpoints. A schema is served at/api/schema/This does not yet enforce a single "primary" address. That should be enforced by the UI initially. I'll add an enhancement that prevents multiple addresses from being assigned as primary.
Permissions are done via session cookies. For the PATCH/POST/PUT API calls the CSRF token must be sent both in the
X-CSRFTokenheader and in thecsrftokencookie.Note that some existing code was refactored to share code with the API.
More work will be needed on this, but it's definitely time to get more eyes on it.