mirror of
https://github.com/coder/coder.git
synced 2026-10-29 17:44:33 +08:00
feat: add github device flow for authentication (#8232)
* feat: add github device flow for authentication This will allow us to add a GitHub OAuth provider out-of-the-box to reduce setup requirements. * Improve askpass view * Add routes to improve clarity of git auth * Redesign the git auth page * Refactor to add a page view * Fix sideways layout * Remove legacy notify * Fix git auth redirects * Add E2E tests * Fix route documentation * Fix imports * Remove unused imports * Fix E2E web test * Fix friendly message appearance * Fix layout shifting for full-screen sign-in * Fix height going to 100% * Fix comments
This commit is contained in:
+138
-11
@@ -593,8 +593,12 @@
|
||||
{
|
||||
"value": [
|
||||
{
|
||||
"app_install_url": "string",
|
||||
"app_installations_url": "string",
|
||||
"auth_url": "string",
|
||||
"client_id": "string",
|
||||
"device_code_url": "string",
|
||||
"device_flow": true,
|
||||
"id": "string",
|
||||
"no_refresh": true,
|
||||
"regex": "string",
|
||||
@@ -1878,8 +1882,12 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
|
||||
"git_auth": {
|
||||
"value": [
|
||||
{
|
||||
"app_install_url": "string",
|
||||
"app_installations_url": "string",
|
||||
"auth_url": "string",
|
||||
"client_id": "string",
|
||||
"device_code_url": "string",
|
||||
"device_flow": true,
|
||||
"id": "string",
|
||||
"no_refresh": true,
|
||||
"regex": "string",
|
||||
@@ -2210,8 +2218,12 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
|
||||
"git_auth": {
|
||||
"value": [
|
||||
{
|
||||
"app_install_url": "string",
|
||||
"app_installations_url": "string",
|
||||
"auth_url": "string",
|
||||
"client_id": "string",
|
||||
"device_code_url": "string",
|
||||
"device_flow": true,
|
||||
"id": "string",
|
||||
"no_refresh": true,
|
||||
"regex": "string",
|
||||
@@ -2574,12 +2586,81 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
|
||||
| `count` | integer | false | | |
|
||||
| `users` | array of [codersdk.User](#codersdkuser) | false | | |
|
||||
|
||||
## codersdk.GitAuth
|
||||
|
||||
```json
|
||||
{
|
||||
"app_install_url": "string",
|
||||
"app_installable": true,
|
||||
"authenticated": true,
|
||||
"device": true,
|
||||
"installations": [
|
||||
{
|
||||
"account": {
|
||||
"avatar_url": "string",
|
||||
"login": "string",
|
||||
"name": "string",
|
||||
"profile_url": "string"
|
||||
},
|
||||
"configure_url": "string",
|
||||
"id": 0
|
||||
}
|
||||
],
|
||||
"type": "string",
|
||||
"user": {
|
||||
"avatar_url": "string",
|
||||
"login": "string",
|
||||
"name": "string",
|
||||
"profile_url": "string"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Type | Required | Restrictions | Description |
|
||||
| ----------------- | --------------------------------------------------------------------------- | -------- | ------------ | ----------------------------------------------------------------------- |
|
||||
| `app_install_url` | string | false | | App install URL is the URL to install the app. |
|
||||
| `app_installable` | boolean | false | | App installable is true if the request for app installs was successful. |
|
||||
| `authenticated` | boolean | false | | |
|
||||
| `device` | boolean | false | | |
|
||||
| `installations` | array of [codersdk.GitAuthAppInstallation](#codersdkgitauthappinstallation) | false | | Installations are the installations that the user has access to. |
|
||||
| `type` | string | false | | |
|
||||
| `user` | [codersdk.GitAuthUser](#codersdkgitauthuser) | false | | User is the user that authenticated with the provider. |
|
||||
|
||||
## codersdk.GitAuthAppInstallation
|
||||
|
||||
```json
|
||||
{
|
||||
"account": {
|
||||
"avatar_url": "string",
|
||||
"login": "string",
|
||||
"name": "string",
|
||||
"profile_url": "string"
|
||||
},
|
||||
"configure_url": "string",
|
||||
"id": 0
|
||||
}
|
||||
```
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Type | Required | Restrictions | Description |
|
||||
| --------------- | -------------------------------------------- | -------- | ------------ | ----------- |
|
||||
| `account` | [codersdk.GitAuthUser](#codersdkgitauthuser) | false | | |
|
||||
| `configure_url` | string | false | | |
|
||||
| `id` | integer | false | | |
|
||||
|
||||
## codersdk.GitAuthConfig
|
||||
|
||||
```json
|
||||
{
|
||||
"app_install_url": "string",
|
||||
"app_installations_url": "string",
|
||||
"auth_url": "string",
|
||||
"client_id": "string",
|
||||
"device_code_url": "string",
|
||||
"device_flow": true,
|
||||
"id": "string",
|
||||
"no_refresh": true,
|
||||
"regex": "string",
|
||||
@@ -2592,17 +2673,63 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Type | Required | Restrictions | Description |
|
||||
| -------------- | --------------- | -------- | ------------ | ----------- |
|
||||
| `auth_url` | string | false | | |
|
||||
| `client_id` | string | false | | |
|
||||
| `id` | string | false | | |
|
||||
| `no_refresh` | boolean | false | | |
|
||||
| `regex` | string | false | | |
|
||||
| `scopes` | array of string | false | | |
|
||||
| `token_url` | string | false | | |
|
||||
| `type` | string | false | | |
|
||||
| `validate_url` | string | false | | |
|
||||
| Name | Type | Required | Restrictions | Description |
|
||||
| ----------------------- | --------------- | -------- | ------------ | ----------- |
|
||||
| `app_install_url` | string | false | | |
|
||||
| `app_installations_url` | string | false | | |
|
||||
| `auth_url` | string | false | | |
|
||||
| `client_id` | string | false | | |
|
||||
| `device_code_url` | string | false | | |
|
||||
| `device_flow` | boolean | false | | |
|
||||
| `id` | string | false | | |
|
||||
| `no_refresh` | boolean | false | | |
|
||||
| `regex` | string | false | | |
|
||||
| `scopes` | array of string | false | | |
|
||||
| `token_url` | string | false | | |
|
||||
| `type` | string | false | | |
|
||||
| `validate_url` | string | false | | |
|
||||
|
||||
## codersdk.GitAuthDevice
|
||||
|
||||
```json
|
||||
{
|
||||
"device_code": "string",
|
||||
"expires_in": 0,
|
||||
"interval": 0,
|
||||
"user_code": "string",
|
||||
"verification_uri": "string"
|
||||
}
|
||||
```
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Type | Required | Restrictions | Description |
|
||||
| ------------------ | ------- | -------- | ------------ | ----------- |
|
||||
| `device_code` | string | false | | |
|
||||
| `expires_in` | integer | false | | |
|
||||
| `interval` | integer | false | | |
|
||||
| `user_code` | string | false | | |
|
||||
| `verification_uri` | string | false | | |
|
||||
|
||||
## codersdk.GitAuthUser
|
||||
|
||||
```json
|
||||
{
|
||||
"avatar_url": "string",
|
||||
"login": "string",
|
||||
"name": "string",
|
||||
"profile_url": "string"
|
||||
}
|
||||
```
|
||||
|
||||
### Properties
|
||||
|
||||
| Name | Type | Required | Restrictions | Description |
|
||||
| ------------- | ------ | -------- | ------------ | ----------- |
|
||||
| `avatar_url` | string | false | | |
|
||||
| `login` | string | false | | |
|
||||
| `name` | string | false | | |
|
||||
| `profile_url` | string | false | | |
|
||||
|
||||
## codersdk.GitProvider
|
||||
|
||||
|
||||
Reference in New Issue
Block a user