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

devel: rest api token auth#469

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
jelly wants to merge1 commit intoarchlinux:master
base:master
Choose a base branch
Loading
fromjelly:rest-token-complete-todolist

Conversation

@jelly
Copy link
Member

Implement a simple token authentication header for various "restish" endpoints we might want for adoption/disowning of packages.

Implement a simple token authentication header for various "restish"endpoints we might want for adoption/disowning of packages.
@raffomania
Copy link

Hey, just a reminder, if you don't find the time to continue this, I'd like to help out :)

@raffomaniaraffomania mentioned this pull requestDec 20, 2024
5 tasks
Copy link
Member

@anthraxxanthraxx left a comment

Choose a reason for hiding this comment

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

Awesome to see progress on this, this will be a very useful feature. Thank you for working on this.


classAuthTokenBackend(object):
defauthenticate(self,request,username=None,password=None):
if'X-Archweb-Token'inrequest.headers:
Copy link
Member

Choose a reason for hiding this comment

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

Wouldn't it make sense to useAuthorization: Bearer as header, this is a quite widely used way for such API and would also allow a lot of HTTP clients to use implemented helper methods for authenticate a request with a token. Otherwise you'd need to pass around custom header strings likeX-Archweb-Token.
What are your thoughts about this?

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Sounds fine to me, it shouldn't conflict with things I suppose.

<formid="api-profile-form"enctype="multipart/form-data"method="post"action="">{% csrf_token %}
<h3>API token</h3>
<p>Token for completing todolist items with for example, rebuild-todo</p>
{% if profile.api_token is None %}
Copy link
Member

Choose a reason for hiding this comment

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

I assume it would be a good pattern to be able to revoke a token, or to phrase it differently: Generate a new token and invalidate the existing one.
I'd probably propose something like only showing the token once when the generate button is clicked and otherwise show an invalidate/regenerate button instead. We should hide the token after generating it.

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

Reviewers

@anthraxxanthraxxanthraxx left review comments

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

@jelly@raffomania@anthraxx

[8]ページ先頭

©2009-2025 Movatter.jp