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 document authentication #312

Merged
merged 1 commit into from
Feb 26, 2021
Merged

Conversation

gongul
Copy link
Contributor

@gongul gongul commented Feb 22, 2021

Proplems

  1. The documentation authentication method is specified as drf DEFAULT_AUTHENTICATION_CLASSES, which prevents the use of other authentication methods. (There is a way to use it by inheriting the class, but I think it is better to set it in SPECTACULAR_SETTINGS like SERVE_PERMISSIONS.)

Result

If you follow the example and set it up, it's over. Even if SERVE_AUTHENTICATION is not specified, it is applied to the DRF as DEFAULT_AUTHENTICATION_CLASSES.

settings.py

SPECTACULAR_SETTINGS = {
    'SERVE_AUTHENTICATION': ['rest_framework.authentication.SessionAuthentication'],
}

@codecov
Copy link

codecov bot commented Feb 22, 2021

Codecov Report

Merging #312 (1611f6f) into master (6b53554) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #312   +/-   ##
=======================================
  Coverage   98.29%   98.29%           
=======================================
  Files          53       53           
  Lines        4569     4573    +4     
=======================================
+ Hits         4491     4495    +4     
  Misses         78       78           
Impacted Files Coverage Δ
drf_spectacular/settings.py 100.00% <ø> (ø)
drf_spectacular/views.py 98.73% <100.00%> (+0.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6b53554...1611f6f. Read the comment docs.

tfranzel added a commit that referenced this pull request Feb 26, 2021
@tfranzel tfranzel merged commit 1611f6f into tfranzel:master Feb 26, 2021
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.

None yet

2 participants