mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: add ability to name tokens (#6365)
* add tokens switch * reorged TokensPage * using Trans component for description * using Trans component on DeleteDialog * add owner col * simplify hook return * lint * type for response * added flag for name * fixed auth * lint, prettier, tests * added unique index for login type token * remove tokens by name * better check for unique constraint * docs * test: Fix dbfake to insert token name * fix doc tests * Update cli/tokens.go Co-authored-by: Steven Masley <Emyrk@users.noreply.github.com> * Update coderd/database/migrations/000102_add_apikey_name.down.sql Co-authored-by: Steven Masley <Emyrk@users.noreply.github.com> * add more specificity to IsUniqueViolation check * fix tests * Fix AutorizeAllEndpoints * rename migration --------- Co-authored-by: Steven Masley <stevenmasley@coder.com> Co-authored-by: Steven Masley <Emyrk@users.noreply.github.com>
This commit is contained in:
co-authored by
Steven Masley
Steven Masley
parent
e3a4861e93
commit
71d1e63af0
+1
-1
@@ -22,7 +22,7 @@ Get Started:
|
||||
[;m$ coder tokens rm WuoWs4ZsMX[0m
|
||||
|
||||
Commands:
|
||||
create Create a tokens
|
||||
create Create a token
|
||||
list List tokens
|
||||
remove Delete a token
|
||||
|
||||
|
||||
+2
-1
@@ -1,4 +1,4 @@
|
||||
Create a tokens
|
||||
Create a token
|
||||
|
||||
Usage:
|
||||
coder tokens create [flags]
|
||||
@@ -7,6 +7,7 @@ Flags:
|
||||
-h, --help help for create
|
||||
--lifetime duration Specify a duration for the lifetime of the token.
|
||||
Consumes $CODER_TOKEN_LIFETIME (default 720h0m0s)
|
||||
-n, --name string Specify a human-readable name.
|
||||
|
||||
Global Flags:
|
||||
--global-config coder Path to the global coder config directory.
|
||||
|
||||
+3
-3
@@ -9,9 +9,9 @@ Aliases:
|
||||
Flags:
|
||||
-a, --all Specifies whether all users' tokens will be listed or not (must have
|
||||
Owner role to see all tokens).
|
||||
-c, --column strings Columns to display in table output. Available columns: id, last used,
|
||||
expires at, created at, owner (default [id,last used,expires
|
||||
at,created at])
|
||||
-c, --column strings Columns to display in table output. Available columns: id, name, last
|
||||
used, expires at, created at, owner (default [id,name,last
|
||||
used,expires at,created at])
|
||||
-h, --help help for list
|
||||
-o, --output string Output format. Available formats: table, json (default "table")
|
||||
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
Delete a token
|
||||
|
||||
Usage:
|
||||
coder tokens remove [id] [flags]
|
||||
coder tokens remove [name] [flags]
|
||||
|
||||
Aliases:
|
||||
remove, rm
|
||||
|
||||
Reference in New Issue
Block a user