Skip to content

Commit 57b3605

Browse files
committed
chore: add boolean to auth methods to know if the deployment supports oidc conversion
1 parent ddabcf7 commit 57b3605

File tree

7 files changed

+18
-6
lines changed

7 files changed

+18
-6
lines changed

coderd/apidoc/docs.go

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/userauth.go

+1
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ func (api *API) userAuthMethods(rw http.ResponseWriter, r *http.Request) {
411411

412412
httpapi.Write(r.Context(), rw, http.StatusOK, codersdk.AuthMethods{
413413
UserAuthenticationType: currentUserLoginType,
414+
ConvertToOIDCEnabled: api.Options.DeploymentValues.EnableOauthAccountConversion.Value(),
414415
Password: codersdk.AuthMethod{
415416
Enabled: !api.DeploymentValues.DisablePasswordAuth.Value(),
416417
},

codersdk/users.go

+1
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ type AuthMethods struct {
126126
// UserAuthenticationType returns the authentication method for the given
127127
// caller if the request is an authenticated request. Otherwise it is empty.
128128
UserAuthenticationType LoginType `json:"me_login_type,omitempty"`
129+
ConvertToOIDCEnabled bool `json:"convert_to_oidc_enabled"`
129130
Password AuthMethod `json:"password"`
130131
Github AuthMethod `json:"github"`
131132
OIDC OIDCAuthMethod `json:"oidc"`

docs/api/schemas.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -1107,6 +1107,7 @@
11071107

11081108
```json
11091109
{
1110+
"convert_to_oidc_enabled": true,
11101111
"github": {
11111112
"enabled": true
11121113
},
@@ -1124,12 +1125,13 @@
11241125

11251126
### Properties
11261127

1127-
| Name | Type | Required | Restrictions | Description |
1128-
| --------------- | -------------------------------------------------- | -------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------- |
1129-
| `github` | [codersdk.AuthMethod](#codersdkauthmethod) | false | | |
1130-
| `me_login_type` | [codersdk.LoginType](#codersdklogintype) | false | | Me login type returns the authentication method for the given caller if the request is an authenticated request. Otherwise it is empty. |
1131-
| `oidc` | [codersdk.OIDCAuthMethod](#codersdkoidcauthmethod) | false | | |
1132-
| `password` | [codersdk.AuthMethod](#codersdkauthmethod) | false | | |
1128+
| Name | Type | Required | Restrictions | Description |
1129+
| ------------------------- | -------------------------------------------------- | -------- | ------------ | --------------------------------------------------------------------------------------------------------------------------------------- |
1130+
| `convert_to_oidc_enabled` | boolean | false | | |
1131+
| `github` | [codersdk.AuthMethod](#codersdkauthmethod) | false | | |
1132+
| `me_login_type` | [codersdk.LoginType](#codersdklogintype) | false | | Me login type returns the authentication method for the given caller if the request is an authenticated request. Otherwise it is empty. |
1133+
| `oidc` | [codersdk.OIDCAuthMethod](#codersdkoidcauthmethod) | false | | |
1134+
| `password` | [codersdk.AuthMethod](#codersdkauthmethod) | false | | |
11331135

11341136
## codersdk.AuthorizationCheck
11351137

docs/api/users.md

+1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ curl -X GET http://coder-server:8080/api/v2/users/authmethods \
140140
141141
```json
142142
{
143+
"convert_to_oidc_enabled": true,
143144
"github": {
144145
"enabled": true
145146
},

site/src/api/typesGenerated.ts

+1
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ export interface AuthMethod {
105105
// From codersdk/users.go
106106
export interface AuthMethods {
107107
readonly me_login_type?: LoginType
108+
readonly convert_to_oidc_enabled: boolean
108109
readonly password: AuthMethod
109110
readonly github: AuthMethod
110111
readonly oidc: OIDCAuthMethod

0 commit comments

Comments
 (0)