Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore: migrate vcs exchange token to v1 (#6648)
ecmadao997702ee2140
diff --git a/backend/api/v1/externalvs_service.go b/backend/api/v1/externalvs_service.goindex 14fdcefed1..960074305d 100644--- a/backend/api/v1/externalvs_service.go+++ b/backend/api/v1/externalvs_service.go@@ -4,10 +4,12 @@ import ("context""fmt""strings"+ "time""google.golang.org/grpc/codes""google.golang.org/grpc/status""google.golang.org/protobuf/types/known/emptypb"+ "google.golang.org/protobuf/types/known/timestamppb""github.com/pkg/errors"@@ -30,20 +32,12 @@ func NewExternalVersionControlService(store *store.Store) *ExternalVersionContro// GetExternalVersionControl get a single external version control.func (s *ExternalVersionControlService) GetExternalVersionControl(ctx context.Context, request *v1pb.GetExternalVersionControlRequest) (*v1pb.ExternalVersionControl, error) {- externalVersionControlUID, err := getExternalVersionControlID(request.Name)+ vcs, err := s.getVCS(ctx, request.Name)if err != nil {- return nil, status.Errorf(codes.InvalidArgument, err.Error())- }-- externalVersionControl, err := s.store.GetExternalVersionControlV2(ctx, externalVersionControlUID)- if err != nil {- return nil, status.Errorf(codes.Internal, "Failed to retrieve external version control: %v", err)- }- if externalVersionControl == nil {- return nil, status.Errorf(codes.NotFound, "External version control not found: %v", err)+ return nil, err}- return convertToExternalVersionControl(externalVersionControl), nil+ return convertToExternalVersionControl(vcs), nil}// ListExternalVersionControls lists external version controls.@@ -202,6 +196,103 @@ func (s *ExternalVersionControlService) ListProjectGitOpsInfo(ctx context.Contexreturn resp, nil}+// ExchangeToken exchanges the OAuth token for VCS.+func (s *ExternalVersionControlService) ExchangeToken(ctx context.Context, request *v1pb.ExchangeTokenRequest) (*v1pb.OAuthToken, error) {+ var vcsType vcs.Type+ var instanceURL string+ var oauthExchange *common.OAuthExchange++ if request.ExchangeToken.Name == fmt.Sprintf("%s-", externalVersionControlPrefix) {+ tp, err := convertExternalVersionControlTypeToVCSType(request.ExchangeToken.Type)+ if err != nil {+ return nil, status.Errorf(codes.Internal, err.Error())+ }+ vcsType = tp+ if vcsType != vcs.GitLab && vcsType != vcs.GitHub && vcsType != vcs.Bitbucket {+ return nil, status.Errorf(codes.InvalidArgument, "unsupport vcs type %v", request.ExchangeToken.Type)+ }++ instanceURL = request.ExchangeToken.InstanceUrl+ oauthExchange = &common.OAuthExchange{+ ClientID: request.ExchangeToken.ClientId,+ ClientSecret: request.ExchangeToken.ClientSecret,+ Code: request.ExchangeToken.Code,+ }++ if instanceURL == "" {+ return nil, status.Errorf(codes.InvalidArgument, "instance url is required")+ }+ if oauthExchange.ClientID == "" || oauthExchange.ClientSecret == "" || oauthExchange.Code == "" {+ return nil, status.Errorf(codes.InvalidArgument, "client_id, client_secret and code is required")+ }+ } else {+ externalVersionControl, err := s.getVCS(ctx, request.ExchangeToken.Name)+ if err != nil {+ return nil, err+ }++ vcsType = externalVersionControl.Type+ instanceURL = externalVersionControl.InstanceURL+ clientID := request.ExchangeToken.ClientId+ clientSecret := request.ExchangeToken.ClientSecret+ // Since we may not pass in ClientID and ClientSecret in the request, we will use the client ID and secret from VCS store even if it's stale.+ // If it's stale, we should return better error messages and ask users to update the VCS secrets.+ // https://sourcegraph.com/github.com/bytebase/bytebase/-/blob/frontend/src/components/RepositorySelectionPanel.vue?L77:8&subtree=true+ // https://github.com/bytebase/bytebase/issues/1372+ if clientID == "" || clientSecret == "" {+ clientID = externalVersionControl.ApplicationID+ clientSecret = externalVersionControl.Secret+ }+ oauthExchange = &common.OAuthExchange{+ ClientID: clientID,+ ClientSecret: clientSecret,+ Code: request.ExchangeToken.Code,+ }+ }++ setting, err := s.store.GetWorkspaceGeneralSetting(ctx)+ if err != nil {+ return nil, status.Errorf(codes.Internal, "failed to find workspace setting with error: %v", err.Error())+ }+ if setting.ExternalUrl == "" {+ return nil, status.Errorf(codes.InvalidArgument, "external url is required")+ }++ oauthExchange.RedirectURL = fmt.Sprintf("%s/oauth/callback", setting.ExternalUrl)+ oauthToken, err := vcs.Get(vcsType, vcs.ProviderConfig{}).+ ExchangeOAuthToken(+ ctx,+ instanceURL,+ oauthExchange,+ )+ if err != nil {+ return nil, status.Errorf(codes.Internal, "failed to exchange OAuth token with error: %v. Make sure %q matches your browser host. Note that if you are not using port 80 or 443, you should also specify the port such as --external-url=http://host:port", err.Error(), setting.ExternalUrl)+ }++ return &v1pb.OAuthToken{+ AccessToken: oauthToken.AccessToken,+ RefreshToken: oauthToken.RefreshToken,+ ExpiresTime: timestamppb.New(time.Unix(oauthToken.ExpiresTs, 0)),+ }, nil+}++func (s *ExternalVersionControlService) getVCS(ctx context.Context, name string) (*store.ExternalVersionControlMessage, error) {+ externalVersionControlUID, err := getExternalVersionControlID(name)+ if err != nil {+ return nil, status.Errorf(codes.InvalidArgument, err.Error())+ }++ externalVersionControl, err := s.store.GetExternalVersionControlV2(ctx, externalVersionControlUID)+ if err != nil {+ return nil, status.Errorf(codes.Internal, "Failed to retrieve external version control: %v", err)+ }+ if externalVersionControl == nil {+ return nil, status.Errorf(codes.NotFound, "External version control not found: %v", err)+ }++ return externalVersionControl, nil+}+func convertToExternalVersionControls(externalVersionControls []*store.ExternalVersionControlMessage) []*v1pb.ExternalVersionControl {var res []*v1pb.ExternalVersionControlfor _, externalVersionControl := range externalVersionControls {diff --git a/backend/server/oauth.go b/backend/server/oauth.godeleted file mode 100644index 4462512dac..0000000000--- a/backend/server/oauth.go+++ /dev/null@@ -1,100 +0,0 @@-package server--import (- "fmt"- "net/http"-- "github.com/google/jsonapi"- "github.com/labstack/echo/v4"-- "github.com/bytebase/bytebase/backend/common"- api "github.com/bytebase/bytebase/backend/legacyapi"- vcsPlugin "github.com/bytebase/bytebase/backend/plugin/vcs"-)--func (s *Server) registerOAuthRoutes(g *echo.Group) {- // This is a generic endpoint of exchanging access token for VCS providers. It- // requires either the "vcsId", "clientId", "clientSecret" to infer the other details- // from an existing VCS provider or "vcsType", "instanceURL", "clientId" and "clientSecret"- // to directly compose the request to the VCS host.- g.POST("/oauth/vcs/exchange-token", func(c echo.Context) error {- req := &api.VCSExchangeToken{}- if err := jsonapi.UnmarshalPayload(c.Request().Body, req); err != nil {- return echo.NewHTTPError(http.StatusBadRequest, "Malformed VCS exchange token request").SetInternal(err)- }-- var vcsType vcsPlugin.Type- var instanceURL string- var oauthExchange *common.OAuthExchange- if req.ID > 0 {- vcs, err := s.store.GetExternalVersionControlV2(c.Request().Context(), req.ID)- if err != nil {- return echo.NewHTTPError(http.StatusInternalServerError, err)- }- if vcs == nil {- return echo.NewHTTPError(http.StatusNotFound, fmt.Sprintf("Failed to find VCS, ID: %v", req.ID))- }-- vcsType = vcs.Type- instanceURL = vcs.InstanceURL- clientID := req.ClientID- clientSecret := req.ClientSecret- // Since we may not pass in ClientID and ClientSecret in the request, we will use the client ID and secret from VCS store even if it's stale.- // If it's stale, we should return better error messages and ask users to update the VCS secrets.- // https://sourcegraph.com/github.com/bytebase/bytebase/-/blob/frontend/src/components/RepositorySelectionPanel.vue?L77:8&subtree=true- // https://github.com/bytebase/bytebase/issues/1372- if clientID == "" || clientSecret == "" {- clientID = vcs.ApplicationID- clientSecret = vcs.Secret- }- oauthExchange = &common.OAuthExchange{- ClientID: clientID,- ClientSecret: clientSecret,- Code: req.Code,- }- } else {- vcsType = req.Type- if vcsType != vcsPlugin.GitLab && vcsType != vcsPlugin.GitHub && vcsType != vcsPlugin.Bitbucket {- return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Unexpected VCS type: %s", vcsType))- }-- instanceURL = req.InstanceURL- oauthExchange = &common.OAuthExchange{- ClientID: req.ClientID,- ClientSecret: req.ClientSecret,- Code: req.Code,- }- }-- ctx := c.Request().Context()- setting, err := s.store.GetWorkspaceGeneralSetting(ctx)- if err != nil {- return echo.NewHTTPError(http.StatusInternalServerError, "Failed to find workspace setting").SetInternal(err)- }-- oauthExchange.RedirectURL = fmt.Sprintf("%s/oauth/callback", setting.ExternalUrl)- oauthToken, err := vcsPlugin.Get(vcsType, vcsPlugin.ProviderConfig{}).- ExchangeOAuthToken(- c.Request().Context(),- instanceURL,- oauthExchange,- )- if err != nil {- return echo.NewHTTPError(- http.StatusInternalServerError,- fmt.Sprintf("Failed to exchange OAuth token. Make sure %q matches your browser host. Note that if you are not using port 80 or 443, you should also specify the port such as --external-url=http://host:port", setting.ExternalUrl),- ).SetInternal(err)- }-- resp := &api.OAuthToken{- AccessToken: oauthToken.AccessToken,- RefreshToken: oauthToken.RefreshToken,- ExpiresTs: oauthToken.ExpiresTs,- }- c.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSONCharsetUTF8)- if err := jsonapi.MarshalPayload(c.Response().Writer, resp); err != nil {- return echo.NewHTTPError(http.StatusInternalServerError, "Failed to marshal oauth token response").SetInternal(err)- }- return nil- })-}diff --git a/backend/server/server.go b/backend/server/server.goindex 91678d582c..1afc5db4b6 100644--- a/backend/server/server.go+++ b/backend/server/server.go@@ -510,7 +510,6 @@ func NewServer(ctx context.Context, profile config.Profile) (*Server, error) {apiGroup.Use(func(next echo.HandlerFunc) echo.HandlerFunc {return aclMiddleware(s, internalAPIPrefix, ce, next, profile.Readonly)})- s.registerOAuthRoutes(apiGroup)s.registerDatabaseRoutes(apiGroup)s.registerIssueRoutes(apiGroup)s.registerIssueSubscriberRoutes(apiGroup)diff --git a/frontend/src/components/RepositorySelectionPanel.vue b/frontend/src/components/RepositorySelectionPanel.vueindex ba856f0262..94a8aac476 100644--- a/frontend/src/components/RepositorySelectionPanel.vue+++ b/frontend/src/components/RepositorySelectionPanel.vue@@ -41,17 +41,13 @@ export default { name: "RepositorySelectionPanel" };<script setup lang="ts">import { reactive, computed, onMounted } from "vue";+import { ExternalRepositoryInfo, ProjectRepositoryConfig } from "../types";+import { useVCSV1Store } from "@/store";import {- ExternalRepositoryInfo,OAuthToken,- ProjectRepositoryConfig,-} from "../types";-import { useOAuthStore, useVCSV1Store } from "@/store";-import {ExternalVersionControl_Type,SearchExternalVersionControlProjectsResponse_Project,} from "@/types/proto/v1/externalvs_service";-import { getVCSUid } from "@/store/modules/v1/common";interface LocalState {repositoryList: SearchExternalVersionControlProjectsResponse_Project[];@@ -77,9 +73,9 @@ onMounted(() => {});const prepareRepositoryList = () => {- useOAuthStore()- .exchangeVCSTokenWithID({- vcsId: getVCSUid(props.config.vcs.name),+ vcsV1Store+ .exchangeToken({+ vcsName: props.config.vcs.name,code: props.config.code,}).then((token: OAuthToken) => {diff --git a/frontend/src/components/RepositorySetupWizard.vue b/frontend/src/components/RepositorySetupWizard.vueindex 1b286d9f58..1df6f71921 100644--- a/frontend/src/components/RepositorySetupWizard.vue+++ b/frontend/src/components/RepositorySetupWizard.vue@@ -134,11 +134,7 @@ import { useRouter } from "vue-router";import isEmpty from "lodash-es/isEmpty";import { cloneDeep } from "lodash-es";import { BBStepTabItem } from "../bbkit/types";-import {- ExternalRepositoryInfo,- OAuthToken,- ProjectRepositoryConfig,-} from "../types";+import { ExternalRepositoryInfo, ProjectRepositoryConfig } from "../types";import { projectSlugV1 } from "../utils";import { useI18n } from "vue-i18n";import { useRepositoryV1Store, hasFeature, useProjectV1Store } from "@/store";@@ -149,6 +145,7 @@ import {SchemaChange,} from "@/types/proto/v1/project_service";import {+ OAuthToken,ProjectGitOpsInfo,ExternalVersionControl,ExternalVersionControl_Type,@@ -223,7 +220,6 @@ const state = reactive<LocalState>({code: "",token: {accessToken: "",- expiresTs: 0,refreshToken: "",},repositoryInfo: {@@ -332,7 +328,7 @@ const tryFinishSetup = async (allowFinishCallback: () => void) => {sheetPathTemplate: state.config.repositoryConfig.sheetPathTemplate,externalId: externalId,accessToken: state.config.token.accessToken,- expiresTime: new Date(state.config.token.expiresTs * 1000),+ expiresTime: state.config.token.expiresTime,refreshToken: state.config.token.refreshToken,enableSqlReviewCi: false,};diff --git a/frontend/src/components/VCSSetupWizard.vue b/frontend/src/components/VCSSetupWizard.vueindex 9b517ecf8a..15bc364cd5 100644--- a/frontend/src/components/VCSSetupWizard.vue+++ b/frontend/src/components/VCSSetupWizard.vue@@ -38,12 +38,12 @@ import {VCSConfig,openWindowForOAuth,OAuthWindowEventPayload,- OAuthToken,} from "../types";import { isUrl } from "../utils";import { useI18n } from "vue-i18n";-import { pushNotification, useOAuthStore, useVCSV1Store } from "@/store";+import { pushNotification, useVCSV1Store } from "@/store";import {+ OAuthToken,ExternalVersionControl,ExternalVersionControl_Type,} from "@/types/proto/v1/externalvs_service";@@ -96,8 +96,8 @@ const eventListener = (event: Event) => {state.config.type === ExternalVersionControl_Type.GITHUB ||state.config.type === ExternalVersionControl_Type.BITBUCKET) {- useOAuthStore()- .exchangeVCSToken({+ vcsV1Store+ .exchangeToken({vcsType: state.config.type,instanceUrl: state.config.instanceUrl,clientId: state.config.applicationId,diff --git a/frontend/src/store/modules/index.ts b/frontend/src/store/modules/index.tsindex cdd1b7d447..d6d6dd08ea 100644--- a/frontend/src/store/modules/index.ts+++ b/frontend/src/store/modules/index.ts@@ -10,7 +10,6 @@ export * from "./issue";export * from "./issueSubscriber";export * from "./instance";export * from "./notification";-export * from "./oauth";export * from "./pipeline";export * from "./slowQueryPolicy";export * from "./principal";diff --git a/frontend/src/store/modules/oauth.ts b/frontend/src/store/modules/oauth.tsdeleted file mode 100644index 73e8c5e602..0000000000--- a/frontend/src/store/modules/oauth.ts+++ /dev/null@@ -1,85 +0,0 @@-import { defineStore } from "pinia";-import axios from "axios";-import { VCSId, OAuthToken, ResourceObject } from "@/types";-import {- ExternalVersionControl_Type,- externalVersionControl_TypeToJSON,-} from "@/types/proto/v1/externalvs_service";--const convert = (raw: ResourceObject): OAuthToken => {- const attr = raw.attributes;- return {- accessToken: attr.accessToken as string,- refreshToken: attr.refreshToken as string,- expiresTs: attr.expiresTs as number,- };-};--export const useOAuthStore = defineStore("oauth", {- actions: {- // exchangeVCSTokenWithID uses "vcsId" to let the backend infer the details from an existing VCS provider.- async exchangeVCSTokenWithID({- code,- vcsId,- clientId,- clientSecret,- }: {- code: string;- vcsId: VCSId;- clientId?: string;- clientSecret?: string;- }): Promise<OAuthToken> {- const data = (- await axios.post(`/api/oauth/vcs/exchange-token`, {- data: {- type: "exchangeToken",- attributes: {- code,- vcsId,- clientId,- clientSecret,- },- },- })- ).data.data;-- const token = convert(data);- return token;- },-- // exchangeVCSToken passes client details to the backend to allow the backend directly- // compose the request to the VCS host. This should only be used in the initial VCS set up.- async exchangeVCSToken({- vcsType,- instanceUrl,- clientId,- clientSecret,- code,- }: {- vcsType: ExternalVersionControl_Type;- instanceUrl: string;- clientId: string;- clientSecret: string;- code: string;- }): Promise<OAuthToken> {- const data = (- await axios.post(`/api/oauth/vcs/exchange-token`, {- data: {- type: "exchangeToken",- attributes: {- // TODO(ed): change vcs type- vcsType: externalVersionControl_TypeToJSON(vcsType),- instanceUrl,- clientId,- clientSecret,- code,- },- },- })- ).data.data;-- const token = convert(data);- return token;- },- },-});diff --git a/frontend/src/store/modules/v1/vcs.ts b/frontend/src/store/modules/v1/vcs.tsindex d35b3486d7..bdf08c0bd0 100644--- a/frontend/src/store/modules/v1/vcs.ts+++ b/frontend/src/store/modules/v1/vcs.ts@@ -2,7 +2,10 @@ import { defineStore } from "pinia";import { reactive } from "vue";import { isEqual, isUndefined } from "lodash-es";import { externalVersionControlServiceClient } from "@/grpcweb";-import { ExternalVersionControl } from "@/types/proto/v1/externalvs_service";+import {+ ExternalVersionControl,+ ExternalVersionControl_Type,+} from "@/types/proto/v1/externalvs_service";import { externalVersionControlPrefix } from "./common";import { VCSId } from "@/types";@@ -90,6 +93,35 @@ export const useVCSV1Store = defineStore("vcs_v1", () => {return resp;};+ const exchangeToken = async ({+ vcsName,+ vcsType,+ instanceUrl,+ clientId,+ clientSecret,+ code,+ }: {+ vcsName?: string;+ vcsType?: ExternalVersionControl_Type;+ instanceUrl?: string;+ clientId?: string;+ clientSecret?: string;+ code: string;+ }) => {+ const oauthToken = await externalVersionControlServiceClient.exchangeToken({+ exchangeToken: {+ name: vcsName ?? `${externalVersionControlPrefix}-`,+ code,+ type: vcsType,+ instanceUrl,+ clientId,+ clientSecret,+ },+ });++ return oauthToken;+ };+return {listVCSExternalProjects,getVCSByUid,@@ -100,6 +132,7 @@ export const useVCSV1Store = defineStore("vcs_v1", () => {deleteVCS,createVCS,updateVCS,+ exchangeToken,};});diff --git a/frontend/src/types/oauth.ts b/frontend/src/types/oauth.tsindex 5a915ca467..34e988eaf1 100644--- a/frontend/src/types/oauth.ts+++ b/frontend/src/types/oauth.ts@@ -3,19 +3,6 @@ import {externalVersionControl_TypeToJSON,} from "@/types/proto/v1/externalvs_service";-export type OAuthConfig = {- endpoint: string;- applicationId: string;- secret: string;- redirectUrl: string;-};--export type OAuthToken = {- accessToken: string;- expiresTs: number;- refreshToken: string;-};-export const OAuthStateSessionKey = "oauth-state";export type OAuthWindowEventPayload = {diff --git a/frontend/src/types/project.ts b/frontend/src/types/project.tsindex bf23b6b3cd..2018195419 100644--- a/frontend/src/types/project.ts+++ b/frontend/src/types/project.ts@@ -1,10 +1,12 @@import { RowStatus } from "./common";import { ProjectId } from "./id";-import { OAuthToken } from "./oauth";import { Principal } from "./principal";import { ExternalRepositoryInfo, RepositoryConfig } from "./repository";import { SchemaChange } from "@/types/proto/v1/project_service";-import { ExternalVersionControl } from "@/types/proto/v1/externalvs_service";+import {+ OAuthToken,+ ExternalVersionControl,+} from "@/types/proto/v1/externalvs_service";export type ProjectRoleType =| "OWNER"diff --git a/frontend/src/types/proto/google/protobuf/descriptor.ts b/frontend/src/types/proto/google/protobuf/descriptor.tsindex 3147feee09..50a68d0dac 100644--- a/frontend/src/types/proto/google/protobuf/descriptor.ts+++ b/frontend/src/types/proto/google/protobuf/descriptor.ts@@ -4045,7 +4045,7 @@ function createBaseUninterpretedOption(): UninterpretedOption {positiveIntValue: 0,negativeIntValue: 0,doubleValue: 0,- stringValue: new Uint8Array(),+ stringValue: new Uint8Array(0),aggregateValue: "",};}@@ -4148,7 +4148,7 @@ export const UninterpretedOption = {positiveIntValue: isSet(object.positiveIntValue) ? Number(object.positiveIntValue) : 0,negativeIntValue: isSet(object.negativeIntValue) ? Number(object.negativeIntValue) : 0,doubleValue: isSet(object.doubleValue) ? Number(object.doubleValue) : 0,- stringValue: isSet(object.stringValue) ? bytesFromBase64(object.stringValue) : new Uint8Array(),+ stringValue: isSet(object.stringValue) ? bytesFromBase64(object.stringValue) : new Uint8Array(0),aggregateValue: isSet(object.aggregateValue) ? String(object.aggregateValue) : "",};},@@ -4165,7 +4165,7 @@ export const UninterpretedOption = {message.negativeIntValue !== undefined && (obj.negativeIntValue = Math.round(message.negativeIntValue));message.doubleValue !== undefined && (obj.doubleValue = message.doubleValue);message.stringValue !== undefined &&- (obj.stringValue = base64FromBytes(message.stringValue !== undefined ? message.stringValue : new Uint8Array()));+ (obj.stringValue = base64FromBytes(message.stringValue !== undefined ? message.stringValue : new Uint8Array(0)));message.aggregateValue !== undefined && (obj.aggregateValue = message.aggregateValue);return obj;},@@ -4181,7 +4181,7 @@ export const UninterpretedOption = {message.positiveIntValue = object.positiveIntValue ?? 0;message.negativeIntValue = object.negativeIntValue ?? 0;message.doubleValue = object.doubleValue ?? 0;- message.stringValue = object.stringValue ?? new Uint8Array();+ message.stringValue = object.stringValue ?? new Uint8Array(0);message.aggregateValue = object.aggregateValue ?? "";return message;},diff --git a/frontend/src/types/proto/google/protobuf/wrappers.ts b/frontend/src/types/proto/google/protobuf/wrappers.tsindex 517f2dbc4f..1387d5f38b 100644--- a/frontend/src/types/proto/google/protobuf/wrappers.ts+++ b/frontend/src/types/proto/google/protobuf/wrappers.ts@@ -543,7 +543,7 @@ export const StringValue = {};function createBaseBytesValue(): BytesValue {- return { value: new Uint8Array() };+ return { value: new Uint8Array(0) };}export const BytesValue = {@@ -578,13 +578,13 @@ export const BytesValue = {},fromJSON(object: any): BytesValue {- return { value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array() };+ return { value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(0) };},toJSON(message: BytesValue): unknown {const obj: any = {};message.value !== undefined &&- (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array()));+ (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array(0)));return obj;},@@ -594,7 +594,7 @@ export const BytesValue = {fromPartial(object: DeepPartial<BytesValue>): BytesValue {const message = createBaseBytesValue();- message.value = object.value ?? new Uint8Array();+ message.value = object.value ?? new Uint8Array(0);return message;},};diff --git a/frontend/src/types/proto/v1/externalvs_service.ts b/frontend/src/types/proto/v1/externalvs_service.tsindex d5b9e99937..928a30fd40 100644--- a/frontend/src/types/proto/v1/externalvs_service.ts+++ b/frontend/src/types/proto/v1/externalvs_service.ts@@ -213,6 +213,29 @@ export interface ProjectGitOpsInfo {refreshToken: string;}+export interface ExchangeTokenRequest {+ exchangeToken?: ExchangeToken;+}++export interface ExchangeToken {+ /**+ * The name of the external version control to retrieve the linked projects.+ * Format: externalVersionControls/{externalVersionControl}+ */+ name: string;+ code: string;+ type: ExternalVersionControl_Type;+ instanceUrl: string;+ clientId: string;+ clientSecret: string;+}++export interface OAuthToken {+ accessToken: string;+ refreshToken: string;+ expiresTime?: Date;+}+function createBaseCreateExternalVersionControlRequest(): CreateExternalVersionControlRequest {return { externalVersionControl: undefined };}@@ -1406,6 +1429,272 @@ export const ProjectGitOpsInfo = {},};+function createBaseExchangeTokenRequest(): ExchangeTokenRequest {+ return { exchangeToken: undefined };+}++export const ExchangeTokenRequest = {+ encode(message: ExchangeTokenRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.exchangeToken !== undefined) {+ ExchangeToken.encode(message.exchangeToken, writer.uint32(10).fork()).ldelim();+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): ExchangeTokenRequest {+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseExchangeTokenRequest();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ if (tag !== 10) {+ break;+ }++ message.exchangeToken = ExchangeToken.decode(reader, reader.uint32());+ continue;+ }+ if ((tag & 7) === 4 || tag === 0) {+ break;+ }+ reader.skipType(tag & 7);+ }+ return message;+ },++ fromJSON(object: any): ExchangeTokenRequest {+ return { exchangeToken: isSet(object.exchangeToken) ? ExchangeToken.fromJSON(object.exchangeToken) : undefined };+ },++ toJSON(message: ExchangeTokenRequest): unknown {+ const obj: any = {};+ message.exchangeToken !== undefined &&+ (obj.exchangeToken = message.exchangeToken ? ExchangeToken.toJSON(message.exchangeToken) : undefined);+ return obj;+ },++ create(base?: DeepPartial<ExchangeTokenRequest>): ExchangeTokenRequest {+ return ExchangeTokenRequest.fromPartial(base ?? {});+ },++ fromPartial(object: DeepPartial<ExchangeTokenRequest>): ExchangeTokenRequest {+ const message = createBaseExchangeTokenRequest();+ message.exchangeToken = (object.exchangeToken !== undefined && object.exchangeToken !== null)+ ? ExchangeToken.fromPartial(object.exchangeToken)+ : undefined;+ return message;+ },+};++function createBaseExchangeToken(): ExchangeToken {+ return { name: "", code: "", type: 0, instanceUrl: "", clientId: "", clientSecret: "" };+}++export const ExchangeToken = {+ encode(message: ExchangeToken, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.name !== "") {+ writer.uint32(10).string(message.name);+ }+ if (message.code !== "") {+ writer.uint32(18).string(message.code);+ }+ if (message.type !== 0) {+ writer.uint32(24).int32(message.type);+ }+ if (message.instanceUrl !== "") {+ writer.uint32(34).string(message.instanceUrl);+ }+ if (message.clientId !== "") {+ writer.uint32(42).string(message.clientId);+ }+ if (message.clientSecret !== "") {+ writer.uint32(50).string(message.clientSecret);+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): ExchangeToken {+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseExchangeToken();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ if (tag !== 10) {+ break;+ }++ message.name = reader.string();+ continue;+ case 2:+ if (tag !== 18) {+ break;+ }++ message.code = reader.string();+ continue;+ case 3:+ if (tag !== 24) {+ break;+ }++ message.type = reader.int32() as any;+ continue;+ case 4:+ if (tag !== 34) {+ break;+ }++ message.instanceUrl = reader.string();+ continue;+ case 5:+ if (tag !== 42) {+ break;+ }++ message.clientId = reader.string();+ continue;+ case 6:+ if (tag !== 50) {+ break;+ }++ message.clientSecret = reader.string();+ continue;+ }+ if ((tag & 7) === 4 || tag === 0) {+ break;+ }+ reader.skipType(tag & 7);+ }+ return message;+ },++ fromJSON(object: any): ExchangeToken {+ return {+ name: isSet(object.name) ? String(object.name) : "",+ code: isSet(object.code) ? String(object.code) : "",+ type: isSet(object.type) ? externalVersionControl_TypeFromJSON(object.type) : 0,+ instanceUrl: isSet(object.instanceUrl) ? String(object.instanceUrl) : "",+ clientId: isSet(object.clientId) ? String(object.clientId) : "",+ clientSecret: isSet(object.clientSecret) ? String(object.clientSecret) : "",+ };+ },++ toJSON(message: ExchangeToken): unknown {+ const obj: any = {};+ message.name !== undefined && (obj.name = message.name);+ message.code !== undefined && (obj.code = message.code);+ message.type !== undefined && (obj.type = externalVersionControl_TypeToJSON(message.type));+ message.instanceUrl !== undefined && (obj.instanceUrl = message.instanceUrl);+ message.clientId !== undefined && (obj.clientId = message.clientId);+ message.clientSecret !== undefined && (obj.clientSecret = message.clientSecret);+ return obj;+ },++ create(base?: DeepPartial<ExchangeToken>): ExchangeToken {+ return ExchangeToken.fromPartial(base ?? {});+ },++ fromPartial(object: DeepPartial<ExchangeToken>): ExchangeToken {+ const message = createBaseExchangeToken();+ message.name = object.name ?? "";+ message.code = object.code ?? "";+ message.type = object.type ?? 0;+ message.instanceUrl = object.instanceUrl ?? "";+ message.clientId = object.clientId ?? "";+ message.clientSecret = object.clientSecret ?? "";+ return message;+ },+};++function createBaseOAuthToken(): OAuthToken {+ return { accessToken: "", refreshToken: "", expiresTime: undefined };+}++export const OAuthToken = {+ encode(message: OAuthToken, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.accessToken !== "") {+ writer.uint32(10).string(message.accessToken);+ }+ if (message.refreshToken !== "") {+ writer.uint32(18).string(message.refreshToken);+ }+ if (message.expiresTime !== undefined) {+ Timestamp.encode(toTimestamp(message.expiresTime), writer.uint32(122).fork()).ldelim();+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): OAuthToken {+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseOAuthToken();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ if (tag !== 10) {+ break;+ }++ message.accessToken = reader.string();+ continue;+ case 2:+ if (tag !== 18) {+ break;+ }++ message.refreshToken = reader.string();+ continue;+ case 15:+ if (tag !== 122) {+ break;+ }++ message.expiresTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));+ continue;+ }+ if ((tag & 7) === 4 || tag === 0) {+ break;+ }+ reader.skipType(tag & 7);+ }+ return message;+ },++ fromJSON(object: any): OAuthToken {+ return {+ accessToken: isSet(object.accessToken) ? String(object.accessToken) : "",+ refreshToken: isSet(object.refreshToken) ? String(object.refreshToken) : "",+ expiresTime: isSet(object.expiresTime) ? fromJsonTimestamp(object.expiresTime) : undefined,+ };+ },++ toJSON(message: OAuthToken): unknown {+ const obj: any = {};+ message.accessToken !== undefined && (obj.accessToken = message.accessToken);+ message.refreshToken !== undefined && (obj.refreshToken = message.refreshToken);+ message.expiresTime !== undefined && (obj.expiresTime = message.expiresTime.toISOString());+ return obj;+ },++ create(base?: DeepPartial<OAuthToken>): OAuthToken {+ return OAuthToken.fromPartial(base ?? {});+ },++ fromPartial(object: DeepPartial<OAuthToken>): OAuthToken {+ const message = createBaseOAuthToken();+ message.accessToken = object.accessToken ?? "";+ message.refreshToken = object.refreshToken ?? "";+ message.expiresTime = object.expiresTime ?? undefined;+ return message;+ },+};+export type ExternalVersionControlServiceDefinition = typeof ExternalVersionControlServiceDefinition;export const ExternalVersionControlServiceDefinition = {name: "ExternalVersionControlService",@@ -1730,6 +2019,106 @@ export const ExternalVersionControlServiceDefinition = {},},},+ exchangeToken: {+ name: "ExchangeToken",+ requestType: ExchangeTokenRequest,+ requestStream: false,+ responseType: OAuthToken,+ responseStream: false,+ options: {+ _unknownFields: {+ 8410: [new Uint8Array([0])],+ 578365826: [+ new Uint8Array([+ 83,+ 58,+ 14,+ 101,+ 120,+ 99,+ 104,+ 97,+ 110,+ 103,+ 101,+ 95,+ 116,+ 111,+ 107,+ 101,+ 110,+ 34,+ 65,+ 47,+ 118,+ 49,+ 47,+ 123,+ 101,+ 120,+ 99,+ 104,+ 97,+ 110,+ 103,+ 101,+ 95,+ 116,+ 111,+ 107,+ 101,+ 110,+ 46,+ 110,+ 97,+ 109,+ 101,+ 61,+ 101,+ 120,+ 116,+ 101,+ 114,+ 110,+ 97,+ 108,+ 86,+ 101,+ 114,+ 115,+ 105,+ 111,+ 110,+ 67,+ 111,+ 110,+ 116,+ 114,+ 111,+ 108,+ 115,+ 47,+ 42,+ 125,+ 58,+ 101,+ 120,+ 99,+ 104,+ 97,+ 110,+ 103,+ 101,+ 84,+ 111,+ 107,+ 101,+ 110,+ ]),+ ],+ },+ },+ },deleteExternalVersionControl: {name: "DeleteExternalVersionControl",requestType: DeleteExternalVersionControlRequest,@@ -1939,6 +2328,7 @@ export interface ExternalVersionControlServiceImplementation<CallContextExt = {}request: UpdateExternalVersionControlRequest,context: CallContext & CallContextExt,): Promise<DeepPartial<ExternalVersionControl>>;+ exchangeToken(request: ExchangeTokenRequest, context: CallContext & CallContextExt): Promise<DeepPartial<OAuthToken>>;deleteExternalVersionControl(request: DeleteExternalVersionControlRequest,context: CallContext & CallContextExt,@@ -1970,6 +2360,10 @@ export interface ExternalVersionControlServiceClient<CallOptionsExt = {}> {request: DeepPartial<UpdateExternalVersionControlRequest>,options?: CallOptions & CallOptionsExt,): Promise<ExternalVersionControl>;+ exchangeToken(+ request: DeepPartial<ExchangeTokenRequest>,+ options?: CallOptions & CallOptionsExt,+ ): Promise<OAuthToken>;deleteExternalVersionControl(request: DeepPartial<DeleteExternalVersionControlRequest>,options?: CallOptions & CallOptionsExt,diff --git a/frontend/src/types/proto/v1/sheet_service.ts b/frontend/src/types/proto/v1/sheet_service.tsindex 5314bcc8d2..1450e32687 100644--- a/frontend/src/types/proto/v1/sheet_service.ts+++ b/frontend/src/types/proto/v1/sheet_service.ts@@ -986,7 +986,7 @@ function createBaseSheet(): Sheet {creator: "",createTime: undefined,updateTime: undefined,- content: new Uint8Array(),+ content: new Uint8Array(0),contentSize: 0,visibility: 0,source: 0,@@ -1155,7 +1155,7 @@ export const Sheet = {creator: isSet(object.creator) ? String(object.creator) : "",createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,updateTime: isSet(object.updateTime) ? fromJsonTimestamp(object.updateTime) : undefined,- content: isSet(object.content) ? bytesFromBase64(object.content) : new Uint8Array(),+ content: isSet(object.content) ? bytesFromBase64(object.content) : new Uint8Array(0),contentSize: isSet(object.contentSize) ? Number(object.contentSize) : 0,visibility: isSet(object.visibility) ? sheet_VisibilityFromJSON(object.visibility) : 0,source: isSet(object.source) ? sheet_SourceFromJSON(object.source) : 0,@@ -1174,7 +1174,7 @@ export const Sheet = {message.createTime !== undefined && (obj.createTime = message.createTime.toISOString());message.updateTime !== undefined && (obj.updateTime = message.updateTime.toISOString());message.content !== undefined &&- (obj.content = base64FromBytes(message.content !== undefined ? message.content : new Uint8Array()));+ (obj.content = base64FromBytes(message.content !== undefined ? message.content : new Uint8Array(0)));message.contentSize !== undefined && (obj.contentSize = Math.round(message.contentSize));message.visibility !== undefined && (obj.visibility = sheet_VisibilityToJSON(message.visibility));message.source !== undefined && (obj.source = sheet_SourceToJSON(message.source));@@ -1196,7 +1196,7 @@ export const Sheet = {message.creator = object.creator ?? "";message.createTime = object.createTime ?? undefined;message.updateTime = object.updateTime ?? undefined;- message.content = object.content ?? new Uint8Array();+ message.content = object.content ?? new Uint8Array(0);message.contentSize = object.contentSize ?? 0;message.visibility = object.visibility ?? 0;message.source = object.source ?? 0;diff --git a/frontend/src/types/proto/v1/sql_service.ts b/frontend/src/types/proto/v1/sql_service.tsindex e9bf1d64f8..9b552a988b 100644--- a/frontend/src/types/proto/v1/sql_service.ts+++ b/frontend/src/types/proto/v1/sql_service.ts@@ -504,7 +504,7 @@ export const ExportRequest = {};function createBaseExportResponse(): ExportResponse {- return { content: new Uint8Array() };+ return { content: new Uint8Array(0) };}export const ExportResponse = {@@ -539,13 +539,13 @@ export const ExportResponse = {},fromJSON(object: any): ExportResponse {- return { content: isSet(object.content) ? bytesFromBase64(object.content) : new Uint8Array() };+ return { content: isSet(object.content) ? bytesFromBase64(object.content) : new Uint8Array(0) };},toJSON(message: ExportResponse): unknown {const obj: any = {};message.content !== undefined &&- (obj.content = base64FromBytes(message.content !== undefined ? message.content : new Uint8Array()));+ (obj.content = base64FromBytes(message.content !== undefined ? message.content : new Uint8Array(0)));return obj;},@@ -555,7 +555,7 @@ export const ExportResponse = {fromPartial(object: DeepPartial<ExportResponse>): ExportResponse {const message = createBaseExportResponse();- message.content = object.content ?? new Uint8Array();+ message.content = object.content ?? new Uint8Array(0);return message;},};diff --git a/frontend/src/views/SettingWorkspaceVCSDetail.vue b/frontend/src/views/SettingWorkspaceVCSDetail.vueindex 034eb0ce34..ffb68f5cc1 100644--- a/frontend/src/views/SettingWorkspaceVCSDetail.vue+++ b/frontend/src/views/SettingWorkspaceVCSDetail.vue@@ -183,16 +183,11 @@ import { idFromSlug, getVCSUIType } from "../utils";import {openWindowForOAuth,OAuthWindowEventPayload,- OAuthToken,VCSUIType,} from "../types";+import { pushNotification, useRepositoryV1Store, useVCSV1Store } from "@/store";import {- pushNotification,- useOAuthStore,- useRepositoryV1Store,- useVCSV1Store,-} from "@/store";-import {+ OAuthToken,ExternalVersionControl,ExternalVersionControl_Type,} from "@/types/proto/v1/externalvs_service";@@ -248,10 +243,10 @@ const eventListener = (event: Event) => {vcs.value?.type === ExternalVersionControl_Type.GITHUB ||vcs.value?.type === ExternalVersionControl_Type.BITBUCKET) {- useOAuthStore()- .exchangeVCSTokenWithID({+ vcsV1Store+ .exchangeToken({code: payload.code,- vcsId: idFromSlug(props.vcsSlug),+ vcsName: vcs.value.name,clientId: state.applicationId,clientSecret: state.secret,})diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.mdindex 89dac9993a..d3b7da021a 100644--- a/proto/gen/grpc-doc/v1/README.md+++ b/proto/gen/grpc-doc/v1/README.md@@ -160,12 +160,15 @@- [v1/externalvs_service.proto](#v1_externalvs_service-proto)- [CreateExternalVersionControlRequest](#bytebase-v1-CreateExternalVersionControlRequest)- [DeleteExternalVersionControlRequest](#bytebase-v1-DeleteExternalVersionControlRequest)+ - [ExchangeToken](#bytebase-v1-ExchangeToken)+ - [ExchangeTokenRequest](#bytebase-v1-ExchangeTokenRequest)- [ExternalVersionControl](#bytebase-v1-ExternalVersionControl)- [GetExternalVersionControlRequest](#bytebase-v1-GetExternalVersionControlRequest)- [ListExternalVersionControlsRequest](#bytebase-v1-ListExternalVersionControlsRequest)- [ListExternalVersionControlsResponse](#bytebase-v1-ListExternalVersionControlsResponse)- [ListProjectGitOpsInfoRequest](#bytebase-v1-ListProjectGitOpsInfoRequest)- [ListProjectGitOpsInfoResponse](#bytebase-v1-ListProjectGitOpsInfoResponse)+ - [OAuthToken](#bytebase-v1-OAuthToken)- [ProjectGitOpsInfo](#bytebase-v1-ProjectGitOpsInfo)- [SearchExternalVersionControlProjectsRequest](#bytebase-v1-SearchExternalVersionControlProjectsRequest)- [SearchExternalVersionControlProjectsResponse](#bytebase-v1-SearchExternalVersionControlProjectsResponse)@@ -2803,6 +2806,41 @@ The environment's `name` field is used to identify the environment to update+<a name="bytebase-v1-ExchangeToken"></a>++### ExchangeToken++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| name | [string](#string) | | The name of the external version control to retrieve the linked projects. Format: externalVersionControls/{externalVersionControl} |+| code | [string](#string) | | |+| type | [ExternalVersionControl.Type](#bytebase-v1-ExternalVersionControl-Type) | | |+| instance_url | [string](#string) | | |+| client_id | [string](#string) | | |+| client_secret | [string](#string) | | |+++++++<a name="bytebase-v1-ExchangeTokenRequest"></a>++### ExchangeTokenRequest++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| exchange_token | [ExchangeToken](#bytebase-v1-ExchangeToken) | | |++++++<a name="bytebase-v1-ExternalVersionControl"></a>### ExternalVersionControl@@ -2901,6 +2939,23 @@ The environment's `name` field is used to identify the environment to update+<a name="bytebase-v1-OAuthToken"></a>++### OAuthToken++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| access_token | [string](#string) | | |+| refresh_token | [string](#string) | | |+| expires_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | |++++++<a name="bytebase-v1-ProjectGitOpsInfo"></a>### ProjectGitOpsInfo@@ -3028,6 +3083,7 @@ The environment's `name` field is used to identify the environment to update| ListExternalVersionControls | [ListExternalVersionControlsRequest](#bytebase-v1-ListExternalVersionControlsRequest) | [ListExternalVersionControlsResponse](#bytebase-v1-ListExternalVersionControlsResponse) | || CreateExternalVersionControl | [CreateExternalVersionControlRequest](#bytebase-v1-CreateExternalVersionControlRequest) | [ExternalVersionControl](#bytebase-v1-ExternalVersionControl) | || UpdateExternalVersionControl | [UpdateExternalVersionControlRequest](#bytebase-v1-UpdateExternalVersionControlRequest) | [ExternalVersionControl](#bytebase-v1-ExternalVersionControl) | |+| ExchangeToken | [ExchangeTokenRequest](#bytebase-v1-ExchangeTokenRequest) | [OAuthToken](#bytebase-v1-OAuthToken) | || DeleteExternalVersionControl | [DeleteExternalVersionControlRequest](#bytebase-v1-DeleteExternalVersionControlRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | || SearchExternalVersionControlProjects | [SearchExternalVersionControlProjectsRequest](#bytebase-v1-SearchExternalVersionControlProjectsRequest) | [SearchExternalVersionControlProjectsResponse](#bytebase-v1-SearchExternalVersionControlProjectsResponse) | || ListProjectGitOpsInfo | [ListProjectGitOpsInfoRequest](#bytebase-v1-ListProjectGitOpsInfoRequest) | [ListProjectGitOpsInfoResponse](#bytebase-v1-ListProjectGitOpsInfoResponse) | |diff --git a/proto/generated-go/v1/externalvs_service.pb.go b/proto/generated-go/v1/externalvs_service.pb.goindex cdd787c320..f16ab68bf3 100644--- a/proto/generated-go/v1/externalvs_service.pb.go+++ b/proto/generated-go/v1/externalvs_service.pb.go@@ -898,6 +898,205 @@ func (x *ProjectGitOpsInfo) GetRefreshToken() string {return ""}+type ExchangeTokenRequest struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ ExchangeToken *ExchangeToken `protobuf:"bytes,1,opt,name=exchange_token,json=exchangeToken,proto3" json:"exchange_token,omitempty"`+}++func (x *ExchangeTokenRequest) Reset() {+ *x = ExchangeTokenRequest{}+ if protoimpl.UnsafeEnabled {+ mi := &file_v1_externalvs_service_proto_msgTypes[12]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *ExchangeTokenRequest) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*ExchangeTokenRequest) ProtoMessage() {}++func (x *ExchangeTokenRequest) ProtoReflect() protoreflect.Message {+ mi := &file_v1_externalvs_service_proto_msgTypes[12]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use ExchangeTokenRequest.ProtoReflect.Descriptor instead.+func (*ExchangeTokenRequest) Descriptor() ([]byte, []int) {+ return file_v1_externalvs_service_proto_rawDescGZIP(), []int{12}+}++func (x *ExchangeTokenRequest) GetExchangeToken() *ExchangeToken {+ if x != nil {+ return x.ExchangeToken+ }+ return nil+}++type ExchangeToken struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ // The name of the external version control to retrieve the linked projects.+ // Format: externalVersionControls/{externalVersionControl}+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`+ Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"`+ Type ExternalVersionControl_Type `protobuf:"varint,3,opt,name=type,proto3,enum=bytebase.v1.ExternalVersionControl_Type" json:"type,omitempty"`+ InstanceUrl string `protobuf:"bytes,4,opt,name=instance_url,json=instanceUrl,proto3" json:"instance_url,omitempty"`+ ClientId string `protobuf:"bytes,5,opt,name=client_id,json=clientId,proto3" json:"client_id,omitempty"`+ ClientSecret string `protobuf:"bytes,6,opt,name=client_secret,json=clientSecret,proto3" json:"client_secret,omitempty"`+}++func (x *ExchangeToken) Reset() {+ *x = ExchangeToken{}+ if protoimpl.UnsafeEnabled {+ mi := &file_v1_externalvs_service_proto_msgTypes[13]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *ExchangeToken) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*ExchangeToken) ProtoMessage() {}++func (x *ExchangeToken) ProtoReflect() protoreflect.Message {+ mi := &file_v1_externalvs_service_proto_msgTypes[13]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use ExchangeToken.ProtoReflect.Descriptor instead.+func (*ExchangeToken) Descriptor() ([]byte, []int) {+ return file_v1_externalvs_service_proto_rawDescGZIP(), []int{13}+}++func (x *ExchangeToken) GetName() string {+ if x != nil {+ return x.Name+ }+ return ""+}++func (x *ExchangeToken) GetCode() string {+ if x != nil {+ return x.Code+ }+ return ""+}++func (x *ExchangeToken) GetType() ExternalVersionControl_Type {+ if x != nil {+ return x.Type+ }+ return ExternalVersionControl_TYPE_UNSPECIFIED+}++func (x *ExchangeToken) GetInstanceUrl() string {+ if x != nil {+ return x.InstanceUrl+ }+ return ""+}++func (x *ExchangeToken) GetClientId() string {+ if x != nil {+ return x.ClientId+ }+ return ""+}++func (x *ExchangeToken) GetClientSecret() string {+ if x != nil {+ return x.ClientSecret+ }+ return ""+}++type OAuthToken struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`+ RefreshToken string `protobuf:"bytes,2,opt,name=refresh_token,json=refreshToken,proto3" json:"refresh_token,omitempty"`+ ExpiresTime *timestamppb.Timestamp `protobuf:"bytes,15,opt,name=expires_time,json=expiresTime,proto3" json:"expires_time,omitempty"`+}++func (x *OAuthToken) Reset() {+ *x = OAuthToken{}+ if protoimpl.UnsafeEnabled {+ mi := &file_v1_externalvs_service_proto_msgTypes[14]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *OAuthToken) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*OAuthToken) ProtoMessage() {}++func (x *OAuthToken) ProtoReflect() protoreflect.Message {+ mi := &file_v1_externalvs_service_proto_msgTypes[14]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use OAuthToken.ProtoReflect.Descriptor instead.+func (*OAuthToken) Descriptor() ([]byte, []int) {+ return file_v1_externalvs_service_proto_rawDescGZIP(), []int{14}+}++func (x *OAuthToken) GetAccessToken() string {+ if x != nil {+ return x.AccessToken+ }+ return ""+}++func (x *OAuthToken) GetRefreshToken() string {+ if x != nil {+ return x.RefreshToken+ }+ return ""+}++func (x *OAuthToken) GetExpiresTime() *timestamppb.Timestamp {+ if x != nil {+ return x.ExpiresTime+ }+ return nil+}+type SearchExternalVersionControlProjectsResponse_Project struct {state protoimpl.MessageStatesizeCache protoimpl.SizeCache@@ -916,7 +1115,7 @@ type SearchExternalVersionControlProjectsResponse_Project struct {func (x *SearchExternalVersionControlProjectsResponse_Project) Reset() {*x = SearchExternalVersionControlProjectsResponse_Project{}if protoimpl.UnsafeEnabled {- mi := &file_v1_externalvs_service_proto_msgTypes[12]+ mi := &file_v1_externalvs_service_proto_msgTypes[15]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -929,7 +1128,7 @@ func (x *SearchExternalVersionControlProjectsResponse_Project) String() string {func (*SearchExternalVersionControlProjectsResponse_Project) ProtoMessage() {}func (x *SearchExternalVersionControlProjectsResponse_Project) ProtoReflect() protoreflect.Message {- mi := &file_v1_externalvs_service_proto_msgTypes[12]+ mi := &file_v1_externalvs_service_proto_msgTypes[15]if protoimpl.UnsafeEnabled && x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -1134,94 +1333,134 @@ var file_v1_externalvs_service_proto_rawDesc = []byte{0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x04, 0x52, 0x0b, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73,0x54, 0x69, 0x6d, 0x65, 0x12, 0x28, 0x0a, 0x0d, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f,0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x04,- 0x52, 0x0c, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x32, 0xcb,- 0x0a, 0x0a, 0x1d, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69,- 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,- 0x12, 0xa4, 0x01, 0x0a, 0x19, 0x47, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c,- 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x2d,- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74,+ 0x52, 0x0c, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x59,+ 0x0a, 0x14, 0x45, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52,+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x41, 0x0a, 0x0e, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e,+ 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a,+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x63,+ 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0d, 0x65, 0x78, 0x63, 0x68,+ 0x61, 0x6e, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0xda, 0x01, 0x0a, 0x0d, 0x45, 0x78,+ 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x6e,+ 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12,+ 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63,+ 0x6f, 0x64, 0x65, 0x12, 0x3c, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,+ 0x0e, 0x32, 0x28, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43,- 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e,- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x74, 0x65,- 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72,- 0x6f, 0x6c, 0x22, 0x33, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02,- 0x26, 0x12, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x65, 0x78, 0x74,- 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74,- 0x72, 0x6f, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xa8, 0x01, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74,+ 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70,+ 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x75, 0x72,+ 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63,+ 0x65, 0x55, 0x72, 0x6c, 0x12, 0x1b, 0x0a, 0x09, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x69,+ 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x49,+ 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x65, 0x63, 0x72,+ 0x65, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74,+ 0x53, 0x65, 0x63, 0x72, 0x65, 0x74, 0x22, 0xa2, 0x01, 0x0a, 0x0a, 0x4f, 0x41, 0x75, 0x74, 0x68,+ 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x26, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f,+ 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03,+ 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x28, 0x0a,+ 0x0d, 0x72, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02,+ 0x20, 0x01, 0x28, 0x09, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0c, 0x72, 0x65, 0x66, 0x72, 0x65,+ 0x73, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x42, 0x0a, 0x0c, 0x65, 0x78, 0x70, 0x69, 0x72,+ 0x65, 0x73, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e,+ 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,+ 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x03, 0xe0, 0x41, 0x03, 0x52, 0x0b,+ 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x54, 0x69, 0x6d, 0x65, 0x32, 0xf7, 0x0b, 0x0a, 0x1d,0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43,- 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x73, 0x12, 0x2f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,- 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e,+ 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0xa4, 0x01,+ 0x0a, 0x19, 0x47, 0x65, 0x74, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72,+ 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x2d, 0x2e, 0x62, 0x79,+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x74,+ 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74,+ 0x72, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x62, 0x79, 0x74,+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61,+ 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x22,+ 0x33, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x12, 0x24,+ 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e,0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c,- 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,- 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x74, 0x65, 0x72,- 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f,- 0x6c, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0xda, 0x41, 0x00, 0x82,- 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x72,- 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f,- 0x6c, 0x73, 0x12, 0xb7, 0x01, 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x78, 0x74,+ 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xa8, 0x01, 0x0a, 0x1b, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x74,0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74,- 0x72, 0x6f, 0x6c, 0x12, 0x30, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,- 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c,- 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x52, 0x65,- 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,- 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73,- 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x22, 0x40, 0xda, 0x41, 0x00, 0x82,- 0xd3, 0xe4, 0x93, 0x02, 0x37, 0x3a, 0x18, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f,- 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x22,- 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72,- 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x73, 0x12, 0xfe, 0x01, 0x0a,- 0x1c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56,- 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x30, 0x2e,- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61,- 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f,- 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,- 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78,+ 0x72, 0x6f, 0x6c, 0x73, 0x12, 0x2f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,+ 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56,+ 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x73, 0x52, 0x65,+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x30, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,+ 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c,+ 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x73, 0x52,+ 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0xda, 0x41, 0x00, 0x82, 0xd3, 0xe4, 0x93,+ 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x76, 0x31, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c,+ 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x73, 0x12,+ 0xb7, 0x01, 0x0a, 0x1c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e,+ 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c,+ 0x12, 0x30, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43,+ 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72,+ 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65,+ 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,+ 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,+ 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x22, 0x40, 0xda, 0x41, 0x00, 0x82, 0xd3, 0xe4, 0x93,+ 0x02, 0x37, 0x3a, 0x18, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x76, 0x65, 0x72,+ 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x22, 0x1b, 0x2f, 0x76,+ 0x31, 0x2f, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f,+ 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x73, 0x12, 0xfe, 0x01, 0x0a, 0x1c, 0x55, 0x70,+ 0x64, 0x61, 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73,+ 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x30, 0x2e, 0x62, 0x79, 0x74,+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x45,+ 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f,+ 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x62,+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x74, 0x65, 0x72,+ 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f,+ 0x6c, 0x22, 0x86, 0x01, 0xda, 0x41, 0x24, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f,+ 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2c,+ 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02,+ 0x59, 0x3a, 0x18, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x76, 0x65, 0x72, 0x73,+ 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x32, 0x3d, 0x2f, 0x76, 0x31,+ 0x2f, 0x7b, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69,+ 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d,+ 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43,+ 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xa9, 0x01, 0x0a, 0x0d, 0x45,+ 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x21, 0x2e, 0x62,+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x78, 0x63, 0x68, 0x61,+ 0x6e, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,+ 0x17, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x41,+ 0x75, 0x74, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x5c, 0xda, 0x41, 0x00, 0x82, 0xd3, 0xe4,+ 0x93, 0x02, 0x53, 0x3a, 0x0e, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x5f, 0x74, 0x6f,+ 0x6b, 0x65, 0x6e, 0x22, 0x41, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e,+ 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x65, 0x78,0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e,- 0x74, 0x72, 0x6f, 0x6c, 0x22, 0x86, 0x01, 0xda, 0x41, 0x24, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e,- 0x61, 0x6c, 0x5f, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72,- 0x6f, 0x6c, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3,- 0xe4, 0x93, 0x02, 0x59, 0x3a, 0x18, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x76,- 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x32, 0x3d,- 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x5f, 0x76, 0x65,- 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x2e, 0x6e, 0x61,- 0x6d, 0x65, 0x3d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69,- 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x96, 0x01,- 0x0a, 0x1c, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c,- 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x30,- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c,- 0x65, 0x74, 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69,- 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 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, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26,- 0x2a, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x65, 0x78, 0x74, 0x65,+ 0x74, 0x72, 0x6f, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x65, 0x78, 0x63, 0x68, 0x61, 0x6e, 0x67,+ 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x96, 0x01, 0x0a, 0x1c, 0x44, 0x65, 0x6c, 0x65, 0x74,+ 0x65, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,+ 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x12, 0x30, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x45, 0x78, 0x74, 0x65,0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72,- 0x6f, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0xdb, 0x01, 0x0a, 0x24, 0x53, 0x65, 0x61, 0x72, 0x63,- 0x68, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,- 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12,- 0x38, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65,- 0x61, 0x72, 0x63, 0x68, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73,- 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63,- 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x62, 0x79, 0x74, 0x65,- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x45, 0x78,- 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e,- 0x74, 0x72, 0x6f, 0x6c, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70,- 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x38, 0x3a, 0x01, 0x2a, 0x22,- 0x33, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x65, 0x78, 0x74, 0x65, 0x72,- 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f,- 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x6a,- 0x65, 0x63, 0x74, 0x73, 0x12, 0xa5, 0x01, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f,- 0x6a, 0x65, 0x63, 0x74, 0x47, 0x69, 0x74, 0x4f, 0x70, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x29,- 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73,- 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x47, 0x69, 0x74, 0x4f, 0x70, 0x73, 0x49, 0x6e,- 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x62, 0x79, 0x74, 0x65,- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a,- 0x65, 0x63, 0x74, 0x47, 0x69, 0x74, 0x4f, 0x70, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73,- 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x12, 0x2d, 0x2f,- 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61,- 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x73,- 0x2f, 0x2a, 0x7d, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 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,+ 0x6f, 0x6c, 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, 0x2c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x26, 0x2a, 0x24, 0x2f, 0x76, 0x31, 0x2f, 0x7b,+ 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72,+ 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x12,+ 0xdb, 0x01, 0x0a, 0x24, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e,+ 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c,+ 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x38, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,+ 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x45, 0x78, 0x74,+ 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74,+ 0x72, 0x6f, 0x6c, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,+ 0x73, 0x74, 0x1a, 0x39, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,+ 0x2e, 0x53, 0x65, 0x61, 0x72, 0x63, 0x68, 0x45, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56,+ 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x50, 0x72, 0x6f,+ 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3e, 0x82,+ 0xd3, 0xe4, 0x93, 0x02, 0x38, 0x3a, 0x01, 0x2a, 0x22, 0x33, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e,+ 0x61, 0x6d, 0x65, 0x3d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73,+ 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x73,+ 0x65, 0x61, 0x72, 0x63, 0x68, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0xa5, 0x01,+ 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x47, 0x69, 0x74,+ 0x4f, 0x70, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x29, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,+ 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63,+ 0x74, 0x47, 0x69, 0x74, 0x4f, 0x70, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65,+ 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,+ 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x47, 0x69, 0x74, 0x4f,+ 0x70, 0x73, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x35,+ 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x12, 0x2d, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d,+ 0x65, 0x3d, 0x65, 0x78, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f,+ 0x6e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x70, 0x72, 0x6f,+ 0x6a, 0x65, 0x63, 0x74, 0x73, 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 (@@ -1237,7 +1476,7 @@ func file_v1_externalvs_service_proto_rawDescGZIP() []byte {}var file_v1_externalvs_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)-var file_v1_externalvs_service_proto_msgTypes = make([]protoimpl.MessageInfo, 13)+var file_v1_externalvs_service_proto_msgTypes = make([]protoimpl.MessageInfo, 16)var file_v1_externalvs_service_proto_goTypes = []interface{}{(ExternalVersionControl_Type)(0), // 0: bytebase.v1.ExternalVersionControl.Type(*CreateExternalVersionControlRequest)(nil), // 1: bytebase.v1.CreateExternalVersionControlRequest@@ -1252,39 +1491,47 @@ var file_v1_externalvs_service_proto_goTypes = []interface{}{(*ListProjectGitOpsInfoResponse)(nil), // 10: bytebase.v1.ListProjectGitOpsInfoResponse(*ExternalVersionControl)(nil), // 11: bytebase.v1.ExternalVersionControl(*ProjectGitOpsInfo)(nil), // 12: bytebase.v1.ProjectGitOpsInfo- (*SearchExternalVersionControlProjectsResponse_Project)(nil), // 13: bytebase.v1.SearchExternalVersionControlProjectsResponse.Project- (*fieldmaskpb.FieldMask)(nil), // 14: google.protobuf.FieldMask- (*timestamppb.Timestamp)(nil), // 15: google.protobuf.Timestamp- (*emptypb.Empty)(nil), // 16: google.protobuf.Empty+ (*ExchangeTokenRequest)(nil), // 13: bytebase.v1.ExchangeTokenRequest+ (*ExchangeToken)(nil), // 14: bytebase.v1.ExchangeToken+ (*OAuthToken)(nil), // 15: bytebase.v1.OAuthToken+ (*SearchExternalVersionControlProjectsResponse_Project)(nil), // 16: bytebase.v1.SearchExternalVersionControlProjectsResponse.Project+ (*fieldmaskpb.FieldMask)(nil), // 17: google.protobuf.FieldMask+ (*timestamppb.Timestamp)(nil), // 18: google.protobuf.Timestamp+ (*emptypb.Empty)(nil), // 19: google.protobuf.Empty}var file_v1_externalvs_service_proto_depIdxs = []int32{11, // 0: bytebase.v1.CreateExternalVersionControlRequest.external_version_control:type_name -> bytebase.v1.ExternalVersionControl11, // 1: bytebase.v1.ListExternalVersionControlsResponse.external_version_controls:type_name -> bytebase.v1.ExternalVersionControl11, // 2: bytebase.v1.UpdateExternalVersionControlRequest.external_version_control:type_name -> bytebase.v1.ExternalVersionControl- 14, // 3: bytebase.v1.UpdateExternalVersionControlRequest.update_mask:type_name -> google.protobuf.FieldMask- 13, // 4: bytebase.v1.SearchExternalVersionControlProjectsResponse.projects:type_name -> bytebase.v1.SearchExternalVersionControlProjectsResponse.Project+ 17, // 3: bytebase.v1.UpdateExternalVersionControlRequest.update_mask:type_name -> google.protobuf.FieldMask+ 16, // 4: bytebase.v1.SearchExternalVersionControlProjectsResponse.projects:type_name -> bytebase.v1.SearchExternalVersionControlProjectsResponse.Project12, // 5: bytebase.v1.ListProjectGitOpsInfoResponse.project_gitops_info:type_name -> bytebase.v1.ProjectGitOpsInfo0, // 6: bytebase.v1.ExternalVersionControl.type:type_name -> bytebase.v1.ExternalVersionControl.Type- 15, // 7: bytebase.v1.ProjectGitOpsInfo.expires_time:type_name -> google.protobuf.Timestamp- 2, // 8: bytebase.v1.ExternalVersionControlService.GetExternalVersionControl:input_type -> bytebase.v1.GetExternalVersionControlRequest- 3, // 9: bytebase.v1.ExternalVersionControlService.ListExternalVersionControls:input_type -> bytebase.v1.ListExternalVersionControlsRequest- 1, // 10: bytebase.v1.ExternalVersionControlService.CreateExternalVersionControl:input_type -> bytebase.v1.CreateExternalVersionControlRequest- 5, // 11: bytebase.v1.ExternalVersionControlService.UpdateExternalVersionControl:input_type -> bytebase.v1.UpdateExternalVersionControlRequest- 6, // 12: bytebase.v1.ExternalVersionControlService.DeleteExternalVersionControl:input_type -> bytebase.v1.DeleteExternalVersionControlRequest- 7, // 13: bytebase.v1.ExternalVersionControlService.SearchExternalVersionControlProjects:input_type -> bytebase.v1.SearchExternalVersionControlProjectsRequest- 9, // 14: bytebase.v1.ExternalVersionControlService.ListProjectGitOpsInfo:input_type -> bytebase.v1.ListProjectGitOpsInfoRequest- 11, // 15: bytebase.v1.ExternalVersionControlService.GetExternalVersionControl:output_type -> bytebase.v1.ExternalVersionControl- 4, // 16: bytebase.v1.ExternalVersionControlService.ListExternalVersionControls:output_type -> bytebase.v1.ListExternalVersionControlsResponse- 11, // 17: bytebase.v1.ExternalVersionControlService.CreateExternalVersionControl:output_type -> bytebase.v1.ExternalVersionControl- 11, // 18: bytebase.v1.ExternalVersionControlService.UpdateExternalVersionControl:output_type -> bytebase.v1.ExternalVersionControl- 16, // 19: bytebase.v1.ExternalVersionControlService.DeleteExternalVersionControl:output_type -> google.protobuf.Empty- 8, // 20: bytebase.v1.ExternalVersionControlService.SearchExternalVersionControlProjects:output_type -> bytebase.v1.SearchExternalVersionControlProjectsResponse- 10, // 21: bytebase.v1.ExternalVersionControlService.ListProjectGitOpsInfo:output_type -> bytebase.v1.ListProjectGitOpsInfoResponse- 15, // [15:22] is the sub-list for method output_type- 8, // [8:15] is the sub-list for method input_type- 8, // [8:8] is the sub-list for extension type_name- 8, // [8:8] is the sub-list for extension extendee- 0, // [0:8] is the sub-list for field type_name+ 18, // 7: bytebase.v1.ProjectGitOpsInfo.expires_time:type_name -> google.protobuf.Timestamp+ 14, // 8: bytebase.v1.ExchangeTokenRequest.exchange_token:type_name -> bytebase.v1.ExchangeToken+ 0, // 9: bytebase.v1.ExchangeToken.type:type_name -> bytebase.v1.ExternalVersionControl.Type+ 18, // 10: bytebase.v1.OAuthToken.expires_time:type_name -> google.protobuf.Timestamp+ 2, // 11: bytebase.v1.ExternalVersionControlService.GetExternalVersionControl:input_type -> bytebase.v1.GetExternalVersionControlRequest+ 3, // 12: bytebase.v1.ExternalVersionControlService.ListExternalVersionControls:input_type -> bytebase.v1.ListExternalVersionControlsRequest+ 1, // 13: bytebase.v1.ExternalVersionControlService.CreateExternalVersionControl:input_type -> bytebase.v1.CreateExternalVersionControlRequest+ 5, // 14: bytebase.v1.ExternalVersionControlService.UpdateExternalVersionControl:input_type -> bytebase.v1.UpdateExternalVersionControlRequest+ 13, // 15: bytebase.v1.ExternalVersionControlService.ExchangeToken:input_type -> bytebase.v1.ExchangeTokenRequest+ 6, // 16: bytebase.v1.ExternalVersionControlService.DeleteExternalVersionControl:input_type -> bytebase.v1.DeleteExternalVersionControlRequest+ 7, // 17: bytebase.v1.ExternalVersionControlService.SearchExternalVersionControlProjects:input_type -> bytebase.v1.SearchExternalVersionControlProjectsRequest+ 9, // 18: bytebase.v1.ExternalVersionControlService.ListProjectGitOpsInfo:input_type -> bytebase.v1.ListProjectGitOpsInfoRequest+ 11, // 19: bytebase.v1.ExternalVersionControlService.GetExternalVersionControl:output_type -> bytebase.v1.ExternalVersionControl+ 4, // 20: bytebase.v1.ExternalVersionControlService.ListExternalVersionControls:output_type -> bytebase.v1.ListExternalVersionControlsResponse+ 11, // 21: bytebase.v1.ExternalVersionControlService.CreateExternalVersionControl:output_type -> bytebase.v1.ExternalVersionControl+ 11, // 22: bytebase.v1.ExternalVersionControlService.UpdateExternalVersionControl:output_type -> bytebase.v1.ExternalVersionControl+ 15, // 23: bytebase.v1.ExternalVersionControlService.ExchangeToken:output_type -> bytebase.v1.OAuthToken+ 19, // 24: bytebase.v1.ExternalVersionControlService.DeleteExternalVersionControl:output_type -> google.protobuf.Empty+ 8, // 25: bytebase.v1.ExternalVersionControlService.SearchExternalVersionControlProjects:output_type -> bytebase.v1.SearchExternalVersionControlProjectsResponse+ 10, // 26: bytebase.v1.ExternalVersionControlService.ListProjectGitOpsInfo:output_type -> bytebase.v1.ListProjectGitOpsInfoResponse+ 19, // [19:27] is the sub-list for method output_type+ 11, // [11:19] is the sub-list for method input_type+ 11, // [11:11] is the sub-list for extension type_name+ 11, // [11:11] is the sub-list for extension extendee+ 0, // [0:11] is the sub-list for field type_name}func init() { file_v1_externalvs_service_proto_init() }@@ -1438,6 +1685,42 @@ func file_v1_externalvs_service_proto_init() {}}file_v1_externalvs_service_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*ExchangeTokenRequest); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_v1_externalvs_service_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*ExchangeToken); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_v1_externalvs_service_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*OAuthToken); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_v1_externalvs_service_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} {switch v := v.(*SearchExternalVersionControlProjectsResponse_Project); i {case 0:return &v.state@@ -1456,7 +1739,7 @@ func file_v1_externalvs_service_proto_init() {GoPackagePath: reflect.TypeOf(x{}).PkgPath(),RawDescriptor: file_v1_externalvs_service_proto_rawDesc,NumEnums: 1,- NumMessages: 13,+ NumMessages: 16,NumExtensions: 0,NumServices: 1,},diff --git a/proto/generated-go/v1/externalvs_service.pb.gw.go b/proto/generated-go/v1/externalvs_service.pb.gw.goindex d78300ab55..3795abdea6 100644--- a/proto/generated-go/v1/externalvs_service.pb.gw.go+++ b/proto/generated-go/v1/externalvs_service.pb.gw.go@@ -253,6 +253,74 @@ func local_request_ExternalVersionControlService_UpdateExternalVersionControl_0(}+func request_ExternalVersionControlService_ExchangeToken_0(ctx context.Context, marshaler runtime.Marshaler, client ExternalVersionControlServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq ExchangeTokenRequest+ var metadata runtime.ServerMetadata++ newReader, berr := utilities.IOReaderFactory(req.Body)+ if berr != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)+ }+ if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.ExchangeToken); err != nil && err != io.EOF {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }++ var (+ val string+ ok bool+ err error+ _ = err+ )++ val, ok = pathParams["exchange_token.name"]+ if !ok {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "exchange_token.name")+ }++ err = runtime.PopulateFieldFromPath(&protoReq, "exchange_token.name", val)+ if err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "exchange_token.name", err)+ }++ msg, err := client.ExchangeToken(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))+ return msg, metadata, err++}++func local_request_ExternalVersionControlService_ExchangeToken_0(ctx context.Context, marshaler runtime.Marshaler, server ExternalVersionControlServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq ExchangeTokenRequest+ var metadata runtime.ServerMetadata++ newReader, berr := utilities.IOReaderFactory(req.Body)+ if berr != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)+ }+ if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.ExchangeToken); err != nil && err != io.EOF {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }++ var (+ val string+ ok bool+ err error+ _ = err+ )++ val, ok = pathParams["exchange_token.name"]+ if !ok {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "exchange_token.name")+ }++ err = runtime.PopulateFieldFromPath(&protoReq, "exchange_token.name", val)+ if err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "exchange_token.name", err)+ }++ msg, err := server.ExchangeToken(ctx, &protoReq)+ return msg, metadata, err++}+func request_ExternalVersionControlService_DeleteExternalVersionControl_0(ctx context.Context, marshaler runtime.Marshaler, client ExternalVersionControlServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {var protoReq DeleteExternalVersionControlRequestvar metadata runtime.ServerMetadata@@ -531,6 +599,31 @@ func RegisterExternalVersionControlServiceHandlerServer(ctx context.Context, mux})+ mux.Handle("POST", pattern_ExternalVersionControlService_ExchangeToken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ var stream runtime.ServerTransportStream+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.ExternalVersionControlService/ExchangeToken", runtime.WithHTTPPathPattern("/v1/{exchange_token.name=externalVersionControls/*}:exchangeToken"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := local_request_ExternalVersionControlService_ExchangeToken_0(annotatedContext, inboundMarshaler, server, req, pathParams)+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_ExternalVersionControlService_ExchangeToken_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })+mux.Handle("DELETE", pattern_ExternalVersionControlService_DeleteExternalVersionControl_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {ctx, cancel := context.WithCancel(req.Context())defer cancel()@@ -735,6 +828,28 @@ func RegisterExternalVersionControlServiceHandlerClient(ctx context.Context, mux})+ mux.Handle("POST", pattern_ExternalVersionControlService_ExchangeToken_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.ExternalVersionControlService/ExchangeToken", runtime.WithHTTPPathPattern("/v1/{exchange_token.name=externalVersionControls/*}:exchangeToken"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := request_ExternalVersionControlService_ExchangeToken_0(annotatedContext, inboundMarshaler, client, req, pathParams)+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_ExternalVersionControlService_ExchangeToken_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })+mux.Handle("DELETE", pattern_ExternalVersionControlService_DeleteExternalVersionControl_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {ctx, cancel := context.WithCancel(req.Context())defer cancel()@@ -813,6 +928,8 @@ var (pattern_ExternalVersionControlService_UpdateExternalVersionControl_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"v1", "externalVersionControls", "external_version_control.name"}, ""))+ pattern_ExternalVersionControlService_ExchangeToken_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"v1", "externalVersionControls", "exchange_token.name"}, "exchangeToken"))+pattern_ExternalVersionControlService_DeleteExternalVersionControl_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"v1", "externalVersionControls", "name"}, ""))pattern_ExternalVersionControlService_SearchExternalVersionControlProjects_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"v1", "externalVersionControls", "name"}, "searchProjects"))@@ -829,6 +946,8 @@ var (forward_ExternalVersionControlService_UpdateExternalVersionControl_0 = runtime.ForwardResponseMessage+ forward_ExternalVersionControlService_ExchangeToken_0 = runtime.ForwardResponseMessage+forward_ExternalVersionControlService_DeleteExternalVersionControl_0 = runtime.ForwardResponseMessageforward_ExternalVersionControlService_SearchExternalVersionControlProjects_0 = runtime.ForwardResponseMessagediff --git a/proto/generated-go/v1/externalvs_service_grpc.pb.go b/proto/generated-go/v1/externalvs_service_grpc.pb.goindex dc8ca21286..ff866735b9 100644--- a/proto/generated-go/v1/externalvs_service_grpc.pb.go+++ b/proto/generated-go/v1/externalvs_service_grpc.pb.go@@ -24,6 +24,7 @@ const (ExternalVersionControlService_ListExternalVersionControls_FullMethodName = "/bytebase.v1.ExternalVersionControlService/ListExternalVersionControls"ExternalVersionControlService_CreateExternalVersionControl_FullMethodName = "/bytebase.v1.ExternalVersionControlService/CreateExternalVersionControl"ExternalVersionControlService_UpdateExternalVersionControl_FullMethodName = "/bytebase.v1.ExternalVersionControlService/UpdateExternalVersionControl"+ ExternalVersionControlService_ExchangeToken_FullMethodName = "/bytebase.v1.ExternalVersionControlService/ExchangeToken"ExternalVersionControlService_DeleteExternalVersionControl_FullMethodName = "/bytebase.v1.ExternalVersionControlService/DeleteExternalVersionControl"ExternalVersionControlService_SearchExternalVersionControlProjects_FullMethodName = "/bytebase.v1.ExternalVersionControlService/SearchExternalVersionControlProjects"ExternalVersionControlService_ListProjectGitOpsInfo_FullMethodName = "/bytebase.v1.ExternalVersionControlService/ListProjectGitOpsInfo"@@ -37,6 +38,7 @@ type ExternalVersionControlServiceClient interface {ListExternalVersionControls(ctx context.Context, in *ListExternalVersionControlsRequest, opts ...grpc.CallOption) (*ListExternalVersionControlsResponse, error)CreateExternalVersionControl(ctx context.Context, in *CreateExternalVersionControlRequest, opts ...grpc.CallOption) (*ExternalVersionControl, error)UpdateExternalVersionControl(ctx context.Context, in *UpdateExternalVersionControlRequest, opts ...grpc.CallOption) (*ExternalVersionControl, error)+ ExchangeToken(ctx context.Context, in *ExchangeTokenRequest, opts ...grpc.CallOption) (*OAuthToken, error)DeleteExternalVersionControl(ctx context.Context, in *DeleteExternalVersionControlRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)SearchExternalVersionControlProjects(ctx context.Context, in *SearchExternalVersionControlProjectsRequest, opts ...grpc.CallOption) (*SearchExternalVersionControlProjectsResponse, error)ListProjectGitOpsInfo(ctx context.Context, in *ListProjectGitOpsInfoRequest, opts ...grpc.CallOption) (*ListProjectGitOpsInfoResponse, error)@@ -86,6 +88,15 @@ func (c *externalVersionControlServiceClient) UpdateExternalVersionControl(ctx creturn out, nil}+func (c *externalVersionControlServiceClient) ExchangeToken(ctx context.Context, in *ExchangeTokenRequest, opts ...grpc.CallOption) (*OAuthToken, error) {+ out := new(OAuthToken)+ err := c.cc.Invoke(ctx, ExternalVersionControlService_ExchangeToken_FullMethodName, in, out, opts...)+ if err != nil {+ return nil, err+ }+ return out, nil+}+func (c *externalVersionControlServiceClient) DeleteExternalVersionControl(ctx context.Context, in *DeleteExternalVersionControlRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {out := new(emptypb.Empty)err := c.cc.Invoke(ctx, ExternalVersionControlService_DeleteExternalVersionControl_FullMethodName, in, out, opts...)@@ -121,6 +132,7 @@ type ExternalVersionControlServiceServer interface {ListExternalVersionControls(context.Context, *ListExternalVersionControlsRequest) (*ListExternalVersionControlsResponse, error)CreateExternalVersionControl(context.Context, *CreateExternalVersionControlRequest) (*ExternalVersionControl, error)UpdateExternalVersionControl(context.Context, *UpdateExternalVersionControlRequest) (*ExternalVersionControl, error)+ ExchangeToken(context.Context, *ExchangeTokenRequest) (*OAuthToken, error)DeleteExternalVersionControl(context.Context, *DeleteExternalVersionControlRequest) (*emptypb.Empty, error)SearchExternalVersionControlProjects(context.Context, *SearchExternalVersionControlProjectsRequest) (*SearchExternalVersionControlProjectsResponse, error)ListProjectGitOpsInfo(context.Context, *ListProjectGitOpsInfoRequest) (*ListProjectGitOpsInfoResponse, error)@@ -143,6 +155,9 @@ func (UnimplementedExternalVersionControlServiceServer) CreateExternalVersionConfunc (UnimplementedExternalVersionControlServiceServer) UpdateExternalVersionControl(context.Context, *UpdateExternalVersionControlRequest) (*ExternalVersionControl, error) {return nil, status.Errorf(codes.Unimplemented, "method UpdateExternalVersionControl not implemented")}+func (UnimplementedExternalVersionControlServiceServer) ExchangeToken(context.Context, *ExchangeTokenRequest) (*OAuthToken, error) {+ return nil, status.Errorf(codes.Unimplemented, "method ExchangeToken not implemented")+}func (UnimplementedExternalVersionControlServiceServer) DeleteExternalVersionControl(context.Context, *DeleteExternalVersionControlRequest) (*emptypb.Empty, error) {return nil, status.Errorf(codes.Unimplemented, "method DeleteExternalVersionControl not implemented")}@@ -238,6 +253,24 @@ func _ExternalVersionControlService_UpdateExternalVersionControl_Handler(srv intreturn interceptor(ctx, in, info, handler)}+func _ExternalVersionControlService_ExchangeToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {+ in := new(ExchangeTokenRequest)+ if err := dec(in); err != nil {+ return nil, err+ }+ if interceptor == nil {+ return srv.(ExternalVersionControlServiceServer).ExchangeToken(ctx, in)+ }+ info := &grpc.UnaryServerInfo{+ Server: srv,+ FullMethod: ExternalVersionControlService_ExchangeToken_FullMethodName,+ }+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {+ return srv.(ExternalVersionControlServiceServer).ExchangeToken(ctx, req.(*ExchangeTokenRequest))+ }+ return interceptor(ctx, in, info, handler)+}+func _ExternalVersionControlService_DeleteExternalVersionControl_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {in := new(DeleteExternalVersionControlRequest)if err := dec(in); err != nil {@@ -315,6 +348,10 @@ var ExternalVersionControlService_ServiceDesc = grpc.ServiceDesc{MethodName: "UpdateExternalVersionControl",Handler: _ExternalVersionControlService_UpdateExternalVersionControl_Handler,},+ {+ MethodName: "ExchangeToken",+ Handler: _ExternalVersionControlService_ExchangeToken_Handler,+ },{MethodName: "DeleteExternalVersionControl",Handler: _ExternalVersionControlService_DeleteExternalVersionControl_Handler,diff --git a/proto/v1/externalvs_service.proto b/proto/v1/externalvs_service.protoindex 7a686995ca..674f892332 100644--- a/proto/v1/externalvs_service.proto+++ b/proto/v1/externalvs_service.proto@@ -38,6 +38,14 @@ service ExternalVersionControlService {option (google.api.method_signature) = "external_version_control,update_mask";}+ rpc ExchangeToken(ExchangeTokenRequest) returns (OAuthToken) {+ option (google.api.http) = {+ post: "/v1/{exchange_token.name=externalVersionControls/*}:exchangeToken"+ body: "exchange_token"+ };+ option (google.api.method_signature) = "";+ }+rpc DeleteExternalVersionControl(DeleteExternalVersionControlRequest) returns (google.protobuf.Empty) {option (google.api.http) = {delete: "/v1/{name=externalVersionControls/*}"};}@@ -220,3 +228,31 @@ message ProjectGitOpsInfo {string refresh_token = 16 [(google.api.field_behavior) = INPUT_ONLY];}++message ExchangeTokenRequest {+ ExchangeToken exchange_token = 1;+}++message ExchangeToken {+ // The name of the external version control to retrieve the linked projects.+ // Format: externalVersionControls/{externalVersionControl}+ string name = 1;++ string code = 2;++ ExternalVersionControl.Type type = 3;++ string instance_url = 4;++ string client_id = 5;++ string client_secret = 6;+}++message OAuthToken {+ string access_token = 1 [(google.api.field_behavior) = OUTPUT_ONLY];++ string refresh_token = 2 [(google.api.field_behavior) = OUTPUT_ONLY];++ google.protobuf.Timestamp expires_time = 15 [(google.api.field_behavior) = OUTPUT_ONLY];+}