Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: move oidc from experimental to ga#8742

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Emyrk merged 2 commits intomainfromstevenmasley/convert_oidc_ga
Jul 31, 2023
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletionscoderd/apidoc/docs.go
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

5 changes: 0 additions & 5 deletionscoderd/apidoc/swagger.json
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

13 changes: 0 additions & 13 deletionscoderd/userauth.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -64,13 +64,6 @@ type OAuthConvertStateClaims struct {
// @Success 201 {object} codersdk.OAuthConversionResponse
// @Router /users/{user}/convert-login [post]
func (api *API) postConvertLoginType(rw http.ResponseWriter, r *http.Request) {
if !api.Experiments.Enabled(codersdk.ExperimentConvertToOIDC) {
httpapi.Write(r.Context(), rw, http.StatusForbidden, codersdk.Response{
Message: "Oauth conversion is not allowed, contact an administrator to turn on this feature.",
})
return
}

var (
user = httpmw.UserParam(r)
ctx = r.Context()
Expand DownExpand Up@@ -455,7 +448,6 @@ func (api *API) userAuthMethods(rw http.ResponseWriter, r *http.Request) {
}

httpapi.Write(r.Context(), rw, http.StatusOK, codersdk.AuthMethods{
ConvertToOIDCEnabled: api.Experiments.Enabled(codersdk.ExperimentConvertToOIDC),
Password: codersdk.AuthMethod{
Enabled: !api.DeploymentValues.DisablePasswordAuth.Value(),
},
Expand DownExpand Up@@ -1499,11 +1491,6 @@ func (api *API) convertUserToOauth(ctx context.Context, r *http.Request, db data
oauthConvertAudit.UserID = claims.UserID
oauthConvertAudit.Old = user

// If we do not allow converting to oauth, return an error.
if !api.Experiments.Enabled(codersdk.ExperimentConvertToOIDC) {
return database.User{}, wrongLoginTypeHTTPError(user.LoginType, params.LoginType)
}

if claims.RegisteredClaims.Issuer != api.DeploymentID {
return database.User{}, httpError{
code: http.StatusForbidden,
Expand Down
2 changes: 0 additions & 2 deletionscoderd/userauth_test.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -20,7 +20,6 @@ import (
"golang.org/x/xerrors"

"cdr.dev/slog/sloggers/slogtest"
"github.com/coder/coder/cli/clibase"
"github.com/coder/coder/coderd"
"github.com/coder/coder/coderd/audit"
"github.com/coder/coder/coderd/coderdtest"
Expand DownExpand Up@@ -796,7 +795,6 @@ func TestUserOIDC(t *testing.T) {
config.AllowSignups = true

cfg := coderdtest.DeploymentValues(t)
cfg.Experiments = clibase.StringArray{string(codersdk.ExperimentConvertToOIDC)}
client := coderdtest.New(t, &coderdtest.Options{
Auditor: auditor,
OIDCConfig: config,
Expand Down
4 changes: 0 additions & 4 deletionscodersdk/deployment.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1850,10 +1850,6 @@ const (
// only Coordinator
ExperimentTailnetPGCoordinator Experiment = "tailnet_pg_coordinator"

// ExperimentConvertToOIDC enables users to convert from password to
// oidc.
ExperimentConvertToOIDC Experiment = "convert-to-oidc"

// ExperimentSingleTailnet replaces workspace connections inside coderd to
// all use a single tailnet, instead of the previous behavior of creating a
// single tailnet for each agent.
Expand Down
7 changes: 3 additions & 4 deletionscodersdk/users.go
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -160,10 +160,9 @@ type CreateOrganizationRequest struct {

// AuthMethods contains authentication method information like whether they are enabled or not or custom text, etc.
type AuthMethods struct {
ConvertToOIDCEnabled bool `json:"convert_to_oidc_enabled"`
Password AuthMethod `json:"password"`
Github AuthMethod `json:"github"`
OIDC OIDCAuthMethod `json:"oidc"`
Password AuthMethod `json:"password"`
Github AuthMethod `json:"github"`
OIDC OIDCAuthMethod `json:"oidc"`
}

type AuthMethod struct {
Expand Down
13 changes: 5 additions & 8 deletionsdocs/api/schemas.md
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

1 change: 0 additions & 1 deletiondocs/api/users.md
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

3 changes: 0 additions & 3 deletionssite/src/api/typesGenerated.ts
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

6 changes: 0 additions & 6 deletionssite/src/components/SignInForm/SignInForm.stories.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -28,7 +28,6 @@ SigningIn.args = {
...SignedOut.args,
isSigningIn: true,
authMethods: {
convert_to_oidc_enabled: false,
password: { enabled: true },
github: { enabled: true },
oidc: { enabled: false, signInText: "", iconUrl: "" },
Expand DownExpand Up@@ -56,7 +55,6 @@ export const WithGithub = Template.bind({})
WithGithub.args = {
...SignedOut.args,
authMethods: {
convert_to_oidc_enabled: false,
password: { enabled: true },
github: { enabled: true },
oidc: { enabled: false, signInText: "", iconUrl: "" },
Expand All@@ -67,7 +65,6 @@ export const WithOIDC = Template.bind({})
WithOIDC.args = {
...SignedOut.args,
authMethods: {
convert_to_oidc_enabled: false,
password: { enabled: true },
github: { enabled: false },
oidc: { enabled: true, signInText: "", iconUrl: "" },
Expand All@@ -78,7 +75,6 @@ export const WithOIDCWithoutPassword = Template.bind({})
WithOIDCWithoutPassword.args = {
...SignedOut.args,
authMethods: {
convert_to_oidc_enabled: false,
password: { enabled: false },
github: { enabled: false },
oidc: { enabled: true, signInText: "", iconUrl: "" },
Expand All@@ -89,7 +85,6 @@ export const WithoutAny = Template.bind({})
WithoutAny.args = {
...SignedOut.args,
authMethods: {
convert_to_oidc_enabled: false,
password: { enabled: false },
github: { enabled: false },
oidc: { enabled: false, signInText: "", iconUrl: "" },
Expand All@@ -100,7 +95,6 @@ export const WithGithubAndOIDC = Template.bind({})
WithGithubAndOIDC.args = {
...SignedOut.args,
authMethods: {
convert_to_oidc_enabled: false,
password: { enabled: true },
github: { enabled: true },
oidc: { enabled: true, signInText: "", iconUrl: "" },
Expand Down
2 changes: 0 additions & 2 deletionssite/src/pages/LoginPage/LoginPage.test.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -61,7 +61,6 @@ describe("LoginPage", () => {

it("shows github authentication when enabled", async () => {
const authMethods: TypesGen.AuthMethods = {
convert_to_oidc_enabled: false,
password: { enabled: true },
github: { enabled: true },
oidc: { enabled: true, signInText: "", iconUrl: "" },
Expand DownExpand Up@@ -113,7 +112,6 @@ describe("LoginPage", () => {

it("hides password authentication if OIDC/GitHub is enabled and displays on click", async () => {
const authMethods: TypesGen.AuthMethods = {
convert_to_oidc_enabled: false,
password: { enabled: true },
github: { enabled: true },
oidc: { enabled: true, signInText: "", iconUrl: "" },
Expand Down
18 changes: 7 additions & 11 deletionssite/src/pages/UserSettingsPage/SecurityPage/SecurityPage.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -53,17 +53,13 @@ export const SecurityPage: FC = () => {
},
},
}}
oidc={
authMethods.convert_to_oidc_enabled
? {
section: {
authMethods,
userLoginType,
...singleSignOnSection,
},
}
: undefined
}
oidc={{
section: {
authMethods,
userLoginType,
...singleSignOnSection,
},
}}
/>
)
}
Expand Down
1 change: 0 additions & 1 deletionsite/src/testHelpers/entities.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1113,7 +1113,6 @@ export const MockAuthMethods: TypesGen.AuthMethods = {
password: { enabled: true },
github: { enabled: false },
oidc: { enabled: false, signInText: "", iconUrl: "" },
convert_to_oidc_enabled: true,
}

export const MockAuthMethodsWithPasswordType: TypesGen.AuthMethods = {
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp