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

Commitc2cb0e9

Browse files
authored
chore: testIDP to be usable as primary auth (#13132)
Flags printed to console show as external or primary auth.Usage assumes only 1 static oidc_member for now
1 parent3de737f commitc2cb0e9

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

‎scripts/testidp/main.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,14 @@ func RunIDP() func(t *testing.T) {
8484
returnfunc(t*testing.T) {
8585
idp:=oidctest.NewFakeIDP(t,
8686
oidctest.WithServing(),
87-
oidctest.WithStaticUserInfo(jwt.MapClaims{}),
87+
oidctest.WithStaticUserInfo(jwt.MapClaims{
88+
// This is a static set of auth fields. Might be beneficial to make flags
89+
// to allow different values here. This is only required for using the
90+
// testIDP as primary auth. External auth does not ever fetch these fields.
91+
"email":"oidc_member@coder.com",
92+
"preferred_username":"oidc_member",
93+
"email_verified":true,
94+
}),
8895
oidctest.WithDefaultIDClaims(jwt.MapClaims{}),
8996
oidctest.WithDefaultExpire(*expiry),
9097
oidctest.WithStaticCredentials(*clientID,*clientSecret),
@@ -133,6 +140,8 @@ func RunIDP() func(t *testing.T) {
133140
data,err:=json.Marshal([]withClientSecret{cfg})
134141
require.NoError(t,err)
135142
log.Printf(`--external-auth-providers='%s'`,string(data))
143+
log.Println("As primary OIDC auth")
144+
log.Printf(`--oidc-issuer-url=%s --oidc-client-id=%s --oidc-client-secret=%s`,idp.IssuerURL().String(),*clientID,*clientSecret)
136145

137146
log.Println("Press Ctrl+C to exit")
138147
c:=make(chan os.Signal,1)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp