Skip to content
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

feat: add button for rotating API token #1461

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

bshaffer
Copy link
Contributor

@bshaffer bshaffer commented Jul 19, 2024

Resolves #1460 - adds a button for rotating API tokens

If you do not like how this looks, we could potentially hide the button with a query flag like ?show-rotate-api-key=1. Please let me know what you think!

Screenshot 2024-07-19 at 1 09 13 PM

And upon clicking the button:
Screenshot 2024-07-19 at 1 09 26 PM

if (!$user instanceof User) {
throw $this->createAccessDeniedException('This user does not have access to this section.');
}
$user->initializeApiToken();
Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps add as well a CSRF check prior to rotating data?

@Seldaek Seldaek merged commit 4efe72b into composer:main Aug 19, 2024
3 checks passed
@Seldaek
Copy link
Member

Seldaek commented Aug 19, 2024

Thanks, I've added the CSRF protection after merging.

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.

feature request: add way to rotate / revoke packagist API tokens
3 participants