fix: do not allow operator token from being deleted#26418
fix: do not allow operator token from being deleted#26418praveen-influx merged 4 commits intomainfrom
Conversation
6d32af6 to
9b60be9
Compare
|
Is there a reason we even allow the prompt on deleting the It looks like the |
hiltontj
left a comment
There was a problem hiding this comment.
I had one nit on a HTTP response code, but not sure if I'm right on that. I will approve for now.
influxdb3/tests/server/configure.rs
Outdated
| let json: CreateTokenWithPermissionsResponse = result.json().await.unwrap(); | ||
| info!(?json, "test: result running the token delete"); | ||
| assert_eq!(json.id, 2); | ||
| assert_eq!(result.status(), StatusCode::INTERNAL_SERVER_ERROR); |
There was a problem hiding this comment.
Could this potentially be a 409 CONFLICT error?
There was a problem hiding this comment.
Yes - it can, I'll change that too.
peterbarnett03
left a comment
There was a problem hiding this comment.
Just a change to wording.
influxdb3/src/commands/delete.rs
Outdated
| && message == "cannot delete operator token" | ||
| { | ||
| println!( | ||
| "Cannot delete operator token, to regenerate an operator token, use `influxdb3 create token --admin --regenerate --token $TOKEN`" |
There was a problem hiding this comment.
The operator token "_admin" is required cannot be deleted. To regenerate an operator token, use influxdb3 create token --admin --regenerate --token $TOKEN.
@peterbarnett03 - not really, I can easily pull this up. We don't even need to go to the server to check. I'll make that change too. |
hiltontj
left a comment
There was a problem hiding this comment.
Looks good from my end.
* fix: do not allow operator token from being deleted closes: influxdata/influxdb_pro#819 * refactor: address PR feedback * fix: add a word and clarifying colon * fix: failing test --------- Co-authored-by: Peter Barnett <peter.barnett03@gmail.com> commit hash in main: b404e84
* fix: do not allow operator token from being deleted closes: influxdata/influxdb_pro#819 * refactor: address PR feedback * fix: add a word and clarifying colon * fix: failing test --------- Co-authored-by: Peter Barnett <peter.barnett03@gmail.com> commit hash in main: b404e84
closes: https://github.com/influxdata/influxdb_pro/issues/819
Tests