Skip to content

Conversation

@fMeow
Copy link
Collaborator

@fMeow fMeow commented Jun 22, 2022

Add a feature gate auth-required to require authorization for downloading crates, searching crates, getting crate owner.

@fMeow fMeow closed this by deleting the head repository Sep 3, 2022
@fMeow fMeow reopened this Sep 3, 2022
@gagbo gagbo self-assigned this Sep 7, 2022
Copy link
Collaborator

@gagbo gagbo left a comment

Choose a reason for hiding this comment

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

That looks pretty cool, thanks a lot for that! I'd like to have integration tests to be sure that there are no regressions, but I don't really have time for that now, so I might just merge as is really.

I only added a few nitpicky comments, feel free to ignore those

db-sled = ["sled"]
db-redis = ["redis"]
db-mongo = ["mongodb", "bson"]
auth-required = []
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should name the feature registry-auth instead

.read()
.await
.user_id_for_token(&token)
.map_err(|_| Error::InvalidToken(token.clone()))
Copy link
Collaborator

Choose a reason for hiding this comment

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

It could be cool to add the WWW-Authenticate header on rejection here

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.

2 participants