Skip to content

Use local Hex key to revoke local Hex API key #4441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

scristobal
Copy link
Contributor

@scristobal scristobal commented Apr 3, 2025

resolves #4319

After a bit of though, I realized we can use the existing key to revoke itself. Provided the Hex API allows such a thing.

As it turns out, using the existing key to revoke itself works just fine, but requires asking the user for the local password. Hence the command flow needs to change a bit. Here is the result:

In any case, if the key couldn't be revoked, the user is hinted to finish the process manually, instead of failing, like in #4319.

Please do let me know if you think this approach is a good fit.

Thanks!

@scristobal scristobal changed the title Improve deletion and revocation of local Hex API key Use local Hex key to revoke local Hex API key Apr 3, 2025
Copy link
Member

@lpil lpil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

Rather than decrypting it first we should only do it if the new key cannot be used to delete the old one. The most common reason to overwrite the existing key is if the programmer has forgotten their password, as it's very rare for someone to have multiple Hex accounts. There's not really any reason to make more than one because Hex supports organisations and multiple maintainers per package.

@scristobal
Copy link
Contributor Author

Thank you!

Rather than decrypting it first we should only do it if the new key cannot be used to delete the old one. The most common reason to overwrite the existing key is if the programmer has forgotten their password, as it's very rare for someone to have multiple Hex accounts. There's not really any reason to make more than one because Hex supports organisations and multiple maintainers per package.

uuups, it makes sense. I will put this is in draft mode and come back later.

@scristobal scristobal marked this pull request as draft April 3, 2025 12:55
@scristobal
Copy link
Contributor Author

follow up in #4446

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.

gleam hex authenticate must be run twice to switch accounts.
2 participants