Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Explore swappable API key model functionality#191

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
florimondmanca wants to merge1 commit intomaster
base:master
Choose a base branch
Loading
fromfm/swappable-api-key-model

Conversation

@florimondmanca
Copy link
Owner

@florimondmancaflorimondmanca commentedDec 5, 2021
edited
Loading

This is an illustration of a possible resolution for#180.

  • Allows users to define a default API key model they'd like to use.
  • If "a default API key model" does not make sense for their use case (e.g. maybe they have multiple custom API key models), then the defaultAPIKey model would still get created. I'm not sure there's a sensible way out of this, because allowing dropping the model midways, e.g. viaAPI_KEY_MODEL = None, would add migration questions for existing apps.
  • However, this PR also proposes to notregister() any API key models by default, meaning at least they wouldn't see it in the admin. It's possible we want this to be a separate, isolated PR.

This would be a fully backwards-compatible change, as the default behavior would match the existingAPIKey-based behavior — except for the admin dropout, which we'd need to document as a change.

cc@virogenesis What do you think about this?

@codecov-commenter
Copy link

Codecov Report

Merging#191 (5f20bf9) intomaster (dd806cf) willdecrease coverage by0.66%.
The diff coverage is78.94%.

Impacted file tree graph

@@            Coverage Diff             @@##           master     #191      +/-   ##==========================================- Coverage   96.55%   95.88%   -0.67%==========================================  Files          22       22                Lines         522      535      +13     ==========================================+ Hits          504      513       +9- Misses         18       22       +4
Impacted FilesCoverage Δ
src/rest_framework_api_key/models.py96.00% <75.00%> (-4.00%)⬇️
src/rest_framework_api_key/admin.py76.00% <100.00%> (-0.93%)⬇️
src/rest_framework_api_key/permissions.py94.73% <100.00%> (ø)

Continue to review full report at Codecov.

Legend -Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered byCodecov. Last updatedd806cf...5f20bf9. Read thecomment docs.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@florimondmanca@codecov-commenter

[8]ページ先頭

©2009-2025 Movatter.jp