mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
feat: add external-auth
cli (#10052)
* feat: add `external-auth` cli * Add subcommands * Improve descriptions * Add external-auth subcommand * Fix docs * Fix gen * Fix comment * Fix golden file
This commit is contained in:
28
cli/testdata/coder_external-auth_access-token_--help.golden
vendored
Normal file
28
cli/testdata/coder_external-auth_access-token_--help.golden
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
coder v0.0.0-devel
|
||||
|
||||
USAGE:
|
||||
coder external-auth access-token [flags] <provider>
|
||||
|
||||
Print auth for an external provider
|
||||
|
||||
Print an access-token for an external auth provider. The access-token will be
|
||||
validated and sent to stdout with exit code 0. If a valid access-token cannot
|
||||
be obtained, the URL to authenticate will be sent to stdout with exit code 1
|
||||
- Ensure that the user is authenticated with GitHub before cloning.:
|
||||
|
||||
$ #!/usr/bin/env sh
|
||||
|
||||
OUTPUT=$(coder external-auth access-token github)
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "Authenticated with GitHub"
|
||||
else
|
||||
echo "Please authenticate with GitHub:"
|
||||
echo $OUTPUT
|
||||
fi
|
||||
|
||||
OPTIONS:
|
||||
--s bool
|
||||
Do not print the URL or access token.
|
||||
|
||||
———
|
||||
Run `coder --help` for a list of global options.
|
Reference in New Issue
Block a user