Commit graph

374 commits

Author SHA1 Message Date
Jennifer Richards c58490bb36
feat: django-rest-framework + Person/Email API (#8256)
* feat: django-rest-framework + Person/Email API (#8233)

* 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 03808ddf94afe42b7382ddd3730959987389612b.

* 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

* test: drf URL names + API tests (#8248)

* 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

* chore: disable DRF api for now

* chore: fix git inanity

* fix: lint

* test: disable tests of disabled code

* test: more lint
2024-11-27 14:54:28 -06:00
Jennifer Richards 3130ecd9f5
fix: add recording-name api key endpoint; appauth url fix (#8081)
* fix: add endpoint option for recording-name

* chore: migration

* test: validate PersonalApiKey when used in tests

* fix: limit /api/appauth URLs as intended

* test: fix tests

* chore: fix lint

* test: PersonalApiKey create -> factory

* chore: remove unused import
2024-10-25 08:52:09 -05:00
Robert Sparks 8362b45c8e
fix: optimize and debug has_role and can_manage_some_groups (#7949)
* fix: optimize can_manage_some_groups

* fix: improve cache key

* refactor: extra_role_qs to kwargs and bugfix to cache key

* fix: restrict groupman_role matches to active states

* chore: styling, decommenting, black
2024-09-17 13:05:56 -05:00
Emelia Smith 30970749e3
fix: Send create user email for password resets where we have an email and person, but no user. (#7729)
* fix: Send create user email for password resets where we have an email and person, but no user account

This fixes https://github.com/ietf-tools/datatracker/issues/6458

* fix: create User straight away and use nomral password reset

---------

Co-authored-by: Robert Sparks <rjsparks@nostrum.com>
2024-08-07 13:25:08 -05:00
Robert Sparks 704f9967fd
fix: remove no longer needed htpasswd infrastructure (#7590) 2024-06-26 13:33:09 -05:00
Jennifer Richards 2ccc230ce7
feat: send_apikey_usage_emails_task() (#7486)
* feat: send_apikey_usage_emails_task

* chore: update test to use task instead of cmd

* chore: add PeriodicTask

* chore: remove old command + empty management dir

* chore: remove now-empty bin/weekly

* refactor: only consider keys that might have events

---------

Co-authored-by: Robert Sparks <rjsparks@nostrum.com>
2024-05-30 08:31:25 -05:00
Jennifer Richards 3c13db45fd
fix: validate form in login() (#7435)
* fix: validate form in login()

* refactor: custom LoginView subclass for logins

Preserves old behavior, but avoids some hacks.

* test: reverse with strings, not view refs

* chore: remove unused imports

* fix: restore logout() call
2024-05-24 16:36:58 -05:00
Robert Sparks ae01f6fb92
chore: clean away unused views/tests related to the Allowlisted model (#7027) 2024-02-06 09:39:09 -06:00
Robert Sparks efdaee3bb3
feat: decouple from mailman2 - explicitly model nonwg mailing lists (#7013)
* fix: remove synchronization with mailman2

* feat: manage non wg mailing lists explicitly

* chore: black

* fix: update tests for new nonwg view

* feat: drop unused models
2024-02-05 09:28:23 -06:00
Paul Selkirk a3b4162841
fix: Don't redirect user to the login page when logging in (#6570)
* fix: Don't redirect user to the login page when logging in (#5876)

(Embrace and extend c4bf508cd8.)

* test: Add test case for login button

* refactor: The template filter just strips off a path prefix, so rename/recode accordingly

Also test with a non-trivial redirect target.
2023-11-05 11:09:07 +01:00
Robert Sparks 3c1fc3c0f9
chore: use factory-boy 3.3 (#6269) 2023-09-05 09:54:30 -05:00
Robert Sparks c8c1ebdf12
chore: remove unnecessary .gitignore files (#6262) 2023-08-31 17:12:01 -05:00
Robert Sparks 593bdb465d
feat: allow openId to choose an unactive email if there are none active (#6041)
* feat: allow openId to choose an unactive email if there are no active ones

* chore: correct typo

* chore: rename unactive to inactive
2023-07-25 12:15:39 -07:00
Lars Eggert 9d5d9d5172
fix: replace deprecated bootstrap things (#5858)
* text-muted -> text-body-secondary

* navbar-dark is deprecated

* Remove FIXME block, not an issue anymore

* Remove `navbar-light`
2023-07-18 12:22:28 -05:00
Jennifer Richards 2a29be5d6a
test: Remove unused import 2023-05-19 16:23:42 -03:00
Jennifer Richards 2eaea55ce8
chore: Move log out suppression to settings,py 2023-05-19 15:25:35 -03:00
Jennifer Richards 579d187f0c
chore: Suppress deprecation warning in oidc_provider 2023-05-19 15:20:09 -03:00
Jennifer Richards 102a612857
test: POST instead of GET for logout tests 2023-05-19 14:12:12 -03:00
Jennifer Richards 37a6521879
test: Form is r.context["form"], not r["form"] 2023-05-19 13:37:39 -03:00
Jennifer Richards fdc074b313
test: Use new signature for assertFormError 2023-05-19 13:23:07 -03:00
Jennifer Richards b714bfb083
chore: Put widgets from django-password-strength into ietfauth 2023-05-15 17:55:11 -03:00
Jennifer Richards b5d9e9b14c
refactor: Replace deprecated django.utils.http.urlquote 2023-05-12 18:27:51 -03:00
Jennifer Richards 9fda268853
fix: Replace available_attrs helper (dropped by Django 3.0) 2023-05-08 15:19:33 -03:00
Jennifer Richards db2f7362c5
feat: Include support address in error message 2023-04-27 17:51:19 +00:00
Jennifer Richards b691cb4a9f
fix: Avoid 500 error creating account when User.person is None 2023-04-26 18:34:49 +00:00
Jennifer Richards c6fbdef6df
fix: Handle integrity violations when confirming email address (#5506)
* fix: Handle integrity violations when confirming email address

* test: Add tests of confirm_new_email view
2023-04-23 17:58:05 -05:00
Jennifer Richards 6b826fd985
refactor: Purge old migrations and update ci to build on a clean schema (#5431)
* refactor: Remove all existing migrations

* refactor: Create clean set of migrations

* chore: Skip check_statetype_slugs when DB is not yet populated

* fix: Do not cache active_groups_menu on module import

* fix: Do not patch timezone awareness out of oidc-provider

* refactor: Migrate to create postgres schema, only use pgloader for data

* ci: Use migration scripts from feat/pg-migrations branch

* Revert "ci: Use migration scripts from feat/pg-migrations branch"

This reverts commit c82f64c614241ccede4865a50d494725c8a47c15.

* ci: Run check before migrate

* fix: Remove redundant migration caused by merge error

* chore: Add casts/ALTER TABLEs to eliminate pgloader errors/warnings

* chore: Change schema name to match docker image assumptions

* chore: Clear out schema so we get a clean start in case of a retry
2023-03-28 18:06:07 +09:00
Kesara Rathnayake b0c76416cd
feat: Allow password reset with non username email address (#5419)
This change allows password reset with any email address associated with the
account.
The password reset will only be sent to the active email addresses associated
with the account.

Fixes #5057
2023-03-28 11:07:31 +09:00
Jennifer Richards 330442171f
fix: Remove accidentally doubled bracket in f-string (#5365) 2023-03-17 17:23:51 -05:00
Lars Eggert 0faa2e40e7
fix: Don't expose existing emails via reset password and account creation forms (#5288)
* Rebase to feat/postgres

* Attempt to address further review comments
2023-03-15 17:27:29 -05:00
Robert Sparks 4b4e876305
Merge branch 'main' into feat/postgres 2023-03-09 11:43:38 -06:00
Robert Sparks fce28e78f9
fix: case sensitivity for Subscribed.email (#5270) 2023-03-03 09:05:17 -06:00
Lars Eggert 276dd08794
fix: Don't offer already-disabled API keys for disablement (#5262)
* fix: Don't offer already-disabled API keys for disablement

Fixes #3441

* Remove test class
2023-03-02 10:18:51 -06:00
Robert Sparks 1f990bce1d
Merge branch 'main' into feat/postgres 2023-02-28 14:19:59 -06:00
Robert Sparks 74990cfcb8
fix: improve api key delete form validation and tests (#5236) 2023-02-28 11:54:45 -06:00
Robert Sparks c38ade6e1b
feat: treat django auth username as case insensitive throughout the datatracker (#5165)
* feat: insensitive username matching at django authentication

* feat: use iexact when using the User object manager

* fix: more places to ignore username case

* fix: remove unused management command

* fix: avoid get when probing for object existance

* fix: force lowercase new usernames in secr/rolodex

* fix: use explicit arguments when creating user
2023-02-21 10:01:03 -06:00
Robert Sparks e1206fa91e
Merge remote-tracking branch 'upstream/main' into feat/postgres 2023-02-13 09:17:05 -06:00
Robert Sparks 4309a4bb50
fix: allow rswg chairs to request sessions (#5124)
Fixes #5122
2023-02-10 14:15:16 -06:00
Robert Sparks 6bbad15b3d
fix: restore generation of rswg/rsab chair aliases (#5121) 2023-02-09 16:57:42 -06:00
Robert Sparks 2a1602d9bb
Merge remote-tracking branch 'origin/main' into feat/postgres 2023-01-31 16:57:03 -06:00
Jennifer Richards 98d7b15dfb
fix: Only send password reset email to known, active addresses (#5061)
* fix: Only send password reset email to known, active addresses

Limits password reset to Users with a Person and at least one active
address on file. Avoids the possibility of sending a password reset to
a spoofed address as in CVE-2019-19844.

* test: Use factory instead of explicit construction

* test: Test that a User with no Person cannot reset password

* fix: Fix handling of User.person field when it's null

* test: Test that reset emails are sent to known, active addresses
2023-01-31 13:56:33 -06:00
Robert Sparks afac1f8f19
feat: enable editorial stream adoption and balloting (#5011)
* feat: enable editorial stream adoption and balloting

* fix: bring tests into line with refactor

* feat: force intended_std_level to Informational when adopting into a non-ietf stream.

* fix: improve blocking position labels and email content

* fix: simplify pointer to group on doc main page for rswg docs

* fix: recover from merge typos

* fix: correct defer and clear ballot behavior

* fix: improve publication request access logic

* fix: clean up broken editorial state

* fix: adjust test to match migrations
2023-01-31 13:50:51 -06:00
Robert Sparks a202cf4bf9
feat: Case Insensitive Email.address field (#5046)
* fix: address mypy quibble

* fix: use citext for Email.address

* test: confirm adding case-varied email fails
2023-01-30 11:52:38 -06:00
Lars Eggert 220be21998
chore: Use codespell to fix typos in code. (#4797)
* chore: Use codespell to fix typos in code.

Second part of replacement of #4651

@rjsparks, I probably need to revert some things here, and I also
still need to add that new migration - how do I do that?

* Revert migrations

* Migrate "Whitelisted" to "Allowlisted"

* TEST_COVERAGE_MASTER_FILE -> TEST_COVERAGE_MAIN_FILE

* Fix permissions

* Add suggestions from @jennifer-richards
2022-12-07 15:10:35 -06:00
Lars Eggert 6eabd4a3a1
chore: Use codespell to fix typos in comments. (#4794)
First part of replacement of #4651
2022-11-28 10:36:36 -06:00
Jennifer Richards d55280d0b1
Merge pull request #4638 from ietf-tools/main
chore: merge main into feat/tzaware
2022-10-24 12:57:11 -03:00
Lars Eggert d34e88dfd9
fix: Set an aria-label on freetext pronouns field (#4633) 2022-10-22 15:26:11 -05:00
Jennifer Richards 69447d0ba0
Merge branch 'feat/tzaware' into jennifer/main-for-tzaware-merge
# Conflicts:
#	ietf/name/fixtures/names.json
#	ietf/utils/management/commands/send_gdpr_consent_request.py
2022-10-18 16:57:42 -03:00
Robert Sparks 9b4903e2e6
fix: Fix incorrect "GDPR" features/terminology. Fixes #4521. (#4587)
* fix: remove help/personal-information and the prompt-for-consent email management command.

* fix: remove gdpr treatment except for consent checkbox. Rename Submit.

* fix: drom the consent column from Person and Person.History

* fix: remove the consent boolean. Reorganize the account info form.

* chore: reorder migrations
2022-10-18 13:27:19 -05:00
Jennifer Richards 3220bf3c40
chore: replace last few datetime.date.today() calls with date_today() 2022-10-18 12:45:47 -03:00