Skip to content

fix: Updated POST request structure to retrieve token#215

Merged
frgfm merged 9 commits into
masterfrom
client-retrieve-token
Oct 14, 2022
Merged

fix: Updated POST request structure to retrieve token#215
frgfm merged 9 commits into
masterfrom
client-retrieve-token

Conversation

@fe51

@fe51 fe51 commented Sep 22, 2022

Copy link
Copy Markdown
Member

Proposed solution to the issue #214

This PR introduces the following modifications in _retrieve_token method :

  • Updates data to pass creds to json
  • Deletes specific headers

Closes #214

@codecov

codecov Bot commented Sep 22, 2022

Copy link
Copy Markdown

Codecov Report

Merging #215 (f37847c) into master (5df89ed) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #215   +/-   ##
=======================================
  Coverage   94.08%   94.08%           
=======================================
  Files          47       47           
  Lines        1285     1285           
=======================================
  Hits         1209     1209           
  Misses         76       76           
Flag Coverage Δ
unittests 94.08% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/app/api/routes/media.py 86.84% <0.00%> (ø)

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

@fe51
fe51 requested a review from frgfm September 25, 2022 09:42

@frgfm frgfm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks Felix!

But that's the type of bug correction we cannot leave without testing. Do you think we could integrate that in the unittests? Either by changing the dummy creds to something reproducing the bug or simply checking the encoding by decoding the payload somewhere?

@fe51

fe51 commented Sep 26, 2022

Copy link
Copy Markdown
Member Author

You are right, it has to be integrated to unittests !
As this is a bug for which we don't have a theoretical explanation, I made an update of the dummy creds in the light of what the current fix allows (hence including special characters in the frame of the creds at the origin of the bug)

@fe51
fe51 requested a review from frgfm September 26, 2022 15:24
@frgfm

frgfm commented Sep 27, 2022

Copy link
Copy Markdown
Member

Can you confirm that those unittests fail without your modification? (if that's the case, we can move forward)

@frgfm

frgfm commented Sep 29, 2022

Copy link
Copy Markdown
Member

ping @fe51 🙏

@fe51

fe51 commented Oct 11, 2022

Copy link
Copy Markdown
Member Author

@frgfm tested updated, we can merge !

@frgfm

frgfm commented Oct 12, 2022

Copy link
Copy Markdown
Member

Did you manage to get the client unittests to run? Because the job is failing, and flake8 isn't happy :/

@fe51

fe51 commented Oct 13, 2022

Copy link
Copy Markdown
Member Author

Okay, I have been able to run tests locally and solve issues !

I think this is ready to merge @frgfm, finally :D

As a reminder, the problems encountered were :

  • login must fit regular expression imposed in base.py

login: str = Field(..., min_length=3, max_length=50, regex="^[a-zA-Z0-9_-]+$", example="JohnDoe")

  • Did not managed to pass a double $$ in password var to docker-compose env variable salthough doc was suggesting it would work with singles quotes ' ' (here and there)

@frgfm frgfm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks Felix 🙏

@frgfm frgfm added this to the 0.2.0 milestone Oct 14, 2022
@frgfm
frgfm merged commit 6894cdd into master Oct 14, 2022
@frgfm
frgfm deleted the client-retrieve-token branch October 14, 2022 09:51
blenzi pushed a commit that referenced this pull request May 1, 2023
blenzi pushed a commit that referenced this pull request May 12, 2023
frgfm added a commit that referenced this pull request May 28, 2023
* fix: authentication, alert payload and exception handling in scripts/api_e2e.py

* fix: login POST request as in #215

* fix: login POST request as in #215

* ci: Removes MacOS job for scripts

* chore: Updates the version specifier for the E2E script

---------

Co-authored-by: Bruno Lenzi <[email protected]>
Co-authored-by: F-G Fernandez <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ext: client type: fix Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[client][Retrieve Token] Issues passing creds with Content Type "application/x-www-form-urlencoded"

2 participants