influxdata / influxdata/influxdb
influx auth ls --user(-id) not working
- Dominant language
- Rust
- Stars
- 31.7k
- Forks
- 3.7k
- Avg merge
- 13h 37m
- Merged PRs (30d)
- 8
Description
Hello wonderful people,
just wondering why this command doesn't work as i guessed it does.
Is this intended behaviour and if so, is there any way to get the expected results?
__Steps to reproduce:__
List the minimal actions needed to reproduce the behavior.
1. Create some API tokens with `influx auth create`
2. Try fetching with `influx auth ls --user(-id)`
__Expected behavior:__
```
influx auth ls --user test
ID Description Token User Name User ID Permissions
id test's Token token test test_id [read:orgs/org-id/buckets/bucket-id]
```
```
influx auth ls --user-id test-id
ID Description Token User Name User ID Permissions
id test's Token token test test_id [read:orgs/org-id/buckets/bucket-id]
```
__Actual behavior:__
```
influx auth ls --user test
ID Description Token User Name User ID Permissions
id test's Token token test test_id [read:orgs/org-id/buckets/bucket-id]
id dave's Token token dave dave_id [read:orgs/org-id/buckets/bucket-id]
id jenny's Token token jenny jenny_id [read:orgs/org-id/buckets/bucket-id]
id my's Token token my my_id [read:orgs/org-id/buckets/bucket-id]
```
```
influx auth ls --user-id test_id
ID Description Token User Name User ID Permissions
id test's Token token test test_id [read:orgs/org-id/buckets/bucket-id]
id dave's Token token dave dave_id [read:orgs/org-id/buckets/bucket-id]
id jenny's Token token jenny jenny_id [read:orgs/org-id/buckets/bucket-id]
id my's Token token my my_id [read:orgs/org-id/buckets/bucket-id]
```
__Environment info:__
* System info: Run `uname -srm` and copy the output here
```
uname -srm
Linux 5.4.0-77-generic x86_64
```
* InfluxDB version: Run `influxd version` and copy the output here
```
influxd version
InfluxDB 2.1.1 (git: 657e1839de) build_date: 2021-11-09T03:03:48Z
```
* Other relevant environment details: Container runtime, disk info, etc
__Config:__
Copy any non-default config values here or attach the full config as a gist or file.
```
cat /etc/influxdb/config.toml
engine-path = "/var/lib/influxdb/engine"
bolt-path = "/var/lib/influxdb/influxd.bolt"
tls-cert = "path-to.crt"
tls-key = "path-to.key"
```
__Logs:__
Include snippet of errors in log.
__Performance:__
Generate profiles with the following commands for bugs related to performance, locking, out of memory (OOM), etc.
```sh
# Commands should be run when the bug is actively happening.
# Note: This command will run for ~30 seconds.
curl -o profiles.tar.gz "http://localhost:8086/debug/pprof/all?cpu=30s"
iostat -xd 1 30 > iostat.txt
# Attach the `profiles.tar.gz` and `iostat.txt` output files.
```
Contributor guide
Research direction
Start by reproducing the issue with `influx auth create`, then run `influx auth ls --user test` and `influx auth ls --user-id test_id` against the reported InfluxDB version. Trace the `influx auth ls` filtering entry point and determine why both commands return every token; done means each command returns only the matching token.
Written by the indexing model from the issue text.
Assessment
- Domain
- cli, databases
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100