cloudflare / serverless-registry

A container registry backed by Workers and R2.
Apache License 2.0
997 stars 36 forks source link

Check capabilities in requests for basic auth users and added pull-only credentials #57

Closed theoriginalgri closed 1 month ago

theoriginalgri commented 1 month ago

This a provisional implementation for #38.

While I've only tried with the READONLY_USERNAME and READONLY_PASSWORD, the passing of the capabilities should also work for the JWT tokens which have the capabilities in them.

Since JS/TS is not my world, please forgive me simple mistakes you could find.

theoriginalgri commented 1 month ago

Yeah, maybe I should have added tests 😄