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

Allow GET to /token/ to create a new API token if none exists #4672

Merged
merged 1 commit into from Oct 3, 2023

Conversation

jnm
Copy link
Member

@jnm jnm commented Oct 3, 2023

The old behavior of POST is unchanged for the sake of API stability.

Something in releases prior to 2.023.37 was creating these tokens implicitly. It's not happening anymore, meaning that new accounts are left without API tokens, and the front end has never had any facility to send anything other than a GET to the token endpoint. To avoid the hassle of backfilling tokens for accounts that have none, or of rewriting the front end to send POST whenever GET returns a 404, this change simply allows a GET request to create a token implicitly if none exists.

…if none exists. The old behavior of POST is unchanged for the sake of
API stability.

Something in releases prior to 2.023.37 was creating these tokens
implicitly. It's not happening anymore, meaning that new accounts are
left without API tokens, and the front end has never had any facility to
send anything other than a GET to the token endpoint. To avoid the
hassle of backfilling tokens for accounts that have none, or of
rewriting the front end to send POST whenever GET returns a 404, this
change simply allows a GET request to create a token implicitly if none
exists.
@jnm jnm requested a review from noliveleger October 3, 2023 04:15
@noliveleger noliveleger added API Changes related to API endpoints bug-fix Back end labels Oct 3, 2023
@noliveleger noliveleger merged commit 8cb1ea9 into release/2.023.37 Oct 3, 2023
4 checks passed
@noliveleger noliveleger deleted the create-api-token-via-get-request branch October 3, 2023 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Changes related to API endpoints Back end bug-fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants