Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ODKToken Authentication Method #1705

Merged
merged 47 commits into from
Oct 25, 2019
Merged

Add ODKToken Authentication Method #1705

merged 47 commits into from
Oct 25, 2019

Conversation

DavisRayM
Copy link
Contributor

@DavisRayM DavisRayM commented Oct 17, 2019

This PR adds a new Digest Authentication method name "ODKTokenAuthentication" which accepts an email and ODKToken generated on the onadata platform.

Changes Implemented in this PR

  • Add new ODK Token Model
  • Add new settings ODK_KEY_LIFETIME and ODK_TOKEN_LENGTH
  • Added new endpoint /api/v1/user/odk_token that accepts GET and POST requests
  • Added new authentication class ODKTokenAuthentication

ivermac
ivermac previously approved these changes Oct 17, 2019
Copy link
Contributor

@ivermac ivermac left a comment

Choose a reason for hiding this comment

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

lgtm!

onadata/apps/api/viewsets/connect_viewset.py Outdated Show resolved Hide resolved
onadata/apps/api/viewsets/connect_viewset.py Outdated Show resolved Hide resolved
onadata/apps/api/models/odk_token.py Show resolved Hide resolved
- Directly assigning values to data dict rather than use a function
- Store the key value in an encrypted format
- Generate new migration for the ODKToken Model
- Check that passing the raw_token authenticates the user
- Change field 'odk_token' to 'enc_odk_token'
- Change field 'expires_in' to 'active_till'
- Update tests
- Regenerate migrations
@DavisRayM DavisRayM force-pushed the odk-token-authentication branch 2 times, most recently from f18811b to 85d34e7 Compare October 18, 2019 11:20
- Chance Active and Inactive value
- Recreate migrations
- Lint code
- Remove ODK_TOKEN_FERNET_KEY variable
- Minor Code Cleanup
- Add ability to make PATCH Requests
- Add ability to change ODKToken Status
- Minor code cleanup
- Test that ODK Token status can be changed through a PATCH request
ukanga
ukanga previously approved these changes Oct 22, 2019
onadata/apps/api/storage.py Outdated Show resolved Hide resolved
onadata/apps/api/models/odk_token.py Show resolved Hide resolved
- Change DigestAccountStorage to ODKTokenAccountStorage
- Add additional information to the ODKTokenAccountStorage docstring
- Use ODKTokenAccountStorage while testing expiry date failure
onadata/apps/api/viewsets/connect_viewset.py Outdated Show resolved Hide resolved
onadata/apps/api/viewsets/connect_viewset.py Outdated Show resolved Hide resolved
@ukanga ukanga merged commit e77b7ca into master Oct 25, 2019
@ukanga ukanga deleted the odk-token-authentication branch October 25, 2019 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants