upbound / up

The @upbound CLI
Apache License 2.0
52 stars 41 forks source link

up logout should clear token on expired session #567

Open nullable-eth opened 3 months ago

nullable-eth commented 3 months ago

What happened?

up logout fails with 401 Unauthorized when the session token has expired and the token is not cleared.

Also docker pull xpkg.upbound.io/crossplane-contrib/function-go-templating:v0.4.0 is failing when previously logged in to upbound but the token has expired. This provides a 401 on the docker call because a token is passed and is invalid even though the pull only needs public access and should be granted.

This requires the user to login to get a valid token and then they can logout and the above requests succeed.

up logout should be changed to clear the local session token at all times and then the credential helper should be updated to logout the user when it receives a 401 on a request that it passed the auth session token and retry the request.

Epic #

How can we reproduce it?

What environment did it happen in?