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

Island: Include refresh token into responses #3180

Merged
merged 5 commits into from
Mar 31, 2023
Merged

Conversation

cakekoa
Copy link
Contributor

@cakekoa cakekoa commented Mar 30, 2023

What does this PR do?

Fixes part of #3137.

Login and registration should respond with a token pair

PR Checklist

  • Have you added an explanation of what your changes do and why you'd like to include them?
  • Is the TravisCI build passing?
  • Was the CHANGELOG.md updated to reflect the changes?
  • Was the documentation framework updated to reflect the changes?
  • Have you checked that you haven't introduced any duplicate code?

Testing Checklist

  • Added relevant unit tests?
  • Do all unit tests pass?
  • Do all end-to-end tests pass?
  • Any other testing performed?

    Tested by validating the output of cURL commands to the endpoints

  • If applicable, add screenshots or log transcripts of the feature working
    $ curl -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' --data '{"username": "test", "password": "testtest"}' -k ${ISLAND}/api/register
    {"meta": {"code": 200}, "response": {"user": {"authentication_token": "WyJmOGMxZTc0YzBkNWM0MjQzYWI4NTE0NDY3MGYzNzRhYiJd.ZCW59Q.RHLJsim5y-SvYb8Nppe1qy_p0UY", "refresh_token": "ImY4YzFlNzRjMGQ1YzQyNDNhYjg1MTQ0NjcwZjM3NGFiIg.ZCW59Q.GaWzjz9XpCu50VItcHp8OYhgk6o"}, "csrf_token": "IjFhMzJmNDdlMzEyYmM1NDNjM2EwOGJlYzBmYWY2ZjI2OGFiZmE2MmIi.ZCW59Q.aPp670PyIpbjDa21IggSRVC1Zic"}}
    
    $ curl -X POST -H 'Accept: application/json' -H 'Content-Type: application/json' --data '{"username": "test", "password": "testtest"}' -k ${ISLAND}/api/login
    {"meta": {"code": 200}, "response": {"user": {"authentication_token": "WyJmOGMxZTc0YzBkNWM0MjQzYWI4NTE0NDY3MGYzNzRhYiJd.ZCW6oQ.rDpRYYkGKD5ZqP0mcr3Ht1mdR3U", "refresh_token": "ImY4YzFlNzRjMGQ1YzQyNDNhYjg1MTQ0NjcwZjM3NGFiIg.ZCW6oQ.Fzt20Y92SD1cp7HTcMJrau7zP6Q"}, "csrf_token": "ImRmODNmN2E4Mzg1MTY4MjA5YTgxMGVhYzRiNzNhYmE1NzUwYTZiMjgi.ZCW6oQ.naYnUG37y7TmpBA-LrmCduFDB04"}}
    

@cakekoa cakekoa force-pushed the 3137-send-refresh-token branch from 46dc521 to 25770e0 Compare March 30, 2023 16:39
@codecov
Copy link

codecov bot commented Mar 30, 2023

Codecov Report

Patch coverage has no change and project coverage change: +0.02 🎉

Comparison is base (d50b781) 72.48% compared to head (08e396a) 72.50%.

❗ Current head 08e396a differs from pull request most recent head 7b68728. Consider uploading reports for the commit 7b68728 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #3180      +/-   ##
===========================================
+ Coverage    72.48%   72.50%   +0.02%     
===========================================
  Files          467      467              
  Lines        13285    13295      +10     
===========================================
+ Hits          9630     9640      +10     
  Misses        3655     3655              

see 5 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Collaborator

@mssalvatore mssalvatore left a comment

Choose a reason for hiding this comment

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

Travis fails
Missing unit tests


def add_refresh_token_to_response(response: Response, refresh_token: Token) -> Response:
"""
Adds a refresh token to the response
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Adds a refresh token to the response
Returns a copy of the response object with a refresh token added to it.

Copy link
Contributor

@ilija-lazoroski ilija-lazoroski left a comment

Choose a reason for hiding this comment

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

Again Travis fails.
image

@VakarisZ VakarisZ force-pushed the 3137-send-refresh-token branch from 08e396a to 7b68728 Compare March 31, 2023 07:30
@VakarisZ VakarisZ merged commit 37acd73 into develop Mar 31, 2023
@mssalvatore mssalvatore deleted the 3137-send-refresh-token branch April 7, 2023 19:40
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.

4 participants