influxdata / influxdata/influxdb
Add ability to pass a token value when creating a new token
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
__Proposal:__
Add an option to `influx auth create` so that we can give it a pre-defined token value.
Note: a `token` option already exists but is is only used to authenticate the command, not to define the new token value.
This was also asked in [Discourse](https://community.influxdata.com/t/import-existing-tokens/16014/3).
__Current behavior:__
`influx auth create --org example --user grafana --write-user`
An auto generated token is created and returned.
__Desired behavior:__
`influx auth create --org example --user grafana --write-user --token-value my-predefined-token`
`my-predefined-token` is set as token and returned.
__Alternatives considered:__
__Use case:__
I'm creating a [ansible role](https://github.com/boutetnico/ansible-role-influxdb) to allow one to setup and configure InfluxDB 2.X. With the current version 2.0.3, one can't predict token values and have them pre-defined in their favourite Infrastructure As Code utility (Ansible, Terraform, etc...).
Contributor guide
Research direction
Start at the `influx auth create` CLI entry point and trace how its existing `--token` option is handled versus token creation. No files or tests are named in the issue, so locate the command implementation and its coverage first. Done means accepting a separate predefined token value, storing it for the new token, returning it, and preserving the existing authentication option.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- authentication, cli
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100