-
Notifications
You must be signed in to change notification settings - Fork 17
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
Update HTTP Basic auth for FastAPI and Starlette #32
Conversation
- Remove default username and password (**IMPORTANT**): the environment variables `BASIC_AUTH_USERNAME` and `BASIC_AUTH_PASSWORD` must now be set on the server to use HTTP Basic auth. Defaults were provided as examples, but in production contexts, the defaults shouldn't be used. - Raise an exception if server HTTP Basic auth credentials are not set, and clients make requests to authenticate with HTTP Basic auth - Add docstrings to HTTP Basic auth methods - Update example username and password throughout tests and examples
Sourcery Code Quality Report❌ Merging this PR will decrease code quality in the affected files by 0.71%.
Here are some functions in these files that still need a tune-up:
Legend and ExplanationThe emojis denote the absolute quality of the code:
The 👍 and 👎 indicate whether the quality has improved or gotten worse with this pull request. Please see our documentation here for details on how these metrics are calculated. We are actively working on this report - lots more documentation and extra metrics to come! Let us know what you think of it by mentioning @sourcery-ai in a comment. |
Codecov Report
@@ Coverage Diff @@
## develop #32 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 9 9
Lines 256 264 +8
=========================================
+ Hits 256 264 +8
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Description
The HTTP Basic auth methods have been useful as examples, but they could also be used by other applications when the inboard Python package has been installed. This PR will provide some updates to these methods.
The only potentially breaking change is that the default
BASIC_AUTH_USERNAME
andBASIC_AUTH_PASSWORD
will be removed. These environment variables must be set on the server to use HTTP Basic auth.Changes
Update HTTP Basic auth for FastAPI and Starlette (2630dea)
BASIC_AUTH_USERNAME
andBASIC_AUTH_PASSWORD
must now be set on the server to use HTTP Basic auth. Defaults were provided as examples, but in production contexts, the defaults shouldn't be used.Related