hmpf / easydmp

MIT License
7 stars 2 forks source link

Add API authentication by token #171

Closed hmpf closed 3 years ago

hmpf commented 3 years ago

For CLI usage of the API, authenticating with just a token is very convenient.

The header looks like "Authorization: Bearer GVFHTYt75y68vghbyj" where the stuff after "Bearer" is a token connected to a single User.

Since this is meant for CLI API usage, no attempts are made to make it easy to get a token for an ordinary user. Tokens can be made and fetched via the admin and via a management command and that's it.

This will create a new table in the database.

codecov[bot] commented 3 years ago

Codecov Report

Merging #171 (a02f749) into master (dcfec69) will increase coverage by 0.01%. The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #171      +/-   ##
==========================================
+ Coverage   55.15%   55.16%   +0.01%     
==========================================
  Files         102      102              
  Lines        5898     5900       +2     
==========================================
+ Hits         3253     3255       +2     
  Misses       2645     2645              
Impacted Files Coverage Δ
src/easydmp/site/settings/base.py 90.16% <ø> (ø)
src/easydmp/auth/admin.py 100.00% <100.00%> (ø)

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 dcfec69...a02f749. Read the comment docs.