feat: allow external auth providers to expose extra metadata (#10157)

This commit is contained in:
Kyle Carberry
2023-10-09 23:02:16 -05:00
committed by GitHub
parent 3eb9a43190
commit 9c098b218f
12 changed files with 144 additions and 30 deletions

2
docs/api/agents.md generated
View File

@ -250,6 +250,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/me/external-auth?mat
{
"access_token": "string",
"password": "string",
"token_extra": {},
"type": "string",
"url": "string",
"username": "string"
@ -293,6 +294,7 @@ curl -X GET http://coder-server:8080/api/v2/workspaceagents/me/gitauth?match=str
{
"access_token": "string",
"password": "string",
"token_extra": {},
"type": "string",
"url": "string",
"username": "string"

2
docs/api/schemas.md generated
View File

@ -115,6 +115,7 @@
{
"access_token": "string",
"password": "string",
"token_extra": {},
"type": "string",
"url": "string",
"username": "string"
@ -127,6 +128,7 @@
| -------------- | ------ | -------- | ------------ | ---------------------------------------------------------------------------------------- |
| `access_token` | string | false | | |
| `password` | string | false | | |
| `token_extra` | object | false | | |
| `type` | string | false | | |
| `url` | string | false | | |
| `username` | string | false | | Deprecated: Only supported on `/workspaceagents/me/gitauth` for backwards compatibility. |

View File

@ -26,14 +26,18 @@ else
echo $OUTPUT
fi
- Obtain an extra property of an access token for additional metadata.:
$ coder external-auth access-token slack --extra "authed_user.id"
```
## Options
### --s
### --extra
| | |
| ---- | ----------------- |
| Type | <code>bool</code> |
| | |
| ---- | ------------------- |
| Type | <code>string</code> |
Do not print the URL or access token.
Extract a field from the "extra" properties of the OAuth token.