Skip to content

Conversation

ysangkok
Copy link
Member

@ysangkok ysangkok commented Apr 9, 2022

Before this PR:

mirroring 3d-graphics-examples-0.0.0.0
hackage-mirror: Failed to upload package 3d-graphics-examples-0.0.0.0,
  HTTP error code 403, Forbidden 
  http://admin:...@localhost:8080/package/3d-graphics-examples-0.0.0.0/3d-graphics-examples.cabal

Not very helpful, since you can't see what kind of problem there was. Were the credentials wrong? It's hard to tell.

One problem is that the server doesn't know that the client wants the error
message as text/plain, so this PR adds this Accept header.

This PR also improves the generated message such that it includes the groups
against which the users' membership is checked. It is done by added a generic group checker
mechanism, that could potentially be used in more places. But for now, only the
mirror client uses this.

After this PR, the message is much improved:

mirroring 3d-graphics-examples-0.0.0.0
hackage-mirror: Failed to upload package 3d-graphics-examples-0.0.0.0,
  HTTP error code 403, Forbidden 
  http://admin:...@localhost:8080/package/3d-graphics-examples-0.0.0.0/3d-graphics-examples.cabal
  Error: Missing group membership
  
  Access denied, you must be member of either of the following groups: ["Mirror
  clients"]

@gbaz gbaz merged commit 73d008d into haskell:master Apr 11, 2022
@ysangkok ysangkok deleted the janus/friendly-group-error branch April 11, 2022 02:57
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