Commit graph

62 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 b714bfb083
chore: Put widgets from django-password-strength into ietfauth 2023-05-15 17:55:11 -03: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 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
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
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 d34e88dfd9
fix: Set an aria-label on freetext pronouns field (#4633) 2022-10-22 15:26:11 -05: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
Robert Sparks 8b90ecd4aa
feat: add pronouns to Person and oidc claims. Fixes #4043. (#4059)
* feat: add pronouns

* fix: include migrations

* fix: correct daggers on person form.

* fix: clean pronouns

* feat: add choices to pronouns

* feat: show pronouns on public profile

* feat: add pronouns to oidc userinfo

* fix: move pronouns to new claim. Add tests.

* fix: improve html generated by new widget

* feat: use a MultiWidget for pronouns

* refactor: use two fields on Person for the two types of pronoun entry.

* chore: update copyrights
2022-06-21 15:02:02 -05:00
Henrik Levkowetz f41fd1867d Upgraded the required versions of mypy and django-stubs to the latest that support Django 2.2. Fixed some issues found by after the upgrades.
- Legacy-Id: 18717
2020-11-22 21:13:36 +00:00
Henrik Levkowetz bee0dc9aa1 Added a person name validation step to prevent names using 'anonymous'.
- Legacy-Id: 18597
2020-10-11 15:10:27 +00:00
Henrik Levkowetz 726fcbf27d Removed all __future__ imports.
- Legacy-Id: 17391
2020-03-05 23:53:42 +00:00
Henrik Levkowetz 77abc3868e Type checking tweaks.
- Legacy-Id: 16867
2019-10-15 16:54:33 +00:00
Henrik Levkowetz 2d7c9629aa Added 'from __future__' imports all over the place, to bring code behaviour into closer alignment between python2 and python3
- Legacy-Id: 16446
2019-07-15 15:40:51 +00:00
Henrik Levkowetz d7f5c84182 Initial 2to3 patch with added copyright statement updates.
- Legacy-Id: 16309
2019-06-27 14:40:54 +00:00
Henrik Levkowetz 3756923f40 Added username validation to the change username form, to avoid database key collision exceptions. Instead give a message to contact the secretariat to resolve the situation.
- Legacy-Id: 15490
2018-09-27 12:52:40 +00:00
Henrik Levkowetz 5251d0eb78 Changed the handling of the consent field of /account/profile/ to only be required set when information requiring consent is present.
- Legacy-Id: 15261
2018-06-14 19:28:06 +00:00
Henrik Levkowetz eaff1f0825 Fixed a bug in a form clean method.
- Legacy-Id: 15210
2018-06-04 15:31:37 +00:00
Henrik Levkowetz f6537fda59 Added a dagger at the end of some fields in the account data forms to signify consent-based fields, and made the consent field required.
- Legacy-Id: 15174
2018-05-26 08:36:06 +00:00
Henrik Levkowetz 70ed611472 Changed the field type for the Person.consent field.
- Legacy-Id: 15146
2018-05-17 16:45:21 +00:00
Henrik Levkowetz 246c348f1e Disallow profile changes without consent given. Together with previous commits this fixes issues #2505 and #2507.
- Legacy-Id: 15143
2018-05-08 16:26:01 +00:00
Henrik Levkowetz ad2139dc8f Fixed a settings typo.
- Legacy-Id: 14725
2018-03-03 18:30:19 +00:00
Lars Eggert 8a70e9773d Fix various "RemovedInDjango20Warning" warnings. Commit ready for merge.
- Legacy-Id: 13112
2017-03-25 19:16:45 +00:00
Henrik Levkowetz 858d855eff Changed the new account creation to require a proper name at the same time as the account password is set, before actually creating the account. Also tweaked the password strength and confirmation code.
- Legacy-Id: 12892
2017-02-20 16:50:39 +00:00
Henrik Levkowetz 8930d29a8e Merged in Django-1.10 upgrade work from ^/personal/henrik/6.43.1-django-1.10
- Legacy-Id: 12881
2017-02-19 18:18:00 +00:00
Henrik Levkowetz efc77762be Added the ability for logged-in users to change their login (username) to any of the active email addresses of the account. Fixes ticket #2052.
- Legacy-Id: 12843
2017-02-15 16:59:23 +00:00
Henrik Levkowetz 40c73cd483 Tweaked the password strength indicator, and added indication of offline cracking time for throughput 10e4 attempts per second.
- Legacy-Id: 12827
2017-02-12 17:12:03 +00:00
Henrik Levkowetz 7dea44e626 Added a change password page, and linked to it from the account profile page and user menu. Added zxcvbn-based browser-side password strength estimation on the various password setting, re-setting, and changing forms. Added a change password test. Changed ietfauth/urls.py to not use the deprecated string form for views in urlpatterns.
- Legacy-Id: 12798
2017-02-09 17:03:44 +00:00
Henrik Levkowetz db1cc15f1f Undid last commit
- Legacy-Id: 12792
2017-02-08 18:03:29 +00:00
Henrik Levkowetz 15628c698f Tweaked the IPR Details page to show the possible a), b), and c) choices under section 'V' when licensing declaration to be provided later has been chosen.
- Legacy-Id: 12791
2017-02-08 18:02:03 +00:00
Ole Laursen 958ba5ba95 Make new branch from trunk and merge in review-tracker-r11921
- Legacy-Id: 12129
2016-10-13 16:38:47 +00:00
Henrik Levkowetz ec684e1b4e Added a pylint rc-file, and fixed or silenced a number of issues found by pylint using the settings .pylintrc (which enable only error checking).
- Legacy-Id: 11941
2016-09-08 14:48:59 +00:00
Ole Laursen ea6a016ee2 Regularize use of ModelForm in ietfauth.forms, a cosmetic change,
probably a left-over from way back
 - Legacy-Id: 11932
2016-09-07 16:08:01 +00:00
Ole Laursen c4e2f68ea5 Add check for reserved name in account registration
Commit ready for merge
 - Legacy-Id: 11783
2016-08-15 13:14:08 +00:00
Ole Laursen afccaa0b4d Handle Person.ascii in edit profile better to try to ensure that
people fill it in correctly. Blank it out if it's unchanged from name
and use unidecode to set it automatically (with a warning if it
actually converts something). Branch ready for merge.
 - Legacy-Id: 11752
2016-08-03 14:20:13 +00:00
Ole Laursen d56560ed89 Throw a validation error if a profile name contains an @ sign upon
edit so that people do not forget to enter their name.
Commit ready for merge.
 - Legacy-Id: 11750
2016-08-03 10:21:02 +00:00
Henrik Levkowetz e110419916 Merged in ^/personal/henrik/6.22.1-acctdeps which provides import of addresses subscribed to IETF mailing lists, and additional datatracker account creation requirements. Also a table and form for manual whitelisting of account logins, in order to handle cases which fall outside the default requirements. Fixed some tests.
- Legacy-Id: 11389
2016-06-15 22:10:50 +00:00
Henrik Levkowetz 6304897519 Temporarily disable photo upload field -- requires handler code.
- Legacy-Id: 11376
2016-06-15 14:58:43 +00:00
Henrik Levkowetz fed2a04445 Increased the requirements for account creation, and added a form where the secretariat can add whitelisting to make account creation possible for addresses that don't fulfil the default requirements.
- Legacy-Id: 11374
2016-06-14 21:39:12 +00:00
Henrik Levkowetz 9eacdbf2c6 Merged in ^/personal/henrik/6.21.1-biophoto@11313, with work from rjsparks@nostrum.com and henrik@levkowetz.com which provides support for profile biography and photo.
- Legacy-Id: 11314
2016-06-10 19:36:47 +00:00
Henrik Levkowetz aa4ddc00e2 Limited the biography and photo uploading to people who have been assigned a role.
- Legacy-Id: 11283
2016-06-06 12:42:24 +00:00
Henrik Levkowetz a15d0ecbd6 Prevent people from adding ietf list addresses to their personal accounts.
- Legacy-Id: 11218
2016-05-20 22:39:30 +00:00
Ole Laursen b83e0d2c78 Unify the URL name handling in ietfauth, i.e. just refer directly to
the view behind the URL instead of naming it.
 - Legacy-Id: 11172
2016-05-06 12:58:10 +00:00
Ole Laursen 4d4cf93f22 Make password reset use username throughout and reword the reset page
so it's clear that one has to enter the account name and not just any
email address associated with the account.
 - Legacy-Id: 11171
2016-05-06 12:32:11 +00:00
Ole Laursen a99aa32c59 Refactor account code to use the built-in Django signing framework
(reusing code previously written for the community lists) instead of
the a custom MD5 scheme, add tests of all views, rewrite custom form
handling code to use plain forms and ensure that the data is properly
validated and errors visible in the UI. Move help texts on the Person
form up to the model.
 - Legacy-Id: 11136
2016-04-27 16:26:04 +00:00
Lars Eggert a4daf2630c Merge branch 'lars/5.6.3-facelift' into lars/5.6.4-facelift
Conflicts:
	ietf/doc/templatetags/ietf_filters.py
	ietf/doc/views_charter.py
	ietf/templates/doc/charter/edit_notify.html
	ietf/templates/doc/charter/edit_telechat_date.html
	ietf/templates/doc/document_ballot_content.html
	ietf/templates/doc/document_history.html
	ietf/templates/doc/edit_notify.html
	ietf/templates/doc/edit_telechat_date.html
	ietf/templates/doc/notify.html
	ietf/templates/group/concluded_groups.html
 - Legacy-Id: 8429
2014-10-14 11:48:57 +00:00
Ole Laursen e63ac36b8f Remove shim layer from ietfauth, delete some dead code and migrate
remaining importers of ietfauth.decorators to ietfauth.utils
 - Legacy-Id: 6797
2013-12-05 16:24:03 +00:00
Henrik Levkowetz a7db9eec43 Require logins to be all-lowercase. This was prompted by repeated
trouble with people registering non-lowercase logins, then trying to
log in with all-lowercase, or vice versa.
 - Legacy-Id: 6472
2013-10-21 20:26:03 +00:00
Henrik Levkowetz d4e8a98346 Merged [4737] from adam@nostrum.com:
Fixed profile update page to keep Alias table up to date. Also, roles for inactive groups are no longer displayed on the profile page.
 - Legacy-Id: 4776
Note: SVN reference [4737] has been migrated to Git commit 6d87558b06
2012-08-22 10:01:52 +00:00
Henrik Levkowetz 3038396b5f Fix the update password request form to *not* give an error for existing accounts ,:-)
- Legacy-Id: 4742
2012-07-31 22:29:07 +00:00