mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08: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:
Generated
+23
@@ -0,0 +1,23 @@
|
||||
<!-- DO NOT EDIT | GENERATED CONTENT -->
|
||||
|
||||
# external-auth
|
||||
|
||||
Manage external authentication
|
||||
|
||||
## Usage
|
||||
|
||||
```console
|
||||
coder external-auth
|
||||
```
|
||||
|
||||
## Description
|
||||
|
||||
```console
|
||||
Authenticate with external services inside of a workspace.
|
||||
```
|
||||
|
||||
## Subcommands
|
||||
|
||||
| Name | Purpose |
|
||||
| ------------------------------------------------------------ | ----------------------------------- |
|
||||
| [<code>access-token</code>](./external-auth_access-token.md) | Print auth for an external provider |
|
||||
Generated
+39
@@ -0,0 +1,39 @@
|
||||
<!-- DO NOT EDIT | GENERATED CONTENT -->
|
||||
|
||||
# external-auth access-token
|
||||
|
||||
Print auth for an external provider
|
||||
|
||||
## Usage
|
||||
|
||||
```console
|
||||
coder external-auth access-token [flags] <provider>
|
||||
```
|
||||
|
||||
## Description
|
||||
|
||||
```console
|
||||
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
|
||||
|
||||
| | |
|
||||
| ---- | ----------------- |
|
||||
| Type | <code>bool</code> |
|
||||
|
||||
Do not print the URL or access token.
|
||||
Reference in New Issue
Block a user