Skip to content

Respond with 401 WWW-Authenticate when user is defined but no ACL #403

Description

@juan-ferrer-toribio

I suggest to respond with HTTP 401 WWW-Authenticate when a user is defined but has no ACL for the requested action. Currently server responds with an "empty actions" token and it confuses some web UIs like joxit/docker-registry-ui.

Example config:

users:
  admin:
    password: "$2y$05$***"
  "": {}
acl: 
  - match: { account: "admin", ip: "10.0.0.0/8" }
    actions: ["*"]
    comment: "Admin has full access to everything."
  - match: { account: "", type: "registry", name: "catalog"}
    actions: ["*"]
    comment: "Anonymous user can query the registry"
  - match: { account: "" }
    actions: ["pull"]
    comment: "Anonymous user can pull"

When auth server receives a request for delete action but the anonymous user has no ACL defined for it, it responds with an "empty actions" token instead of requesting username and password.

Related with: #248

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions