operator-framework / operator-courier

Build, verify and push operators
Apache License 2.0
41 stars 53 forks source link

Unauthorized access on push #191

Closed ryandawsonuk closed 4 years ago

ryandawsonuk commented 4 years ago

I was able to push fine a week or two ago but now when I do operator-courier push deploy/olm-catalog/seldon-deploy-operator seldon seldon-deploy-operator 0.7.0 "$QUAY_TOKEN":

ERROR:operatorcourier.push:{"error":{"code":"forbidden","details":{"package":"seldon/seldon-deploy-operator","scopes":["create"]},"message":"Unauthorized access for: seldon/seldon-deploy-operator"}}

Just like in https://github.com/operator-framework/operator-courier/issues/30

I am thinking something may have changed in the authentication with quay as when I do docker login quay.io -u="${QUAY_USERNAME}" -p="${QUAY_PASSWORD}" then I see login succeeded but if I then run:

TOKEN_CURL_RESPONSE=$(curl -sH "Content-Type: application/json" -XPOST https://quay.io/cnr/api/v1/users/login -d '
> {
>     "user": {
>         "username": "'"${QUAY_USERNAME}"'",
>         "password": "'"${QUAY_PASSWORD}"'"
>     }
> }')
echo $TOKEN_CURL_RESPONSE

Then I see {"error":{"code":"invalid-usage","details":{},"message":"Missing username or password"}}. I've tried different ways of putting the username and password in but presumably it should work just with the env vars as that's what's in the README.

I'm also seeing that when I do

curl -X PUT https://quay.io/api/v1/organization/{orgname}/robots/{robot shortname} -H 'Authorization: Bearer {QUAY_TOKEN}''

I get the message {"message": "CSRF token was invalid or missing."}. That's following an example and using a token that I've taken straight from the quay.io UI's encrypted password export.

ryandawsonuk commented 4 years ago

Turns out it works when I run https://github.com/operator-framework/operator-courier/blob/master/scripts/get-quay-token. I think this was just my mistake