Skip to content

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

feat: update login api with MFA (#4988)

boojackae21a0317f66
diff --git a/backend/api/v1/auth_service.go b/backend/api/v1/auth_service.go
index f7c5c3db3b..95ab530053 100644
--- a/backend/api/v1/auth_service.go
+++ b/backend/api/v1/auth_service.go
@@ -9,6 +9,7 @@ import (
"strings"
"golang.org/x/crypto/bcrypt"
+ "golang.org/x/exp/slices"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata"
@@ -23,6 +24,7 @@ import (
"github.com/bytebase/bytebase/backend/plugin/idp/oauth2"
"github.com/bytebase/bytebase/backend/plugin/idp/oidc"
"github.com/bytebase/bytebase/backend/plugin/metric"
+ "github.com/bytebase/bytebase/backend/plugin/mfa/otp"
"github.com/bytebase/bytebase/backend/runner/metricreport"
"github.com/bytebase/bytebase/backend/store"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
@@ -427,6 +429,23 @@ func (s *AuthService) Login(ctx context.Context, request *v1pb.LoginRequest) (*v
if loginUser == nil {
return nil, status.Errorf(codes.Unauthenticated, "login user not found")
}
+ if loginUser.MemberDeleted {
+ return nil, status.Errorf(codes.Unauthenticated, "user has been deactivated by administrators")
+ }
+ if loginUser.MFAConfig != nil && loginUser.MFAConfig.OtpSecret != "" {
+ if request.MfaCode != nil {
+ if err := challengeMFACode(loginUser, *request.MfaCode); err != nil {
+ return nil, err
+ }
+ } else if request.RecoveryCode != nil {
+ if err := s.challengeRecoveryCode(ctx, loginUser, *request.RecoveryCode); err != nil {
+ return nil, err
+ }
+ } else {
+ // Return FailedPrecondition error to indicate MFA is required.
+ return nil, status.Errorf(codes.FailedPrecondition, "MFA is required")
+ }
+ }
var accessToken string
if request.Web {
@@ -482,9 +501,6 @@ func (s *AuthService) getAndVerifyUser(ctx context.Context, request *v1pb.LoginR
if user == nil {
return nil, status.Errorf(codes.Unauthenticated, "user %q not found", request.Email)
}
- if user.MemberDeleted {
- return nil, status.Errorf(codes.Unauthenticated, "user %q has been deactivated by administrators", request.Email)
- }
// Compare the stored hashed password, with the hashed version of the password that was received.
if err := bcrypt.CompareHashAndPassword([]byte(user.PasswordHash), []byte(request.Password)); err != nil {
// If the two passwords don't match, return a 401 status.
@@ -516,7 +532,7 @@ func (s *AuthService) getOrCreateUserWithIDP(ctx context.Context, request *v1pb.
var userInfo *storepb.IdentityProviderUserInfo
var fieldMapping *storepb.FieldMapping
if idp.Type == storepb.IdentityProviderType_OAUTH2 {
- oauth2Context := request.Context.GetOauth2Context()
+ oauth2Context := request.IdpContext.GetOauth2Context()
if oauth2Context == nil {
return nil, status.Errorf(codes.InvalidArgument, "missing OAuth2 context")
}
@@ -535,7 +551,7 @@ func (s *AuthService) getOrCreateUserWithIDP(ctx context.Context, request *v1pb.
}
fieldMapping = idp.Config.GetOauth2Config().FieldMapping
} else if idp.Type == storepb.IdentityProviderType_OIDC {
- oauth2Context := request.Context.GetOauth2Context()
+ oauth2Context := request.IdpContext.GetOauth2Context()
if oauth2Context == nil {
return nil, status.Errorf(codes.InvalidArgument, "missing OAuth2 context")
}
@@ -613,13 +629,37 @@ func (s *AuthService) getOrCreateUserWithIDP(ctx context.Context, request *v1pb.
} else {
user = users[0]
}
- if user.MemberDeleted {
- return nil, status.Errorf(codes.Unauthenticated, "user has been deactivated by administrators")
- }
return user, nil
}
+func challengeMFACode(user *store.UserMessage, mfaCode string) error {
+ if !otp.ValidateWithCodeAndSecret(mfaCode, user.MFAConfig.OtpSecret) {
+ return status.Errorf(codes.Unauthenticated, "invalid MFA code")
+ }
+ return nil
+}
+
+func (s *AuthService) challengeRecoveryCode(ctx context.Context, user *store.UserMessage, recoveryCode string) error {
+ for i, code := range user.MFAConfig.RecoveryCodes {
+ if code == recoveryCode {
+ // If the recovery code is valid, delete it from the user's recovery code list.
+ user.MFAConfig.RecoveryCodes = slices.Delete(user.MFAConfig.RecoveryCodes, i, i+1)
+ _, err := s.store.UpdateUser(ctx, user.ID, &store.UpdateUserMessage{
+ MFAConfig: &storepb.MFAConfig{
+ OtpSecret: user.MFAConfig.OtpSecret,
+ RecoveryCodes: user.MFAConfig.RecoveryCodes,
+ },
+ }, user.ID)
+ if err != nil {
+ return status.Errorf(codes.Internal, "failed to update user: %v", err)
+ }
+ return nil
+ }
+ }
+ return status.Errorf(codes.Unauthenticated, "invalid recovery code")
+}
+
func validateEmail(email string) error {
formatedEmail := strings.ToLower(email)
if email != formatedEmail {
diff --git a/frontend/src/types/proto/v1/auth_service.ts b/frontend/src/types/proto/v1/auth_service.ts
index 6bf6eff3f9..5fb1cf17ec 100644
--- a/frontend/src/types/proto/v1/auth_service.ts
+++ b/frontend/src/types/proto/v1/auth_service.ts
@@ -178,20 +178,26 @@ export interface LoginRequest {
* Format: idps/{idp}
*/
idpName: string;
- /** The context data is using to get the user information from identity provider. */
- context?: IdentityProviderContext;
+ /** The idp_context is using to get the user information from identity provider. */
+ idpContext?: IdentityProviderContext;
+ /** The mfa_code is used to verify the user's identity by MFA. */
+ mfaCode?:
+ | string
+ | undefined;
+ /** The recovery_code is used to recovery the user's identity with MFA. */
+ recoveryCode?: string | undefined;
}
export interface IdentityProviderContext {
oauth2Context?: OAuth2IdentityProviderContext | undefined;
- oidcContext?: OIDCIdentityProviderContextx | undefined;
+ oidcContext?: OIDCIdentityProviderContext | undefined;
}
export interface OAuth2IdentityProviderContext {
code: string;
}
-export interface OIDCIdentityProviderContextx {
+export interface OIDCIdentityProviderContext {
}
export interface LoginResponse {
@@ -593,7 +599,15 @@ export const UndeleteUserRequest = {
};
function createBaseLoginRequest(): LoginRequest {
- return { email: "", password: "", web: false, idpName: "", context: undefined };
+ return {
+ email: "",
+ password: "",
+ web: false,
+ idpName: "",
+ idpContext: undefined,
+ mfaCode: undefined,
+ recoveryCode: undefined,
+ };
}
export const LoginRequest = {
@@ -610,8 +624,14 @@ export const LoginRequest = {
if (message.idpName !== "") {
writer.uint32(34).string(message.idpName);
}
- if (message.context !== undefined) {
- IdentityProviderContext.encode(message.context, writer.uint32(42).fork()).ldelim();
+ if (message.idpContext !== undefined) {
+ IdentityProviderContext.encode(message.idpContext, writer.uint32(42).fork()).ldelim();
+ }
+ if (message.mfaCode !== undefined) {
+ writer.uint32(50).string(message.mfaCode);
+ }
+ if (message.recoveryCode !== undefined) {
+ writer.uint32(58).string(message.recoveryCode);
}
return writer;
},
@@ -636,7 +656,13 @@ export const LoginRequest = {
message.idpName = reader.string();
break;
case 5:
- message.context = IdentityProviderContext.decode(reader, reader.uint32());
+ message.idpContext = IdentityProviderContext.decode(reader, reader.uint32());
+ break;
+ case 6:
+ message.mfaCode = reader.string();
+ break;
+ case 7:
+ message.recoveryCode = reader.string();
break;
default:
reader.skipType(tag & 7);
@@ -652,7 +678,9 @@ export const LoginRequest = {
password: isSet(object.password) ? String(object.password) : "",
web: isSet(object.web) ? Boolean(object.web) : false,
idpName: isSet(object.idpName) ? String(object.idpName) : "",
- context: isSet(object.context) ? IdentityProviderContext.fromJSON(object.context) : undefined,
+ idpContext: isSet(object.idpContext) ? IdentityProviderContext.fromJSON(object.idpContext) : undefined,
+ mfaCode: isSet(object.mfaCode) ? String(object.mfaCode) : undefined,
+ recoveryCode: isSet(object.recoveryCode) ? String(object.recoveryCode) : undefined,
};
},
@@ -662,8 +690,10 @@ export const LoginRequest = {
message.password !== undefined && (obj.password = message.password);
message.web !== undefined && (obj.web = message.web);
message.idpName !== undefined && (obj.idpName = message.idpName);
- message.context !== undefined &&
- (obj.context = message.context ? IdentityProviderContext.toJSON(message.context) : undefined);
+ message.idpContext !== undefined &&
+ (obj.idpContext = message.idpContext ? IdentityProviderContext.toJSON(message.idpContext) : undefined);
+ message.mfaCode !== undefined && (obj.mfaCode = message.mfaCode);
+ message.recoveryCode !== undefined && (obj.recoveryCode = message.recoveryCode);
return obj;
},
@@ -673,9 +703,11 @@ export const LoginRequest = {
message.password = object.password ?? "";
message.web = object.web ?? false;
message.idpName = object.idpName ?? "";
- message.context = (object.context !== undefined && object.context !== null)
- ? IdentityProviderContext.fromPartial(object.context)
+ message.idpContext = (object.idpContext !== undefined && object.idpContext !== null)
+ ? IdentityProviderContext.fromPartial(object.idpContext)
: undefined;
+ message.mfaCode = object.mfaCode ?? undefined;
+ message.recoveryCode = object.recoveryCode ?? undefined;
return message;
},
};
@@ -690,7 +722,7 @@ export const IdentityProviderContext = {
OAuth2IdentityProviderContext.encode(message.oauth2Context, writer.uint32(10).fork()).ldelim();
}
if (message.oidcContext !== undefined) {
- OIDCIdentityProviderContextx.encode(message.oidcContext, writer.uint32(18).fork()).ldelim();
+ OIDCIdentityProviderContext.encode(message.oidcContext, writer.uint32(18).fork()).ldelim();
}
return writer;
},
@@ -706,7 +738,7 @@ export const IdentityProviderContext = {
message.oauth2Context = OAuth2IdentityProviderContext.decode(reader, reader.uint32());
break;
case 2:
- message.oidcContext = OIDCIdentityProviderContextx.decode(reader, reader.uint32());
+ message.oidcContext = OIDCIdentityProviderContext.decode(reader, reader.uint32());
break;
default:
reader.skipType(tag & 7);
@@ -721,7 +753,7 @@ export const IdentityProviderContext = {
oauth2Context: isSet(object.oauth2Context)
? OAuth2IdentityProviderContext.fromJSON(object.oauth2Context)
: undefined,
- oidcContext: isSet(object.oidcContext) ? OIDCIdentityProviderContextx.fromJSON(object.oidcContext) : undefined,
+ oidcContext: isSet(object.oidcContext) ? OIDCIdentityProviderContext.fromJSON(object.oidcContext) : undefined,
};
},
@@ -731,7 +763,7 @@ export const IdentityProviderContext = {
? OAuth2IdentityProviderContext.toJSON(message.oauth2Context)
: undefined);
message.oidcContext !== undefined &&
- (obj.oidcContext = message.oidcContext ? OIDCIdentityProviderContextx.toJSON(message.oidcContext) : undefined);
+ (obj.oidcContext = message.oidcContext ? OIDCIdentityProviderContext.toJSON(message.oidcContext) : undefined);
return obj;
},
@@ -741,7 +773,7 @@ export const IdentityProviderContext = {
? OAuth2IdentityProviderContext.fromPartial(object.oauth2Context)
: undefined;
message.oidcContext = (object.oidcContext !== undefined && object.oidcContext !== null)
- ? OIDCIdentityProviderContextx.fromPartial(object.oidcContext)
+ ? OIDCIdentityProviderContext.fromPartial(object.oidcContext)
: undefined;
return message;
},
@@ -794,19 +826,19 @@ export const OAuth2IdentityProviderContext = {
},
};
-function createBaseOIDCIdentityProviderContextx(): OIDCIdentityProviderContextx {
+function createBaseOIDCIdentityProviderContext(): OIDCIdentityProviderContext {
return {};
}
-export const OIDCIdentityProviderContextx = {
- encode(_: OIDCIdentityProviderContextx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+export const OIDCIdentityProviderContext = {
+ encode(_: OIDCIdentityProviderContext, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
return writer;
},
- decode(input: _m0.Reader | Uint8Array, length?: number): OIDCIdentityProviderContextx {
+ decode(input: _m0.Reader | Uint8Array, length?: number): OIDCIdentityProviderContext {
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
let end = length === undefined ? reader.len : reader.pos + length;
- const message = createBaseOIDCIdentityProviderContextx();
+ const message = createBaseOIDCIdentityProviderContext();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
@@ -818,17 +850,17 @@ export const OIDCIdentityProviderContextx = {
return message;
},
- fromJSON(_: any): OIDCIdentityProviderContextx {
+ fromJSON(_: any): OIDCIdentityProviderContext {
return {};
},
- toJSON(_: OIDCIdentityProviderContextx): unknown {
+ toJSON(_: OIDCIdentityProviderContext): unknown {
const obj: any = {};
return obj;
},
- fromPartial(_: DeepPartial<OIDCIdentityProviderContextx>): OIDCIdentityProviderContextx {
- const message = createBaseOIDCIdentityProviderContextx();
+ fromPartial(_: DeepPartial<OIDCIdentityProviderContext>): OIDCIdentityProviderContext {
+ const message = createBaseOIDCIdentityProviderContext();
return message;
},
};
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index 2a35fb31c2..f03c3aa5ca 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -40,7 +40,7 @@
- [LoginResponse](#bytebase-v1-LoginResponse)
- [LogoutRequest](#bytebase-v1-LogoutRequest)
- [OAuth2IdentityProviderContext](#bytebase-v1-OAuth2IdentityProviderContext)
- - [OIDCIdentityProviderContextx](#bytebase-v1-OIDCIdentityProviderContextx)
+ - [OIDCIdentityProviderContext](#bytebase-v1-OIDCIdentityProviderContext)
- [UndeleteUserRequest](#bytebase-v1-UndeleteUserRequest)
- [UpdateUserRequest](#bytebase-v1-UpdateUserRequest)
- [User](#bytebase-v1-User)
@@ -645,7 +645,7 @@ BackupPlanSchedule is the backup plan schedule.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| oauth2_context | [OAuth2IdentityProviderContext](#bytebase-v1-OAuth2IdentityProviderContext) | | |
-| oidc_context | [OIDCIdentityProviderContextx](#bytebase-v1-OIDCIdentityProviderContextx) | | |
+| oidc_context | [OIDCIdentityProviderContext](#bytebase-v1-OIDCIdentityProviderContext) | | |
@@ -699,7 +699,9 @@ When paginating, all other parameters provided to `ListUsers` must match the cal
| password | [string](#string) | | |
| web | [bool](#bool) | | If web is set, we will set access token, refresh token, and user to the cookie. |
| idp_name | [string](#string) | | The name of the identity provider. Format: idps/{idp} |
-| context | [IdentityProviderContext](#bytebase-v1-IdentityProviderContext) | | The context data is using to get the user information from identity provider. |
+| idp_context | [IdentityProviderContext](#bytebase-v1-IdentityProviderContext) | | The idp_context is using to get the user information from identity provider. |
+| mfa_code | [string](#string) | optional | The mfa_code is used to verify the user&#39;s identity by MFA. |
+| recovery_code | [string](#string) | optional | The recovery_code is used to recovery the user&#39;s identity with MFA. |
@@ -746,9 +748,9 @@ When paginating, all other parameters provided to `ListUsers` must match the cal
-<a name="bytebase-v1-OIDCIdentityProviderContextx"></a>
+<a name="bytebase-v1-OIDCIdentityProviderContext"></a>
-### OIDCIdentityProviderContextx
+### OIDCIdentityProviderContext
diff --git a/proto/generated-go/v1/auth_service.pb.go b/proto/generated-go/v1/auth_service.pb.go
index 3a0c41f08e..7c1bc0d4a6 100644
--- a/proto/generated-go/v1/auth_service.pb.go
+++ b/proto/generated-go/v1/auth_service.pb.go
@@ -526,8 +526,12 @@ type LoginRequest struct {
// The name of the identity provider.
// Format: idps/{idp}
IdpName string `protobuf:"bytes,4,opt,name=idp_name,json=idpName,proto3" json:"idp_name,omitempty"`
- // The context data is using to get the user information from identity provider.
- Context *IdentityProviderContext `protobuf:"bytes,5,opt,name=context,proto3" json:"context,omitempty"`
+ // The idp_context is using to get the user information from identity provider.
+ IdpContext *IdentityProviderContext `protobuf:"bytes,5,opt,name=idp_context,json=idpContext,proto3" json:"idp_context,omitempty"`
+ // The mfa_code is used to verify the user's identity by MFA.
+ MfaCode *string `protobuf:"bytes,6,opt,name=mfa_code,json=mfaCode,proto3,oneof" json:"mfa_code,omitempty"`
+ // The recovery_code is used to recovery the user's identity with MFA.
+ RecoveryCode *string `protobuf:"bytes,7,opt,name=recovery_code,json=recoveryCode,proto3,oneof" json:"recovery_code,omitempty"`
}
func (x *LoginRequest) Reset() {
@@ -590,13 +594,27 @@ func (x *LoginRequest) GetIdpName() string {
return ""
}
-func (x *LoginRequest) GetContext() *IdentityProviderContext {
+func (x *LoginRequest) GetIdpContext() *IdentityProviderContext {
if x != nil {
- return x.Context
+ return x.IdpContext
}
return nil
}
+func (x *LoginRequest) GetMfaCode() string {
+ if x != nil && x.MfaCode != nil {
+ return *x.MfaCode
+ }
+ return ""
+}
+
+func (x *LoginRequest) GetRecoveryCode() string {
+ if x != nil && x.RecoveryCode != nil {
+ return *x.RecoveryCode
+ }
+ return ""
+}
+
type IdentityProviderContext struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -655,7 +673,7 @@ func (x *IdentityProviderContext) GetOauth2Context() *OAuth2IdentityProviderCont
return nil
}
-func (x *IdentityProviderContext) GetOidcContext() *OIDCIdentityProviderContextx {
+func (x *IdentityProviderContext) GetOidcContext() *OIDCIdentityProviderContext {
if x, ok := x.GetContext().(*IdentityProviderContext_OidcContext); ok {
return x.OidcContext
}
@@ -671,7 +689,7 @@ type IdentityProviderContext_Oauth2Context struct {
}
type IdentityProviderContext_OidcContext struct {
- OidcContext *OIDCIdentityProviderContextx `protobuf:"bytes,2,opt,name=oidc_context,json=oidcContext,proto3,oneof"`
+ OidcContext *OIDCIdentityProviderContext `protobuf:"bytes,2,opt,name=oidc_context,json=oidcContext,proto3,oneof"`
}
func (*IdentityProviderContext_Oauth2Context) isIdentityProviderContext_Context() {}
@@ -725,14 +743,14 @@ func (x *OAuth2IdentityProviderContext) GetCode() string {
return ""
}
-type OIDCIdentityProviderContextx struct {
+type OIDCIdentityProviderContext struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
-func (x *OIDCIdentityProviderContextx) Reset() {
- *x = OIDCIdentityProviderContextx{}
+func (x *OIDCIdentityProviderContext) Reset() {
+ *x = OIDCIdentityProviderContext{}
if protoimpl.UnsafeEnabled {
mi := &file_v1_auth_service_proto_msgTypes[10]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -740,13 +758,13 @@ func (x *OIDCIdentityProviderContextx) Reset() {
}
}
-func (x *OIDCIdentityProviderContextx) String() string {
+func (x *OIDCIdentityProviderContext) String() string {
return protoimpl.X.MessageStringOf(x)
}
-func (*OIDCIdentityProviderContextx) ProtoMessage() {}
+func (*OIDCIdentityProviderContext) ProtoMessage() {}
-func (x *OIDCIdentityProviderContextx) ProtoReflect() protoreflect.Message {
+func (x *OIDCIdentityProviderContext) ProtoReflect() protoreflect.Message {
mi := &file_v1_auth_service_proto_msgTypes[10]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -758,8 +776,8 @@ func (x *OIDCIdentityProviderContextx) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
-// Deprecated: Use OIDCIdentityProviderContextx.ProtoReflect.Descriptor instead.
-func (*OIDCIdentityProviderContextx) Descriptor() ([]byte, []int) {
+// Deprecated: Use OIDCIdentityProviderContext.ProtoReflect.Descriptor instead.
+func (*OIDCIdentityProviderContext) Descriptor() ([]byte, []int) {
return file_v1_auth_service_proto_rawDescGZIP(), []int{10}
}
@@ -1006,122 +1024,129 @@ var file_v1_auth_service_proto_rawDesc = []byte{
0x65, 0x22, 0x2f, 0x0a, 0x13, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65,
0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x04, 0x6e, 0x61,
- 0x6d, 0x65, 0x22, 0xb3, 0x01, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75,
+ 0x6d, 0x65, 0x22, 0xa3, 0x02, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73,
0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73,
0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x77, 0x65, 0x62, 0x18, 0x03, 0x20, 0x01,
0x28, 0x08, 0x52, 0x03, 0x77, 0x65, 0x62, 0x12, 0x1f, 0x0a, 0x08, 0x69, 0x64, 0x70, 0x5f, 0x6e,
0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52,
- 0x07, 0x69, 0x64, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x3e, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74,
- 0x65, 0x78, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x62, 0x79, 0x74, 0x65,
- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79,
- 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52,
- 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0xc9, 0x01, 0x0a, 0x17, 0x49, 0x64, 0x65,
+ 0x07, 0x69, 0x64, 0x70, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x45, 0x0a, 0x0b, 0x69, 0x64, 0x70, 0x5f,
+ 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x64, 0x65, 0x6e,
+ 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74,
+ 0x65, 0x78, 0x74, 0x52, 0x0a, 0x69, 0x64, 0x70, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12,
+ 0x1e, 0x0a, 0x08, 0x6d, 0x66, 0x61, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28,
+ 0x09, 0x48, 0x00, 0x52, 0x07, 0x6d, 0x66, 0x61, 0x43, 0x6f, 0x64, 0x65, 0x88, 0x01, 0x01, 0x12,
+ 0x28, 0x0a, 0x0d, 0x72, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x64, 0x65,
+ 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x0c, 0x72, 0x65, 0x63, 0x6f, 0x76, 0x65,
+ 0x72, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6d, 0x66,
+ 0x61, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x42, 0x10, 0x0a, 0x0e, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x76,
+ 0x65, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x22, 0xc8, 0x01, 0x0a, 0x17, 0x49, 0x64, 0x65,
0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e,
0x74, 0x65, 0x78, 0x74, 0x12, 0x53, 0x0a, 0x0e, 0x6f, 0x61, 0x75, 0x74, 0x68, 0x32, 0x5f, 0x63,
0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2a, 0x2e, 0x62,
0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x41, 0x75, 0x74, 0x68,
0x32, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65,
0x72, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x48, 0x00, 0x52, 0x0d, 0x6f, 0x61, 0x75, 0x74,
- 0x68, 0x32, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x4e, 0x0a, 0x0c, 0x6f, 0x69, 0x64,
+ 0x68, 0x32, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x4d, 0x0a, 0x0c, 0x6f, 0x69, 0x64,
0x63, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
- 0x29, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x49,
+ 0x28, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x49,
0x44, 0x43, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64,
- 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x78, 0x48, 0x00, 0x52, 0x0b, 0x6f, 0x69,
- 0x64, 0x63, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x42, 0x09, 0x0a, 0x07, 0x63, 0x6f, 0x6e,
- 0x74, 0x65, 0x78, 0x74, 0x22, 0x33, 0x0a, 0x1d, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x49, 0x64,
- 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f,
- 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x1e, 0x0a, 0x1c, 0x4f, 0x49, 0x44,
- 0x43, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65,
- 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x78, 0x22, 0x25, 0x0a, 0x0d, 0x4c, 0x6f, 0x67,
- 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f,
- 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e,
- 0x22, 0x0f, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
- 0x74, 0x22, 0xa7, 0x02, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x04, 0x6e, 0x61,
- 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x04,
- 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20,
- 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
- 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14,
- 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65,
- 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20,
- 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x32, 0x0a, 0x09, 0x75, 0x73,
- 0x65, 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e,
+ 0x65, 0x72, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x48, 0x00, 0x52, 0x0b, 0x6f, 0x69, 0x64,
+ 0x63, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x42, 0x09, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74,
+ 0x65, 0x78, 0x74, 0x22, 0x33, 0x0a, 0x1d, 0x4f, 0x41, 0x75, 0x74, 0x68, 0x32, 0x49, 0x64, 0x65,
+ 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x43, 0x6f, 0x6e,
+ 0x74, 0x65, 0x78, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x1d, 0x0a, 0x1b, 0x4f, 0x49, 0x44, 0x43,
+ 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72,
+ 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x22, 0x25, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x69, 0x6e,
+ 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65,
+ 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x0f,
+ 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22,
+ 0xa7, 0x02, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x04, 0x6e, 0x61,
+ 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
+ 0x0e, 0x32, 0x12, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
+ 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05,
+ 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61,
+ 0x69, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
+ 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x32, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72,
+ 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x62, 0x79,
+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x54, 0x79,
+ 0x70, 0x65, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x32, 0x0a, 0x09,
+ 0x75, 0x73, 0x65, 0x72, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32,
+ 0x15, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73,
+ 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65,
+ 0x12, 0x20, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x07, 0x20, 0x01,
+ 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x04, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f,
+ 0x72, 0x64, 0x12, 0x25, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6b, 0x65,
+ 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x04, 0x52, 0x0a, 0x73,
+ 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x2a, 0x54, 0x0a, 0x08, 0x55, 0x73, 0x65,
+ 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x15, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x54, 0x59,
+ 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00,
+ 0x12, 0x08, 0x0a, 0x04, 0x55, 0x53, 0x45, 0x52, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x59,
+ 0x53, 0x54, 0x45, 0x4d, 0x5f, 0x42, 0x4f, 0x54, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x45,
+ 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x41, 0x43, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x10, 0x03, 0x2a,
+ 0x48, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x15, 0x55,
+ 0x53, 0x45, 0x52, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49,
+ 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x4f, 0x57, 0x4e, 0x45, 0x52, 0x10,
+ 0x01, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x42, 0x41, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x45,
+ 0x56, 0x45, 0x4c, 0x4f, 0x50, 0x45, 0x52, 0x10, 0x03, 0x32, 0xba, 0x06, 0x0a, 0x0b, 0x41, 0x75,
+ 0x74, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5c, 0x0a, 0x07, 0x47, 0x65, 0x74,
+ 0x55, 0x73, 0x65, 0x72, 0x12, 0x1b, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
+ 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
+ 0x74, 0x1a, 0x11, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
+ 0x55, 0x73, 0x65, 0x72, 0x22, 0x21, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4,
+ 0x93, 0x02, 0x14, 0x12, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75,
+ 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x66, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x55,
+ 0x73, 0x65, 0x72, 0x73, 0x12, 0x1d, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
+ 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
+ 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
+ 0x6e, 0x73, 0x65, 0x22, 0x1a, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x82, 0xd3,
+ 0xe4, 0x93, 0x02, 0x0b, 0x12, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12,
+ 0x5f, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1e, 0x2e,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61,
+ 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e,
0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72,
- 0x54, 0x79, 0x70, 0x65, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x32,
- 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28,
- 0x0e, 0x32, 0x15, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,
- 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x52, 0x6f,
- 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x07,
- 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x04, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73,
- 0x77, 0x6f, 0x72, 0x64, 0x12, 0x25, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f,
- 0x6b, 0x65, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x04, 0x52,
- 0x0a, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x4b, 0x65, 0x79, 0x2a, 0x54, 0x0a, 0x08, 0x55,
- 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x15, 0x55, 0x53, 0x45, 0x52, 0x5f,
- 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44,
- 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x53, 0x45, 0x52, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a,
- 0x53, 0x59, 0x53, 0x54, 0x45, 0x4d, 0x5f, 0x42, 0x4f, 0x54, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f,
- 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x41, 0x43, 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x10,
- 0x03, 0x2a, 0x48, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x19, 0x0a,
- 0x15, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45,
- 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x4f, 0x57, 0x4e, 0x45,
- 0x52, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x42, 0x41, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09,
- 0x44, 0x45, 0x56, 0x45, 0x4c, 0x4f, 0x50, 0x45, 0x52, 0x10, 0x03, 0x32, 0xba, 0x06, 0x0a, 0x0b,
- 0x41, 0x75, 0x74, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5c, 0x0a, 0x07, 0x47,
- 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1b, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75,
- 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
- 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x21, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82,
- 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x12, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65,
- 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x66, 0x0a, 0x09, 0x4c, 0x69, 0x73,
- 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x1d, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65,
- 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
- 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73,
- 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0xda, 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74,
- 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x12, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72,
- 0x73, 0x12, 0x5f, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12,
- 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72,
- 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
- 0x11, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73,
- 0x65, 0x72, 0x22, 0x1e, 0xda, 0x41, 0x04, 0x75, 0x73, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02,
- 0x11, 0x3a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65,
- 0x72, 0x73, 0x12, 0x79, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72,
- 0x12, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55,
- 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
- 0x1a, 0x11, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55,
- 0x73, 0x65, 0x72, 0x22, 0x38, 0xda, 0x41, 0x10, 0x75, 0x73, 0x65, 0x72, 0x2c, 0x75, 0x70, 0x64,
- 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x04,
- 0x75, 0x73, 0x65, 0x72, 0x32, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x2e,
- 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x67, 0x0a,
- 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1e, 0x2e, 0x62, 0x79,
- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
- 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f,
- 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d,
- 0x70, 0x74, 0x79, 0x22, 0x21, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93,
- 0x02, 0x14, 0x2a, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73,
- 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x6b, 0x0a, 0x0c, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65,
- 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65,
- 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
- 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x26, 0x82, 0xd3, 0xe4,
- 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d,
- 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x75, 0x6e, 0x64, 0x65, 0x6c,
- 0x65, 0x74, 0x65, 0x12, 0x59, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x19, 0x2e, 0x62,
- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e,
- 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
- 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f,
- 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x3a, 0x01, 0x2a, 0x22, 0x0e,
- 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x58,
- 0x0a, 0x06, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x12, 0x1a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
- 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x71,
- 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x1a, 0x82, 0xd3,
- 0xe4, 0x93, 0x02, 0x14, 0x3a, 0x01, 0x2a, 0x22, 0x0f, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74,
- 0x68, 0x2f, 0x6c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65,
- 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x33,
+ 0x22, 0x1e, 0xda, 0x41, 0x04, 0x75, 0x73, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x3a,
+ 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73,
+ 0x12, 0x79, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1e,
+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64,
+ 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11,
+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65,
+ 0x72, 0x22, 0x38, 0xda, 0x41, 0x10, 0x75, 0x73, 0x65, 0x72, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74,
+ 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x04, 0x75, 0x73,
+ 0x65, 0x72, 0x32, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x6e, 0x61,
+ 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x67, 0x0a, 0x0a, 0x44,
+ 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65,
+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73,
+ 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
+ 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74,
+ 0x79, 0x22, 0x21, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14,
+ 0x2a, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72,
+ 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x6b, 0x0a, 0x0c, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65,
+ 0x55, 0x73, 0x65, 0x72, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
+ 0x76, 0x31, 0x2e, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52,
+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
+ 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02,
+ 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
+ 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x75, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74,
+ 0x65, 0x12, 0x59, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x19, 0x2e, 0x62, 0x79, 0x74,
+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
+ 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
+ 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x3a, 0x01, 0x2a, 0x22, 0x0e, 0x2f, 0x76,
+ 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x58, 0x0a, 0x06,
+ 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x12, 0x1a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
+ 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65,
+ 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x1a, 0x82, 0xd3, 0xe4, 0x93,
+ 0x02, 0x14, 0x3a, 0x01, 0x2a, 0x22, 0x0f, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f,
+ 0x6c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61,
+ 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
+ 0x33,
}
var (
@@ -1151,7 +1176,7 @@ var file_v1_auth_service_proto_goTypes = []interface{}{
(*LoginRequest)(nil), // 9: bytebase.v1.LoginRequest
(*IdentityProviderContext)(nil), // 10: bytebase.v1.IdentityProviderContext
(*OAuth2IdentityProviderContext)(nil), // 11: bytebase.v1.OAuth2IdentityProviderContext
- (*OIDCIdentityProviderContextx)(nil), // 12: bytebase.v1.OIDCIdentityProviderContextx
+ (*OIDCIdentityProviderContext)(nil), // 12: bytebase.v1.OIDCIdentityProviderContext
(*LoginResponse)(nil), // 13: bytebase.v1.LoginResponse
(*LogoutRequest)(nil), // 14: bytebase.v1.LogoutRequest
(*User)(nil), // 15: bytebase.v1.User
@@ -1164,9 +1189,9 @@ var file_v1_auth_service_proto_depIdxs = []int32{
15, // 1: bytebase.v1.CreateUserRequest.user:type_name -> bytebase.v1.User
15, // 2: bytebase.v1.UpdateUserRequest.user:type_name -> bytebase.v1.User
16, // 3: bytebase.v1.UpdateUserRequest.update_mask:type_name -> google.protobuf.FieldMask
- 10, // 4: bytebase.v1.LoginRequest.context:type_name -> bytebase.v1.IdentityProviderContext
+ 10, // 4: bytebase.v1.LoginRequest.idp_context:type_name -> bytebase.v1.IdentityProviderContext
11, // 5: bytebase.v1.IdentityProviderContext.oauth2_context:type_name -> bytebase.v1.OAuth2IdentityProviderContext
- 12, // 6: bytebase.v1.IdentityProviderContext.oidc_context:type_name -> bytebase.v1.OIDCIdentityProviderContextx
+ 12, // 6: bytebase.v1.IdentityProviderContext.oidc_context:type_name -> bytebase.v1.OIDCIdentityProviderContext
17, // 7: bytebase.v1.User.state:type_name -> bytebase.v1.State
0, // 8: bytebase.v1.User.user_type:type_name -> bytebase.v1.UserType
1, // 9: bytebase.v1.User.user_role:type_name -> bytebase.v1.UserRole
@@ -1321,7 +1346,7 @@ func file_v1_auth_service_proto_init() {
}
}
file_v1_auth_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*OIDCIdentityProviderContextx); i {
+ switch v := v.(*OIDCIdentityProviderContext); i {
case 0:
return &v.state
case 1:
@@ -1369,6 +1394,7 @@ func file_v1_auth_service_proto_init() {
}
}
}
+ file_v1_auth_service_proto_msgTypes[7].OneofWrappers = []interface{}{}
file_v1_auth_service_proto_msgTypes[8].OneofWrappers = []interface{}{
(*IdentityProviderContext_Oauth2Context)(nil),
(*IdentityProviderContext_OidcContext)(nil),
diff --git a/proto/v1/auth_service.proto b/proto/v1/auth_service.proto
index 325c47fe30..a5a2616fd3 100644
--- a/proto/v1/auth_service.proto
+++ b/proto/v1/auth_service.proto
@@ -147,14 +147,20 @@ message LoginRequest {
// Format: idps/{idp}
string idp_name = 4 [(google.api.field_behavior) = REQUIRED];
- // The context data is using to get the user information from identity provider.
- IdentityProviderContext context = 5;
+ // The idp_context is using to get the user information from identity provider.
+ IdentityProviderContext idp_context = 5;
+
+ // The mfa_code is used to verify the user's identity by MFA.
+ optional string mfa_code = 6;
+
+ // The recovery_code is used to recovery the user's identity with MFA.
+ optional string recovery_code = 7;
}
message IdentityProviderContext {
oneof context {
OAuth2IdentityProviderContext oauth2_context = 1;
- OIDCIdentityProviderContextx oidc_context = 2;
+ OIDCIdentityProviderContext oidc_context = 2;
}
}
@@ -162,7 +168,7 @@ message OAuth2IdentityProviderContext {
string code = 1;
}
-message OIDCIdentityProviderContextx {
+message OIDCIdentityProviderContext {
}
message LoginResponse {