Skip to content

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

fix: make LDAP Test Connection verify the real sign-in flow

Dannyfef01ba28d31
diff --git a/backend/api/mcp/gen/openapi.yaml b/backend/api/mcp/gen/openapi.yaml
index d8791c91ca..d6efdfe50f 100644
--- a/backend/api/mcp/gen/openapi.yaml
+++ b/backend/api/mcp/gen/openapi.yaml
@@ -13289,6 +13289,19 @@ components:
- SECURITY_PROTOCOL_UNSPECIFIED
- START_TLS
- LDAPS
+ bytebase.v1.LDAPIdentityProviderTestRequestContext:
+ type: object
+ properties:
+ username:
+ type: string
+ title: username
+ description: The username of a directory user, substituted into the user filter.
+ password:
+ type: string
+ title: password
+ description: The password of the directory user.
+ title: LDAPIdentityProviderTestRequestContext
+ additionalProperties: false
bytebase.v1.Label:
type: object
properties:
@@ -19839,6 +19852,15 @@ components:
description: The identity provider to test connection including uncreated.
$ref: '#/components/schemas/bytebase.v1.IdentityProvider'
- oneOf:
+ - type: object
+ properties:
+ ldapContext:
+ title: ldap_context
+ description: LDAP credentials context for test connection.
+ $ref: '#/components/schemas/bytebase.v1.LDAPIdentityProviderTestRequestContext'
+ title: ldap_context
+ required:
+ - ldapContext
- type: object
properties:
oauth2Context:
diff --git a/backend/api/v1/idp_service.go b/backend/api/v1/idp_service.go
index 52a7a66e4a..89768624e3 100644
--- a/backend/api/v1/idp_service.go
+++ b/backend/api/v1/idp_service.go
@@ -388,13 +388,37 @@ func (s *IdentityProviderService) TestIdentityProvider(ctx context.Context, req
return nil, connect.NewError(connect.CodeInternal, errors.Wrapf(err, "failed to create new LDAP identity provider"))
}
+ // With user credentials, run the full sign-in flow (search with the user
+ // filter, bind as the matched user, read attributes) so the base DN, user
+ // filter, and field mapping are actually verified.
+ if ldapContext := req.Msg.GetLdapContext(); ldapContext != nil {
+ if ldapContext.Username == "" || ldapContext.Password == "" {
+ return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("username and password are required to test LDAP sign-in"))
+ }
+ userInfo, attributes, err := ldapIdentityProvider.TestAuthenticate(ldapContext.Username, ldapContext.Password)
+ if err != nil {
+ return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("failed to test sign-in, error: %s", err.Error()))
+ }
+ userInfoMap := make(map[string]string)
+ if userInfo.Identifier != "" {
+ userInfoMap["email"] = userInfo.Identifier
+ }
+ if userInfo.DisplayName != "" {
+ userInfoMap["title"] = userInfo.DisplayName
+ }
+ if userInfo.Phone != "" {
+ userInfoMap["phone"] = userInfo.Phone
+ }
+ return connect.NewResponse(&v1pb.TestIdentityProviderResponse{Claims: attributes, UserInfo: userInfoMap}), nil
+ }
+
+ // Without credentials, only connectivity and the service-account bind can
+ // be verified.
conn, err := ldapIdentityProvider.Connect()
if err != nil {
return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("failed to test connection, error: %s", err.Error()))
}
_ = conn.Close()
-
- // LDAP cannot return claims without username and password so we return an empty claims map.
return connect.NewResponse(&v1pb.TestIdentityProviderResponse{Claims: make(map[string]string)}), nil
default:
return nil, connect.NewError(connect.CodeInvalidArgument, errors.Errorf("identity provider type %s not supported", identityProvider.Type.String()))
diff --git a/backend/generated-go/v1/idp_service.pb.go b/backend/generated-go/v1/idp_service.pb.go
index 6b98ccf660..12a19352f3 100644
--- a/backend/generated-go/v1/idp_service.pb.go
+++ b/backend/generated-go/v1/idp_service.pb.go
@@ -180,7 +180,7 @@ func (x LDAPIdentityProviderConfig_SecurityProtocol) Number() protoreflect.EnumN
// Deprecated: Use LDAPIdentityProviderConfig_SecurityProtocol.Descriptor instead.
func (LDAPIdentityProviderConfig_SecurityProtocol) EnumDescriptor() ([]byte, []int) {
- return file_v1_idp_service_proto_rawDescGZIP(), []int{14, 0}
+ return file_v1_idp_service_proto_rawDescGZIP(), []int{15, 0}
}
type GetIdentityProviderRequest struct {
@@ -509,6 +509,7 @@ type TestIdentityProviderRequest struct {
//
// *TestIdentityProviderRequest_Oauth2Context
// *TestIdentityProviderRequest_OidcContext
+ // *TestIdentityProviderRequest_LdapContext
Context isTestIdentityProviderRequest_Context `protobuf_oneof:"context"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
@@ -576,6 +577,15 @@ func (x *TestIdentityProviderRequest) GetOidcContext() *OIDCIdentityProviderTest
return nil
}
+func (x *TestIdentityProviderRequest) GetLdapContext() *LDAPIdentityProviderTestRequestContext {
+ if x != nil {
+ if x, ok := x.Context.(*TestIdentityProviderRequest_LdapContext); ok {
+ return x.LdapContext
+ }
+ }
+ return nil
+}
+
type isTestIdentityProviderRequest_Context interface {
isTestIdentityProviderRequest_Context()
}
@@ -589,10 +599,17 @@ type TestIdentityProviderRequest_OidcContext struct {
OidcContext *OIDCIdentityProviderTestRequestContext `protobuf:"bytes,3,opt,name=oidc_context,json=oidcContext,proto3,oneof"`
}
+type TestIdentityProviderRequest_LdapContext struct {
+ // LDAP credentials context for test connection.
+ LdapContext *LDAPIdentityProviderTestRequestContext `protobuf:"bytes,4,opt,name=ldap_context,json=ldapContext,proto3,oneof"`
+}
+
func (*TestIdentityProviderRequest_Oauth2Context) isTestIdentityProviderRequest_Context() {}
func (*TestIdentityProviderRequest_OidcContext) isTestIdentityProviderRequest_Context() {}
+func (*TestIdentityProviderRequest_LdapContext) isTestIdentityProviderRequest_Context() {}
+
type OAuth2IdentityProviderTestRequestContext struct {
state protoimpl.MessageState `protogen:"open.v1"`
// Authorize code from website.
@@ -683,6 +700,60 @@ func (x *OIDCIdentityProviderTestRequestContext) GetCode() string {
return ""
}
+type LDAPIdentityProviderTestRequestContext struct {
+ state protoimpl.MessageState `protogen:"open.v1"`
+ // The username of a directory user, substituted into the user filter.
+ Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"`
+ // The password of the directory user.
+ Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
+}
+
+func (x *LDAPIdentityProviderTestRequestContext) Reset() {
+ *x = LDAPIdentityProviderTestRequestContext{}
+ mi := &file_v1_idp_service_proto_msgTypes[9]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *LDAPIdentityProviderTestRequestContext) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*LDAPIdentityProviderTestRequestContext) ProtoMessage() {}
+
+func (x *LDAPIdentityProviderTestRequestContext) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_idp_service_proto_msgTypes[9]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use LDAPIdentityProviderTestRequestContext.ProtoReflect.Descriptor instead.
+func (*LDAPIdentityProviderTestRequestContext) Descriptor() ([]byte, []int) {
+ return file_v1_idp_service_proto_rawDescGZIP(), []int{9}
+}
+
+func (x *LDAPIdentityProviderTestRequestContext) GetUsername() string {
+ if x != nil {
+ return x.Username
+ }
+ return ""
+}
+
+func (x *LDAPIdentityProviderTestRequestContext) GetPassword() string {
+ if x != nil {
+ return x.Password
+ }
+ return ""
+}
+
type TestIdentityProviderResponse struct {
state protoimpl.MessageState `protogen:"open.v1"`
// The map of claims returned by the identity provider.
@@ -695,7 +766,7 @@ type TestIdentityProviderResponse struct {
func (x *TestIdentityProviderResponse) Reset() {
*x = TestIdentityProviderResponse{}
- mi := &file_v1_idp_service_proto_msgTypes[9]
+ mi := &file_v1_idp_service_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -707,7 +778,7 @@ func (x *TestIdentityProviderResponse) String() string {
func (*TestIdentityProviderResponse) ProtoMessage() {}
func (x *TestIdentityProviderResponse) ProtoReflect() protoreflect.Message {
- mi := &file_v1_idp_service_proto_msgTypes[9]
+ mi := &file_v1_idp_service_proto_msgTypes[10]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -720,7 +791,7 @@ func (x *TestIdentityProviderResponse) ProtoReflect() protoreflect.Message {
// Deprecated: Use TestIdentityProviderResponse.ProtoReflect.Descriptor instead.
func (*TestIdentityProviderResponse) Descriptor() ([]byte, []int) {
- return file_v1_idp_service_proto_rawDescGZIP(), []int{9}
+ return file_v1_idp_service_proto_rawDescGZIP(), []int{10}
}
func (x *TestIdentityProviderResponse) GetClaims() map[string]string {
@@ -756,7 +827,7 @@ type IdentityProvider struct {
func (x *IdentityProvider) Reset() {
*x = IdentityProvider{}
- mi := &file_v1_idp_service_proto_msgTypes[10]
+ mi := &file_v1_idp_service_proto_msgTypes[11]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -768,7 +839,7 @@ func (x *IdentityProvider) String() string {
func (*IdentityProvider) ProtoMessage() {}
func (x *IdentityProvider) ProtoReflect() protoreflect.Message {
- mi := &file_v1_idp_service_proto_msgTypes[10]
+ mi := &file_v1_idp_service_proto_msgTypes[11]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -781,7 +852,7 @@ func (x *IdentityProvider) ProtoReflect() protoreflect.Message {
// Deprecated: Use IdentityProvider.ProtoReflect.Descriptor instead.
func (*IdentityProvider) Descriptor() ([]byte, []int) {
- return file_v1_idp_service_proto_rawDescGZIP(), []int{10}
+ return file_v1_idp_service_proto_rawDescGZIP(), []int{11}
}
func (x *IdentityProvider) GetName() string {
@@ -833,7 +904,7 @@ type IdentityProviderConfig struct {
func (x *IdentityProviderConfig) Reset() {
*x = IdentityProviderConfig{}
- mi := &file_v1_idp_service_proto_msgTypes[11]
+ mi := &file_v1_idp_service_proto_msgTypes[12]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -845,7 +916,7 @@ func (x *IdentityProviderConfig) String() string {
func (*IdentityProviderConfig) ProtoMessage() {}
func (x *IdentityProviderConfig) ProtoReflect() protoreflect.Message {
- mi := &file_v1_idp_service_proto_msgTypes[11]
+ mi := &file_v1_idp_service_proto_msgTypes[12]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -858,7 +929,7 @@ func (x *IdentityProviderConfig) ProtoReflect() protoreflect.Message {
// Deprecated: Use IdentityProviderConfig.ProtoReflect.Descriptor instead.
func (*IdentityProviderConfig) Descriptor() ([]byte, []int) {
- return file_v1_idp_service_proto_rawDescGZIP(), []int{11}
+ return file_v1_idp_service_proto_rawDescGZIP(), []int{12}
}
func (x *IdentityProviderConfig) GetConfig() isIdentityProviderConfig_Config {
@@ -947,7 +1018,7 @@ type OAuth2IdentityProviderConfig struct {
func (x *OAuth2IdentityProviderConfig) Reset() {
*x = OAuth2IdentityProviderConfig{}
- mi := &file_v1_idp_service_proto_msgTypes[12]
+ mi := &file_v1_idp_service_proto_msgTypes[13]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -959,7 +1030,7 @@ func (x *OAuth2IdentityProviderConfig) String() string {
func (*OAuth2IdentityProviderConfig) ProtoMessage() {}
func (x *OAuth2IdentityProviderConfig) ProtoReflect() protoreflect.Message {
- mi := &file_v1_idp_service_proto_msgTypes[12]
+ mi := &file_v1_idp_service_proto_msgTypes[13]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -972,7 +1043,7 @@ func (x *OAuth2IdentityProviderConfig) ProtoReflect() protoreflect.Message {
// Deprecated: Use OAuth2IdentityProviderConfig.ProtoReflect.Descriptor instead.
func (*OAuth2IdentityProviderConfig) Descriptor() ([]byte, []int) {
- return file_v1_idp_service_proto_rawDescGZIP(), []int{12}
+ return file_v1_idp_service_proto_rawDescGZIP(), []int{13}
}
func (x *OAuth2IdentityProviderConfig) GetAuthUrl() string {
@@ -1065,7 +1136,7 @@ type OIDCIdentityProviderConfig struct {
func (x *OIDCIdentityProviderConfig) Reset() {
*x = OIDCIdentityProviderConfig{}
- mi := &file_v1_idp_service_proto_msgTypes[13]
+ mi := &file_v1_idp_service_proto_msgTypes[14]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1077,7 +1148,7 @@ func (x *OIDCIdentityProviderConfig) String() string {
func (*OIDCIdentityProviderConfig) ProtoMessage() {}
func (x *OIDCIdentityProviderConfig) ProtoReflect() protoreflect.Message {
- mi := &file_v1_idp_service_proto_msgTypes[13]
+ mi := &file_v1_idp_service_proto_msgTypes[14]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1090,7 +1161,7 @@ func (x *OIDCIdentityProviderConfig) ProtoReflect() protoreflect.Message {
// Deprecated: Use OIDCIdentityProviderConfig.ProtoReflect.Descriptor instead.
func (*OIDCIdentityProviderConfig) Descriptor() ([]byte, []int) {
- return file_v1_idp_service_proto_rawDescGZIP(), []int{13}
+ return file_v1_idp_service_proto_rawDescGZIP(), []int{14}
}
func (x *OIDCIdentityProviderConfig) GetIssuer() string {
@@ -1182,7 +1253,7 @@ type LDAPIdentityProviderConfig struct {
func (x *LDAPIdentityProviderConfig) Reset() {
*x = LDAPIdentityProviderConfig{}
- mi := &file_v1_idp_service_proto_msgTypes[14]
+ mi := &file_v1_idp_service_proto_msgTypes[15]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1194,7 +1265,7 @@ func (x *LDAPIdentityProviderConfig) String() string {
func (*LDAPIdentityProviderConfig) ProtoMessage() {}
func (x *LDAPIdentityProviderConfig) ProtoReflect() protoreflect.Message {
- mi := &file_v1_idp_service_proto_msgTypes[14]
+ mi := &file_v1_idp_service_proto_msgTypes[15]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1207,7 +1278,7 @@ func (x *LDAPIdentityProviderConfig) ProtoReflect() protoreflect.Message {
// Deprecated: Use LDAPIdentityProviderConfig.ProtoReflect.Descriptor instead.
func (*LDAPIdentityProviderConfig) Descriptor() ([]byte, []int) {
- return file_v1_idp_service_proto_rawDescGZIP(), []int{14}
+ return file_v1_idp_service_proto_rawDescGZIP(), []int{15}
}
func (x *LDAPIdentityProviderConfig) GetHost() string {
@@ -1293,7 +1364,7 @@ type FieldMapping struct {
func (x *FieldMapping) Reset() {
*x = FieldMapping{}
- mi := &file_v1_idp_service_proto_msgTypes[15]
+ mi := &file_v1_idp_service_proto_msgTypes[16]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1305,7 +1376,7 @@ func (x *FieldMapping) String() string {
func (*FieldMapping) ProtoMessage() {}
func (x *FieldMapping) ProtoReflect() protoreflect.Message {
- mi := &file_v1_idp_service_proto_msgTypes[15]
+ mi := &file_v1_idp_service_proto_msgTypes[16]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1318,7 +1389,7 @@ func (x *FieldMapping) ProtoReflect() protoreflect.Message {
// Deprecated: Use FieldMapping.ProtoReflect.Descriptor instead.
func (*FieldMapping) Descriptor() ([]byte, []int) {
- return file_v1_idp_service_proto_rawDescGZIP(), []int{15}
+ return file_v1_idp_service_proto_rawDescGZIP(), []int{16}
}
func (x *FieldMapping) GetIdentifier() string {
@@ -1373,16 +1444,20 @@ const file_v1_idp_service_proto_rawDesc = "" +
"\rallow_missing\x18\x03 \x01(\bR\fallowMissing\"M\n" +
"\x1dDeleteIdentityProviderRequest\x12,\n" +
"\x04name\x18\x01 \x01(\tB\x18\xe0A\x02\xfaA\x12\n" +
- "\x10bytebase.com/IdPR\x04name\"\xae\x02\n" +
+ "\x10bytebase.com/IdPR\x04name\"\x88\x03\n" +
"\x1bTestIdentityProviderRequest\x12J\n" +
"\x11identity_provider\x18\x01 \x01(\v2\x1d.bytebase.v1.IdentityProviderR\x10identityProvider\x12^\n" +
"\x0eoauth2_context\x18\x02 \x01(\v25.bytebase.v1.OAuth2IdentityProviderTestRequestContextH\x00R\roauth2Context\x12X\n" +
- "\foidc_context\x18\x03 \x01(\v23.bytebase.v1.OIDCIdentityProviderTestRequestContextH\x00R\voidcContextB\t\n" +
+ "\foidc_context\x18\x03 \x01(\v23.bytebase.v1.OIDCIdentityProviderTestRequestContextH\x00R\voidcContext\x12X\n" +
+ "\fldap_context\x18\x04 \x01(\v23.bytebase.v1.LDAPIdentityProviderTestRequestContextH\x00R\vldapContextB\t\n" +
"\acontext\">\n" +
"(OAuth2IdentityProviderTestRequestContext\x12\x12\n" +
"\x04code\x18\x01 \x01(\tR\x04code\"<\n" +
"&OIDCIdentityProviderTestRequestContext\x12\x12\n" +
- "\x04code\x18\x01 \x01(\tR\x04code\"\xbb\x02\n" +
+ "\x04code\x18\x01 \x01(\tR\x04code\"`\n" +
+ "&LDAPIdentityProviderTestRequestContext\x12\x1a\n" +
+ "\busername\x18\x01 \x01(\tR\busername\x12\x1a\n" +
+ "\bpassword\x18\x02 \x01(\tR\bpassword\"\xbb\x02\n" +
"\x1cTestIdentityProviderResponse\x12M\n" +
"\x06claims\x18\x01 \x03(\v25.bytebase.v1.TestIdentityProviderResponse.ClaimsEntryR\x06claims\x12T\n" +
"\tuser_info\x18\x02 \x03(\v27.bytebase.v1.TestIdentityProviderResponse.UserInfoEntryR\buserInfo\x1a9\n" +
@@ -1482,7 +1557,7 @@ func file_v1_idp_service_proto_rawDescGZIP() []byte {
}
var file_v1_idp_service_proto_enumTypes = make([]protoimpl.EnumInfo, 3)
-var file_v1_idp_service_proto_msgTypes = make([]protoimpl.MessageInfo, 18)
+var file_v1_idp_service_proto_msgTypes = make([]protoimpl.MessageInfo, 19)
var file_v1_idp_service_proto_goTypes = []any{
(IdentityProviderType)(0), // 0: bytebase.v1.IdentityProviderType
(OAuth2AuthStyle)(0), // 1: bytebase.v1.OAuth2AuthStyle
@@ -1496,56 +1571,58 @@ var file_v1_idp_service_proto_goTypes = []any{
(*TestIdentityProviderRequest)(nil), // 9: bytebase.v1.TestIdentityProviderRequest
(*OAuth2IdentityProviderTestRequestContext)(nil), // 10: bytebase.v1.OAuth2IdentityProviderTestRequestContext
(*OIDCIdentityProviderTestRequestContext)(nil), // 11: bytebase.v1.OIDCIdentityProviderTestRequestContext
- (*TestIdentityProviderResponse)(nil), // 12: bytebase.v1.TestIdentityProviderResponse
- (*IdentityProvider)(nil), // 13: bytebase.v1.IdentityProvider
- (*IdentityProviderConfig)(nil), // 14: bytebase.v1.IdentityProviderConfig
- (*OAuth2IdentityProviderConfig)(nil), // 15: bytebase.v1.OAuth2IdentityProviderConfig
- (*OIDCIdentityProviderConfig)(nil), // 16: bytebase.v1.OIDCIdentityProviderConfig
- (*LDAPIdentityProviderConfig)(nil), // 17: bytebase.v1.LDAPIdentityProviderConfig
- (*FieldMapping)(nil), // 18: bytebase.v1.FieldMapping
- nil, // 19: bytebase.v1.TestIdentityProviderResponse.ClaimsEntry
- nil, // 20: bytebase.v1.TestIdentityProviderResponse.UserInfoEntry
- (*fieldmaskpb.FieldMask)(nil), // 21: google.protobuf.FieldMask
- (*emptypb.Empty)(nil), // 22: google.protobuf.Empty
+ (*LDAPIdentityProviderTestRequestContext)(nil), // 12: bytebase.v1.LDAPIdentityProviderTestRequestContext
+ (*TestIdentityProviderResponse)(nil), // 13: bytebase.v1.TestIdentityProviderResponse
+ (*IdentityProvider)(nil), // 14: bytebase.v1.IdentityProvider
+ (*IdentityProviderConfig)(nil), // 15: bytebase.v1.IdentityProviderConfig
+ (*OAuth2IdentityProviderConfig)(nil), // 16: bytebase.v1.OAuth2IdentityProviderConfig
+ (*OIDCIdentityProviderConfig)(nil), // 17: bytebase.v1.OIDCIdentityProviderConfig
+ (*LDAPIdentityProviderConfig)(nil), // 18: bytebase.v1.LDAPIdentityProviderConfig
+ (*FieldMapping)(nil), // 19: bytebase.v1.FieldMapping
+ nil, // 20: bytebase.v1.TestIdentityProviderResponse.ClaimsEntry
+ nil, // 21: bytebase.v1.TestIdentityProviderResponse.UserInfoEntry
+ (*fieldmaskpb.FieldMask)(nil), // 22: google.protobuf.FieldMask
+ (*emptypb.Empty)(nil), // 23: google.protobuf.Empty
}
var file_v1_idp_service_proto_depIdxs = []int32{
- 13, // 0: bytebase.v1.ListIdentityProvidersResponse.identity_providers:type_name -> bytebase.v1.IdentityProvider
- 13, // 1: bytebase.v1.CreateIdentityProviderRequest.identity_provider:type_name -> bytebase.v1.IdentityProvider
- 13, // 2: bytebase.v1.UpdateIdentityProviderRequest.identity_provider:type_name -> bytebase.v1.IdentityProvider
- 21, // 3: bytebase.v1.UpdateIdentityProviderRequest.update_mask:type_name -> google.protobuf.FieldMask
- 13, // 4: bytebase.v1.TestIdentityProviderRequest.identity_provider:type_name -> bytebase.v1.IdentityProvider
+ 14, // 0: bytebase.v1.ListIdentityProvidersResponse.identity_providers:type_name -> bytebase.v1.IdentityProvider
+ 14, // 1: bytebase.v1.CreateIdentityProviderRequest.identity_provider:type_name -> bytebase.v1.IdentityProvider
+ 14, // 2: bytebase.v1.UpdateIdentityProviderRequest.identity_provider:type_name -> bytebase.v1.IdentityProvider
+ 22, // 3: bytebase.v1.UpdateIdentityProviderRequest.update_mask:type_name -> google.protobuf.FieldMask
+ 14, // 4: bytebase.v1.TestIdentityProviderRequest.identity_provider:type_name -> bytebase.v1.IdentityProvider
10, // 5: bytebase.v1.TestIdentityProviderRequest.oauth2_context:type_name -> bytebase.v1.OAuth2IdentityProviderTestRequestContext
11, // 6: bytebase.v1.TestIdentityProviderRequest.oidc_context:type_name -> bytebase.v1.OIDCIdentityProviderTestRequestContext
- 19, // 7: bytebase.v1.TestIdentityProviderResponse.claims:type_name -> bytebase.v1.TestIdentityProviderResponse.ClaimsEntry
- 20, // 8: bytebase.v1.TestIdentityProviderResponse.user_info:type_name -> bytebase.v1.TestIdentityProviderResponse.UserInfoEntry
- 0, // 9: bytebase.v1.IdentityProvider.type:type_name -> bytebase.v1.IdentityProviderType
- 14, // 10: bytebase.v1.IdentityProvider.config:type_name -> bytebase.v1.IdentityProviderConfig
- 15, // 11: bytebase.v1.IdentityProviderConfig.oauth2_config:type_name -> bytebase.v1.OAuth2IdentityProviderConfig
- 16, // 12: bytebase.v1.IdentityProviderConfig.oidc_config:type_name -> bytebase.v1.OIDCIdentityProviderConfig
- 17, // 13: bytebase.v1.IdentityProviderConfig.ldap_config:type_name -> bytebase.v1.LDAPIdentityProviderConfig
- 18, // 14: bytebase.v1.OAuth2IdentityProviderConfig.field_mapping:type_name -> bytebase.v1.FieldMapping
- 1, // 15: bytebase.v1.OAuth2IdentityProviderConfig.auth_style:type_name -> bytebase.v1.OAuth2AuthStyle
- 18, // 16: bytebase.v1.OIDCIdentityProviderConfig.field_mapping:type_name -> bytebase.v1.FieldMapping
- 1, // 17: bytebase.v1.OIDCIdentityProviderConfig.auth_style:type_name -> bytebase.v1.OAuth2AuthStyle
- 2, // 18: bytebase.v1.LDAPIdentityProviderConfig.security_protocol:type_name -> bytebase.v1.LDAPIdentityProviderConfig.SecurityProtocol
- 18, // 19: bytebase.v1.LDAPIdentityProviderConfig.field_mapping:type_name -> bytebase.v1.FieldMapping
- 3, // 20: bytebase.v1.IdentityProviderService.GetIdentityProvider:input_type -> bytebase.v1.GetIdentityProviderRequest
- 4, // 21: bytebase.v1.IdentityProviderService.ListIdentityProviders:input_type -> bytebase.v1.ListIdentityProvidersRequest
- 6, // 22: bytebase.v1.IdentityProviderService.CreateIdentityProvider:input_type -> bytebase.v1.CreateIdentityProviderRequest
- 7, // 23: bytebase.v1.IdentityProviderService.UpdateIdentityProvider:input_type -> bytebase.v1.UpdateIdentityProviderRequest
- 8, // 24: bytebase.v1.IdentityProviderService.DeleteIdentityProvider:input_type -> bytebase.v1.DeleteIdentityProviderRequest
- 9, // 25: bytebase.v1.IdentityProviderService.TestIdentityProvider:input_type -> bytebase.v1.TestIdentityProviderRequest
- 13, // 26: bytebase.v1.IdentityProviderService.GetIdentityProvider:output_type -> bytebase.v1.IdentityProvider
- 5, // 27: bytebase.v1.IdentityProviderService.ListIdentityProviders:output_type -> bytebase.v1.ListIdentityProvidersResponse
- 13, // 28: bytebase.v1.IdentityProviderService.CreateIdentityProvider:output_type -> bytebase.v1.IdentityProvider
- 13, // 29: bytebase.v1.IdentityProviderService.UpdateIdentityProvider:output_type -> bytebase.v1.IdentityProvider
- 22, // 30: bytebase.v1.IdentityProviderService.DeleteIdentityProvider:output_type -> google.protobuf.Empty
- 12, // 31: bytebase.v1.IdentityProviderService.TestIdentityProvider:output_type -> bytebase.v1.TestIdentityProviderResponse
- 26, // [26:32] is the sub-list for method output_type
- 20, // [20:26] is the sub-list for method input_type
- 20, // [20:20] is the sub-list for extension type_name
- 20, // [20:20] is the sub-list for extension extendee
- 0, // [0:20] is the sub-list for field type_name
+ 12, // 7: bytebase.v1.TestIdentityProviderRequest.ldap_context:type_name -> bytebase.v1.LDAPIdentityProviderTestRequestContext
+ 20, // 8: bytebase.v1.TestIdentityProviderResponse.claims:type_name -> bytebase.v1.TestIdentityProviderResponse.ClaimsEntry
+ 21, // 9: bytebase.v1.TestIdentityProviderResponse.user_info:type_name -> bytebase.v1.TestIdentityProviderResponse.UserInfoEntry
+ 0, // 10: bytebase.v1.IdentityProvider.type:type_name -> bytebase.v1.IdentityProviderType
+ 15, // 11: bytebase.v1.IdentityProvider.config:type_name -> bytebase.v1.IdentityProviderConfig
+ 16, // 12: bytebase.v1.IdentityProviderConfig.oauth2_config:type_name -> bytebase.v1.OAuth2IdentityProviderConfig
+ 17, // 13: bytebase.v1.IdentityProviderConfig.oidc_config:type_name -> bytebase.v1.OIDCIdentityProviderConfig
+ 18, // 14: bytebase.v1.IdentityProviderConfig.ldap_config:type_name -> bytebase.v1.LDAPIdentityProviderConfig
+ 19, // 15: bytebase.v1.OAuth2IdentityProviderConfig.field_mapping:type_name -> bytebase.v1.FieldMapping
+ 1, // 16: bytebase.v1.OAuth2IdentityProviderConfig.auth_style:type_name -> bytebase.v1.OAuth2AuthStyle
+ 19, // 17: bytebase.v1.OIDCIdentityProviderConfig.field_mapping:type_name -> bytebase.v1.FieldMapping
+ 1, // 18: bytebase.v1.OIDCIdentityProviderConfig.auth_style:type_name -> bytebase.v1.OAuth2AuthStyle
+ 2, // 19: bytebase.v1.LDAPIdentityProviderConfig.security_protocol:type_name -> bytebase.v1.LDAPIdentityProviderConfig.SecurityProtocol
+ 19, // 20: bytebase.v1.LDAPIdentityProviderConfig.field_mapping:type_name -> bytebase.v1.FieldMapping
+ 3, // 21: bytebase.v1.IdentityProviderService.GetIdentityProvider:input_type -> bytebase.v1.GetIdentityProviderRequest
+ 4, // 22: bytebase.v1.IdentityProviderService.ListIdentityProviders:input_type -> bytebase.v1.ListIdentityProvidersRequest
+ 6, // 23: bytebase.v1.IdentityProviderService.CreateIdentityProvider:input_type -> bytebase.v1.CreateIdentityProviderRequest
+ 7, // 24: bytebase.v1.IdentityProviderService.UpdateIdentityProvider:input_type -> bytebase.v1.UpdateIdentityProviderRequest
+ 8, // 25: bytebase.v1.IdentityProviderService.DeleteIdentityProvider:input_type -> bytebase.v1.DeleteIdentityProviderRequest
+ 9, // 26: bytebase.v1.IdentityProviderService.TestIdentityProvider:input_type -> bytebase.v1.TestIdentityProviderRequest
+ 14, // 27: bytebase.v1.IdentityProviderService.GetIdentityProvider:output_type -> bytebase.v1.IdentityProvider
+ 5, // 28: bytebase.v1.IdentityProviderService.ListIdentityProviders:output_type -> bytebase.v1.ListIdentityProvidersResponse
+ 14, // 29: bytebase.v1.IdentityProviderService.CreateIdentityProvider:output_type -> bytebase.v1.IdentityProvider
+ 14, // 30: bytebase.v1.IdentityProviderService.UpdateIdentityProvider:output_type -> bytebase.v1.IdentityProvider
+ 23, // 31: bytebase.v1.IdentityProviderService.DeleteIdentityProvider:output_type -> google.protobuf.Empty
+ 13, // 32: bytebase.v1.IdentityProviderService.TestIdentityProvider:output_type -> bytebase.v1.TestIdentityProviderResponse
+ 27, // [27:33] is the sub-list for method output_type
+ 21, // [21:27] is the sub-list for method input_type
+ 21, // [21:21] is the sub-list for extension type_name
+ 21, // [21:21] is the sub-list for extension extendee
+ 0, // [0:21] is the sub-list for field type_name
}
func init() { file_v1_idp_service_proto_init() }
@@ -1557,8 +1634,9 @@ func file_v1_idp_service_proto_init() {
file_v1_idp_service_proto_msgTypes[6].OneofWrappers = []any{
(*TestIdentityProviderRequest_Oauth2Context)(nil),
(*TestIdentityProviderRequest_OidcContext)(nil),
+ (*TestIdentityProviderRequest_LdapContext)(nil),
}
- file_v1_idp_service_proto_msgTypes[11].OneofWrappers = []any{
+ file_v1_idp_service_proto_msgTypes[12].OneofWrappers = []any{
(*IdentityProviderConfig_Oauth2Config)(nil),
(*IdentityProviderConfig_OidcConfig)(nil),
(*IdentityProviderConfig_LdapConfig)(nil),
@@ -1569,7 +1647,7 @@ func file_v1_idp_service_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_v1_idp_service_proto_rawDesc), len(file_v1_idp_service_proto_rawDesc)),
NumEnums: 3,
- NumMessages: 18,
+ NumMessages: 19,
NumExtensions: 0,
NumServices: 1,
},
diff --git a/backend/generated-go/v1/idp_service_equal.pb.go b/backend/generated-go/v1/idp_service_equal.pb.go
index 3d82996723..7053633ee5 100644
--- a/backend/generated-go/v1/idp_service_equal.pb.go
+++ b/backend/generated-go/v1/idp_service_equal.pb.go
@@ -123,6 +123,9 @@ func (x *TestIdentityProviderRequest) Equal(y *TestIdentityProviderRequest) bool
if !x.GetOidcContext().Equal(y.GetOidcContext()) {
return false
}
+ if !x.GetLdapContext().Equal(y.GetLdapContext()) {
+ return false
+ }
return true
}
@@ -152,6 +155,22 @@ func (x *OIDCIdentityProviderTestRequestContext) Equal(y *OIDCIdentityProviderTe
return true
}
+func (x *LDAPIdentityProviderTestRequestContext) Equal(y *LDAPIdentityProviderTestRequestContext) bool {
+ if x == y {
+ return true
+ }
+ if x == nil || y == nil {
+ return x == nil && y == nil
+ }
+ if x.Username != y.Username {
+ return false
+ }
+ if x.Password != y.Password {
+ return false
+ }
+ return true
+}
+
func (x *TestIdentityProviderResponse) Equal(y *TestIdentityProviderResponse) bool {
if x == y {
return true
diff --git a/backend/plugin/idp/ldap/ldap.go b/backend/plugin/idp/ldap/ldap.go
index 8fab57b047..b5fd0b45e0 100644
--- a/backend/plugin/idp/ldap/ldap.go
+++ b/backend/plugin/idp/ldap/ldap.go
@@ -6,6 +6,7 @@ import (
"fmt"
"log/slog"
"strings"
+ "unicode/utf8"
"github.com/go-ldap/ldap/v3"
"github.com/pkg/errors"
@@ -128,6 +129,29 @@ func (p *IdentityProvider) Connect() (*ldap.Conn, error) {
// Authenticate authenticates the user with the given username and password.
func (p *IdentityProvider) Authenticate(username, password string) (*storepb.IdentityProviderUserInfo, error) {
+ entry, err := p.searchAndBind(username, password, p.mappedAttributes())
+ if err != nil {
+ return nil, err
+ }
+ return p.userInfoFromEntry(entry), nil
+}
+
+// TestAuthenticate runs the same flow as Authenticate but requests every user
+// attribute of the matched entry, returning them alongside the mapped user
+// info so admins can verify their field mapping against real directory data.
+func (p *IdentityProvider) TestAuthenticate(username, password string) (*storepb.IdentityProviderUserInfo, map[string]string, error) {
+ // A nil attribute list requests all user attributes (RFC 4511).
+ entry, err := p.searchAndBind(username, password, nil)
+ if err != nil {
+ return nil, nil, err
+ }
+ return p.userInfoFromEntry(entry), entryAttributes(entry), nil
+}
+
+// searchAndBind searches for the user matching the configured filter, binds as
+// the matched entry to verify the password, and returns the entry carrying the
+// requested attributes.
+func (p *IdentityProvider) searchAndBind(username, password string, attributes []string) (*ldap.Entry, error) {
conn, err := p.Connect()
if err != nil {
return nil, errors.Errorf("connect: %v", err)
@@ -143,7 +167,7 @@ func (p *IdentityProvider) Authenticate(username, password string) (*storepb.Ide
0,
false,
strings.ReplaceAll(p.config.UserFilter, "%s", ldap.EscapeFilter(username)),
- []string{"dn", p.config.FieldMapping.Identifier, p.config.FieldMapping.DisplayName},
+ attributes,
nil,
),
)
@@ -179,10 +203,45 @@ func (p *IdentityProvider) Authenticate(username, password string) (*storepb.Ide
if err != nil {
return nil, errors.Errorf("bind user: %v", err)
}
+ return entry, nil
+}
+
+// mappedAttributes returns the attributes to request for the configured field
+// mapping, skipping unset mappings: LDAP servers only return explicitly
+// requested attributes.
+func (p *IdentityProvider) mappedAttributes() []string {
+ attributes := []string{"dn", p.config.FieldMapping.Identifier}
+ for _, attribute := range []string{p.config.FieldMapping.DisplayName, p.config.FieldMapping.Phone} {
+ if attribute != "" {
+ attributes = append(attributes, attribute)
+ }
+ }
+ return attributes
+}
- identifier := entry.GetAttributeValue(p.config.FieldMapping.Identifier)
+func (p *IdentityProvider) userInfoFromEntry(entry *ldap.Entry) *storepb.IdentityProviderUserInfo {
return &storepb.IdentityProviderUserInfo{
- Identifier: identifier,
+ Identifier: entry.GetAttributeValue(p.config.FieldMapping.Identifier),
DisplayName: entry.GetAttributeValue(p.config.FieldMapping.DisplayName),
- }, nil
+ Phone: entry.GetAttributeValue(p.config.FieldMapping.Phone),
+ }
+}
+
+// entryAttributes flattens an LDAP entry into a display map: multi-valued
+// attributes are comma-joined and non-UTF-8 values are replaced with a
+// placeholder.
+func entryAttributes(entry *ldap.Entry) map[string]string {
+ attributes := map[string]string{"dn": entry.DN}
+ for _, attribute := range entry.Attributes {
+ values := make([]string, 0, len(attribute.Values))
+ for _, value := range attribute.Values {
+ if utf8.ValidString(value) {
+ values = append(values, value)
+ } else {
+ values = append(values, "<binary>")
+ }
+ }
+ attributes[attribute.Name] = strings.Join(values, ", ")
+ }
+ return attributes
}
diff --git a/backend/plugin/idp/ldap/ldap_test.go b/backend/plugin/idp/ldap/ldap_test.go
index e2b26ca409..d078ee5081 100644
--- a/backend/plugin/idp/ldap/ldap_test.go
+++ b/backend/plugin/idp/ldap/ldap_test.go
@@ -6,6 +6,7 @@ import (
"testing"
"time"
+ goldap "github.com/go-ldap/ldap/v3"
"github.com/lor00x/goldap/message"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -128,7 +129,7 @@ func TestNewIdentityProvider(t *testing.T) {
}
}
-func newMockServer(t *testing.T, uid, displayName, mail string) (host string, port int) {
+func newMockServer(t *testing.T, uid, displayName, mail, phone string) (host string, port int) {
// localhostCert is a PEM-encoded TLS cert with SAN IPs
// "127.0.0.1" and "[::1]", expiring at Jan 29 16:00:00 2084 GMT.
// generated from src/crypto/tls:
@@ -200,6 +201,7 @@ ZboOWVe3icTy64BT3OQhmg==
e.AddAttribute("uid", message.AttributeValue(uid))
e.AddAttribute("displayName", message.AttributeValue(displayName))
e.AddAttribute("mail", message.AttributeValue(mail))
+ e.AddAttribute("telephoneNumber", message.AttributeValue(phone))
w.Write(e)
w.Write(ldapserver.NewSearchResultDoneResponse(ldapserver.LDAPResultSuccess))
})
@@ -226,8 +228,9 @@ func TestIdentityProvider(t *testing.T) {
testUID = "alice"
testDisplayName = "Alice Smith"
testMail = "[email protected]"
+ testPhone = "+1-555-0100"
)
- host, port := newMockServer(t, testUID, testDisplayName, testMail)
+ host, port := newMockServer(t, testUID, testDisplayName, testMail, testPhone)
ldap, err := NewIdentityProvider(
IdentityProviderConfig{
Host: host,
@@ -241,17 +244,47 @@ func TestIdentityProvider(t *testing.T) {
FieldMapping: &storepb.FieldMapping{
Identifier: "uid",
DisplayName: "displayName",
+ Phone: "telephoneNumber",
},
},
)
require.NoError(t, err)
- userInfo, err := ldap.Authenticate("alice", "pa$$word")
- require.NoError(t, err)
-
wantUserInfo := &storepb.IdentityProviderUserInfo{
Identifier: testUID,
DisplayName: testDisplayName,
+ Phone: testPhone,
}
+
+ userInfo, err := ldap.Authenticate("alice", "pa$$word")
+ require.NoError(t, err)
assert.Equal(t, wantUserInfo, userInfo)
+
+ testUserInfo, attributes, err := ldap.TestAuthenticate("alice", "pa$$word")
+ require.NoError(t, err)
+ assert.Equal(t, wantUserInfo, testUserInfo)
+ assert.Equal(t, map[string]string{
+ "dn": testUID,
+ "uid": testUID,
+ "displayName": testDisplayName,
+ "mail": testMail,
+ "telephoneNumber": testPhone,
+ }, attributes)
+}
+
+func TestEntryAttributes(t *testing.T) {
+ entry := &goldap.Entry{
+ DN: "uid=alice,ou=Users,dc=example,dc=com",
+ Attributes: []*goldap.EntryAttribute{
+ goldap.NewEntryAttribute("mail", []string{"[email protected]"}),
+ goldap.NewEntryAttribute("memberOf", []string{"cn=dba,dc=example,dc=com", "cn=dev,dc=example,dc=com"}),
+ goldap.NewEntryAttribute("jpegPhoto", []string{"\xff\xd8\xff"}),
+ },
+ }
+ assert.Equal(t, map[string]string{
+ "dn": "uid=alice,ou=Users,dc=example,dc=com",
+ "mail": "[email protected]",
+ "memberOf": "cn=dba,dc=example,dc=com, cn=dev,dc=example,dc=com",
+ "jpegPhoto": "<binary>",
+ }, entryAttributes(entry))
}
diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.json
index 8b4b55ad4b..1956e20dda 100644
--- a/frontend/src/locales/en-US.json
+++ b/frontend/src/locales/en-US.json
@@ -909,6 +909,7 @@
}
},
"identity-provider": {
+ "attributes-description": "The following attributes were returned from the matched directory entry. Use these exact attribute names in the user information field mapping.",
"claims-description": "The following claims were returned by the identity provider. This information can help you configure field mappings.",
"delete-warning": "Are you sure you want to delete this identity provider? Users who signed up via this SSO will not be able to sign in with it anymore. If password sign-in is disabled in your workspace settings, these users may be locked out completely.",
"identity-provider-create-failed": "Failed to create identity provider",
@@ -917,7 +918,13 @@
"identity-provider-deleted": "Identity provider deleted successfully",
"identity-provider-permission-denied": "Permission denied",
"identity-provider-update-failed": "Failed to update identity provider",
+ "ldap-connectivity-verified": "Connected to the LDAP server and bound with the service account successfully. Base DN, user filter, and field mapping were not verified — run Test Sign-in with a directory user's credentials to check them.",
+ "ldap-test-connectivity-only": "Test Connectivity Only",
+ "ldap-test-description": "Enter the credentials of a directory user to verify the full sign-in flow: base DN, user filter, and field mapping. Or test connectivity only, which verifies just the server connection and the service account bind.",
+ "ldap-test-sign-in": "Test Sign-in",
+ "ldap-test-title": "Test LDAP Sign-in",
"no-claims": "No claims returned by the identity provider.",
+ "no-user-info-mapped": "No user information was mapped. Check that the field mapping matches the values below.",
"self": "Identity Provider",
"test-connection": "Test Connection",
"test-connection-success": "Test Connection Successful",
diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.json
index 8ef50609f1..170b2e206e 100644
--- a/frontend/src/locales/es-ES.json
+++ b/frontend/src/locales/es-ES.json
@@ -909,6 +909,7 @@
}
},
"identity-provider": {
+ "attributes-description": "Los siguientes atributos fueron devueltos por la entrada del directorio coincidente. Utilice estos nombres de atributo exactos en la asignación de campos de información del usuario.",
"claims-description": "El proveedor de identidad devolvió las siguientes notificaciones. Esta información puede ayudarle a configurar las asignaciones de campos.",
"delete-warning": "¿Seguro que desea eliminar este proveedor de identidad? Los usuarios que se registraron con este SSO ya no podrán iniciar sesión con él. Si el inicio de sesión con contraseña está deshabilitado en la configuración de su espacio de trabajo, es posible que estos usuarios queden completamente bloqueados.",
"identity-provider-create-failed": "No se pudo crear el proveedor de identidad",
@@ -917,7 +918,13 @@
"identity-provider-deleted": "Proveedor de identidad eliminado exitosamente",
"identity-provider-permission-denied": "Permiso denegado",
"identity-provider-update-failed": "No se pudo actualizar el proveedor de identidad",
+ "ldap-connectivity-verified": "Conexión con el servidor LDAP y enlace con la cuenta de servicio realizados correctamente. El Base DN, el filtro de usuario y la asignación de campos no se han verificado; ejecute la prueba de inicio de sesión con las credenciales de un usuario del directorio para comprobarlos.",
+ "ldap-test-connectivity-only": "Probar solo la conectividad",
+ "ldap-test-description": "Introduzca las credenciales de un usuario del directorio para verificar el flujo completo de inicio de sesión: Base DN, filtro de usuario y asignación de campos. O pruebe solo la conectividad, que verifica únicamente la conexión al servidor y el enlace de la cuenta de servicio.",
+ "ldap-test-sign-in": "Probar inicio de sesión",
+ "ldap-test-title": "Probar inicio de sesión LDAP",
"no-claims": "El proveedor de identidad no devolvió ninguna reclamación.",
+ "no-user-info-mapped": "No se asignó ninguna información de usuario. Compruebe que la asignación de campos coincida con los valores siguientes.",
"self": "Proveedor de identidad",
"test-connection": "Probar conexión",
"test-connection-success": "Conexión de prueba exitosa",
diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.json
index b602738095..cfbbe183fe 100644
--- a/frontend/src/locales/ja-JP.json
+++ b/frontend/src/locales/ja-JP.json
@@ -909,6 +909,7 @@
}
},
"identity-provider": {
+ "attributes-description": "一致したディレクトリエントリから返された属性は以下のとおりです。ユーザー情報のフィールドマッピングには、これらの属性名をそのまま使用してください。",
"claims-description": "IDプロバイダーから以下のクレームが返されました。この情報は、フィールドマッピングの設定に役立ちます。",
"delete-warning": "このアイデンティティプロバイダを削除してもよろしいですか?このSSO経由でサインアップしたユーザーは、今後このSSOでサインインできなくなります。ワークスペースの設定でパスワードによるサインインが無効になっている場合、これらのユーザーは完全にロックアウトされる可能性があります。",
"identity-provider-create-failed": "IDプロバイダの作成に失敗しました",
@@ -917,7 +918,13 @@
"identity-provider-deleted": "ID プロバイダが正常に削除されました",
"identity-provider-permission-denied": "許可が拒否されました",
"identity-provider-update-failed": "IDプロバイダの更新に失敗しました",
+ "ldap-connectivity-verified": "LDAP サーバーへの接続とサービスアカウントによるバインドに成功しました。Base DN、ユーザーフィルター、フィールドマッピングは未検証です。ディレクトリユーザーの認証情報でサインインテストを実行して確認してください。",
+ "ldap-test-connectivity-only": "接続のみテスト",
+ "ldap-test-description": "ディレクトリユーザーの認証情報を入力すると、Base DN、ユーザーフィルター、フィールドマッピングを含むサインインフロー全体を検証できます。接続のみのテストでは、サーバーへの接続とサービスアカウントのバインドだけを検証します。",
+ "ldap-test-sign-in": "サインインをテスト",
+ "ldap-test-title": "LDAP サインインのテスト",
"no-claims": "アイデンティティ プロバイダーから返されるクレームはありません。",
+ "no-user-info-mapped": "ユーザー情報がマッピングされませんでした。フィールドマッピングが以下の値と一致しているか確認してください。",
"self": "IDプロバイダ",
"test-connection": "テスト接続",
"test-connection-success": "テスト接続に成功しました",
diff --git a/frontend/src/locales/vi-VN.json b/frontend/src/locales/vi-VN.json
index aa30d8e4ae..7bab61f145 100644
--- a/frontend/src/locales/vi-VN.json
+++ b/frontend/src/locales/vi-VN.json
@@ -909,6 +909,7 @@
}
},
"identity-provider": {
+ "attributes-description": "Các thuộc tính sau được trả về từ mục thư mục khớp. Hãy dùng chính xác các tên thuộc tính này trong ánh xạ trường thông tin người dùng.",
"claims-description": "Các yêu cầu sau đây đã được nhà cung cấp danh tính trả về. Thông tin này có thể giúp bạn cấu hình ánh xạ trường.",
"delete-warning": "Bạn có chắc chắn muốn xóa nhà cung cấp danh tính này không? Người dùng đã đăng ký qua SSO này sẽ không thể đăng nhập bằng SSO này nữa. Nếu đăng nhập bằng mật khẩu bị vô hiệu hóa trong cài đặt không gian làm việc của bạn, những người dùng này có thể bị khóa hoàn toàn.",
"identity-provider-create-failed": "Không tạo được nhà cung cấp danh tính",
@@ -917,7 +918,13 @@
"identity-provider-deleted": "Nhà cung cấp danh tính đã xóa thành công",
"identity-provider-permission-denied": "Quyền bị từ chối",
"identity-provider-update-failed": "Không cập nhật được nhà cung cấp danh tính",
+ "ldap-connectivity-verified": "Đã kết nối máy chủ LDAP và liên kết bằng tài khoản dịch vụ thành công. Base DN, bộ lọc người dùng và ánh xạ trường chưa được kiểm tra — hãy chạy kiểm tra đăng nhập bằng thông tin đăng nhập của một người dùng thư mục để xác minh.",
+ "ldap-test-connectivity-only": "Chỉ kiểm tra kết nối",
+ "ldap-test-description": "Nhập thông tin đăng nhập của một người dùng thư mục để kiểm tra toàn bộ luồng đăng nhập: Base DN, bộ lọc người dùng và ánh xạ trường. Hoặc chỉ kiểm tra kết nối, tức là chỉ xác minh kết nối máy chủ và liên kết tài khoản dịch vụ.",
+ "ldap-test-sign-in": "Kiểm tra đăng nhập",
+ "ldap-test-title": "Kiểm tra đăng nhập LDAP",
"no-claims": "Nhà cung cấp danh tính không trả lại bất kỳ khiếu nại nào.",
+ "no-user-info-mapped": "Không có thông tin người dùng nào được ánh xạ. Hãy kiểm tra ánh xạ trường so với các giá trị bên dưới.",
"self": "Nhà cung cấp danh tính",
"test-connection": "Kiểm tra kết nối",
"test-connection-success": "Kiểm tra kết nối thành công",
diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.json
index 9571fc113d..d4c733f467 100644
--- a/frontend/src/locales/zh-CN.json
+++ b/frontend/src/locales/zh-CN.json
@@ -909,6 +909,7 @@
}
},
"identity-provider": {
+ "attributes-description": "以下是匹配到的目录条目返回的属性。请在用户信息字段映射中使用这些属性名。",
"claims-description": "身份提供商返回了以下 claims。此信息可帮助您配置用户信息映射。",
"delete-warning": "您确定要删除此身份提供者吗?通过此 SSO 注册的用户将无法再使用该身份提供者登录。如果您在工作区设置中禁用了密码登录,这些用户可能会被完全锁定。",
"identity-provider-create-failed": "无法创建身份提供商",
@@ -917,7 +918,13 @@
"identity-provider-deleted": "身份提供商已成功删除",
"identity-provider-permission-denied": "没有权限",
"identity-provider-update-failed": "无法更新身份提供商",
+ "ldap-connectivity-verified": "已成功连接 LDAP 服务器并使用服务账号完成绑定。Base DN、用户过滤器和字段映射尚未验证——请使用目录用户的凭据运行测试登录进行检查。",
+ "ldap-test-connectivity-only": "仅测试连接",
+ "ldap-test-description": "输入目录用户的凭据以验证完整登录流程:Base DN、用户过滤器和字段映射。或仅测试连接,即只验证服务器连接和服务账号绑定。",
+ "ldap-test-sign-in": "测试登录",
+ "ldap-test-title": "测试 LDAP 登录",
"no-claims": "身份提供商未返回 claims。",
+ "no-user-info-mapped": "未匹配到任何用户信息。请对照下方返回的值检查字段映射。",
"self": "身份提供商",
"test-connection": "测试连接",
"test-connection-success": "测试连接成功",
diff --git a/frontend/src/routes/workspace/IDPDetailPage.tsx b/frontend/src/routes/workspace/IDPDetailPage.tsx
index cb56452367..c04fa8f7ad 100644
--- a/frontend/src/routes/workspace/IDPDetailPage.tsx
+++ b/frontend/src/routes/workspace/IDPDetailPage.tsx
@@ -1,10 +1,8 @@
import { create } from "@bufbuild/protobuf";
-import type { ConnectError } from "@connectrpc/connect";
import { cloneDeep, isEqual } from "lodash-es";
import { ArrowRight, Database, Info, Key, ShieldCheck } from "lucide-react";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { useTranslation } from "react-i18next";
-import { identityProviderServiceClientConnect } from "@/api";
import { router, useCurrentRoute } from "@/app/router";
import { WORKSPACE_ROUTE_IDENTITY_PROVIDERS } from "@/app/router/handles";
import { LearnMoreLink } from "@/components/LearnMoreLink";
@@ -18,7 +16,6 @@ import {
} from "@/components/ui/alert-dialog";
import { Button } from "@/components/ui/button";
import { Checkbox } from "@/components/ui/checkbox";
-import { Dialog, DialogContent, DialogTitle } from "@/components/ui/dialog";
import { Input } from "@/components/ui/input";
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
import {
@@ -31,13 +28,11 @@ import {
getIdentityProviderResourceId,
idpNamePrefix,
} from "@/stores/modules/v1/common";
-import type { OAuthWindowEventPayload } from "@/types";
import type {
IdentityProvider,
LDAPIdentityProviderConfig,
OAuth2IdentityProviderConfig,
OIDCIdentityProviderConfig,
- TestIdentityProviderResponse,
} from "@/types/proto-es/v1/idp_service_pb";
import {
FieldMappingSchema,
@@ -49,13 +44,12 @@ import {
OAuth2AuthStyle,
OAuth2IdentityProviderConfigSchema,
OIDCIdentityProviderConfigSchema,
- TestIdentityProviderRequestSchema,
} from "@/types/proto-es/v1/idp_service_pb";
import {
hasWorkspacePermissionV2,
identityProviderTypeToString,
- openWindowForSSO,
} from "@/utils";
+import { TestConnectionButton } from "./IdpTestConnection";
// ============================================================
// Types
@@ -68,251 +62,6 @@ interface FieldMappingState {
groups: string;
}
-// ============================================================
-// TestConnectionResultDialog
-// ============================================================
-
-function TestConnectionResultDialog({
- response,
- onClose,
-}: {
- response: TestIdentityProviderResponse;
- onClose: () => void;
-}) {
- const { t } = useTranslation();
-
- return (
- <Dialog open onOpenChange={(nextOpen) => !nextOpen && onClose()}>
- <DialogContent className="w-[32rem] max-w-[calc(100vw-2rem)] p-6">
- <div className="flex items-center gap-x-2">
- <div className="size-6 text-success">&#10003;</div>
- <DialogTitle>
- {t("identity-provider.test-connection-success")}
- </DialogTitle>
- </div>
-
- <div className="mt-4 flex flex-col gap-y-4">
- <p className="text-sm text-control-light">
- {t("identity-provider.userinfo-description")}
- </p>
- <div className="bg-control-bg rounded-xs p-4">
- <div className="flex flex-col gap-y-1">
- {Object.entries(response.userInfo).map(([key, value]) => (
- <div
- key={key}
- className="grid grid-cols-3 gap-2 py-1 border-b border-block-border last:border-b-0"
- >
- <div
- className="text-sm font-medium text-control truncate"
- title={key}
- >
- {key}
- </div>
- <div
- className="col-span-2 text-sm text-main break-all"
- title={value}
- >
- {value}
- </div>
- </div>
- ))}
- </div>
- </div>
-
- <p className="text-sm text-control-light">
- {t("identity-provider.claims-description")}
- </p>
- <div className="bg-control-bg rounded-xs p-4">
- {Object.keys(response.claims).length === 0 ? (
- <div className="text-sm text-control-light italic">
- {t("identity-provider.no-claims")}
- </div>
- ) : (
- <div className="flex flex-col gap-y-1">
- {Object.entries(response.claims).map(([key, value]) => (
- <div
- key={key}
- className="grid grid-cols-3 gap-2 py-1 border-b border-block-border last:border-b-0"
- >
- <div
- className="text-sm font-medium text-control truncate"
- title={key}
- >
- {key}
- </div>
- <div
- className="col-span-2 text-sm text-main break-all"
- title={value}
- >
- {value}
- </div>
- </div>
- ))}
- </div>
- )}
- </div>
- </div>
-
- <div className="flex justify-end mt-4">
- <Button onClick={onClose}>{t("common.close")}</Button>
- </div>
- </DialogContent>
- </Dialog>
- );
-}
-
-// ============================================================
-// TestConnectionButton
-// ============================================================
-
-function TestConnectionButton({
- idp,
- disabled,
-}: {
- idp: IdentityProvider;
- disabled: boolean;
-}) {
- const { t } = useTranslation();
- const [testing, setTesting] = useState(false);
- const [testResult, setTestResult] =
- useState<TestIdentityProviderResponse | null>(null);
- const currentEventNameRef = useRef("");
- const idpRef = useRef(idp);
- idpRef.current = idp;
- const testingRef = useRef(false);
-
- // Stable event handler that reads latest state via refs
- const handleOAuthEventRef = useRef(async (event: Event) => {
- if (testingRef.current) return;
- const payload = (event as CustomEvent).detail as OAuthWindowEventPayload;
- if (payload.error) {
- pushNotification({
- module: "bytebase",
- style: "CRITICAL",
- title: "Request error occurred",
- description: payload.error,
- });
- return;
- }
-
- try {
- testingRef.current = true;
- setTesting(true);
- const currentIdp = idpRef.current;
- const isOidc = currentIdp.type === IdentityProviderType.OIDC;
- const request = create(TestIdentityProviderRequestSchema, {
- identityProvider: currentIdp,
- context: isOidc
- ? { case: "oidcContext", value: { code: payload.code } }
- : { case: "oauth2Context", value: { code: payload.code } },
- });
- const response =
- await identityProviderServiceClientConnect.testIdentityProvider(
- request
- );
- setTestResult(response);
- } catch (error) {
- pushNotification({
- module: "bytebase",
- style: "CRITICAL",
- title: "Request error occurred",
- description: (error as ConnectError).message,
- });
- } finally {
- testingRef.current = false;
- setTesting(false);
- }
- });
-
- useEffect(() => {
- return () => {
- if (currentEventNameRef.current) {
- window.removeEventListener(
- currentEventNameRef.current,
- handleOAuthEventRef.current as EventListener,
- false
- );
- }
- };
- }, []);
-
- const testConnection = async () => {
- if (testingRef.current) return;
-
- if (
- idp.type === IdentityProviderType.OAUTH2 ||
- idp.type === IdentityProviderType.OIDC
- ) {
- const eventName = `bb.oauth.signin.${idp.name}`;
- if (currentEventNameRef.current) {
- window.removeEventListener(
- currentEventNameRef.current,
- handleOAuthEventRef.current as EventListener,
- false
- );
- }
- window.addEventListener(
- eventName,
- handleOAuthEventRef.current as EventListener,
- false
- );
- currentEventNameRef.current = eventName;
-
- try {
- await openWindowForSSO(idp);
- } catch (error) {
- pushNotification({
- module: "bytebase",
- style: "CRITICAL",
- title: "Request error occurred",
- description: (error as ConnectError).message,
- });
- }
- } else if (idp.type === IdentityProviderType.LDAP) {
- try {
- testingRef.current = true;
- setTesting(true);
- const request = create(TestIdentityProviderRequestSchema, {
- identityProvider: idp,
- });
- const response =
- await identityProviderServiceClientConnect.testIdentityProvider(
- request
- );
- setTestResult(response);
- } catch (error) {
- pushNotification({
- module: "bytebase",
- style: "CRITICAL",
- title: "Request error occurred",
- description: (error as ConnectError).message,
- });
- } finally {
- testingRef.current = false;
- setTesting(false);
- }
- }
- };
-
- return (
- <>
- <Button
- appearance="outline"
- disabled={disabled || testing}
- onClick={testConnection}
- >
- {t("identity-provider.test-connection")}
- </Button>
- {testResult && (
- <TestConnectionResultDialog
- response={testResult}
- onClose={() => setTestResult(null)}
- />
- )}
- </>
- );
-}
-
// ============================================================
// DeleteConfirmDialog
// ============================================================
diff --git a/frontend/src/routes/workspace/IDPsPage.tsx b/frontend/src/routes/workspace/IDPsPage.tsx
index 6546ba81f9..66b96ef80a 100644
--- a/frontend/src/routes/workspace/IDPsPage.tsx
+++ b/frontend/src/routes/workspace/IDPsPage.tsx
@@ -14,7 +14,6 @@ import {
} from "lucide-react";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import { useTranslation } from "react-i18next";
-import { identityProviderServiceClientConnect } from "@/api";
import { router } from "@/app/router";
import { WORKSPACE_ROUTE_IDENTITY_PROVIDER_DETAIL } from "@/app/router/handles";
import { FeatureAttention } from "@/components/FeatureAttention";
@@ -27,7 +26,6 @@ import {
} from "@/components/ResourceIdField";
import { Button } from "@/components/ui/button";
import { Checkbox } from "@/components/ui/checkbox";
-import { Dialog, DialogContent, DialogTitle } from "@/components/ui/dialog";
import { FormField, FormFieldGroup, FormTitle } from "@/components/ui/form";
import { Input } from "@/components/ui/input";
import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group";
@@ -61,16 +59,13 @@ import {
getIdentityProviderResourceId,
idpNamePrefix,
} from "@/stores/modules/v1/common";
-import type { OAuthWindowEventPayload } from "@/types";
import type {
IdentityProvider,
LDAPIdentityProviderConfig,
OAuth2IdentityProviderConfig,
OIDCIdentityProviderConfig,
- TestIdentityProviderResponse,
} from "@/types/proto-es/v1/idp_service_pb";
import {
- CreateIdentityProviderRequestSchema,
FieldMappingSchema,
IdentityProviderConfigSchema,
IdentityProviderSchema,
@@ -80,14 +75,13 @@ import {
OAuth2AuthStyle,
OAuth2IdentityProviderConfigSchema,
OIDCIdentityProviderConfigSchema,
- TestIdentityProviderRequestSchema,
} from "@/types/proto-es/v1/idp_service_pb";
import { PlanFeature } from "@/types/proto-es/v1/subscription_service_pb";
import {
hasWorkspacePermissionV2,
identityProviderTypeToString,
- openWindowForSSO,
} from "@/utils";
+import { TestConnectionButton } from "./IdpTestConnection";
// ============================================================
// Escape key stack
@@ -197,267 +191,6 @@ function ExternalURLInfo({ type }: { type: IdentityProviderType }) {
);
}
-// ============================================================
-// TestConnectionResultDialog
-// ============================================================
-
-function TestConnectionResultDialog({
- response,
- onClose,
-}: {
- response: TestIdentityProviderResponse;
- onClose: () => void;
-}) {
- const { t } = useTranslation();
-
- return (
- <Dialog open onOpenChange={(nextOpen) => !nextOpen && onClose()}>
- <DialogContent className="w-[32rem] max-w-[calc(100vw-2rem)] p-6">
- <div className="flex items-center gap-x-2">
- <div className="size-6 text-success">&#10003;</div>
- <DialogTitle>
- {t("identity-provider.test-connection-success")}
- </DialogTitle>
- </div>
-
- <div className="mt-4 flex flex-col gap-y-4">
- <p className="text-sm text-control-light">
- {t("identity-provider.userinfo-description")}
- </p>
- <div className="bg-gray-50 rounded-xs p-4">
- <div className="flex flex-col gap-y-1">
- {Object.entries(response.userInfo).map(([key, value]) => (
- <div
- key={key}
- className="grid grid-cols-3 gap-2 py-1 border-b border-gray-200 last:border-b-0"
- >
- <div
- className="text-sm font-medium text-control truncate"
- title={key}
- >
- {key}
- </div>
- <div
- className="col-span-2 text-sm text-main break-all"
- title={value}
- >
- {value}
- </div>
- </div>
- ))}
- </div>
- </div>
-
- <p className="text-sm text-control-light">
- {t("identity-provider.claims-description")}
- </p>
- <div className="bg-gray-50 rounded-xs p-4">
- {Object.keys(response.claims).length === 0 ? (
- <div className="text-sm text-control-light italic">
- {t("identity-provider.no-claims")}
- </div>
- ) : (
- <div className="flex flex-col gap-y-1">
- {Object.entries(response.claims).map(([key, value]) => (
- <div
- key={key}
- className="grid grid-cols-3 gap-2 py-1 border-b border-gray-200 last:border-b-0"
- >
- <div
- className="text-sm font-medium text-control truncate"
- title={key}
- >
- {key}
- </div>
- <div
- className="col-span-2 text-sm text-main break-all"
- title={value}
- >
- {value}
- </div>
- </div>
- ))}
- </div>
- )}
- </div>
- </div>
-
- <div className="flex justify-end mt-4">
- <Button onClick={onClose}>{t("common.close")}</Button>
- </div>
- </DialogContent>
- </Dialog>
- );
-}
-
-// ============================================================
-// TestConnectionButton
-// ============================================================
-
-function TestConnectionButton({
- idp,
- disabled,
- isCreating,
-}: {
- idp: IdentityProvider;
- disabled: boolean;
- isCreating?: boolean;
-}) {
- const { t } = useTranslation();
- const [testing, setTesting] = useState(false);
- const [testResult, setTestResult] =
- useState<TestIdentityProviderResponse | null>(null);
- const currentEventNameRef = useRef("");
- const idpRef = useRef(idp);
- idpRef.current = idp;
- const testingRef = useRef(false);
-
- // Stable event handler that reads latest state via refs
- const handleOAuthEventRef = useRef(async (event: Event) => {
- if (testingRef.current) return;
- const payload = (event as CustomEvent).detail as OAuthWindowEventPayload;
- if (payload.error) {
- pushNotification({
- module: "bytebase",
- style: "CRITICAL",
- title: "Request error occurred",
- description: payload.error,
- });
- return;
- }
-
- try {
- testingRef.current = true;
- setTesting(true);
- const currentIdp = idpRef.current;
- const isOidc = currentIdp.type === IdentityProviderType.OIDC;
- const request = create(TestIdentityProviderRequestSchema, {
- identityProvider: currentIdp,
- context: isOidc
- ? { case: "oidcContext", value: { code: payload.code } }
- : { case: "oauth2Context", value: { code: payload.code } },
- });
- const response =
- await identityProviderServiceClientConnect.testIdentityProvider(
- request
- );
- setTestResult(response);
- } catch (error) {
- pushNotification({
- module: "bytebase",
- style: "CRITICAL",
- title: "Request error occurred",
- description: (error as ConnectError).message,
- });
- } finally {
- testingRef.current = false;
- setTesting(false);
- }
- });
-
- useEffect(() => {
- return () => {
- if (currentEventNameRef.current) {
- window.removeEventListener(
- currentEventNameRef.current,
- handleOAuthEventRef.current as EventListener,
- false
- );
- }
- };
- }, []);
-
- const testConnection = async () => {
- if (testingRef.current) return;
-
- if (
- idp.type === IdentityProviderType.OAUTH2 ||
- idp.type === IdentityProviderType.OIDC
- ) {
- let idpForTesting: IdentityProvider = idp;
- if (isCreating && idp.type === IdentityProviderType.OIDC) {
- const request = create(CreateIdentityProviderRequestSchema, {
- identityProviderId: idp.name,
- identityProvider: idp,
- validateOnly: true,
- });
- const response =
- await identityProviderServiceClientConnect.createIdentityProvider(
- request
- );
- idpForTesting = response;
- }
-
- const eventName = `bb.oauth.signin.${idpForTesting.name}`;
- if (currentEventNameRef.current) {
- window.removeEventListener(
- currentEventNameRef.current,
- handleOAuthEventRef.current as EventListener,
- false
- );
- }
- window.addEventListener(
- eventName,
- handleOAuthEventRef.current as EventListener,
- false
- );
- currentEventNameRef.current = eventName;
-
- try {
- await openWindowForSSO(idpForTesting);
- } catch (error) {
- pushNotification({
- module: "bytebase",
- style: "CRITICAL",
- title: "Request error occurred",
- description: (error as ConnectError).message,
- });
- }
- } else if (idp.type === IdentityProviderType.LDAP) {
- try {
- testingRef.current = true;
- setTesting(true);
- const request = create(TestIdentityProviderRequestSchema, {
- identityProvider: idp,
- });
- const response =
- await identityProviderServiceClientConnect.testIdentityProvider(
- request
- );
- setTestResult(response);
- } catch (error) {
- pushNotification({
- module: "bytebase",
- style: "CRITICAL",
- title: "Request error occurred",
- description: (error as ConnectError).message,
- });
- } finally {
- testingRef.current = false;
- setTesting(false);
- }
- }
- };
-
- return (
- <>
- <Button
- appearance="outline"
- disabled={disabled || testing}
- onClick={testConnection}
- >
- {t("identity-provider.test-connection")}
- </Button>
- {testResult && (
- <TestConnectionResultDialog
- response={testResult}
- onClose={() => setTestResult(null)}
- />
- )}
- </>
- );
-}
-
// ============================================================
// ProviderConfigForm
// ============================================================
diff --git a/frontend/src/routes/workspace/IdpTestConnection.tsx b/frontend/src/routes/workspace/IdpTestConnection.tsx
new file mode 100644
index 0000000000..be0f7a62b2
--- /dev/null
+++ b/frontend/src/routes/workspace/IdpTestConnection.tsx
@@ -0,0 +1,392 @@
+import { create } from "@bufbuild/protobuf";
+import type { ConnectError } from "@connectrpc/connect";
+import { useEffect, useRef, useState } from "react";
+import { useTranslation } from "react-i18next";
+import { identityProviderServiceClientConnect } from "@/api";
+import { Button } from "@/components/ui/button";
+import { Dialog, DialogContent, DialogTitle } from "@/components/ui/dialog";
+import { Input } from "@/components/ui/input";
+import { pushNotification } from "@/stores";
+import type { OAuthWindowEventPayload } from "@/types";
+import type {
+ IdentityProvider,
+ TestIdentityProviderResponse,
+} from "@/types/proto-es/v1/idp_service_pb";
+import {
+ CreateIdentityProviderRequestSchema,
+ IdentityProviderType,
+ TestIdentityProviderRequestSchema,
+} from "@/types/proto-es/v1/idp_service_pb";
+import { openWindowForSSO } from "@/utils";
+
+// ============================================================
+// KeyValueBox
+// ============================================================
+
+function KeyValueBox({ entries }: { entries: Record<string, string> }) {
+ return (
+ <div className="flex flex-col gap-y-1">
+ {Object.entries(entries).map(([key, value]) => (
+ <div
+ key={key}
+ className="grid grid-cols-3 gap-2 py-1 border-b border-block-border last:border-b-0"
+ >
+ <div
+ className="text-sm font-medium text-control truncate"
+ title={key}
+ >
+ {key}
+ </div>
+ <div className="col-span-2 text-sm text-main break-all" title={value}>
+ {value}
+ </div>
+ </div>
+ ))}
+ </div>
+ );
+}
+
+// ============================================================
+// TestConnectionResultDialog
+// ============================================================
+
+function TestConnectionResultDialog({
+ response,
+ isLdap,
+ connectivityOnly,
+ onClose,
+}: {
+ response: TestIdentityProviderResponse;
+ isLdap: boolean;
+ connectivityOnly: boolean;
+ onClose: () => void;
+}) {
+ const { t } = useTranslation();
+
+ return (
+ <Dialog open onOpenChange={(nextOpen) => !nextOpen && onClose()}>
+ <DialogContent className="w-[32rem] max-w-[calc(100vw-2rem)] p-6">
+ <div className="flex items-center gap-x-2">
+ <div className="size-6 text-success">&#10003;</div>
+ <DialogTitle>
+ {t("identity-provider.test-connection-success")}
+ </DialogTitle>
+ </div>
+
+ {connectivityOnly ? (
+ <p className="mt-4 text-sm text-control-light">
+ {t("identity-provider.ldap-connectivity-verified")}
+ </p>
+ ) : (
+ <div className="mt-4 flex flex-col gap-y-4">
+ <p className="text-sm text-control-light">
+ {t("identity-provider.userinfo-description")}
+ </p>
+ <div className="bg-control-bg rounded-xs p-4">
+ {Object.keys(response.userInfo).length === 0 ? (
+ <div className="text-sm text-control-light italic">
+ {t("identity-provider.no-user-info-mapped")}
+ </div>
+ ) : (
+ <KeyValueBox entries={response.userInfo} />
+ )}
+ </div>
+
+ <p className="text-sm text-control-light">
+ {isLdap
+ ? t("identity-provider.attributes-description")
+ : t("identity-provider.claims-description")}
+ </p>
+ <div className="bg-control-bg rounded-xs p-4">
+ {Object.keys(response.claims).length === 0 ? (
+ <div className="text-sm text-control-light italic">
+ {t("identity-provider.no-claims")}
+ </div>
+ ) : (
+ <KeyValueBox entries={response.claims} />
+ )}
+ </div>
+ </div>
+ )}
+
+ <div className="flex justify-end mt-4">
+ <Button onClick={onClose}>{t("common.close")}</Button>
+ </div>
+ </DialogContent>
+ </Dialog>
+ );
+}
+
+// ============================================================
+// LdapTestDialog
+// ============================================================
+
+function LdapTestDialog({
+ testing,
+ onTest,
+ onClose,
+}: {
+ testing: boolean;
+ onTest: (credentials?: { username: string; password: string }) => void;
+ onClose: () => void;
+}) {
+ const { t } = useTranslation();
+ const [username, setUsername] = useState("");
+ const [password, setPassword] = useState("");
+ const canSignIn = username.trim() !== "" && password !== "";
+
+ return (
+ <Dialog open onOpenChange={(nextOpen) => !nextOpen && onClose()}>
+ <DialogContent className="w-[32rem] max-w-[calc(100vw-2rem)] p-6">
+ <DialogTitle>{t("identity-provider.ldap-test-title")}</DialogTitle>
+ <form
+ className="mt-4 flex flex-col gap-y-4"
+ onSubmit={(e) => {
+ e.preventDefault();
+ if (canSignIn) {
+ onTest({ username: username.trim(), password });
+ }
+ }}
+ >
+ <p className="text-sm text-control-light">
+ {t("identity-provider.ldap-test-description")}
+ </p>
+ <div className="flex flex-col gap-y-1">
+ <label className="text-sm font-medium text-control">
+ {t("common.username")}
+ </label>
+ <Input
+ value={username}
+ onChange={(e) => setUsername(e.target.value)}
+ autoComplete="off"
+ />
+ </div>
+ <div className="flex flex-col gap-y-1">
+ <label className="text-sm font-medium text-control">
+ {t("common.password")}
+ </label>
+ <Input
+ type="password"
+ value={password}
+ onChange={(e) => setPassword(e.target.value)}
+ autoComplete="new-password"
+ />
+ </div>
+ <div className="flex justify-end gap-x-2">
+ <Button
+ type="button"
+ appearance="outline"
+ disabled={testing}
+ onClick={onClose}
+ >
+ {t("common.cancel")}
+ </Button>
+ <Button
+ type="button"
+ appearance="outline"
+ disabled={testing}
+ onClick={() => onTest(undefined)}
+ >
+ {t("identity-provider.ldap-test-connectivity-only")}
+ </Button>
+ <Button type="submit" disabled={testing || !canSignIn}>
+ {t("identity-provider.ldap-test-sign-in")}
+ </Button>
+ </div>
+ </form>
+ </DialogContent>
+ </Dialog>
+ );
+}
+
+// ============================================================
+// TestConnectionButton
+// ============================================================
+
+export function TestConnectionButton({
+ idp,
+ disabled,
+ isCreating,
+}: {
+ idp: IdentityProvider;
+ disabled: boolean;
+ isCreating?: boolean;
+}) {
+ const { t } = useTranslation();
+ const [testing, setTesting] = useState(false);
+ const [testResult, setTestResult] = useState<{
+ response: TestIdentityProviderResponse;
+ connectivityOnly: boolean;
+ } | null>(null);
+ const [showLdapDialog, setShowLdapDialog] = useState(false);
+ const currentEventNameRef = useRef("");
+ const idpRef = useRef(idp);
+ idpRef.current = idp;
+ const testingRef = useRef(false);
+
+ // Stable event handler that reads latest state via refs
+ const handleOAuthEventRef = useRef(async (event: Event) => {
+ if (testingRef.current) return;
+ const payload = (event as CustomEvent).detail as OAuthWindowEventPayload;
+ if (payload.error) {
+ pushNotification({
+ module: "bytebase",
+ style: "CRITICAL",
+ title: "Request error occurred",
+ description: payload.error,
+ });
+ return;
+ }
+
+ try {
+ testingRef.current = true;
+ setTesting(true);
+ const currentIdp = idpRef.current;
+ const isOidc = currentIdp.type === IdentityProviderType.OIDC;
+ const request = create(TestIdentityProviderRequestSchema, {
+ identityProvider: currentIdp,
+ context: isOidc
+ ? { case: "oidcContext", value: { code: payload.code } }
+ : { case: "oauth2Context", value: { code: payload.code } },
+ });
+ const response =
+ await identityProviderServiceClientConnect.testIdentityProvider(
+ request
+ );
+ setTestResult({ response, connectivityOnly: false });
+ } catch (error) {
+ pushNotification({
+ module: "bytebase",
+ style: "CRITICAL",
+ title: "Request error occurred",
+ description: (error as ConnectError).message,
+ });
+ } finally {
+ testingRef.current = false;
+ setTesting(false);
+ }
+ });
+
+ useEffect(() => {
+ return () => {
+ if (currentEventNameRef.current) {
+ window.removeEventListener(
+ currentEventNameRef.current,
+ handleOAuthEventRef.current as EventListener,
+ false
+ );
+ }
+ };
+ }, []);
+
+ const testLdap = async (credentials?: {
+ username: string;
+ password: string;
+ }) => {
+ if (testingRef.current) return;
+ try {
+ testingRef.current = true;
+ setTesting(true);
+ const request = create(TestIdentityProviderRequestSchema, {
+ identityProvider: idpRef.current,
+ ...(credentials && {
+ context: { case: "ldapContext" as const, value: credentials },
+ }),
+ });
+ const response =
+ await identityProviderServiceClientConnect.testIdentityProvider(
+ request
+ );
+ setShowLdapDialog(false);
+ setTestResult({ response, connectivityOnly: !credentials });
+ } catch (error) {
+ pushNotification({
+ module: "bytebase",
+ style: "CRITICAL",
+ title: "Request error occurred",
+ description: (error as ConnectError).message,
+ });
+ } finally {
+ testingRef.current = false;
+ setTesting(false);
+ }
+ };
+
+ const testConnection = async () => {
+ if (testingRef.current) return;
+
+ if (
+ idp.type === IdentityProviderType.OAUTH2 ||
+ idp.type === IdentityProviderType.OIDC
+ ) {
+ let idpForTesting: IdentityProvider = idp;
+ if (isCreating && idp.type === IdentityProviderType.OIDC) {
+ const request = create(CreateIdentityProviderRequestSchema, {
+ identityProviderId: idp.name,
+ identityProvider: idp,
+ validateOnly: true,
+ });
+ const response =
+ await identityProviderServiceClientConnect.createIdentityProvider(
+ request
+ );
+ idpForTesting = response;
+ }
+
+ const eventName = `bb.oauth.signin.${idpForTesting.name}`;
+ if (currentEventNameRef.current) {
+ window.removeEventListener(
+ currentEventNameRef.current,
+ handleOAuthEventRef.current as EventListener,
+ false
+ );
+ }
+ window.addEventListener(
+ eventName,
+ handleOAuthEventRef.current as EventListener,
+ false
+ );
+ currentEventNameRef.current = eventName;
+
+ try {
+ await openWindowForSSO(idpForTesting);
+ } catch (error) {
+ pushNotification({
+ module: "bytebase",
+ style: "CRITICAL",
+ title: "Request error occurred",
+ description: (error as ConnectError).message,
+ });
+ }
+ } else if (idp.type === IdentityProviderType.LDAP) {
+ setShowLdapDialog(true);
+ }
+ };
+
+ return (
+ <>
+ <Button
+ appearance="outline"
+ disabled={disabled || testing}
+ onClick={testConnection}
+ >
+ {t("identity-provider.test-connection")}
+ </Button>
+ {showLdapDialog && (
+ <LdapTestDialog
+ testing={testing}
+ onTest={testLdap}
+ onClose={() => setShowLdapDialog(false)}
+ />
+ )}
+ {testResult && (
+ <TestConnectionResultDialog
+ response={testResult.response}
+ isLdap={idp.type === IdentityProviderType.LDAP}
+ connectivityOnly={testResult.connectivityOnly}
+ onClose={() => setTestResult(null)}
+ />
+ )}
+ </>
+ );
+}
diff --git a/frontend/src/types/proto-es/v1/idp_service_pb.d.ts b/frontend/src/types/proto-es/v1/idp_service_pb.d.ts
index bfa84daa71..d949215692 100644
--- a/frontend/src/types/proto-es/v1/idp_service_pb.d.ts
+++ b/frontend/src/types/proto-es/v1/idp_service_pb.d.ts
@@ -187,6 +187,14 @@ export declare type TestIdentityProviderRequest = Message<"bytebase.v1.TestIdent
*/
value: OIDCIdentityProviderTestRequestContext;
case: "oidcContext";
+ } | {
+ /**
+ * LDAP credentials context for test connection.
+ *
+ * @generated from field: bytebase.v1.LDAPIdentityProviderTestRequestContext ldap_context = 4;
+ */
+ value: LDAPIdentityProviderTestRequestContext;
+ case: "ldapContext";
} | { case: undefined; value?: undefined };
};
@@ -232,6 +240,31 @@ export declare type OIDCIdentityProviderTestRequestContext = Message<"bytebase.v
*/
export declare const OIDCIdentityProviderTestRequestContextSchema: GenMessage<OIDCIdentityProviderTestRequestContext>;
+/**
+ * @generated from message bytebase.v1.LDAPIdentityProviderTestRequestContext
+ */
+export declare type LDAPIdentityProviderTestRequestContext = Message<"bytebase.v1.LDAPIdentityProviderTestRequestContext"> & {
+ /**
+ * The username of a directory user, substituted into the user filter.
+ *
+ * @generated from field: string username = 1;
+ */
+ username: string;
+
+ /**
+ * The password of the directory user.
+ *
+ * @generated from field: string password = 2;
+ */
+ password: string;
+};
+
+/**
+ * Describes the message bytebase.v1.LDAPIdentityProviderTestRequestContext.
+ * Use `create(LDAPIdentityProviderTestRequestContextSchema)` to create a new message.
+ */
+export declare const LDAPIdentityProviderTestRequestContextSchema: GenMessage<LDAPIdentityProviderTestRequestContext>;
+
/**
* @generated from message bytebase.v1.TestIdentityProviderResponse
*/
diff --git a/frontend/src/types/proto-es/v1/idp_service_pb.js b/frontend/src/types/proto-es/v1/idp_service_pb.js
index 1d5fa515b1..2dc11ab70a 100644
--- a/frontend/src/types/proto-es/v1/idp_service_pb.js
+++ b/frontend/src/types/proto-es/v1/idp_service_pb.js
@@ -15,7 +15,7 @@ import { file_v1_annotation } from "./annotation_pb";
* Describes the file v1/idp_service.proto.
*/
export const file_v1_idp_service = /*@__PURE__*/
- fileDesc("ChR2MS9pZHBfc2VydmljZS5wcm90bxILYnl0ZWJhc2UudjEiRAoaR2V0SWRlbnRpdHlQcm92aWRlclJlcXVlc3QSJgoEbmFtZRgBIAEoCUIY4EEC+kESChBieXRlYmFzZS5jb20vSWRQIksKHExpc3RJZGVudGl0eVByb3ZpZGVyc1JlcXVlc3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WJhc2VcVjFcR1BCTWV0YWRhdGHqAgxCeXRlYmFzZTo6VjFiBnByb3RvMw", [file_buf_validate_validate, file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_empty, file_google_protobuf_field_mask, file_v1_annotation]);
+ fileDesc("ChR2MS9pZHBfc2VydmljZS5wcm90bxILYnl0ZWJhc2UudjEiRAoaR2V0SWRlbnRpdHlQcm92aWRlclJlcXVlc3QSJgoEbmFtZRgBIAEoCUIY4EEC+kESChBieXRlYmFzZS5jb20vSWRQIksKHExpc3RJZGVudGl0eVByb3ZpZGVyc1JlcXVlc3QSKwoGcGFyZW50GAEgASgJQhv6QRgKFmJ5dGViYXNlLmNvbS9Xb3Jrc3BhY2UiWgodTGlzdElkZW50aXR5UHJvdmlkZXJzUmVzcG9uc2USOQoSaWRlbnRpdHlfcHJvdmlkZXJzGAEgAygLMh0uYnl0ZWJhc2UudjEuSWRlbnRpdHlQcm92aWRlciKTAQodQ3JlYXRlSWRlbnRpdHlQcm92aWRlclJlcXVlc3QSPQoRaWRlbnRpdHlfcHJvdmlkZXIYASABKAsyHS5ieXRlYmFzZS52MS5JZGVudGl0eVByb3ZpZGVyQgPgQQISHAoUaWRlbnRpdHlfcHJvdmlkZXJfaWQYAiABKAkSFQoNdmFsaWRhdGVfb25seRgDIAEoCCKmAQodVXBkYXRlSWRlbnRpdHlQcm92aWRlclJlcXVlc3QSPQoRaWRlbnRpdHlfcHJvdmlkZXIYASABKAsyHS5ieXRlYmFzZS52MS5JZGVudGl0eVByb3ZpZGVyQgPgQQISLwoLdXBkYXRlX21hc2sYAiABKAsyGi5nb29nbGUucHJvdG9idWYuRmllbGRNYXNrEhUKDWFsbG93X21pc3NpbmcYAyABKAgiRwodRGVsZXRlSWRlbnRpdHlQcm92aWRlclJlcXVlc3QSJgoEbmFtZRgBIAEoCUIY4EEC+kESChBieXRlYmFzZS5jb20vSWRQIs0CChtUZXN0SWRlbnRpdHlQcm92aWRlclJlcXVl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dvb2dsZS5wcm90b2J1Zi5FbXB0eSJH2kEEbmFtZYrqMBtiYi5pZGVudGl0eVByb3ZpZGVycy5kZWxldGWQ6jABmOowAYLT5JMCEyoRL3YxL3tuYW1lPWlkcHMvKn0SqgEKFFRlc3RJZGVudGl0eVByb3ZpZGVyEiguYnl0ZWJhc2UudjEuVGVzdElkZW50aXR5UHJvdmlkZXJSZXF1ZXN0GikuYnl0ZWJhc2UudjEuVGVzdElkZW50aXR5UHJvdmlkZXJSZXNwb25zZSI9iuowG2JiLmlkZW50aXR5UHJvdmlkZXJzLnVwZGF0ZZDqMAGC0+STAhQ6ASoiDy92MS9pZHBzLyo6dGVzdEKlAQoPY29tLmJ5dGViYXNlLnYxQg9JZHBTZXJ2aWNlUHJvdG9QAVo0Z2l0aHViLmNvbS9ieXRlYmFzZS9ieXRlYmFzZS9iYWNrZW5kL2dlbmVyYXRlZC1nby92MaICA0JYWKoCC0J5dGViYXNlLlYxygILQnl0ZWJhc2VcVjHiAhdCeXRlYmFzZVxWMVxHUEJNZXRhZGF0YeoCDEJ5dGViYXNlOjpWMWIGcHJvdG8z", [file_buf_validate_validate, file_google_api_annotations, file_google_api_client, file_google_api_field_behavior, file_google_api_resource, file_google_protobuf_empty, file_google_protobuf_field_mask, file_v1_annotation]);
/**
* Describes the message bytebase.v1.GetIdentityProviderRequest.
@@ -80,53 +80,60 @@ export const OAuth2IdentityProviderTestRequestContextSchema = /*@__PURE__*/
export const OIDCIdentityProviderTestRequestContextSchema = /*@__PURE__*/
messageDesc(file_v1_idp_service, 8);
+/**
+ * Describes the message bytebase.v1.LDAPIdentityProviderTestRequestContext.
+ * Use `create(LDAPIdentityProviderTestRequestContextSchema)` to create a new message.
+ */
+export const LDAPIdentityProviderTestRequestContextSchema = /*@__PURE__*/
+ messageDesc(file_v1_idp_service, 9);
+
/**
* Describes the message bytebase.v1.TestIdentityProviderResponse.
* Use `create(TestIdentityProviderResponseSchema)` to create a new message.
*/
export const TestIdentityProviderResponseSchema = /*@__PURE__*/
- messageDesc(file_v1_idp_service, 9);
+ messageDesc(file_v1_idp_service, 10);
/**
* Describes the message bytebase.v1.IdentityProvider.
* Use `create(IdentityProviderSchema)` to create a new message.
*/
export const IdentityProviderSchema = /*@__PURE__*/
- messageDesc(file_v1_idp_service, 10);
+ messageDesc(file_v1_idp_service, 11);
/**
* Describes the message bytebase.v1.IdentityProviderConfig.
* Use `create(IdentityProviderConfigSchema)` to create a new message.
*/
export const IdentityProviderConfigSchema = /*@__PURE__*/
- messageDesc(file_v1_idp_service, 11);
+ messageDesc(file_v1_idp_service, 12);
/**
* Describes the message bytebase.v1.OAuth2IdentityProviderConfig.
* Use `create(OAuth2IdentityProviderConfigSchema)` to create a new message.
*/
export const OAuth2IdentityProviderConfigSchema = /*@__PURE__*/
- messageDesc(file_v1_idp_service, 12);
+ messageDesc(file_v1_idp_service, 13);
/**
* Describes the message bytebase.v1.OIDCIdentityProviderConfig.
* Use `create(OIDCIdentityProviderConfigSchema)` to create a new message.
*/
export const OIDCIdentityProviderConfigSchema = /*@__PURE__*/
- messageDesc(file_v1_idp_service, 13);
+ messageDesc(file_v1_idp_service, 14);
/**
* Describes the message bytebase.v1.LDAPIdentityProviderConfig.
* Use `create(LDAPIdentityProviderConfigSchema)` to create a new message.
*/
export const LDAPIdentityProviderConfigSchema = /*@__PURE__*/
- messageDesc(file_v1_idp_service, 14);
+ messageDesc(file_v1_idp_service, 15);
/**
* Describes the enum bytebase.v1.LDAPIdentityProviderConfig.SecurityProtocol.
*/
export const LDAPIdentityProviderConfig_SecurityProtocolSchema = /*@__PURE__*/
- enumDesc(file_v1_idp_service, 14, 0);
+ enumDesc(file_v1_idp_service, 15, 0);
/**
* @generated from enum bytebase.v1.LDAPIdentityProviderConfig.SecurityProtocol
@@ -139,7 +146,7 @@ export const LDAPIdentityProviderConfig_SecurityProtocol = /*@__PURE__*/
* Use `create(FieldMappingSchema)` to create a new message.
*/
export const FieldMappingSchema = /*@__PURE__*/
- messageDesc(file_v1_idp_service, 15);
+ messageDesc(file_v1_idp_service, 16);
/**
* Describes the enum bytebase.v1.IdentityProviderType.
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index 884a5a0fe7..f20aa7c25b 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -24468,6 +24468,19 @@ components:
- SECURITY_PROTOCOL_UNSPECIFIED
- START_TLS
- LDAPS
+ bytebase.v1.LDAPIdentityProviderTestRequestContext:
+ type: object
+ properties:
+ username:
+ type: string
+ title: username
+ description: The username of a directory user, substituted into the user filter.
+ password:
+ type: string
+ title: password
+ description: The password of the directory user.
+ title: LDAPIdentityProviderTestRequestContext
+ additionalProperties: false
bytebase.v1.Label:
type: object
properties:
@@ -31168,6 +31181,15 @@ components:
description: The identity provider to test connection including uncreated.
$ref: '#/components/schemas/bytebase.v1.IdentityProvider'
- oneOf:
+ - type: object
+ properties:
+ ldapContext:
+ title: ldap_context
+ description: LDAP credentials context for test connection.
+ $ref: '#/components/schemas/bytebase.v1.LDAPIdentityProviderTestRequestContext'
+ title: ldap_context
+ required:
+ - ldapContext
- type: object
properties:
oauth2Context:
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index f890abfcd6..e0f93f33d1 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -534,6 +534,7 @@
- [IdentityProvider](#bytebase-v1-IdentityProvider)
- [IdentityProviderConfig](#bytebase-v1-IdentityProviderConfig)
- [LDAPIdentityProviderConfig](#bytebase-v1-LDAPIdentityProviderConfig)
+ - [LDAPIdentityProviderTestRequestContext](#bytebase-v1-LDAPIdentityProviderTestRequestContext)
- [ListIdentityProvidersRequest](#bytebase-v1-ListIdentityProvidersRequest)
- [ListIdentityProvidersResponse](#bytebase-v1-ListIdentityProvidersResponse)
- [OAuth2IdentityProviderConfig](#bytebase-v1-OAuth2IdentityProviderConfig)
@@ -8895,6 +8896,22 @@ LDAPIdentityProviderConfig is the structure for LDAP identity provider config.
+<a name="bytebase-v1-LDAPIdentityProviderTestRequestContext"></a>
+
+### LDAPIdentityProviderTestRequestContext
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| username | [string](#string) | | The username of a directory user, substituted into the user filter. |
+| password | [string](#string) | | The password of the directory user. |
+
+
+
+
+
+
<a name="bytebase-v1-ListIdentityProvidersRequest"></a>
### ListIdentityProvidersRequest
@@ -9011,6 +9028,7 @@ OIDCIdentityProviderConfig is the structure for OIDC identity provider config.
| identity_provider | [IdentityProvider](#bytebase-v1-IdentityProvider) | | The identity provider to test connection including uncreated. |
| oauth2_context | [OAuth2IdentityProviderTestRequestContext](#bytebase-v1-OAuth2IdentityProviderTestRequestContext) | | |
| oidc_context | [OIDCIdentityProviderTestRequestContext](#bytebase-v1-OIDCIdentityProviderTestRequestContext) | | OIDC authentication context for test connection. |
+| ldap_context | [LDAPIdentityProviderTestRequestContext](#bytebase-v1-LDAPIdentityProviderTestRequestContext) | | LDAP credentials context for test connection. |
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index 7168ad6692..16e27df67a 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -2215,6 +2215,10 @@
<a href="#bytebase.v1.LDAPIdentityProviderConfig"><span class="badge">M</span>LDAPIdentityProviderConfig</a>
</li>
+ <li>
+ <a href="#bytebase.v1.LDAPIdentityProviderTestRequestContext"><span class="badge">M</span>LDAPIdentityProviderTestRequestContext</a>
+ </li>
+
<li>
<a href="#bytebase.v1.ListIdentityProvidersRequest"><span class="badge">M</span>ListIdentityProvidersRequest</a>
</li>
@@ -17028,7 +17032,7 @@ Permissions required: bb.changelogs.get</p></td>
<td>/v1/{parent=projects/*/instances/*/databases/*}/changelogs</td>
<td></td>
</tr>
-
+
@@ -17045,7 +17049,7 @@ Permissions required: bb.changelogs.get</p></td>
<td>/v1/{name=projects/*/instances/*/databases/*/changelogs/*}</td>
<td></td>
</tr>
-
+
</tbody>
</table>
@@ -17568,7 +17572,7 @@ Permissions required: bb.databaseCatalogs.update</p></td>
<td>/v1/{name=projects/*/instances/*/databases/*/catalog}</td>
<td></td>
</tr>
-
+
@@ -17585,7 +17589,7 @@ Permissions required: bb.databaseCatalogs.update</p></td>
<td>/v1/{catalog.name=projects/*/instances/*/databases/*/catalog}</td>
<td>catalog</td>
</tr>
-
+
</tbody>
</table>
@@ -18257,7 +18261,7 @@ Permissions required: bb.instanceRoles.list</p></td>
<td>/v1/{parent=projects/*/instances/*}/roles</td>
<td></td>
</tr>
-
+
</tbody>
</table>
@@ -18329,7 +18333,7 @@ Only READ_ONLY data source can be added. </p></td>
Format: projects/{project}. If omitted, all targets must be workspace
instances; otherwise, every target must belong to this project collection. </p></td>
</tr>
-
+
<tr>
<td>requests</td>
<td><a href="#bytebase.v1.SyncInstanceRequest">SyncInstanceRequest</a></td>
@@ -18370,7 +18374,7 @@ A maximum of 1000 instances can be synced in a batch. </p></td>
Format: projects/{project}. If omitted, all targets must be workspace
instances; otherwise, every target must belong to this project collection. </p></td>
</tr>
-
+
<tr>
<td>requests</td>
<td><a href="#bytebase.v1.UpdateInstanceRequest">UpdateInstanceRequest</a></td>
@@ -18427,7 +18431,7 @@ instances; otherwise, every target must belong to this project collection. </p><
Format: projects/{project}. If omitted, the instance is created in the
workspace collection. </p></td>
</tr>
-
+
<tr>
<td>instance</td>
<td><a href="#bytebase.v1.Instance">Instance</a></td>
@@ -19630,7 +19634,7 @@ Format: projects/{project}. If omitted, only workspace instances are
returned. Wildcard project parents are not supported. When set, the
`project` filter must be omitted or match this parent. </p></td>
</tr>
-
+
<tr>
<td>page_size</td>
<td><a href="#int32">int32</a></td>
@@ -20439,7 +20443,7 @@ Permissions required: bb.instances.update</p></td>
<td>/v1/{name=projects/*/instances/*}</td>
<td></td>
</tr>
-
+
@@ -20456,7 +20460,7 @@ Permissions required: bb.instances.update</p></td>
<td>/v1/{parent=projects/*}/instances</td>
<td></td>
</tr>
-
+
@@ -20473,7 +20477,7 @@ Permissions required: bb.instances.update</p></td>
<td>/v1/{parent=projects/*}/instances</td>
<td>instance</td>
</tr>
-
+
@@ -20490,7 +20494,7 @@ Permissions required: bb.instances.update</p></td>
<td>/v1/{instance.name=projects/*/instances/*}</td>
<td>instance</td>
</tr>
-
+
@@ -20507,7 +20511,7 @@ Permissions required: bb.instances.update</p></td>
<td>/v1/{name=projects/*/instances/*}</td>
<td></td>
</tr>
-
+
@@ -20524,7 +20528,7 @@ Permissions required: bb.instances.update</p></td>
<td>/v1/{name=projects/*/instances/*}:undelete</td>
<td>*</td>
</tr>
-
+
@@ -20541,7 +20545,7 @@ Permissions required: bb.instances.update</p></td>
<td>/v1/{name=projects/*/instances/*}:sync</td>
<td>*</td>
</tr>
-
+
@@ -20558,7 +20562,7 @@ Permissions required: bb.instances.update</p></td>
<td>/v1/{name=projects/*/instances/*}:databases</td>
<td>*</td>
</tr>
-
+
@@ -20575,7 +20579,7 @@ Permissions required: bb.instances.update</p></td>
<td>/v1/{parent=projects/*}/instances:batchSync</td>
<td>*</td>
</tr>
-
+
@@ -20592,7 +20596,7 @@ Permissions required: bb.instances.update</p></td>
<td>/v1/{parent=projects/*}/instances:batchUpdate</td>
<td>*</td>
</tr>
-
+
@@ -20609,7 +20613,7 @@ Permissions required: bb.instances.update</p></td>
<td>/v1/{name=projects/*/instances/*}:addDataSource</td>
<td>*</td>
</tr>
-
+
@@ -20626,7 +20630,7 @@ Permissions required: bb.instances.update</p></td>
<td>/v1/{name=projects/*/instances/*}:removeDataSource</td>
<td>*</td>
</tr>
-
+
@@ -20643,7 +20647,7 @@ Permissions required: bb.instances.update</p></td>
<td>/v1/{name=projects/*/instances/*}:updateDataSource</td>
<td>data_source</td>
</tr>
-
+
</tbody>
</table>
@@ -24385,7 +24389,7 @@ Permissions required: bb.databases.getSchema</p></td>
<td>/v1/{name=projects/*/instances/*/databases/*}</td>
<td></td>
</tr>
-
+
@@ -24409,7 +24413,7 @@ Permissions required: bb.databases.getSchema</p></td>
<td>/v1/{parent=projects/*/instances/*}/databases:batchGet</td>
<td></td>
</tr>
-
+
@@ -24440,7 +24444,7 @@ Permissions required: bb.databases.getSchema</p></td>
<td>/v1/{parent=projects/*/instances/*}/databases</td>
<td></td>
</tr>
-
+
@@ -24457,7 +24461,7 @@ Permissions required: bb.databases.getSchema</p></td>
<td>/v1/{database.name=projects/*/instances/*/databases/*}</td>
<td>database</td>
</tr>
-
+
@@ -24474,7 +24478,7 @@ Permissions required: bb.databases.getSchema</p></td>
<td>/v1/{parent=projects/*/instances/*}/databases:batchUpdate</td>
<td>*</td>
</tr>
-
+
@@ -24491,7 +24495,7 @@ Permissions required: bb.databases.getSchema</p></td>
<td>/v1/{name=projects/*/instances/*/databases/*}:sync</td>
<td>*</td>
</tr>
-
+
@@ -24508,7 +24512,7 @@ Permissions required: bb.databases.getSchema</p></td>
<td>/v1/{parent=projects/*/instances/*}/databases:batchSync</td>
<td>*</td>
</tr>
-
+
@@ -24525,7 +24529,7 @@ Permissions required: bb.databases.getSchema</p></td>
<td>/v1/{name=projects/*/instances/*/databases/*/metadata}</td>
<td></td>
</tr>
-
+
@@ -24542,7 +24546,7 @@ Permissions required: bb.databases.getSchema</p></td>
<td>/v1/{name=projects/*/instances/*/databases/*/schema}</td>
<td></td>
</tr>
-
+
@@ -24559,7 +24563,7 @@ Permissions required: bb.databases.getSchema</p></td>
<td>/v1/{name=projects/*/instances/*/databases/*/sdlSchema}</td>
<td></td>
</tr>
-
+
@@ -24576,7 +24580,7 @@ Permissions required: bb.databases.getSchema</p></td>
<td>/v1/{name=projects/*/instances/*/databases/*}:diffSchema</td>
<td>*</td>
</tr>
-
+
<tr>
<td>DiffSchema</td>
<td>POST</td>
@@ -24590,7 +24594,7 @@ Permissions required: bb.databases.getSchema</p></td>
<td>/v1/{name=projects/*/instances/*/databases/*/changelogs/*}:diffSchema</td>
<td>*</td>
</tr>
-
+
@@ -24607,7 +24611,7 @@ Permissions required: bb.databases.getSchema</p></td>
<td>/v1/{name=projects/*/instances/*/databases/*}:diffMetadata</td>
<td>*</td>
</tr>
-
+
@@ -24624,7 +24628,7 @@ Permissions required: bb.databases.getSchema</p></td>
<td>/v1/{name=projects/*/instances/*/databases/*/schemaString}</td>
<td></td>
</tr>
-
+
</tbody>
</table>
@@ -25495,6 +25499,37 @@ server. </p></td>
+ <h3 id="bytebase.v1.LDAPIdentityProviderTestRequestContext">LDAPIdentityProviderTestRequestContext</h3>
+ <p></p>
+
+
+ <table class="field-table">
+ <thead>
+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>username</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The username of a directory user, substituted into the user filter. </p></td>
+ </tr>
+
+ <tr>
+ <td>password</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The password of the directory user. </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
<h3 id="bytebase.v1.ListIdentityProvidersRequest">ListIdentityProvidersRequest</h3>
<p></p>
@@ -25779,6 +25814,13 @@ Should be fetched from the well-known configuration file of the OIDC provider. <
<td><p>OIDC authentication context for test connection. </p></td>
</tr>
+ <tr>
+ <td>ldap_context</td>
+ <td><a href="#bytebase.v1.LDAPIdentityProviderTestRequestContext">LDAPIdentityProviderTestRequestContext</a></td>
+ <td></td>
+ <td><p>LDAP credentials context for test connection. </p></td>
+ </tr>
+
</tbody>
</table>
@@ -30918,7 +30960,7 @@ Permissions required: bb.revisions.delete</p></td>
<td>/v1/{parent=projects/*/instances/*/databases/*}/revisions</td>
<td></td>
</tr>
-
+
@@ -30935,7 +30977,7 @@ Permissions required: bb.revisions.delete</p></td>
<td>/v1/{name=projects/*/instances/*/databases/*/revisions/*}</td>
<td></td>
</tr>
-
+
@@ -30952,7 +30994,7 @@ Permissions required: bb.revisions.delete</p></td>
<td>/v1/{parent=projects/*/instances/*/databases/*}/revisions:batchCreate</td>
<td>*</td>
</tr>
-
+
@@ -30969,7 +31011,7 @@ Permissions required: bb.revisions.delete</p></td>
<td>/v1/{name=projects/*/instances/*/databases/*/revisions/*}</td>
<td></td>
</tr>
-
+
</tbody>
</table>
diff --git a/proto/v1/v1/idp_service.proto b/proto/v1/v1/idp_service.proto
index 1c7fd9a58a..4e606e699e 100644
--- a/proto/v1/v1/idp_service.proto
+++ b/proto/v1/v1/idp_service.proto
@@ -153,6 +153,8 @@ message TestIdentityProviderRequest {
OAuth2IdentityProviderTestRequestContext oauth2_context = 2;
// OIDC authentication context for test connection.
OIDCIdentityProviderTestRequestContext oidc_context = 3;
+ // LDAP credentials context for test connection.
+ LDAPIdentityProviderTestRequestContext ldap_context = 4;
}
}
@@ -166,6 +168,13 @@ message OIDCIdentityProviderTestRequestContext {
string code = 1;
}
+message LDAPIdentityProviderTestRequestContext {
+ // The username of a directory user, substituted into the user filter.
+ string username = 1;
+ // The password of the directory user.
+ string password = 2;
+}
+
message TestIdentityProviderResponse {
// The map of claims returned by the identity provider.
map<string, string> claims = 1;