Skip to content

feat: django-rest-framework + Person/Email API#8256

Merged
rjsparks merged 9 commits into
mainfrom
feat/django-rest-framework
Nov 27, 2024
Merged

feat: django-rest-framework + Person/Email API#8256
rjsparks merged 9 commits into
mainfrom
feat/django-rest-framework

Conversation

@jennifer-richards

Copy link
Copy Markdown
Member

Adds Django Rest Framework to the datatracker and adds API endpoints that allow email address management.

* chore: djangorestframework -> requirements.txt

* chore: auth/perm/schema classes for drf

* chore: settings for drf and friends

* chore: comment that api/serializer.py is not DRF

* feat: URL router for DRF

* feat: simple api/v3/person/{id} endpoint

* fix: actually working demo endpoint

* chore: no auth for PersonViewSet

* ci: params in ci-run-tests.yml

* Revert "ci: params in ci-run-tests.yml"

This reverts commit 03808dd.

* feat: email addresses for person API

* feat: email update api (WIP)

* fix: working Email API endpoint

* chore: annotate address format in api schema

* chore: api adjustments

* feat: expose SpectacularAPIView

At least for now...

* chore: better schema_path_prefix

* feat: permissions for DRF API

* refactor: use permissions classes

* refactor: extract NewEmailForm validation for reuse

* refactor: ietfauth.validators module

* refactor: send new email conf req via helper

* feat: API call to issue new address request

* chore: move datatracker DRF api to /api/core/

* fix: unused import

* fix: lint
* refactor: better drf URL naming

* test: test person-detail view

* test: permissions

* test: add_email tests + stubs

* test: test email update

* test: test 404 vs 403

* fix: fix permissions

* test: test email partial update

* test: assert we have a nonexistent PK
rjsparks
rjsparks previously approved these changes Nov 27, 2024
def prevent_at_symbol(name):
if "@" in name:
raise forms.ValidationError(
"Please fill in name - this looks like an email address (@ is not allowed in names)."

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This, of course, is baiting the real world

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could do away with the check - not sure what, if any, ramifications there'd be.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No - at the moment the check is useful.

@rjsparks
rjsparks merged commit c58490b into main Nov 27, 2024
@jennifer-richards
jennifer-richards deleted the feat/django-rest-framework branch November 27, 2024 22:17
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Dec 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants