Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

feat(sso): support skip TLS verify (#5895)

Joe Chen7f6c81dbeda5
diff --git a/backend/api/v1/auth_service.go b/backend/api/v1/auth_service.go
index 09d177d7a5..e29185b6e3 100644
--- a/backend/api/v1/auth_service.go
+++ b/backend/api/v1/auth_service.go
@@ -672,10 +672,11 @@ func (s *AuthService) getOrCreateUserWithIDP(ctx context.Context, request *v1pb.
oidcIDP, err := oidc.NewIdentityProvider(
ctx,
oidc.IdentityProviderConfig{
- Issuer: idp.Config.GetOidcConfig().Issuer,
- ClientID: idp.Config.GetOidcConfig().ClientId,
- ClientSecret: idp.Config.GetOidcConfig().ClientSecret,
- FieldMapping: idp.Config.GetOidcConfig().FieldMapping,
+ Issuer: idp.Config.GetOidcConfig().Issuer,
+ ClientID: idp.Config.GetOidcConfig().ClientId,
+ ClientSecret: idp.Config.GetOidcConfig().ClientSecret,
+ FieldMapping: idp.Config.GetOidcConfig().FieldMapping,
+ SkipTLSVerify: idp.Config.GetOidcConfig().SkipTlsVerify,
},
)
if err != nil {
diff --git a/backend/api/v1/idp_service.go b/backend/api/v1/idp_service.go
index 7292241e1c..3a55f09395 100644
--- a/backend/api/v1/idp_service.go
+++ b/backend/api/v1/idp_service.go
@@ -252,12 +252,15 @@ func (s *IdentityProviderService) TestIdentityProvider(ctx context.Context, requ
return nil, status.Errorf(codes.InvalidArgument, "missing OAuth2 context")
}
identityProviderConfig := convertIdentityProviderConfigToStore(identityProvider.Config)
- oidcIdentityProvider, err := oidc.NewIdentityProvider(ctx, oidc.IdentityProviderConfig{
- Issuer: identityProviderConfig.GetOidcConfig().Issuer,
- ClientID: identityProviderConfig.GetOidcConfig().ClientId,
- ClientSecret: identityProviderConfig.GetOidcConfig().ClientSecret,
- FieldMapping: identityProviderConfig.GetOidcConfig().FieldMapping,
- })
+ oidcIdentityProvider, err := oidc.NewIdentityProvider(
+ ctx,
+ oidc.IdentityProviderConfig{
+ Issuer: identityProviderConfig.GetOidcConfig().Issuer,
+ ClientID: identityProviderConfig.GetOidcConfig().ClientId,
+ ClientSecret: identityProviderConfig.GetOidcConfig().ClientSecret,
+ FieldMapping: identityProviderConfig.GetOidcConfig().FieldMapping,
+ SkipTLSVerify: identityProviderConfig.GetOidcConfig().SkipTlsVerify,
+ })
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to create new OIDC identity provider: %v", err)
}
@@ -319,13 +322,14 @@ func convertIdentityProviderConfigFromStore(identityProviderConfig *storepb.Iden
return &v1pb.IdentityProviderConfig{
Config: &v1pb.IdentityProviderConfig_Oauth2Config{
Oauth2Config: &v1pb.OAuth2IdentityProviderConfig{
- AuthUrl: v.AuthUrl,
- TokenUrl: v.TokenUrl,
- UserInfoUrl: v.UserInfoUrl,
- ClientId: v.ClientId,
- ClientSecret: "", // SECURITY: We do not expose the client secret
- Scopes: v.Scopes,
- FieldMapping: &fieldMapping,
+ AuthUrl: v.AuthUrl,
+ TokenUrl: v.TokenUrl,
+ UserInfoUrl: v.UserInfoUrl,
+ ClientId: v.ClientId,
+ ClientSecret: "", // SECURITY: We do not expose the client secret
+ Scopes: v.Scopes,
+ FieldMapping: &fieldMapping,
+ SkipTlsVerify: v.SkipTlsVerify,
},
},
}
@@ -338,11 +342,12 @@ func convertIdentityProviderConfigFromStore(identityProviderConfig *storepb.Iden
return &v1pb.IdentityProviderConfig{
Config: &v1pb.IdentityProviderConfig_OidcConfig{
OidcConfig: &v1pb.OIDCIdentityProviderConfig{
- Issuer: v.Issuer,
- ClientId: v.ClientId,
- ClientSecret: "", // SECURITY: We do not expose the client secret
- Scopes: oidc.DefaultScopes,
- FieldMapping: &fieldMapping,
+ Issuer: v.Issuer,
+ ClientId: v.ClientId,
+ ClientSecret: "", // SECURITY: We do not expose the client secret
+ Scopes: oidc.DefaultScopes,
+ FieldMapping: &fieldMapping,
+ SkipTlsVerify: v.SkipTlsVerify,
},
},
}
@@ -360,13 +365,14 @@ func convertIdentityProviderConfigToStore(identityProviderConfig *v1pb.IdentityP
return &storepb.IdentityProviderConfig{
Config: &storepb.IdentityProviderConfig_Oauth2Config{
Oauth2Config: &storepb.OAuth2IdentityProviderConfig{
- AuthUrl: v.AuthUrl,
- TokenUrl: v.TokenUrl,
- UserInfoUrl: v.UserInfoUrl,
- ClientId: v.ClientId,
- ClientSecret: v.ClientSecret,
- Scopes: v.Scopes,
- FieldMapping: &fieldMapping,
+ AuthUrl: v.AuthUrl,
+ TokenUrl: v.TokenUrl,
+ UserInfoUrl: v.UserInfoUrl,
+ ClientId: v.ClientId,
+ ClientSecret: v.ClientSecret,
+ Scopes: v.Scopes,
+ FieldMapping: &fieldMapping,
+ SkipTlsVerify: v.SkipTlsVerify,
},
},
}
@@ -379,10 +385,11 @@ func convertIdentityProviderConfigToStore(identityProviderConfig *v1pb.IdentityP
return &storepb.IdentityProviderConfig{
Config: &storepb.IdentityProviderConfig_OidcConfig{
OidcConfig: &storepb.OIDCIdentityProviderConfig{
- Issuer: v.Issuer,
- ClientId: v.ClientId,
- ClientSecret: v.ClientSecret,
- FieldMapping: &fieldMapping,
+ Issuer: v.Issuer,
+ ClientId: v.ClientId,
+ ClientSecret: v.ClientSecret,
+ FieldMapping: &fieldMapping,
+ SkipTlsVerify: v.SkipTlsVerify,
},
},
}
diff --git a/backend/plugin/idp/oauth2/oauth2.go b/backend/plugin/idp/oauth2/oauth2.go
index 92852eae22..5dc62c9a34 100644
--- a/backend/plugin/idp/oauth2/oauth2.go
+++ b/backend/plugin/idp/oauth2/oauth2.go
@@ -3,6 +3,7 @@ package oauth2
import (
"context"
+ "crypto/tls"
"encoding/json"
"fmt"
"io"
@@ -18,6 +19,7 @@ import (
// IdentityProvider represents an OAuth2 Identity Provider.
type IdentityProvider struct {
+ client *http.Client
config *storepb.OAuth2IdentityProviderConfig
}
@@ -36,6 +38,13 @@ func NewIdentityProvider(config *storepb.OAuth2IdentityProviderConfig) (*Identit
}
return &IdentityProvider{
+ client: &http.Client{
+ Transport: &http.Transport{
+ TLSClientConfig: &tls.Config{
+ InsecureSkipVerify: config.SkipTlsVerify,
+ },
+ },
+ },
config: config,
}, nil
}
@@ -54,6 +63,7 @@ func (p *IdentityProvider) ExchangeToken(ctx context.Context, redirectURL, code
},
}
+ ctx = context.WithValue(ctx, oauth2.HTTPClient, p.client)
token, err := conf.Exchange(ctx, code)
if err != nil {
log.Error("Failed to exchange access token", zap.String("code", code), zap.Error(err))
@@ -71,14 +81,13 @@ func (p *IdentityProvider) ExchangeToken(ctx context.Context, redirectURL, code
// UserInfo returns the parsed user information using the given OAuth2 token.
func (p *IdentityProvider) UserInfo(token string) (*storepb.IdentityProviderUserInfo, error) {
- client := &http.Client{}
req, err := http.NewRequest(http.MethodGet, p.config.UserInfoUrl, nil)
if err != nil {
return nil, errors.Wrap(err, "failed to new http request")
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", token))
- resp, err := client.Do(req)
+ resp, err := p.client.Do(req)
if err != nil {
log.Error("Failed to get user information", zap.String("token", token), zap.Error(err))
return nil, errors.Wrap(err, "failed to get user information")
diff --git a/backend/plugin/idp/oauth2/oauth2_test.go b/backend/plugin/idp/oauth2/oauth2_test.go
index 863159e046..de8f788123 100644
--- a/backend/plugin/idp/oauth2/oauth2_test.go
+++ b/backend/plugin/idp/oauth2/oauth2_test.go
@@ -73,7 +73,7 @@ func TestNewIdentityProvider(t *testing.T) {
}
}
-func newMockServer(t *testing.T, code, accessToken string, userinfo []byte) *httptest.Server {
+func newMockServer(t *testing.T, tls bool, code, accessToken string, userinfo []byte) *httptest.Server {
mux := http.NewServeMux()
var rawIDToken string
@@ -104,7 +104,12 @@ func newMockServer(t *testing.T, code, accessToken string, userinfo []byte) *htt
require.NoError(t, err)
})
- s := httptest.NewServer(mux)
+ var s *httptest.Server
+ if tls {
+ s = httptest.NewTLSServer(mux)
+ } else {
+ s = httptest.NewServer(mux)
+ }
return s
}
@@ -129,7 +134,7 @@ func TestIdentityProvider(t *testing.T) {
)
require.NoError(t, err)
- s := newMockServer(t, testCode, testAccessToken, userInfo)
+ s := newMockServer(t, false, testCode, testAccessToken, userInfo)
oauth2, err := NewIdentityProvider(
&storepb.OAuth2IdentityProviderConfig{
@@ -161,3 +166,80 @@ func TestIdentityProvider(t *testing.T) {
}
assert.Equal(t, wantUserInfo, userInfoResult)
}
+
+func TestIdentityProvider_SelfSigned(t *testing.T) {
+ ctx := context.Background()
+
+ const (
+ testClientID = "test-client-id"
+ testCode = "test-code"
+ testAccessToken = "test-access-token"
+ testSubject = "123456789"
+ testName = "John Doe"
+ testEmail = "[email protected]"
+ )
+ userInfo, err := json.Marshal(
+ map[string]any{
+ "sub": testSubject,
+ "name": testName,
+ "email": testEmail,
+ },
+ )
+ require.NoError(t, err)
+
+ t.Run("verify TLS", func(t *testing.T) {
+ s := newMockServer(t, true, testCode, testAccessToken, userInfo)
+ oauth2, err := NewIdentityProvider(
+ &storepb.OAuth2IdentityProviderConfig{
+ ClientId: testClientID,
+ ClientSecret: "test-client-secret",
+ TokenUrl: fmt.Sprintf("%s/oauth2/token", s.URL),
+ UserInfoUrl: fmt.Sprintf("%s/oauth2/userinfo", s.URL),
+ FieldMapping: &storepb.FieldMapping{
+ Identifier: "sub",
+ DisplayName: "name",
+ Email: "email",
+ },
+ },
+ )
+ require.NoError(t, err)
+
+ redirectURL := "https://example.com/oauth/callback"
+ _, err = oauth2.ExchangeToken(ctx, redirectURL, testCode)
+ assert.ErrorContains(t, err, "x509: certificate signed by unknown authority")
+ })
+
+ t.Run("skip TLS verify", func(t *testing.T) {
+ s := newMockServer(t, true, testCode, testAccessToken, userInfo)
+ oauth2, err := NewIdentityProvider(
+ &storepb.OAuth2IdentityProviderConfig{
+ ClientId: testClientID,
+ ClientSecret: "test-client-secret",
+ TokenUrl: fmt.Sprintf("%s/oauth2/token", s.URL),
+ UserInfoUrl: fmt.Sprintf("%s/oauth2/userinfo", s.URL),
+ FieldMapping: &storepb.FieldMapping{
+ Identifier: "sub",
+ DisplayName: "name",
+ Email: "email",
+ },
+ SkipTlsVerify: true,
+ },
+ )
+ require.NoError(t, err)
+
+ redirectURL := "https://example.com/oauth/callback"
+ oauthToken, err := oauth2.ExchangeToken(ctx, redirectURL, testCode)
+ require.NoError(t, err)
+ require.Equal(t, testAccessToken, oauthToken)
+
+ userInfoResult, err := oauth2.UserInfo(oauthToken)
+ require.NoError(t, err)
+
+ wantUserInfo := &storepb.IdentityProviderUserInfo{
+ Identifier: testSubject,
+ DisplayName: testName,
+ Email: testEmail,
+ }
+ assert.Equal(t, wantUserInfo, userInfoResult)
+ })
+}
diff --git a/backend/plugin/idp/oidc/oidc.go b/backend/plugin/idp/oidc/oidc.go
index 9032ff4a4f..120466db75 100644
--- a/backend/plugin/idp/oidc/oidc.go
+++ b/backend/plugin/idp/oidc/oidc.go
@@ -3,6 +3,8 @@ package oidc
import (
"context"
+ "crypto/tls"
+ "net/http"
"github.com/coreos/go-oidc"
"github.com/pkg/errors"
@@ -15,6 +17,7 @@ import (
// IdentityProvider represents an OIDC Identity Provider.
type IdentityProvider struct {
+ client *http.Client
provider *oidc.Provider
config IdentityProviderConfig
}
@@ -22,10 +25,11 @@ type IdentityProvider struct {
// IdentityProviderConfig is the configuration to be consumed by the OIDC
// Identity Provider.
type IdentityProviderConfig struct {
- Issuer string `json:"issuer"`
- ClientID string `json:"clientId"`
- ClientSecret string `json:"clientSecret"`
- FieldMapping *storepb.FieldMapping `json:"fieldMapping"`
+ Issuer string `json:"issuer"`
+ ClientID string `json:"clientId"`
+ ClientSecret string `json:"clientSecret"`
+ FieldMapping *storepb.FieldMapping `json:"fieldMapping"`
+ SkipTLSVerify bool `json:"skipTlsVerify"`
}
// NewIdentityProvider initializes a new OIDC Identity Provider with the given
@@ -42,11 +46,20 @@ func NewIdentityProvider(ctx context.Context, config IdentityProviderConfig) (*I
}
}
+ client := &http.Client{
+ Transport: &http.Transport{
+ TLSClientConfig: &tls.Config{
+ InsecureSkipVerify: config.SkipTLSVerify,
+ },
+ },
+ }
+ ctx = context.WithValue(ctx, oauth2.HTTPClient, client)
p, err := oidc.NewProvider(ctx, config.Issuer)
if err != nil {
return nil, errors.Wrap(err, "create new provider")
}
return &IdentityProvider{
+ client: client,
provider: p,
config: config,
}, nil
@@ -68,6 +81,8 @@ func (p *IdentityProvider) ExchangeToken(ctx context.Context, redirectURL, code
Endpoint: p.provider.Endpoint(),
Scopes: DefaultScopes,
}
+
+ ctx = context.WithValue(ctx, oauth2.HTTPClient, p.client)
token, err := oauth2Config.Exchange(ctx, code)
if err != nil {
return nil, errors.Wrap(err, "exchange token")
@@ -86,6 +101,7 @@ func (p *IdentityProvider) UserInfo(ctx context.Context, token *oauth2.Token, no
return nil, errors.New(`missing "id_token" from the issuer's authorization response`)
}
+ ctx = context.WithValue(ctx, oauth2.HTTPClient, p.client)
verifier := p.provider.Verifier(&oidc.Config{ClientID: p.config.ClientID})
idToken, err := verifier.Verify(ctx, rawIDToken)
if err != nil {
diff --git a/backend/plugin/idp/oidc/oidc_test.go b/backend/plugin/idp/oidc/oidc_test.go
index 6d9f816fa5..f442667e55 100644
--- a/backend/plugin/idp/oidc/oidc_test.go
+++ b/backend/plugin/idp/oidc/oidc_test.go
@@ -84,7 +84,7 @@ func TestNewIdentityProvider(t *testing.T) {
}
}
-func newMockServer(t *testing.T, clientID, code, accessToken, nonce string, userinfo []byte) *httptest.Server {
+func newMockServer(t *testing.T, tls bool, clientID, code, accessToken, nonce string, userinfo []byte) *httptest.Server {
mux := http.NewServeMux()
var openidConfig map[string]any
@@ -143,7 +143,12 @@ func newMockServer(t *testing.T, clientID, code, accessToken, nonce string, user
require.NoError(t, err)
})
- s := httptest.NewServer(mux)
+ var s *httptest.Server
+ if tls {
+ s = httptest.NewTLSServer(mux)
+ } else {
+ s = httptest.NewServer(mux)
+ }
openidConfig = map[string]any{
"issuer": s.URL,
@@ -191,7 +196,7 @@ func TestIdentityProvider(t *testing.T) {
)
require.NoError(t, err)
- s := newMockServer(t, testClientID, testCode, testAccessToken, testNonce, userinfo)
+ s := newMockServer(t, false, testClientID, testCode, testAccessToken, testNonce, userinfo)
oidc, err := NewIdentityProvider(
ctx,
IdentityProviderConfig{
@@ -221,3 +226,76 @@ func TestIdentityProvider(t *testing.T) {
}
assert.Equal(t, wantUserInfo, userInfo)
}
+
+func TestIdentityProvider_SelfSigned(t *testing.T) {
+ ctx := context.Background()
+
+ const (
+ testClientID = "test-client-id"
+ testNonce = "test-nonce"
+ testCode = "test-code"
+ testAccessToken = "test-access-token"
+ testSubject = "123456789"
+ testName = "John Doe"
+ testEmail = "[email protected]"
+ )
+ userinfo, err := json.Marshal(
+ map[string]any{
+ "sub": testSubject,
+ "name": testName,
+ "email": testEmail,
+ },
+ )
+ require.NoError(t, err)
+
+ t.Run("verify TLS", func(t *testing.T) {
+ s := newMockServer(t, true, testClientID, testCode, testAccessToken, testNonce, userinfo)
+ _, err := NewIdentityProvider(
+ ctx,
+ IdentityProviderConfig{
+ Issuer: s.URL,
+ ClientID: testClientID,
+ ClientSecret: "test-client-secret",
+ FieldMapping: &storepb.FieldMapping{
+ Identifier: "sub",
+ DisplayName: "name",
+ Email: "email",
+ },
+ },
+ )
+ assert.ErrorContains(t, err, "x509: certificate signed by unknown authority")
+ })
+
+ t.Run("skip TLS verify", func(t *testing.T) {
+ s := newMockServer(t, true, testClientID, testCode, testAccessToken, testNonce, userinfo)
+ oidc, err := NewIdentityProvider(
+ ctx,
+ IdentityProviderConfig{
+ Issuer: s.URL,
+ ClientID: testClientID,
+ ClientSecret: "test-client-secret",
+ FieldMapping: &storepb.FieldMapping{
+ Identifier: "sub",
+ DisplayName: "name",
+ Email: "email",
+ },
+ SkipTLSVerify: true,
+ },
+ )
+ require.NoError(t, err)
+
+ oauthToken, err := oidc.ExchangeToken(ctx, "https://example.com/oidc/callback", testCode)
+ require.NoError(t, err)
+ require.Equal(t, testAccessToken, oauthToken.AccessToken)
+
+ userInfo, err := oidc.UserInfo(ctx, oauthToken, testNonce)
+ require.NoError(t, err)
+
+ wantUserInfo := &storepb.IdentityProviderUserInfo{
+ Identifier: testSubject,
+ DisplayName: testName,
+ Email: testEmail,
+ }
+ assert.Equal(t, wantUserInfo, userInfo)
+ })
+}
diff --git a/frontend/src/components/IdentityProviderCreateForm.vue b/frontend/src/components/IdentityProviderCreateForm.vue
index 275326815f..edf09ae0f5 100644
--- a/frontend/src/components/IdentityProviderCreateForm.vue
+++ b/frontend/src/components/IdentityProviderCreateForm.vue
@@ -240,6 +240,22 @@
placeholder="e.g. https://api.github.com/user"
/>
</div>
+ <div class="w-full flex flex-col justify-start items-start">
+ <p class="textlabel">
+ {{ $t("settings.sso.form.connection-security") }}
+ </p>
+ <p class="textinfolabel mt-1">
+ <BBCheckbox
+ :title="$t('settings.sso.form.connection-security-skip-tls-verify')"
+ :v-model="configForOAuth2.skipTlsVerify"
+ :disabled="!allowEdit"
+ @toggle="
+ () =>
+ (configForOAuth2.skipTlsVerify = !configForOAuth2.skipTlsVerify)
+ "
+ />
+ </p>
+ </div>
<div class="w-full flex flex-col justify-start items-start">
<p class="text-lg font-medium mt-2">
@@ -396,6 +412,21 @@
"
/>
</div>
+ <div class="w-full flex flex-col justify-start items-start">
+ <p class="textlabel">
+ {{ $t("settings.sso.form.connection-security") }}
+ </p>
+ <p class="textinfolabel mt-1">
+ <BBCheckbox
+ :title="$t('settings.sso.form.connection-security-skip-tls-verify')"
+ :value="configForOIDC.skipTlsVerify"
+ :disabled="!allowEdit"
+ @toggle="
+ () => (configForOIDC.skipTlsVerify = !configForOIDC.skipTlsVerify)
+ "
+ />
+ </p>
+ </div>
<div class="w-full flex flex-col justify-start items-start">
<p class="text-lg font-medium mt-2">
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 04920e0706..be16ee00b9 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -477,6 +477,8 @@
"scopes-description": "A space-separated list of scopes to be carried when accessing the Auth URL",
"token-url-description": "The API address for obtaining accessToken",
"user-info-url-description": "The API address for obtaining user information by accessToken",
+ "connection-security": "Connection security",
+ "connection-security-skip-tls-verify": "Skip TLS verify for self-signed certificates",
"user-information-mapping": "User information mapping",
"user-information-mapping-description": "Maps the field names from user info API to the Bytebase user.",
"identifier": "Bytebase user identifier",
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index 7a6ef5f8a5..1bdc0797ed 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -477,6 +477,8 @@
"user-info-url-description": "用于通过 accessToken 获取用户信息的 API 地址",
"user-information-mapping": "用户信息映射",
"user-information-mapping-description": "字段映射保存了来自 API 用户信息的字段名。",
+ "connection-security": "安全性选项",
+ "connection-security-skip-tls-verify": "跳过自签名证书验证",
"identifier": "Bytebase 用户的唯一标识符",
"display-name": "Bytebase 用户的昵称",
"email": "Bytebase 用户的 Email"
diff --git a/frontend/src/types/proto/store/idp.ts b/frontend/src/types/proto/store/idp.ts
index 8ddf8b8e98..4db18b9aaf 100644
--- a/frontend/src/types/proto/store/idp.ts
+++ b/frontend/src/types/proto/store/idp.ts
@@ -56,6 +56,7 @@ export interface OAuth2IdentityProviderConfig {
clientSecret: string;
scopes: string[];
fieldMapping?: FieldMapping;
+ skipTlsVerify: boolean;
}
/** OIDCIdentityProviderConfig is the structure for OIDC identity provider config. */
@@ -64,6 +65,7 @@ export interface OIDCIdentityProviderConfig {
clientId: string;
clientSecret: string;
fieldMapping?: FieldMapping;
+ skipTlsVerify: boolean;
}
/**
@@ -180,6 +182,7 @@ function createBaseOAuth2IdentityProviderConfig(): OAuth2IdentityProviderConfig
clientSecret: "",
scopes: [],
fieldMapping: undefined,
+ skipTlsVerify: false,
};
}
@@ -206,6 +209,9 @@ export const OAuth2IdentityProviderConfig = {
if (message.fieldMapping !== undefined) {
FieldMapping.encode(message.fieldMapping, writer.uint32(58).fork()).ldelim();
}
+ if (message.skipTlsVerify === true) {
+ writer.uint32(64).bool(message.skipTlsVerify);
+ }
return writer;
},
@@ -265,6 +271,13 @@ export const OAuth2IdentityProviderConfig = {
message.fieldMapping = FieldMapping.decode(reader, reader.uint32());
continue;
+ case 8:
+ if (tag !== 64) {
+ break;
+ }
+
+ message.skipTlsVerify = reader.bool();
+ continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -283,6 +296,7 @@ export const OAuth2IdentityProviderConfig = {
clientSecret: isSet(object.clientSecret) ? String(object.clientSecret) : "",
scopes: Array.isArray(object?.scopes) ? object.scopes.map((e: any) => String(e)) : [],
fieldMapping: isSet(object.fieldMapping) ? FieldMapping.fromJSON(object.fieldMapping) : undefined,
+ skipTlsVerify: isSet(object.skipTlsVerify) ? Boolean(object.skipTlsVerify) : false,
};
},
@@ -300,6 +314,7 @@ export const OAuth2IdentityProviderConfig = {
}
message.fieldMapping !== undefined &&
(obj.fieldMapping = message.fieldMapping ? FieldMapping.toJSON(message.fieldMapping) : undefined);
+ message.skipTlsVerify !== undefined && (obj.skipTlsVerify = message.skipTlsVerify);
return obj;
},
@@ -318,12 +333,13 @@ export const OAuth2IdentityProviderConfig = {
message.fieldMapping = (object.fieldMapping !== undefined && object.fieldMapping !== null)
? FieldMapping.fromPartial(object.fieldMapping)
: undefined;
+ message.skipTlsVerify = object.skipTlsVerify ?? false;
return message;
},
};
function createBaseOIDCIdentityProviderConfig(): OIDCIdentityProviderConfig {
- return { issuer: "", clientId: "", clientSecret: "", fieldMapping: undefined };
+ return { issuer: "", clientId: "", clientSecret: "", fieldMapping: undefined, skipTlsVerify: false };
}
export const OIDCIdentityProviderConfig = {
@@ -340,6 +356,9 @@ export const OIDCIdentityProviderConfig = {
if (message.fieldMapping !== undefined) {
FieldMapping.encode(message.fieldMapping, writer.uint32(34).fork()).ldelim();
}
+ if (message.skipTlsVerify === true) {
+ writer.uint32(40).bool(message.skipTlsVerify);
+ }
return writer;
},
@@ -378,6 +397,13 @@ export const OIDCIdentityProviderConfig = {
message.fieldMapping = FieldMapping.decode(reader, reader.uint32());
continue;
+ case 5:
+ if (tag !== 40) {
+ break;
+ }
+
+ message.skipTlsVerify = reader.bool();
+ continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -393,6 +419,7 @@ export const OIDCIdentityProviderConfig = {
clientId: isSet(object.clientId) ? String(object.clientId) : "",
clientSecret: isSet(object.clientSecret) ? String(object.clientSecret) : "",
fieldMapping: isSet(object.fieldMapping) ? FieldMapping.fromJSON(object.fieldMapping) : undefined,
+ skipTlsVerify: isSet(object.skipTlsVerify) ? Boolean(object.skipTlsVerify) : false,
};
},
@@ -403,6 +430,7 @@ export const OIDCIdentityProviderConfig = {
message.clientSecret !== undefined && (obj.clientSecret = message.clientSecret);
message.fieldMapping !== undefined &&
(obj.fieldMapping = message.fieldMapping ? FieldMapping.toJSON(message.fieldMapping) : undefined);
+ message.skipTlsVerify !== undefined && (obj.skipTlsVerify = message.skipTlsVerify);
return obj;
},
@@ -418,6 +446,7 @@ export const OIDCIdentityProviderConfig = {
message.fieldMapping = (object.fieldMapping !== undefined && object.fieldMapping !== null)
? FieldMapping.fromPartial(object.fieldMapping)
: undefined;
+ message.skipTlsVerify = object.skipTlsVerify ?? false;
return message;
},
};
diff --git a/frontend/src/types/proto/v1/idp_service.ts b/frontend/src/types/proto/v1/idp_service.ts
index 132e899e53..d2375edeb1 100644
--- a/frontend/src/types/proto/v1/idp_service.ts
+++ b/frontend/src/types/proto/v1/idp_service.ts
@@ -164,6 +164,7 @@ export interface OAuth2IdentityProviderConfig {
clientSecret: string;
scopes: string[];
fieldMapping?: FieldMapping;
+ skipTlsVerify: boolean;
}
/** OIDCIdentityProviderConfig is the structure for OIDC identity provider config. */
@@ -173,6 +174,7 @@ export interface OIDCIdentityProviderConfig {
clientSecret: string;
scopes: string[];
fieldMapping?: FieldMapping;
+ skipTlsVerify: boolean;
}
/**
@@ -1076,6 +1078,7 @@ function createBaseOAuth2IdentityProviderConfig(): OAuth2IdentityProviderConfig
clientSecret: "",
scopes: [],
fieldMapping: undefined,
+ skipTlsVerify: false,
};
}
@@ -1102,6 +1105,9 @@ export const OAuth2IdentityProviderConfig = {
if (message.fieldMapping !== undefined) {
FieldMapping.encode(message.fieldMapping, writer.uint32(58).fork()).ldelim();
}
+ if (message.skipTlsVerify === true) {
+ writer.uint32(64).bool(message.skipTlsVerify);
+ }
return writer;
},
@@ -1161,6 +1167,13 @@ export const OAuth2IdentityProviderConfig = {
message.fieldMapping = FieldMapping.decode(reader, reader.uint32());
continue;
+ case 8:
+ if (tag !== 64) {
+ break;
+ }
+
+ message.skipTlsVerify = reader.bool();
+ continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -1179,6 +1192,7 @@ export const OAuth2IdentityProviderConfig = {
clientSecret: isSet(object.clientSecret) ? String(object.clientSecret) : "",
scopes: Array.isArray(object?.scopes) ? object.scopes.map((e: any) => String(e)) : [],
fieldMapping: isSet(object.fieldMapping) ? FieldMapping.fromJSON(object.fieldMapping) : undefined,
+ skipTlsVerify: isSet(object.skipTlsVerify) ? Boolean(object.skipTlsVerify) : false,
};
},
@@ -1196,6 +1210,7 @@ export const OAuth2IdentityProviderConfig = {
}
message.fieldMapping !== undefined &&
(obj.fieldMapping = message.fieldMapping ? FieldMapping.toJSON(message.fieldMapping) : undefined);
+ message.skipTlsVerify !== undefined && (obj.skipTlsVerify = message.skipTlsVerify);
return obj;
},
@@ -1214,12 +1229,13 @@ export const OAuth2IdentityProviderConfig = {
message.fieldMapping = (object.fieldMapping !== undefined && object.fieldMapping !== null)
? FieldMapping.fromPartial(object.fieldMapping)
: undefined;
+ message.skipTlsVerify = object.skipTlsVerify ?? false;
return message;
},
};
function createBaseOIDCIdentityProviderConfig(): OIDCIdentityProviderConfig {
- return { issuer: "", clientId: "", clientSecret: "", scopes: [], fieldMapping: undefined };
+ return { issuer: "", clientId: "", clientSecret: "", scopes: [], fieldMapping: undefined, skipTlsVerify: false };
}
export const OIDCIdentityProviderConfig = {
@@ -1239,6 +1255,9 @@ export const OIDCIdentityProviderConfig = {
if (message.fieldMapping !== undefined) {
FieldMapping.encode(message.fieldMapping, writer.uint32(42).fork()).ldelim();
}
+ if (message.skipTlsVerify === true) {
+ writer.uint32(48).bool(message.skipTlsVerify);
+ }
return writer;
},
@@ -1284,6 +1303,13 @@ export const OIDCIdentityProviderConfig = {
message.fieldMapping = FieldMapping.decode(reader, reader.uint32());
continue;
+ case 6:
+ if (tag !== 48) {
+ break;
+ }
+
+ message.skipTlsVerify = reader.bool();
+ continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -1300,6 +1326,7 @@ export const OIDCIdentityProviderConfig = {
clientSecret: isSet(object.clientSecret) ? String(object.clientSecret) : "",
scopes: Array.isArray(object?.scopes) ? object.scopes.map((e: any) => String(e)) : [],
fieldMapping: isSet(object.fieldMapping) ? FieldMapping.fromJSON(object.fieldMapping) : undefined,
+ skipTlsVerify: isSet(object.skipTlsVerify) ? Boolean(object.skipTlsVerify) : false,
};
},
@@ -1315,6 +1342,7 @@ export const OIDCIdentityProviderConfig = {
}
message.fieldMapping !== undefined &&
(obj.fieldMapping = message.fieldMapping ? FieldMapping.toJSON(message.fieldMapping) : undefined);
+ message.skipTlsVerify !== undefined && (obj.skipTlsVerify = message.skipTlsVerify);
return obj;
},
@@ -1331,6 +1359,7 @@ export const OIDCIdentityProviderConfig = {
message.fieldMapping = (object.fieldMapping !== undefined && object.fieldMapping !== null)
? FieldMapping.fromPartial(object.fieldMapping)
: undefined;
+ message.skipTlsVerify = object.skipTlsVerify ?? false;
return message;
},
};
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index df815ce592..8d4c7c8bd8 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -785,6 +785,7 @@ OAuth2IdentityProviderConfig is the structure for OAuth2 identity provider confi
| client_secret | [string](#string) | | |
| scopes | [string](#string) | repeated | |
| field_mapping | [FieldMapping](#bytebase-store-FieldMapping) | | |
+| skip_tls_verify | [bool](#bool) | | |
@@ -803,6 +804,7 @@ OIDCIdentityProviderConfig is the structure for OIDC identity provider config.
| client_id | [string](#string) | | |
| client_secret | [string](#string) | | |
| field_mapping | [FieldMapping](#bytebase-store-FieldMapping) | | |
+| skip_tls_verify | [bool](#bool) | | |
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index a098b82147..598f3e78b3 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -2527,6 +2527,7 @@ OAuth2IdentityProviderConfig is the structure for OAuth2 identity provider confi
| client_secret | [string](#string) | | |
| scopes | [string](#string) | repeated | |
| field_mapping | [FieldMapping](#bytebase-v1-FieldMapping) | | |
+| skip_tls_verify | [bool](#bool) | | |
@@ -2561,6 +2562,7 @@ OIDCIdentityProviderConfig is the structure for OIDC identity provider config.
| client_secret | [string](#string) | | |
| scopes | [string](#string) | repeated | |
| field_mapping | [FieldMapping](#bytebase-v1-FieldMapping) | | |
+| skip_tls_verify | [bool](#bool) | | |
diff --git a/proto/generated-go/store/idp.pb.go b/proto/generated-go/store/idp.pb.go
index eb593d8916..0364ab8978 100644
--- a/proto/generated-go/store/idp.pb.go
+++ b/proto/generated-go/store/idp.pb.go
@@ -156,13 +156,14 @@ type OAuth2IdentityProviderConfig struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- AuthUrl string `protobuf:"bytes,1,opt,name=auth_url,json=authUrl,proto3" json:"auth_url,omitempty"`
- TokenUrl string `protobuf:"bytes,2,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"`
- UserInfoUrl string `protobuf:"bytes,3,opt,name=user_info_url,json=userInfoUrl,proto3" json:"user_info_url,omitempty"`
- ClientId string `protobuf:"bytes,4,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
- ClientSecret string `protobuf:"bytes,5,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"`
- Scopes []string `protobuf:"bytes,6,rep,name=scopes,proto3" json:"scopes,omitempty"`
- FieldMapping *FieldMapping `protobuf:"bytes,7,opt,name=field_mapping,json=fieldMapping,proto3" json:"field_mapping,omitempty"`
+ AuthUrl string `protobuf:"bytes,1,opt,name=auth_url,json=authUrl,proto3" json:"auth_url,omitempty"`
+ TokenUrl string `protobuf:"bytes,2,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"`
+ UserInfoUrl string `protobuf:"bytes,3,opt,name=user_info_url,json=userInfoUrl,proto3" json:"user_info_url,omitempty"`
+ ClientId string `protobuf:"bytes,4,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
+ ClientSecret string `protobuf:"bytes,5,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"`
+ Scopes []string `protobuf:"bytes,6,rep,name=scopes,proto3" json:"scopes,omitempty"`
+ FieldMapping *FieldMapping `protobuf:"bytes,7,opt,name=field_mapping,json=fieldMapping,proto3" json:"field_mapping,omitempty"`
+ SkipTlsVerify bool `protobuf:"varint,8,opt,name=skip_tls_verify,json=skipTlsVerify,proto3" json:"skip_tls_verify,omitempty"`
}
func (x *OAuth2IdentityProviderConfig) Reset() {
@@ -246,16 +247,24 @@ func (x *OAuth2IdentityProviderConfig) GetFieldMapping() *FieldMapping {
return nil
}
+func (x *OAuth2IdentityProviderConfig) GetSkipTlsVerify() bool {
+ if x != nil {
+ return x.SkipTlsVerify
+ }
+ return false
+}
+
// OIDCIdentityProviderConfig is the structure for OIDC identity provider config.
type OIDCIdentityProviderConfig struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- Issuer string `protobuf:"bytes,1,opt,name=issuer,proto3" json:"issuer,omitempty"`
- ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
- ClientSecret string `protobuf:"bytes,3,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"`
- FieldMapping *FieldMapping `protobuf:"bytes,4,opt,name=field_mapping,json=fieldMapping,proto3" json:"field_mapping,omitempty"`
+ Issuer string `protobuf:"bytes,1,opt,name=issuer,proto3" json:"issuer,omitempty"`
+ ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
+ ClientSecret string `protobuf:"bytes,3,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"`
+ FieldMapping *FieldMapping `protobuf:"bytes,4,opt,name=field_mapping,json=fieldMapping,proto3" json:"field_mapping,omitempty"`
+ SkipTlsVerify bool `protobuf:"varint,5,opt,name=skip_tls_verify,json=skipTlsVerify,proto3" json:"skip_tls_verify,omitempty"`
}
func (x *OIDCIdentityProviderConfig) Reset() {
@@ -318,6 +327,13 @@ func (x *OIDCIdentityProviderConfig) GetFieldMapping() *FieldMapping {
return nil
}
+func (x *OIDCIdentityProviderConfig) GetSkipTlsVerify() bool {
+ if x != nil {
+ return x.SkipTlsVerify
+ }
+ return false
+}
+
// FieldMapping saves the field names from user info API of identity provider.
// As we save all raw json string of user info response data into `principal.idp_user_info`,
// we can extract the relevant data based with `FieldMapping`.
@@ -475,7 +491,7 @@ var file_store_idp_proto_rawDesc = []byte{
0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4f, 0x49, 0x44, 0x43, 0x49, 0x64, 0x65, 0x6e,
0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66,
0x69, 0x67, 0x48, 0x00, 0x52, 0x0a, 0x6f, 0x69, 0x64, 0x63, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
- 0x42, 0x08, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x97, 0x02, 0x0a, 0x1c, 0x4f,
+ 0x42, 0x08, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0xbf, 0x02, 0x0a, 0x1c, 0x4f,
0x41, 0x75, 0x74, 0x68, 0x32, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f,
0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x61,
0x75, 0x74, 0x68, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61,
@@ -493,18 +509,23 @@ var file_store_idp_proto_rawDesc = []byte{
0x6e, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d,
0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x0c, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x70,
- 0x70, 0x69, 0x6e, 0x67, 0x22, 0xb9, 0x01, 0x0a, 0x1a, 0x4f, 0x49, 0x44, 0x43, 0x49, 0x64, 0x65,
- 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e,
- 0x66, 0x69, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x63,
- 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08,
- 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6c, 0x69, 0x65,
- 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
- 0x0c, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x41, 0x0a,
- 0x0d, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x04,
- 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
- 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x70, 0x70, 0x69,
- 0x6e, 0x67, 0x52, 0x0c, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67,
+ 0x70, 0x69, 0x6e, 0x67, 0x12, 0x26, 0x0a, 0x0f, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x74, 0x6c, 0x73,
+ 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x73,
+ 0x6b, 0x69, 0x70, 0x54, 0x6c, 0x73, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x22, 0xe1, 0x01, 0x0a,
+ 0x1a, 0x4f, 0x49, 0x44, 0x43, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f,
+ 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x69,
+ 0x73, 0x73, 0x75, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x73, 0x73,
+ 0x75, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64,
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64,
+ 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65,
+ 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53,
+ 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x41, 0x0a, 0x0d, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d,
+ 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62,
+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x46, 0x69,
+ 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x0c, 0x66, 0x69, 0x65, 0x6c,
+ 0x64, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x26, 0x0a, 0x0f, 0x73, 0x6b, 0x69, 0x70,
+ 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28,
+ 0x08, 0x52, 0x0d, 0x73, 0x6b, 0x69, 0x70, 0x54, 0x6c, 0x73, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79,
0x22, 0x67, 0x0a, 0x0c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67,
0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72,
diff --git a/proto/generated-go/v1/idp_service.pb.go b/proto/generated-go/v1/idp_service.pb.go
index d51a258bdb..23c64e3990 100644
--- a/proto/generated-go/v1/idp_service.pb.go
+++ b/proto/generated-go/v1/idp_service.pb.go
@@ -816,13 +816,14 @@ type OAuth2IdentityProviderConfig struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- AuthUrl string `protobuf:"bytes,1,opt,name=auth_url,json=authUrl,proto3" json:"auth_url,omitempty"`
- TokenUrl string `protobuf:"bytes,2,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"`
- UserInfoUrl string `protobuf:"bytes,3,opt,name=user_info_url,json=userInfoUrl,proto3" json:"user_info_url,omitempty"`
- ClientId string `protobuf:"bytes,4,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
- ClientSecret string `protobuf:"bytes,5,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"`
- Scopes []string `protobuf:"bytes,6,rep,name=scopes,proto3" json:"scopes,omitempty"`
- FieldMapping *FieldMapping `protobuf:"bytes,7,opt,name=field_mapping,json=fieldMapping,proto3" json:"field_mapping,omitempty"`
+ AuthUrl string `protobuf:"bytes,1,opt,name=auth_url,json=authUrl,proto3" json:"auth_url,omitempty"`
+ TokenUrl string `protobuf:"bytes,2,opt,name=token_url,json=tokenUrl,proto3" json:"token_url,omitempty"`
+ UserInfoUrl string `protobuf:"bytes,3,opt,name=user_info_url,json=userInfoUrl,proto3" json:"user_info_url,omitempty"`
+ ClientId string `protobuf:"bytes,4,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
+ ClientSecret string `protobuf:"bytes,5,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"`
+ Scopes []string `protobuf:"bytes,6,rep,name=scopes,proto3" json:"scopes,omitempty"`
+ FieldMapping *FieldMapping `protobuf:"bytes,7,opt,name=field_mapping,json=fieldMapping,proto3" json:"field_mapping,omitempty"`
+ SkipTlsVerify bool `protobuf:"varint,8,opt,name=skip_tls_verify,json=skipTlsVerify,proto3" json:"skip_tls_verify,omitempty"`
}
func (x *OAuth2IdentityProviderConfig) Reset() {
@@ -906,17 +907,25 @@ func (x *OAuth2IdentityProviderConfig) GetFieldMapping() *FieldMapping {
return nil
}
+func (x *OAuth2IdentityProviderConfig) GetSkipTlsVerify() bool {
+ if x != nil {
+ return x.SkipTlsVerify
+ }
+ return false
+}
+
// OIDCIdentityProviderConfig is the structure for OIDC identity provider config.
type OIDCIdentityProviderConfig struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- Issuer string `protobuf:"bytes,1,opt,name=issuer,proto3" json:"issuer,omitempty"`
- ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
- ClientSecret string `protobuf:"bytes,3,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"`
- Scopes []string `protobuf:"bytes,4,rep,name=scopes,proto3" json:"scopes,omitempty"`
- FieldMapping *FieldMapping `protobuf:"bytes,5,opt,name=field_mapping,json=fieldMapping,proto3" json:"field_mapping,omitempty"`
+ Issuer string `protobuf:"bytes,1,opt,name=issuer,proto3" json:"issuer,omitempty"`
+ ClientId string `protobuf:"bytes,2,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`
+ ClientSecret string `protobuf:"bytes,3,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"`
+ Scopes []string `protobuf:"bytes,4,rep,name=scopes,proto3" json:"scopes,omitempty"`
+ FieldMapping *FieldMapping `protobuf:"bytes,5,opt,name=field_mapping,json=fieldMapping,proto3" json:"field_mapping,omitempty"`
+ SkipTlsVerify bool `protobuf:"varint,6,opt,name=skip_tls_verify,json=skipTlsVerify,proto3" json:"skip_tls_verify,omitempty"`
}
func (x *OIDCIdentityProviderConfig) Reset() {
@@ -986,6 +995,13 @@ func (x *OIDCIdentityProviderConfig) GetFieldMapping() *FieldMapping {
return nil
}
+func (x *OIDCIdentityProviderConfig) GetSkipTlsVerify() bool {
+ if x != nil {
+ return x.SkipTlsVerify
+ }
+ return false
+}
+
// FieldMapping saves the field names from user info API of identity provider.
// As we save all raw json string of user info response data into `principal.idp_user_info`,
// we can extract the relevant data based with `FieldMapping`.
@@ -1173,7 +1189,7 @@ var file_v1_idp_service_proto_rawDesc = []byte{
0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x49, 0x44, 0x43, 0x49, 0x64, 0x65, 0x6e,
0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66,
0x69, 0x67, 0x48, 0x00, 0x52, 0x0a, 0x6f, 0x69, 0x64, 0x63, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
- 0x42, 0x08, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0x94, 0x02, 0x0a, 0x1c, 0x4f,
+ 0x42, 0x08, 0x0a, 0x06, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x22, 0xbc, 0x02, 0x0a, 0x1c, 0x4f,
0x41, 0x75, 0x74, 0x68, 0x32, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f,
0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x19, 0x0a, 0x08, 0x61,
0x75, 0x74, 0x68, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61,
@@ -1191,20 +1207,25 @@ var file_v1_idp_service_proto_rawDesc = []byte{
0x6e, 0x67, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x70, 0x70,
0x69, 0x6e, 0x67, 0x52, 0x0c, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e,
- 0x67, 0x22, 0xce, 0x01, 0x0a, 0x1a, 0x4f, 0x49, 0x44, 0x43, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69,
- 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
- 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
- 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65,
- 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69,
- 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f,
- 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6c,
- 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63,
- 0x6f, 0x70, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70,
- 0x65, 0x73, 0x12, 0x3e, 0x0a, 0x0d, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x70, 0x70,
- 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65,
- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x70,
- 0x70, 0x69, 0x6e, 0x67, 0x52, 0x0c, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x70, 0x70, 0x69,
- 0x6e, 0x67, 0x22, 0x67, 0x0a, 0x0c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x70, 0x70, 0x69,
+ 0x67, 0x12, 0x26, 0x0a, 0x0f, 0x73, 0x6b, 0x69, 0x70, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x76, 0x65,
+ 0x72, 0x69, 0x66, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x73, 0x6b, 0x69, 0x70,
+ 0x54, 0x6c, 0x73, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x22, 0xf6, 0x01, 0x0a, 0x1a, 0x4f, 0x49,
+ 0x44, 0x43, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64,
+ 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x73, 0x75,
+ 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x69, 0x73, 0x73, 0x75, 0x65, 0x72,
+ 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20,
+ 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x23, 0x0a,
+ 0x0d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x03,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x65, 0x63, 0x72,
+ 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03,
+ 0x28, 0x09, 0x52, 0x06, 0x73, 0x63, 0x6f, 0x70, 0x65, 0x73, 0x12, 0x3e, 0x0a, 0x0d, 0x66, 0x69,
+ 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x18, 0x05, 0x20, 0x01, 0x28,
+ 0x0b, 0x32, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
+ 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x52, 0x0c, 0x66, 0x69,
+ 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x12, 0x26, 0x0a, 0x0f, 0x73, 0x6b,
+ 0x69, 0x70, 0x5f, 0x74, 0x6c, 0x73, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x79, 0x18, 0x06, 0x20,
+ 0x01, 0x28, 0x08, 0x52, 0x0d, 0x73, 0x6b, 0x69, 0x70, 0x54, 0x6c, 0x73, 0x56, 0x65, 0x72, 0x69,
+ 0x66, 0x79, 0x22, 0x67, 0x0a, 0x0c, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x70, 0x70, 0x69,
0x6e, 0x67, 0x12, 0x1e, 0x0a, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x66, 0x69,
0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x5f, 0x6e, 0x61,
diff --git a/proto/store/idp.proto b/proto/store/idp.proto
index b540dd38b6..5fa50e6a29 100644
--- a/proto/store/idp.proto
+++ b/proto/store/idp.proto
@@ -32,6 +32,8 @@ message OAuth2IdentityProviderConfig {
repeated string scopes = 6;
FieldMapping field_mapping = 7;
+
+ bool skip_tls_verify = 8;
}
// OIDCIdentityProviderConfig is the structure for OIDC identity provider config.
@@ -43,6 +45,8 @@ message OIDCIdentityProviderConfig {
string client_secret = 3;
FieldMapping field_mapping = 4;
+
+ bool skip_tls_verify = 5;
}
// FieldMapping saves the field names from user info API of identity provider.
diff --git a/proto/v1/idp_service.proto b/proto/v1/idp_service.proto
index a72d7ca5bc..52a84ba7a0 100644
--- a/proto/v1/idp_service.proto
+++ b/proto/v1/idp_service.proto
@@ -187,6 +187,8 @@ message OAuth2IdentityProviderConfig {
repeated string scopes = 6;
FieldMapping field_mapping = 7;
+
+ bool skip_tls_verify = 8;
}
// OIDCIdentityProviderConfig is the structure for OIDC identity provider config.
@@ -200,6 +202,8 @@ message OIDCIdentityProviderConfig {
repeated string scopes = 4;
FieldMapping field_mapping = 5;
+
+ bool skip_tls_verify = 6;
}
// FieldMapping saves the field names from user info API of identity provider.