-
Notifications
You must be signed in to change notification settings - Fork 3
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
Authentication with Swagger #27
base: master
Are you sure you want to change the base?
Conversation
-Added Swagger, to allow better visualisation of API(added in requirements.txt file). -Added Authentication app, which allows users to register. -Added Email Verification, which sends users verification tokens, which can then be successfully verified on the API (Email used is a test Gmail account. Details are in the setting.py file in ‘webapp’. - Added all Serializations and Models required to, register verify and login Users -Added Jwt for token generation (added in requirements.txt file) -Two tokens are generated, refresh and access - Added login through Swagger interface, which requires users to input generated token, to access information from the API. -Added Renderers in order to ensure consistent responses in the API, especially when an error is generated.
-Added Swagger, to allow better visualisation of API(added in requirements.txt file). -Added Authentication app, which allows users to register. -Added Email Verification, which sends users verification tokens, which can then be successfully verified on the API (Email used is a test Gmail account. Details are in the setting.py file in ‘webapp’. - Added Password and Token Reset by Email -Added Token Authentication check -Edited Read Me with Basic User Login and Registration Instructions
def test_user_can_register_correctly(self): | ||
res = self.client.post( | ||
self.register_url, self.user_data, format="json") | ||
#self.assertEqual(res.data['email'] ,self.user_data['email']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Were these temporarily commented out because they were failing? If so, I would suggest fixing the issue causing them to fail and uncommenting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I was having an import Issue. Sorting it out now
email = serializers.EmailField( | ||
max_length=255, min_length=8) | ||
password = serializers.CharField( | ||
max_length=68, min_length=3, write_only=True) | ||
username = serializers.CharField( | ||
max_length=255, min_length=3, read_only=True) | ||
tokens = serializers.CharField( | ||
max_length=68, min_length=3,read_only=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a need for these specific min and max length values? If so, the source should be documented. Otherwise, in my experience all min/max length constraints should be set in the model and not in the serializer. Also, I believe that the email, password, and username fields all will be inherited automatically from the User
model, so we should not need to add them manually here.
My Changes
-Added Swagger, to allow better visualisation of API(added in requirements.txt file).
-Added Authentication app, which allows users to register.
-Added Email Verification, which sends users verification tokens, which can then be successfully verified on the API (Email used is a test Gmail account. Details are in the setting.py file in ‘web app’.
-Added Token Authentication check
-Edited Read Me with Basic User Login and Registration Instructions
Have a look, and run the API. Then if you decide I should separate them. Then I will work on separating them.