Skip to content

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

feat: implement update user api for MFA (#4998)

boojack6ed7a1ef8644
diff --git a/backend/api/v1/auth_service.go b/backend/api/v1/auth_service.go
index 95ab530053..caeca97ea1 100644
--- a/backend/api/v1/auth_service.go
+++ b/backend/api/v1/auth_service.go
@@ -16,6 +16,8 @@ import (
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/emptypb"
+ "github.com/pquerna/otp/totp"
+
"github.com/bytebase/bytebase/backend/api/auth"
"github.com/bytebase/bytebase/backend/common"
"github.com/bytebase/bytebase/backend/component/config"
@@ -24,7 +26,6 @@ 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"
@@ -274,6 +275,18 @@ func (s *AuthService) UpdateUser(ctx context.Context, request *v1pb.UpdateUserRe
return nil, status.Errorf(codes.InvalidArgument, "invalid user role %s", request.User.UserRole)
}
patch.Role = &userRole
+ case "user.mfa_enabled":
+ if request.User.MfaEnabled {
+ if user.MFAConfig.TempOtpSecret == "" || len(user.MFAConfig.TempRecoveryCodes) == 0 {
+ return nil, status.Errorf(codes.InvalidArgument, "MFA is not setup yet")
+ }
+ patch.MFAConfig = &storepb.MFAConfig{
+ OtpSecret: user.MFAConfig.TempOtpSecret,
+ RecoveryCodes: user.MFAConfig.TempRecoveryCodes,
+ }
+ } else {
+ patch.MFAConfig = &storepb.MFAConfig{}
+ }
}
}
if passwordPatch != nil {
@@ -284,6 +297,45 @@ func (s *AuthService) UpdateUser(ctx context.Context, request *v1pb.UpdateUserRe
passwordHashStr := string(passwordHash)
patch.PasswordHash = &passwordHashStr
}
+ // This flag is mainly used for validating OTP code when user setup MFA.
+ // We only validate OTP code but not update user.
+ if request.OtpCode != nil {
+ isValid := validateWithCodeAndSecret(*request.OtpCode, user.MFAConfig.TempOtpSecret)
+ if !isValid {
+ return nil, status.Errorf(codes.InvalidArgument, "invalid OTP code")
+ }
+ }
+ // This flag is mainly used for regenerating temp secret and recovery codes when user setup MFA.
+ if request.RegenerateTempMfaSecret {
+ tempSecret, err := generateRandSecret(user.Name)
+ if err != nil {
+ return nil, status.Errorf(codes.Internal, "failed to generate MFA secret, error: %v", err)
+ }
+ tempRecoveryCodes, err := generateRecoveryCodes(10)
+ if err != nil {
+ return nil, status.Errorf(codes.Internal, "failed to generate recovery codes, error: %v", err)
+ }
+ patch.MFAConfig = &storepb.MFAConfig{
+ OtpSecret: user.MFAConfig.OtpSecret,
+ TempOtpSecret: tempSecret,
+ RecoveryCodes: user.MFAConfig.RecoveryCodes,
+ TempRecoveryCodes: tempRecoveryCodes,
+ }
+ }
+ // This flag is mainly used for regenerating recovery codes with MFA enabled.
+ if request.RegenerateRecoveryCodes {
+ if user.MFAConfig.OtpSecret == "" {
+ return nil, status.Errorf(codes.InvalidArgument, "MFA is not enabled")
+ }
+ recoveryCodes, err := generateRecoveryCodes(10)
+ if err != nil {
+ return nil, status.Errorf(codes.Internal, "failed to generate recovery codes, error: %v", err)
+ }
+ patch.MFAConfig = &storepb.MFAConfig{
+ OtpSecret: user.MFAConfig.OtpSecret,
+ RecoveryCodes: recoveryCodes,
+ }
+ }
user, err = s.store.UpdateUser(ctx, userID, patch, principalID)
if err != nil {
@@ -384,6 +436,11 @@ func convertToUser(user *store.UserMessage) *v1pb.User {
UserType: userType,
UserRole: role,
}
+ if user.MFAConfig != nil {
+ convertedUser.MfaEnabled = user.MFAConfig.OtpSecret != ""
+ convertedUser.MfaSecret = user.MFAConfig.TempOtpSecret
+ convertedUser.RecoveryCodes = user.MFAConfig.TempRecoveryCodes
+ }
return convertedUser
}
@@ -433,8 +490,8 @@ func (s *AuthService) Login(ctx context.Context, request *v1pb.LoginRequest) (*v
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 {
+ if request.OtpCode != nil {
+ if err := challengeMFACode(loginUser, *request.OtpCode); err != nil {
return nil, err
}
} else if request.RecoveryCode != nil {
@@ -634,7 +691,7 @@ func (s *AuthService) getOrCreateUserWithIDP(ctx context.Context, request *v1pb.
}
func challengeMFACode(user *store.UserMessage, mfaCode string) error {
- if !otp.ValidateWithCodeAndSecret(mfaCode, user.MFAConfig.OtpSecret) {
+ if !validateWithCodeAndSecret(mfaCode, user.MFAConfig.OtpSecret) {
return status.Errorf(codes.Unauthenticated, "invalid MFA code")
}
return nil
@@ -670,3 +727,38 @@ func validateEmail(email string) error {
}
return nil
}
+
+const (
+ // issuerName is the name of the issuer of the OTP token.
+ issuerName = "Bytebase"
+)
+
+// generateRandSecret generates a random secret for the given account name.
+func generateRandSecret(accountName string) (string, error) {
+ key, err := totp.Generate(totp.GenerateOpts{
+ Issuer: issuerName,
+ AccountName: accountName,
+ })
+ if err != nil {
+ return "", err
+ }
+ return key.Secret(), nil
+}
+
+// validateWithCodeAndSecret validates the given code against the given secret.
+func validateWithCodeAndSecret(code, secret string) bool {
+ return totp.Validate(code, secret)
+}
+
+// generateRecoveryCodes generates n recovery codes.
+func generateRecoveryCodes(n int) ([]string, error) {
+ recoveryCodes := make([]string, n)
+ for i := 0; i < n; i++ {
+ code, err := common.RandomString(10)
+ if err != nil {
+ return nil, err
+ }
+ recoveryCodes[i] = code
+ }
+ return recoveryCodes, nil
+}
diff --git a/backend/plugin/mfa/otp/otp.go b/backend/plugin/mfa/otp/otp.go
deleted file mode 100644
index 4198e3d1d6..0000000000
--- a/backend/plugin/mfa/otp/otp.go
+++ /dev/null
@@ -1,89 +0,0 @@
-// Package otp is the plugin for OTP Multi-Factor Authentication.
-package otp
-
-import (
- "fmt"
- "strings"
- "time"
-
- "github.com/pquerna/otp/totp"
-)
-
-const (
- // issuerName is the name of the issuer of the OTP token.
- issuerName = "Bytebase"
- // generateSecretPeriod is the period that we generate a new secret.
- generateSecretPeriod = 5 * time.Minute
-)
-
-// TimeBasedReader is a reader that returns the same value for the same timestamp.
-type TimeBasedReader struct {
- reader *strings.Reader
-}
-
-// NewTimeBasedReader creates a new TimeBasedReader with the given account name and timestamp.
-func NewTimeBasedReader(accountName string, timestamp time.Time) *TimeBasedReader {
- // Convert the timestamp to Unix time and divide by the secretMaxExpiredDuration.
- // We generate a new secret every 5 minutes. e.g. 15:00, 15:05
- formatedTimestampUnix := timestamp.Unix() / int64(generateSecretPeriod/time.Second)
- return &TimeBasedReader{
- reader: strings.NewReader(fmt.Sprintf("%s-%d", accountName, formatedTimestampUnix)),
- }
-}
-
-func (r *TimeBasedReader) Read(p []byte) (int, error) {
- return r.reader.Read(p)
-}
-
-// GenerateSecret generates a secret for the given account name and timestamp.
-func GenerateSecret(accountName string, timestamp time.Time) (string, error) {
- key, err := totp.Generate(totp.GenerateOpts{
- Issuer: issuerName,
- AccountName: accountName,
- Rand: NewTimeBasedReader(accountName, timestamp),
- })
- if err != nil {
- return "", err
- }
- return key.Secret(), nil
-}
-
-// GetValidSecrets returns a list of valid secrets for the given account name and timestamp.
-func GetValidSecrets(accountName string, timestamp time.Time) ([]string, error) {
- var secrets []string
- // validTimestamps is a list of timestamps that are valid for the secret.
- // The secret is valid for 5 minutes. So we need to check the current timestamp and the timestamp 5 minutes ago.
- validTimestamps := []time.Time{timestamp, timestamp.Add(-1 * generateSecretPeriod)}
- for _, t := range validTimestamps {
- key, err := totp.Generate(totp.GenerateOpts{
- Issuer: issuerName,
- AccountName: accountName,
- Rand: NewTimeBasedReader(accountName, t),
- })
- if err != nil {
- return nil, err
- }
- secrets = append(secrets, key.Secret())
- }
- return secrets, nil
-}
-
-// ValidateWithCodeAndAccountName validates the given code against the given account name.
-func ValidateWithCodeAndAccountName(code, accountName string) (bool, error) {
- validSecrets, err := GetValidSecrets(accountName, time.Now())
- if err != nil {
- return false, err
- }
-
- for _, secret := range validSecrets {
- if ValidateWithCodeAndSecret(code, secret) {
- return true, nil
- }
- }
- return false, nil
-}
-
-// ValidateWithCodeAndSecret validates the given code against the given secret.
-func ValidateWithCodeAndSecret(code, secret string) bool {
- return totp.Validate(code, secret)
-}
diff --git a/backend/plugin/mfa/otp/otp_test.go b/backend/plugin/mfa/otp/otp_test.go
deleted file mode 100644
index 1de62c47bc..0000000000
--- a/backend/plugin/mfa/otp/otp_test.go
+++ /dev/null
@@ -1,107 +0,0 @@
-package otp
-
-import (
- "testing"
- "time"
-
- "github.com/stretchr/testify/assert"
- "golang.org/x/exp/slices"
-)
-
-func TestValidateTimeBasedSecretDuration(t *testing.T) {
- currentTime := time.Now()
- accountName := "test-user"
-
- tests := []struct {
- name string
- generateTime time.Time
- validateTime time.Time
- isSecretExpired bool
- }{
- {
- name: "-5min",
- generateTime: currentTime,
- validateTime: currentTime.Add(-5 * time.Minute),
- isSecretExpired: true,
- },
- {
- name: "0",
- generateTime: currentTime,
- validateTime: currentTime,
- isSecretExpired: false,
- },
- {
- name: "20s",
- generateTime: currentTime,
- validateTime: currentTime.Add(20 * time.Second),
- isSecretExpired: false,
- },
- {
- name: "2min",
- generateTime: currentTime,
- validateTime: currentTime.Add(2 * time.Minute),
- isSecretExpired: false,
- },
- {
- name: "4min - 1s",
- generateTime: currentTime,
- validateTime: currentTime.Add(4*time.Minute - 1*time.Second),
- isSecretExpired: false,
- },
- {
- name: "5min - 1s",
- generateTime: currentTime,
- validateTime: currentTime.Add(5*time.Minute - 1*time.Second),
- isSecretExpired: false,
- },
- {
- name: "5min",
- generateTime: currentTime,
- validateTime: currentTime.Add(5 * time.Minute),
- isSecretExpired: false,
- },
- {
- name: "10min",
- generateTime: currentTime,
- validateTime: currentTime.Add(10 * time.Minute),
- isSecretExpired: true,
- },
- }
-
- for _, test := range tests {
- t.Run(test.name, func(t *testing.T) {
- secret, err := GenerateSecret(accountName, test.generateTime)
- assert.NoError(t, err)
- validSecrets, err := GetValidSecrets(accountName, test.validateTime)
- assert.NoError(t, err)
- assert.Equal(t, test.isSecretExpired, !slices.Contains(validSecrets, secret))
- })
- }
-}
-
-func TestGenerateTimeBasedSecret(t *testing.T) {
- tests := []struct {
- accountName string
- timestamp time.Time
- wantedSecret string
- }{
- {
- accountName: "frank",
- timestamp: time.Unix(1678115520, 0),
- wantedSecret: "MZZGC3TLFU2TKOJTG4YTQAAAAAAAAAAA",
- },
- {
- accountName: "jack",
- timestamp: time.Unix(1678115520, 0),
- wantedSecret: "NJQWG2ZNGU2TSMZXGE4AAAAAAAAAAAAA",
- },
- }
-
- for _, test := range tests {
- t.Run(test.accountName, func(t *testing.T) {
- secret, err := GenerateSecret(test.accountName, test.timestamp)
- assert.NoError(t, err)
- assert.Equal(t, test.wantedSecret, secret)
- })
- }
-}
diff --git a/backend/store/principal.go b/backend/store/principal.go
index bb078b961c..59b3885093 100644
--- a/backend/store/principal.go
+++ b/backend/store/principal.go
@@ -247,7 +247,7 @@ func (*Store) listUserImpl(ctx context.Context, tx *Tx, find *FindUserMessage) (
} else if userMessage.ID != api.SystemBotID {
userMessage.MemberDeleted = true
}
- var mfaConfig storepb.MFAConfig
+ mfaConfig := storepb.MFAConfig{}
decoder := protojson.UnmarshalOptions{DiscardUnknown: true}
if err := decoder.Unmarshal(mfaConfigBytes, &mfaConfig); err != nil {
return nil, err
diff --git a/frontend/src/types/proto/store/user.ts b/frontend/src/types/proto/store/user.ts
index f1156be625..4f2699ea9d 100644
--- a/frontend/src/types/proto/store/user.ts
+++ b/frontend/src/types/proto/store/user.ts
@@ -7,12 +7,16 @@ export const protobufPackage = "bytebase.store";
export interface MFAConfig {
/** The otp_secret is the secret key used to validate the OTP code. */
otpSecret: string;
+ /** The temp_otp_secret is the temporary secret key used to validate the OTP code and will replace the otp_secret in two phase commits. */
+ tempOtpSecret: string;
/** The recovery_codes are the codes that can be used to recover the account. */
recoveryCodes: string[];
+ /** The temp_recovery_codes are the temporary codes that will replace the recovery_codes in two phase commits. */
+ tempRecoveryCodes: string[];
}
function createBaseMFAConfig(): MFAConfig {
- return { otpSecret: "", recoveryCodes: [] };
+ return { otpSecret: "", tempOtpSecret: "", recoveryCodes: [], tempRecoveryCodes: [] };
}
export const MFAConfig = {
@@ -20,8 +24,14 @@ export const MFAConfig = {
if (message.otpSecret !== "") {
writer.uint32(10).string(message.otpSecret);
}
+ if (message.tempOtpSecret !== "") {
+ writer.uint32(18).string(message.tempOtpSecret);
+ }
for (const v of message.recoveryCodes) {
- writer.uint32(18).string(v!);
+ writer.uint32(26).string(v!);
+ }
+ for (const v of message.tempRecoveryCodes) {
+ writer.uint32(34).string(v!);
}
return writer;
},
@@ -37,8 +47,14 @@ export const MFAConfig = {
message.otpSecret = reader.string();
break;
case 2:
+ message.tempOtpSecret = reader.string();
+ break;
+ case 3:
message.recoveryCodes.push(reader.string());
break;
+ case 4:
+ message.tempRecoveryCodes.push(reader.string());
+ break;
default:
reader.skipType(tag & 7);
break;
@@ -50,25 +66,37 @@ export const MFAConfig = {
fromJSON(object: any): MFAConfig {
return {
otpSecret: isSet(object.otpSecret) ? String(object.otpSecret) : "",
+ tempOtpSecret: isSet(object.tempOtpSecret) ? String(object.tempOtpSecret) : "",
recoveryCodes: Array.isArray(object?.recoveryCodes) ? object.recoveryCodes.map((e: any) => String(e)) : [],
+ tempRecoveryCodes: Array.isArray(object?.tempRecoveryCodes)
+ ? object.tempRecoveryCodes.map((e: any) => String(e))
+ : [],
};
},
toJSON(message: MFAConfig): unknown {
const obj: any = {};
message.otpSecret !== undefined && (obj.otpSecret = message.otpSecret);
+ message.tempOtpSecret !== undefined && (obj.tempOtpSecret = message.tempOtpSecret);
if (message.recoveryCodes) {
obj.recoveryCodes = message.recoveryCodes.map((e) => e);
} else {
obj.recoveryCodes = [];
}
+ if (message.tempRecoveryCodes) {
+ obj.tempRecoveryCodes = message.tempRecoveryCodes.map((e) => e);
+ } else {
+ obj.tempRecoveryCodes = [];
+ }
return obj;
},
fromPartial(object: DeepPartial<MFAConfig>): MFAConfig {
const message = createBaseMFAConfig();
message.otpSecret = object.otpSecret ?? "";
+ message.tempOtpSecret = object.tempOtpSecret ?? "";
message.recoveryCodes = object.recoveryCodes?.map((e) => e) || [];
+ message.tempRecoveryCodes = object.tempRecoveryCodes?.map((e) => e) || [];
return message;
},
};
diff --git a/frontend/src/types/proto/v1/auth_service.ts b/frontend/src/types/proto/v1/auth_service.ts
index 5fb1cf17ec..942554f4d4 100644
--- a/frontend/src/types/proto/v1/auth_service.ts
+++ b/frontend/src/types/proto/v1/auth_service.ts
@@ -150,6 +150,17 @@ export interface UpdateUserRequest {
user?: User;
/** The list of fields to update. */
updateMask?: string[];
+ /** The otp_code is used to verify the user's identity by MFA. */
+ otpCode?:
+ | string
+ | undefined;
+ /**
+ * The regenerate_temp_mfa_secret flag means to regenerate tempary MFA secret for user.
+ * This is used for MFA setup. The tempary MFA secret and recovery codes will be returned in the response.
+ */
+ regenerateTempMfaSecret: boolean;
+ /** The regenerate_recovery_codes flag means to regenerate recovery codes for user. */
+ regenerateRecoveryCodes: boolean;
}
export interface DeleteUserRequest {
@@ -180,8 +191,8 @@ export interface LoginRequest {
idpName: string;
/** 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?:
+ /** The otp_code is used to verify the user's identity by MFA. */
+ otpCode?:
| string
| undefined;
/** The recovery_code is used to recovery the user's identity with MFA. */
@@ -221,6 +232,12 @@ export interface User {
userRole: UserRole;
password: string;
serviceKey: string;
+ /** The mfa_enabled flag means if the user has enabled MFA. */
+ mfaEnabled: boolean;
+ /** The mfa_secret is the tempary secret using in two phase verification. */
+ mfaSecret: string;
+ /** The recovery_codes is the tempary recovery codes using in two phase verification. */
+ recoveryCodes: string[];
}
function createBaseGetUserRequest(): GetUserRequest {
@@ -447,7 +464,13 @@ export const CreateUserRequest = {
};
function createBaseUpdateUserRequest(): UpdateUserRequest {
- return { user: undefined, updateMask: undefined };
+ return {
+ user: undefined,
+ updateMask: undefined,
+ otpCode: undefined,
+ regenerateTempMfaSecret: false,
+ regenerateRecoveryCodes: false,
+ };
}
export const UpdateUserRequest = {
@@ -458,6 +481,15 @@ export const UpdateUserRequest = {
if (message.updateMask !== undefined) {
FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).ldelim();
}
+ if (message.otpCode !== undefined) {
+ writer.uint32(26).string(message.otpCode);
+ }
+ if (message.regenerateTempMfaSecret === true) {
+ writer.uint32(32).bool(message.regenerateTempMfaSecret);
+ }
+ if (message.regenerateRecoveryCodes === true) {
+ writer.uint32(40).bool(message.regenerateRecoveryCodes);
+ }
return writer;
},
@@ -474,6 +506,15 @@ export const UpdateUserRequest = {
case 2:
message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));
break;
+ case 3:
+ message.otpCode = reader.string();
+ break;
+ case 4:
+ message.regenerateTempMfaSecret = reader.bool();
+ break;
+ case 5:
+ message.regenerateRecoveryCodes = reader.bool();
+ break;
default:
reader.skipType(tag & 7);
break;
@@ -486,6 +527,9 @@ export const UpdateUserRequest = {
return {
user: isSet(object.user) ? User.fromJSON(object.user) : undefined,
updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,
+ otpCode: isSet(object.otpCode) ? String(object.otpCode) : undefined,
+ regenerateTempMfaSecret: isSet(object.regenerateTempMfaSecret) ? Boolean(object.regenerateTempMfaSecret) : false,
+ regenerateRecoveryCodes: isSet(object.regenerateRecoveryCodes) ? Boolean(object.regenerateRecoveryCodes) : false,
};
},
@@ -493,6 +537,9 @@ export const UpdateUserRequest = {
const obj: any = {};
message.user !== undefined && (obj.user = message.user ? User.toJSON(message.user) : undefined);
message.updateMask !== undefined && (obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask)));
+ message.otpCode !== undefined && (obj.otpCode = message.otpCode);
+ message.regenerateTempMfaSecret !== undefined && (obj.regenerateTempMfaSecret = message.regenerateTempMfaSecret);
+ message.regenerateRecoveryCodes !== undefined && (obj.regenerateRecoveryCodes = message.regenerateRecoveryCodes);
return obj;
},
@@ -500,6 +547,9 @@ export const UpdateUserRequest = {
const message = createBaseUpdateUserRequest();
message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined;
message.updateMask = object.updateMask ?? undefined;
+ message.otpCode = object.otpCode ?? undefined;
+ message.regenerateTempMfaSecret = object.regenerateTempMfaSecret ?? false;
+ message.regenerateRecoveryCodes = object.regenerateRecoveryCodes ?? false;
return message;
},
};
@@ -605,7 +655,7 @@ function createBaseLoginRequest(): LoginRequest {
web: false,
idpName: "",
idpContext: undefined,
- mfaCode: undefined,
+ otpCode: undefined,
recoveryCode: undefined,
};
}
@@ -627,8 +677,8 @@ export const LoginRequest = {
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.otpCode !== undefined) {
+ writer.uint32(50).string(message.otpCode);
}
if (message.recoveryCode !== undefined) {
writer.uint32(58).string(message.recoveryCode);
@@ -659,7 +709,7 @@ export const LoginRequest = {
message.idpContext = IdentityProviderContext.decode(reader, reader.uint32());
break;
case 6:
- message.mfaCode = reader.string();
+ message.otpCode = reader.string();
break;
case 7:
message.recoveryCode = reader.string();
@@ -679,7 +729,7 @@ export const LoginRequest = {
web: isSet(object.web) ? Boolean(object.web) : false,
idpName: isSet(object.idpName) ? String(object.idpName) : "",
idpContext: isSet(object.idpContext) ? IdentityProviderContext.fromJSON(object.idpContext) : undefined,
- mfaCode: isSet(object.mfaCode) ? String(object.mfaCode) : undefined,
+ otpCode: isSet(object.otpCode) ? String(object.otpCode) : undefined,
recoveryCode: isSet(object.recoveryCode) ? String(object.recoveryCode) : undefined,
};
},
@@ -692,7 +742,7 @@ export const LoginRequest = {
message.idpName !== undefined && (obj.idpName = message.idpName);
message.idpContext !== undefined &&
(obj.idpContext = message.idpContext ? IdentityProviderContext.toJSON(message.idpContext) : undefined);
- message.mfaCode !== undefined && (obj.mfaCode = message.mfaCode);
+ message.otpCode !== undefined && (obj.otpCode = message.otpCode);
message.recoveryCode !== undefined && (obj.recoveryCode = message.recoveryCode);
return obj;
},
@@ -706,7 +756,7 @@ export const LoginRequest = {
message.idpContext = (object.idpContext !== undefined && object.idpContext !== null)
? IdentityProviderContext.fromPartial(object.idpContext)
: undefined;
- message.mfaCode = object.mfaCode ?? undefined;
+ message.otpCode = object.otpCode ?? undefined;
message.recoveryCode = object.recoveryCode ?? undefined;
return message;
},
@@ -952,7 +1002,19 @@ export const LogoutRequest = {
};
function createBaseUser(): User {
- return { name: "", state: 0, email: "", title: "", userType: 0, userRole: 0, password: "", serviceKey: "" };
+ return {
+ name: "",
+ state: 0,
+ email: "",
+ title: "",
+ userType: 0,
+ userRole: 0,
+ password: "",
+ serviceKey: "",
+ mfaEnabled: false,
+ mfaSecret: "",
+ recoveryCodes: [],
+ };
}
export const User = {
@@ -981,6 +1043,15 @@ export const User = {
if (message.serviceKey !== "") {
writer.uint32(66).string(message.serviceKey);
}
+ if (message.mfaEnabled === true) {
+ writer.uint32(72).bool(message.mfaEnabled);
+ }
+ if (message.mfaSecret !== "") {
+ writer.uint32(82).string(message.mfaSecret);
+ }
+ for (const v of message.recoveryCodes) {
+ writer.uint32(90).string(v!);
+ }
return writer;
},
@@ -1015,6 +1086,15 @@ export const User = {
case 8:
message.serviceKey = reader.string();
break;
+ case 9:
+ message.mfaEnabled = reader.bool();
+ break;
+ case 10:
+ message.mfaSecret = reader.string();
+ break;
+ case 11:
+ message.recoveryCodes.push(reader.string());
+ break;
default:
reader.skipType(tag & 7);
break;
@@ -1033,6 +1113,9 @@ export const User = {
userRole: isSet(object.userRole) ? userRoleFromJSON(object.userRole) : 0,
password: isSet(object.password) ? String(object.password) : "",
serviceKey: isSet(object.serviceKey) ? String(object.serviceKey) : "",
+ mfaEnabled: isSet(object.mfaEnabled) ? Boolean(object.mfaEnabled) : false,
+ mfaSecret: isSet(object.mfaSecret) ? String(object.mfaSecret) : "",
+ recoveryCodes: Array.isArray(object?.recoveryCodes) ? object.recoveryCodes.map((e: any) => String(e)) : [],
};
},
@@ -1046,6 +1129,13 @@ export const User = {
message.userRole !== undefined && (obj.userRole = userRoleToJSON(message.userRole));
message.password !== undefined && (obj.password = message.password);
message.serviceKey !== undefined && (obj.serviceKey = message.serviceKey);
+ message.mfaEnabled !== undefined && (obj.mfaEnabled = message.mfaEnabled);
+ message.mfaSecret !== undefined && (obj.mfaSecret = message.mfaSecret);
+ if (message.recoveryCodes) {
+ obj.recoveryCodes = message.recoveryCodes.map((e) => e);
+ } else {
+ obj.recoveryCodes = [];
+ }
return obj;
},
@@ -1059,6 +1149,9 @@ export const User = {
message.userRole = object.userRole ?? 0;
message.password = object.password ?? "";
message.serviceKey = object.serviceKey ?? "";
+ message.mfaEnabled = object.mfaEnabled ?? false;
+ message.mfaSecret = object.mfaSecret ?? "";
+ message.recoveryCodes = object.recoveryCodes?.map((e) => e) || [];
return message;
},
};
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index 51da2ebcab..bb18bb8ba8 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -438,7 +438,9 @@ MFAConfig is the MFA configuration for a user.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| otp_secret | [string](#string) | | The otp_secret is the secret key used to validate the OTP code. |
+| temp_otp_secret | [string](#string) | | The temp_otp_secret is the temporary secret key used to validate the OTP code and will replace the otp_secret in two phase commits. |
| recovery_codes | [string](#string) | repeated | The recovery_codes are the codes that can be used to recover the account. |
+| temp_recovery_codes | [string](#string) | repeated | The temp_recovery_codes are the temporary codes that will replace the recovery_codes in two phase commits. |
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index f03c3aa5ca..d0d3283d17 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -700,7 +700,7 @@ When paginating, all other parameters provided to `ListUsers` must match the cal
| 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} |
| 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. |
+| otp_code | [string](#string) | optional | The otp_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. |
@@ -785,6 +785,9 @@ When paginating, all other parameters provided to `ListUsers` must match the cal
The user&#39;s `name` field is used to identify the user to update. Format: users/{user} |
| update_mask | [google.protobuf.FieldMask](#google-protobuf-FieldMask) | | The list of fields to update. |
+| otp_code | [string](#string) | optional | The otp_code is used to verify the user&#39;s identity by MFA. |
+| regenerate_temp_mfa_secret | [bool](#bool) | | The regenerate_temp_mfa_secret flag means to regenerate tempary MFA secret for user. This is used for MFA setup. The tempary MFA secret and recovery codes will be returned in the response. |
+| regenerate_recovery_codes | [bool](#bool) | | The regenerate_recovery_codes flag means to regenerate recovery codes for user. |
@@ -807,6 +810,9 @@ The user&#39;s `name` field is used to identify the user to update. Format: user
| user_role | [UserRole](#bytebase-v1-UserRole) | | The user role will not be respected in the create user request, because the role is controlled by workspace owner. |
| password | [string](#string) | | |
| service_key | [string](#string) | | |
+| mfa_enabled | [bool](#bool) | | The mfa_enabled flag means if the user has enabled MFA. |
+| mfa_secret | [string](#string) | | The mfa_secret is the tempary secret using in two phase verification. |
+| recovery_codes | [string](#string) | repeated | The recovery_codes is the tempary recovery codes using in two phase verification. |
diff --git a/proto/generated-go/store/user.pb.go b/proto/generated-go/store/user.pb.go
index 736e6a4868..88ede2cf2c 100644
--- a/proto/generated-go/store/user.pb.go
+++ b/proto/generated-go/store/user.pb.go
@@ -28,8 +28,12 @@ type MFAConfig struct {
// The otp_secret is the secret key used to validate the OTP code.
OtpSecret string `protobuf:"bytes,1,opt,name=otp_secret,json=otpSecret,proto3" json:"otp_secret,omitempty"`
+ // The temp_otp_secret is the temporary secret key used to validate the OTP code and will replace the otp_secret in two phase commits.
+ TempOtpSecret string `protobuf:"bytes,2,opt,name=temp_otp_secret,json=tempOtpSecret,proto3" json:"temp_otp_secret,omitempty"`
// The recovery_codes are the codes that can be used to recover the account.
- RecoveryCodes []string `protobuf:"bytes,2,rep,name=recovery_codes,json=recoveryCodes,proto3" json:"recovery_codes,omitempty"`
+ RecoveryCodes []string `protobuf:"bytes,3,rep,name=recovery_codes,json=recoveryCodes,proto3" json:"recovery_codes,omitempty"`
+ // The temp_recovery_codes are the temporary codes that will replace the recovery_codes in two phase commits.
+ TempRecoveryCodes []string `protobuf:"bytes,4,rep,name=temp_recovery_codes,json=tempRecoveryCodes,proto3" json:"temp_recovery_codes,omitempty"`
}
func (x *MFAConfig) Reset() {
@@ -71,6 +75,13 @@ func (x *MFAConfig) GetOtpSecret() string {
return ""
}
+func (x *MFAConfig) GetTempOtpSecret() string {
+ if x != nil {
+ return x.TempOtpSecret
+ }
+ return ""
+}
+
func (x *MFAConfig) GetRecoveryCodes() []string {
if x != nil {
return x.RecoveryCodes
@@ -78,19 +89,31 @@ func (x *MFAConfig) GetRecoveryCodes() []string {
return nil
}
+func (x *MFAConfig) GetTempRecoveryCodes() []string {
+ if x != nil {
+ return x.TempRecoveryCodes
+ }
+ return nil
+}
+
var File_store_user_proto protoreflect.FileDescriptor
var file_store_user_proto_rawDesc = []byte{
0x0a, 0x10, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x12, 0x0e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f,
- 0x72, 0x65, 0x22, 0x51, 0x0a, 0x09, 0x4d, 0x46, 0x41, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x12,
- 0x1d, 0x0a, 0x0a, 0x6f, 0x74, 0x70, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x74, 0x70, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x25,
- 0x0a, 0x0e, 0x72, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x73,
- 0x18, 0x02, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79,
- 0x43, 0x6f, 0x64, 0x65, 0x73, 0x42, 0x14, 0x5a, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
- 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x33,
+ 0x72, 0x65, 0x22, 0xa9, 0x01, 0x0a, 0x09, 0x4d, 0x46, 0x41, 0x43, 0x6f, 0x6e, 0x66, 0x69, 0x67,
+ 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x74, 0x70, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18, 0x01,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x74, 0x70, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12,
+ 0x26, 0x0a, 0x0f, 0x74, 0x65, 0x6d, 0x70, 0x5f, 0x6f, 0x74, 0x70, 0x5f, 0x73, 0x65, 0x63, 0x72,
+ 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x65, 0x6d, 0x70, 0x4f, 0x74,
+ 0x70, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x63, 0x6f, 0x76,
+ 0x65, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52,
+ 0x0d, 0x72, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x2e,
+ 0x0a, 0x13, 0x74, 0x65, 0x6d, 0x70, 0x5f, 0x72, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x5f,
+ 0x63, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x11, 0x74, 0x65, 0x6d,
+ 0x70, 0x52, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x42, 0x14,
+ 0x5a, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x73,
+ 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
diff --git a/proto/generated-go/v1/auth_service.pb.go b/proto/generated-go/v1/auth_service.pb.go
index 7c1bc0d4a6..ccbd5adbd7 100644
--- a/proto/generated-go/v1/auth_service.pb.go
+++ b/proto/generated-go/v1/auth_service.pb.go
@@ -368,6 +368,13 @@ type UpdateUserRequest struct {
User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
// The list of fields to update.
UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`
+ // The otp_code is used to verify the user's identity by MFA.
+ OtpCode *string `protobuf:"bytes,3,opt,name=otp_code,json=otpCode,proto3,oneof" json:"otp_code,omitempty"`
+ // The regenerate_temp_mfa_secret flag means to regenerate tempary MFA secret for user.
+ // This is used for MFA setup. The tempary MFA secret and recovery codes will be returned in the response.
+ RegenerateTempMfaSecret bool `protobuf:"varint,4,opt,name=regenerate_temp_mfa_secret,json=regenerateTempMfaSecret,proto3" json:"regenerate_temp_mfa_secret,omitempty"`
+ // The regenerate_recovery_codes flag means to regenerate recovery codes for user.
+ RegenerateRecoveryCodes bool `protobuf:"varint,5,opt,name=regenerate_recovery_codes,json=regenerateRecoveryCodes,proto3" json:"regenerate_recovery_codes,omitempty"`
}
func (x *UpdateUserRequest) Reset() {
@@ -416,6 +423,27 @@ func (x *UpdateUserRequest) GetUpdateMask() *fieldmaskpb.FieldMask {
return nil
}
+func (x *UpdateUserRequest) GetOtpCode() string {
+ if x != nil && x.OtpCode != nil {
+ return *x.OtpCode
+ }
+ return ""
+}
+
+func (x *UpdateUserRequest) GetRegenerateTempMfaSecret() bool {
+ if x != nil {
+ return x.RegenerateTempMfaSecret
+ }
+ return false
+}
+
+func (x *UpdateUserRequest) GetRegenerateRecoveryCodes() bool {
+ if x != nil {
+ return x.RegenerateRecoveryCodes
+ }
+ return false
+}
+
type DeleteUserRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -528,8 +556,8 @@ type LoginRequest struct {
IdpName string `protobuf:"bytes,4,opt,name=idp_name,json=idpName,proto3" json:"idp_name,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 otp_code is used to verify the user's identity by MFA.
+ OtpCode *string `protobuf:"bytes,6,opt,name=otp_code,json=otpCode,proto3,oneof" json:"otp_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"`
}
@@ -601,9 +629,9 @@ func (x *LoginRequest) GetIdpContext() *IdentityProviderContext {
return nil
}
-func (x *LoginRequest) GetMfaCode() string {
- if x != nil && x.MfaCode != nil {
- return *x.MfaCode
+func (x *LoginRequest) GetOtpCode() string {
+ if x != nil && x.OtpCode != nil {
+ return *x.OtpCode
}
return ""
}
@@ -882,6 +910,12 @@ type User struct {
UserRole UserRole `protobuf:"varint,6,opt,name=user_role,json=userRole,proto3,enum=bytebase.v1.UserRole" json:"user_role,omitempty"`
Password string `protobuf:"bytes,7,opt,name=password,proto3" json:"password,omitempty"`
ServiceKey string `protobuf:"bytes,8,opt,name=service_key,json=serviceKey,proto3" json:"service_key,omitempty"`
+ // The mfa_enabled flag means if the user has enabled MFA.
+ MfaEnabled bool `protobuf:"varint,9,opt,name=mfa_enabled,json=mfaEnabled,proto3" json:"mfa_enabled,omitempty"`
+ // The mfa_secret is the tempary secret using in two phase verification.
+ MfaSecret string `protobuf:"bytes,10,opt,name=mfa_secret,json=mfaSecret,proto3" json:"mfa_secret,omitempty"`
+ // The recovery_codes is the tempary recovery codes using in two phase verification.
+ RecoveryCodes []string `protobuf:"bytes,11,rep,name=recovery_codes,json=recoveryCodes,proto3" json:"recovery_codes,omitempty"`
}
func (x *User) Reset() {
@@ -972,6 +1006,27 @@ func (x *User) GetServiceKey() string {
return ""
}
+func (x *User) GetMfaEnabled() bool {
+ if x != nil {
+ return x.MfaEnabled
+ }
+ return false
+}
+
+func (x *User) GetMfaSecret() string {
+ if x != nil {
+ return x.MfaSecret
+ }
+ return ""
+}
+
+func (x *User) GetRecoveryCodes() []string {
+ if x != nil {
+ return x.RecoveryCodes
+ }
+ return nil
+}
+
var File_v1_auth_service_proto protoreflect.FileDescriptor
var file_v1_auth_service_proto_rawDesc = []byte{
@@ -1010,143 +1065,159 @@ var file_v1_auth_service_proto_rawDesc = []byte{
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x04, 0x75,
- 0x73, 0x65, 0x72, 0x22, 0x7d, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65,
- 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72,
- 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52,
- 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f,
- 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f,
- 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65,
- 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61,
- 0x73, 0x6b, 0x22, 0x2d, 0x0a, 0x11, 0x44, 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, 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, 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, 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, 0x4d, 0x0a, 0x0c, 0x6f, 0x69, 0x64,
- 0x63, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
- 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, 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,
- 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,
+ 0x73, 0x65, 0x72, 0x22, 0xa3, 0x02, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73,
+ 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x75, 0x73, 0x65,
+ 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02,
+ 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65,
+ 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f,
+ 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69,
+ 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d,
+ 0x61, 0x73, 0x6b, 0x12, 0x1e, 0x0a, 0x08, 0x6f, 0x74, 0x70, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18,
+ 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x07, 0x6f, 0x74, 0x70, 0x43, 0x6f, 0x64, 0x65,
+ 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x1a, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74,
+ 0x65, 0x5f, 0x74, 0x65, 0x6d, 0x70, 0x5f, 0x6d, 0x66, 0x61, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65,
+ 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x65, 0x72,
+ 0x61, 0x74, 0x65, 0x54, 0x65, 0x6d, 0x70, 0x4d, 0x66, 0x61, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74,
+ 0x12, 0x3a, 0x0a, 0x19, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x72,
+ 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x73, 0x18, 0x05, 0x20,
+ 0x01, 0x28, 0x08, 0x52, 0x17, 0x72, 0x65, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x52,
+ 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x73, 0x42, 0x0b, 0x0a, 0x09,
+ 0x5f, 0x6f, 0x74, 0x70, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x22, 0x2d, 0x0a, 0x11, 0x44, 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, 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, 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,
+ 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, 0x6f, 0x74, 0x70, 0x5f, 0x63, 0x6f,
+ 0x64, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x07, 0x6f, 0x74, 0x70, 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, 0x6f, 0x74, 0x70, 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, 0x4d, 0x0a, 0x0c, 0x6f, 0x69, 0x64, 0x63, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74,
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 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,
+ 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, 0x8e, 0x03, 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,
+ 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x66, 0x61, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18,
+ 0x09, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x6d, 0x66, 0x61, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65,
+ 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x66, 0x61, 0x5f, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x18,
+ 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x66, 0x61, 0x53, 0x65, 0x63, 0x72, 0x65, 0x74,
+ 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x63, 0x6f, 0x76, 0x65, 0x72, 0x79, 0x5f, 0x63, 0x6f, 0x64,
+ 0x65, 0x73, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x63, 0x6f, 0x76, 0x65,
+ 0x72, 0x79, 0x43, 0x6f, 0x64, 0x65, 0x73, 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,
}
var (
@@ -1394,6 +1465,7 @@ func file_v1_auth_service_proto_init() {
}
}
}
+ file_v1_auth_service_proto_msgTypes[4].OneofWrappers = []interface{}{}
file_v1_auth_service_proto_msgTypes[7].OneofWrappers = []interface{}{}
file_v1_auth_service_proto_msgTypes[8].OneofWrappers = []interface{}{
(*IdentityProviderContext_Oauth2Context)(nil),
diff --git a/proto/store/user.proto b/proto/store/user.proto
index f7a6a1462d..163d85d4f5 100644
--- a/proto/store/user.proto
+++ b/proto/store/user.proto
@@ -9,6 +9,12 @@ message MFAConfig {
// The otp_secret is the secret key used to validate the OTP code.
string otp_secret = 1;
+ // The temp_otp_secret is the temporary secret key used to validate the OTP code and will replace the otp_secret in two phase commits.
+ string temp_otp_secret = 2;
+
// The recovery_codes are the codes that can be used to recover the account.
- repeated string recovery_codes = 2;
+ repeated string recovery_codes = 3;
+
+ // The temp_recovery_codes are the temporary codes that will replace the recovery_codes in two phase commits.
+ repeated string temp_recovery_codes = 4;
}
diff --git a/proto/v1/auth_service.proto b/proto/v1/auth_service.proto
index a5a2616fd3..07867d3aa8 100644
--- a/proto/v1/auth_service.proto
+++ b/proto/v1/auth_service.proto
@@ -121,6 +121,16 @@ message UpdateUserRequest {
// The list of fields to update.
google.protobuf.FieldMask update_mask = 2;
+
+ // The otp_code is used to verify the user's identity by MFA.
+ optional string otp_code = 3;
+
+ // The regenerate_temp_mfa_secret flag means to regenerate tempary MFA secret for user.
+ // This is used for MFA setup. The tempary MFA secret and recovery codes will be returned in the response.
+ bool regenerate_temp_mfa_secret = 4;
+
+ // The regenerate_recovery_codes flag means to regenerate recovery codes for user.
+ bool regenerate_recovery_codes = 5;
}
message DeleteUserRequest {
@@ -150,8 +160,8 @@ message LoginRequest {
// 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 otp_code is used to verify the user's identity by MFA.
+ optional string otp_code = 6;
// The recovery_code is used to recovery the user's identity with MFA.
optional string recovery_code = 7;
@@ -197,6 +207,15 @@ message User {
string password = 7 [(google.api.field_behavior) = INPUT_ONLY];
string service_key = 8 [(google.api.field_behavior) = INPUT_ONLY];
+
+ // The mfa_enabled flag means if the user has enabled MFA.
+ bool mfa_enabled = 9;
+
+ // The mfa_secret is the tempary secret using in two phase verification.
+ string mfa_secret = 10;
+
+ // The recovery_codes is the tempary recovery codes using in two phase verification.
+ repeated string recovery_codes = 11;
}
enum UserType {