From 0e80813f36df0becb2c1033068cd513c23626658 Mon Sep 17 00:00:00 2001 From: Huiwen Date: Mon, 27 Nov 2023 09:51:14 +0000 Subject: [PATCH 01/10] Implement --- components/dashboard/src/data/setup.tsx | 4 +- .../service/json-rpc-verification-client.ts | 142 ++ .../dashboard/src/service/public-api.ts | 7 + .../gitpod-db/src/email-domain-filter-db.ts | 2 +- .../typeorm/email-domain-filter-db-impl.ts | 4 +- .../src/public-api-converter.ts | 21 + .../public-api/gitpod/v1/verification.proto | 155 ++ components/public-api/go/v1/scm_grpc.pb.go | 16 + .../public-api/go/v1/v1connect/scm.connect.go | 16 + .../go/v1/v1connect/verification.connect.go | 242 +++ .../v1connect/verification.proxy.connect.go | 90 ++ .../public-api/go/v1/verification.pb.go | 1394 +++++++++++++++++ .../public-api/go/v1/verification_grpc.pb.go | 343 ++++ .../typescript/src/gitpod/v1/scm_connect.ts | 12 + .../src/gitpod/v1/verification_connect.ts | 101 ++ .../src/gitpod/v1/verification_pb.ts | 744 +++++++++ components/server/src/api/sorting.ts | 46 + .../src/api/verification-service-api.ts | 203 +++ .../server/src/auth/verification-service.ts | 53 +- .../src/workspace/gitpod-server-impl.ts | 20 +- 20 files changed, 3596 insertions(+), 19 deletions(-) create mode 100644 components/dashboard/src/service/json-rpc-verification-client.ts create mode 100644 components/public-api/gitpod/v1/verification.proto create mode 100644 components/public-api/go/v1/v1connect/verification.connect.go create mode 100644 components/public-api/go/v1/v1connect/verification.proxy.connect.go create mode 100644 components/public-api/go/v1/verification.pb.go create mode 100644 components/public-api/go/v1/verification_grpc.pb.go create mode 100644 components/public-api/typescript/src/gitpod/v1/verification_connect.ts create mode 100644 components/public-api/typescript/src/gitpod/v1/verification_pb.ts create mode 100644 components/server/src/api/sorting.ts create mode 100644 components/server/src/api/verification-service-api.ts diff --git a/components/dashboard/src/data/setup.tsx b/components/dashboard/src/data/setup.tsx index 3f069e03fcb3a5..54c4fd46bcb84e 100644 --- a/components/dashboard/src/data/setup.tsx +++ b/components/dashboard/src/data/setup.tsx @@ -24,13 +24,14 @@ import * as ConfigurationClasses from "@gitpod/public-api/lib/gitpod/v1/configur import * as AuthProviderClasses from "@gitpod/public-api/lib/gitpod/v1/authprovider_pb"; import * as EnvVarClasses from "@gitpod/public-api/lib/gitpod/v1/envvar_pb"; import * as PrebuildClasses from "@gitpod/public-api/lib/gitpod/v1/prebuild_pb"; +import * as VerificationClasses from "@gitpod/public-api/lib/gitpod/v1/verification_pb"; import * as SCMClasses from "@gitpod/public-api/lib/gitpod/v1/scm_pb"; import * as SSHClasses from "@gitpod/public-api/lib/gitpod/v1/ssh_pb"; // This is used to version the cache // If data we cache changes in a non-backwards compatible way, increment this version // That will bust any previous cache versions a client may have stored -const CACHE_VERSION = "8"; +const CACHE_VERSION = "9"; export function noPersistence(queryKey: QueryKey): QueryKey { return [...queryKey, "no-persistence"]; @@ -152,6 +153,7 @@ function initializeMessages() { ...Object.values(AuthProviderClasses), ...Object.values(EnvVarClasses), ...Object.values(PrebuildClasses), + ...Object.values(VerificationClasses), ...Object.values(SCMClasses), ...Object.values(SSHClasses), ]; diff --git a/components/dashboard/src/service/json-rpc-verification-client.ts b/components/dashboard/src/service/json-rpc-verification-client.ts new file mode 100644 index 00000000000000..3f8b7a3e9f5d2e --- /dev/null +++ b/components/dashboard/src/service/json-rpc-verification-client.ts @@ -0,0 +1,142 @@ +/** + * Copyright (c) 2023 Gitpod GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License.AGPL.txt in the project root for license information. + */ + +import { CallOptions, PromiseClient } from "@connectrpc/connect"; +import { PartialMessage } from "@bufbuild/protobuf"; +import { VerificationService } from "@gitpod/public-api/lib/gitpod/v1/verification_connect"; +import { + SendPhoneNumberVerificationTokenRequest, + SendPhoneNumberVerificationTokenResponse, + VerifyPhoneNumberVerificationTokenRequest, + VerifyPhoneNumberVerificationTokenResponse, + ListBlockedRepositoriesRequest, + ListBlockedRepositoriesResponse, + CreateBlockedRepositoryRequest, + CreateBlockedRepositoryResponse, + DeleteBlockedRepositoryRequest, + DeleteBlockedRepositoryResponse, + ListBlockedEmailDomainsRequest, + ListBlockedEmailDomainsResponse, + CreateBlockedEmailDomainRequest, + CreateBlockedEmailDomainResponse, +} from "@gitpod/public-api/lib/gitpod/v1/verification_pb"; +import { ApplicationError, ErrorCodes } from "@gitpod/gitpod-protocol/lib/messaging/error"; +import { getGitpodService } from "./service"; +import { validate as uuidValidate } from "uuid"; +import { converter } from "./public-api"; +import { PaginationResponse } from "@gitpod/public-api/lib/gitpod/v1/pagination_pb"; + +export class JsonRpcVerificationClient implements PromiseClient { + async sendPhoneNumberVerificationToken( + request: PartialMessage, + _options?: CallOptions | undefined, + ): Promise { + if (!request.phoneNumber) { + throw new ApplicationError(ErrorCodes.BAD_REQUEST, "phoneNumber is required"); + } + const info = await getGitpodService().server.sendPhoneNumberVerificationToken(request.phoneNumber); + return new SendPhoneNumberVerificationTokenResponse({ + verificationId: info.verificationId, + }); + } + + async verifyPhoneNumberVerificationToken( + request: PartialMessage, + _options?: CallOptions | undefined, + ): Promise { + if (!request.phoneNumber) { + throw new ApplicationError(ErrorCodes.BAD_REQUEST, "phoneNumber is required"); + } + if (!request.verificationId || !uuidValidate(request.verificationId)) { + throw new ApplicationError(ErrorCodes.BAD_REQUEST, "verificationId is required"); + } + if (!request.token) { + throw new ApplicationError(ErrorCodes.BAD_REQUEST, "token is required"); + } + const info = await getGitpodService().server.verifyPhoneNumberVerificationToken( + request.phoneNumber, + request.token, + request.verificationId, + ); + return new VerifyPhoneNumberVerificationTokenResponse({ + verified: info, + }); + } + + async listBlockedRepositories( + request: PartialMessage, + _options?: CallOptions | undefined, + ): Promise { + // dashboard params is constant, no need to implement + const info = await getGitpodService().server.adminGetBlockedRepositories({ + limit: 100, + offset: 0, + orderBy: "urlRegexp", + orderDir: "asc", + searchTerm: request.searchTerm, + }); + return new ListBlockedRepositoriesResponse({ + blockedRepositories: info.rows.map((item) => converter.toBlockedRepository(item)), + pagination: new PaginationResponse(), + }); + } + + async createBlockedRepository( + request: PartialMessage, + _options?: CallOptions | undefined, + ): Promise { + if (!request.urlRegexp) { + throw new ApplicationError(ErrorCodes.BAD_REQUEST, "urlRegexp is required"); + } + if (!request.blockUser) { + throw new ApplicationError(ErrorCodes.BAD_REQUEST, "blockUser is required"); + } + const info = await getGitpodService().server.adminCreateBlockedRepository(request.urlRegexp, request.blockUser); + return new CreateBlockedRepositoryResponse({ + blockedRepository: converter.toBlockedRepository(info), + }); + } + + async deleteBlockedRepository( + request: PartialMessage, + _options?: CallOptions | undefined, + ): Promise { + if (!request.blockedRepositoryId) { + throw new ApplicationError(ErrorCodes.BAD_REQUEST, "blockedRepositoryId is required"); + } + await getGitpodService().server.adminDeleteBlockedRepository(request.blockedRepositoryId); + return new DeleteBlockedRepositoryResponse(); + } + + async listBlockedEmailDomains( + request: PartialMessage, + _options?: CallOptions | undefined, + ): Promise { + const info = await getGitpodService().server.adminGetBlockedEmailDomains(); + return new ListBlockedEmailDomainsResponse({ + blockedEmailDomains: info.map((item) => converter.toBlockedEmailDomain(item)), + pagination: new PaginationResponse(), + }); + } + + async createBlockedEmailDomain( + request: PartialMessage, + _options?: CallOptions | undefined, + ): Promise { + if (!request.domain) { + throw new ApplicationError(ErrorCodes.BAD_REQUEST, "domain is required"); + } + if (request.negative === undefined) { + throw new ApplicationError(ErrorCodes.BAD_REQUEST, "negative is required"); + } + await getGitpodService().server.adminSaveBlockedEmailDomain({ + domain: request.domain, + negative: request.negative, + }); + // There's no way to get blockedEmailDomain, just ignore it since dashboard don't care about the response data + return new CreateBlockedEmailDomainResponse({}); + } +} diff --git a/components/dashboard/src/service/public-api.ts b/components/dashboard/src/service/public-api.ts index e9a4888219dd3b..98af53c83cc6a7 100644 --- a/components/dashboard/src/service/public-api.ts +++ b/components/dashboard/src/service/public-api.ts @@ -36,6 +36,8 @@ import { JsonRpcScmClient } from "./json-rpc-scm-client"; import { SCMService } from "@gitpod/public-api/lib/gitpod/v1/scm_connect"; import { SSHService } from "@gitpod/public-api/lib/gitpod/v1/ssh_connect"; import { JsonRpcSSHClient } from "./json-rpc-ssh-client"; +import { JsonRpcVerificationClient } from "./json-rpc-verification-client"; +import { VerificationService } from "@gitpod/public-api/lib/gitpod/v1/verification_connect"; const transport = createConnectTransport({ baseUrl: `${window.location.protocol}//${window.location.host}/public-api`, @@ -91,6 +93,11 @@ export const sshClient = createServiceClient(SSHService, { featureFlagSuffix: "ssh", }); +export const verificationClient = createServiceClient(VerificationService, { + client: new JsonRpcVerificationClient(), + featureFlagSuffix: "verification", +}); + export async function listAllProjects(opts: { orgId: string }): Promise { let pagination = { page: 1, diff --git a/components/gitpod-db/src/email-domain-filter-db.ts b/components/gitpod-db/src/email-domain-filter-db.ts index e4f245f4669f3e..e9962d0daa6ed3 100644 --- a/components/gitpod-db/src/email-domain-filter-db.ts +++ b/components/gitpod-db/src/email-domain-filter-db.ts @@ -8,7 +8,7 @@ import { EmailDomainFilterEntry } from "@gitpod/gitpod-protocol"; export const EmailDomainFilterDB = Symbol("EmailDomainFilterDB"); export interface EmailDomainFilterDB { - storeFilterEntry(entry: EmailDomainFilterEntry): Promise; + storeFilterEntry(entry: EmailDomainFilterEntry): Promise; getFilterEntries(): Promise; /** diff --git a/components/gitpod-db/src/typeorm/email-domain-filter-db-impl.ts b/components/gitpod-db/src/typeorm/email-domain-filter-db-impl.ts index ba7d70b5b34229..2d2eff2310f353 100644 --- a/components/gitpod-db/src/typeorm/email-domain-filter-db-impl.ts +++ b/components/gitpod-db/src/typeorm/email-domain-filter-db-impl.ts @@ -24,9 +24,9 @@ export class EmailDomainFilterDBImpl implements EmailDomainFilterDB { return (await this.getManager()).getRepository(DBEmailDomainFilterEntry); } - async storeFilterEntry(entry: EmailDomainFilterEntry): Promise { + async storeFilterEntry(entry: EmailDomainFilterEntry): Promise { const repo = await this.getRepo(); - await repo.save(entry); + return await repo.save(entry); } async getFilterEntries(): Promise { diff --git a/components/gitpod-protocol/src/public-api-converter.ts b/components/gitpod-protocol/src/public-api-converter.ts index b5f81e51321bd5..ed2e71d065bd5e 100644 --- a/components/gitpod-protocol/src/public-api-converter.ts +++ b/components/gitpod-protocol/src/public-api-converter.ts @@ -51,6 +51,7 @@ import { WorkspacePort_Protocol, WorkspaceStatus, } from "@gitpod/public-api/lib/gitpod/v1/workspace_pb"; +import { BlockedEmailDomain, BlockedRepository } from "@gitpod/public-api/lib/gitpod/v1/verification_pb"; import { SSHPublicKey } from "@gitpod/public-api/lib/gitpod/v1/ssh_pb"; import { ConfigurationEnvironmentVariable, @@ -89,6 +90,7 @@ import { Token, SuggestedRepository as SuggestedRepositoryProtocol, UserSSHPublicKeyValue, + EmailDomainFilterEntry, } from "./protocol"; import { OrgMemberInfo, @@ -109,6 +111,7 @@ import { } from "./workspace-instance"; import { Author, Commit } from "@gitpod/public-api/lib/gitpod/v1/scm_pb"; import type { DeepPartial } from "./util/deep-partial"; +import { BlockedRepository as ProtocolBlockedRepository } from "./blocked-repositories-protocol"; export type PartialConfiguration = DeepPartial & Pick; @@ -879,6 +882,24 @@ export class PublicAPIConverter { return PrebuildPhase_Phase.UNSPECIFIED; } + toBlockedRepository(repo: ProtocolBlockedRepository): BlockedRepository { + return new BlockedRepository({ + id: repo.id, + urlRegexp: repo.urlRegexp, + blockUser: repo.blockUser, + creationTime: Timestamp.fromDate(new Date(repo.createdAt)), + updateTime: Timestamp.fromDate(new Date(repo.updatedAt)), + }); + } + + toBlockedEmailDomain(item: EmailDomainFilterEntry): BlockedEmailDomain { + return new BlockedEmailDomain({ + id: "", + domain: item.domain, + negative: item.negative, + }); + } + toSCMToken(t: Token): SCMToken { return new SCMToken({ username: t.username, diff --git a/components/public-api/gitpod/v1/verification.proto b/components/public-api/gitpod/v1/verification.proto new file mode 100644 index 00000000000000..50aa0888066213 --- /dev/null +++ b/components/public-api/gitpod/v1/verification.proto @@ -0,0 +1,155 @@ +syntax = "proto3"; + +package gitpod.v1; + +import "gitpod/v1/pagination.proto"; +import "gitpod/v1/sorting.proto"; +import "google/protobuf/timestamp.proto"; + +option go_package = "github.com/gitpod-io/gitpod/components/public-api/go/v1"; + +service VerificationService { + // SendPhoneNumberVerificationToken sends a verification token to the + // specified phone number. + rpc SendPhoneNumberVerificationToken(SendPhoneNumberVerificationTokenRequest) returns (SendPhoneNumberVerificationTokenResponse) {} + + // VerifyPhoneNumberVerificationToken verifies the specified verification + // token. + rpc VerifyPhoneNumberVerificationToken(VerifyPhoneNumberVerificationTokenRequest) returns (VerifyPhoneNumberVerificationTokenResponse) {} + + // ListBlockedRepositories lists blocked repositories. + rpc ListBlockedRepositories(ListBlockedRepositoriesRequest) returns (ListBlockedRepositoriesResponse) {} + + // CreateBlockedRepository creates a new blocked repository. + rpc CreateBlockedRepository(CreateBlockedRepositoryRequest) returns (CreateBlockedRepositoryResponse) {} + + // DeleteBlockedRepository deletes a blocked repository. + rpc DeleteBlockedRepository(DeleteBlockedRepositoryRequest) returns (DeleteBlockedRepositoryResponse) {} + + // ListBlockedEmailDomains lists blocked email domains. + rpc ListBlockedEmailDomains(ListBlockedEmailDomainsRequest) returns (ListBlockedEmailDomainsResponse) {} + + // CreateBlockedEmailDomain creates a new blocked email domain. + rpc CreateBlockedEmailDomain(CreateBlockedEmailDomainRequest) returns (CreateBlockedEmailDomainResponse) {} +} + +// Required fields: +// - phone_number +message SendPhoneNumberVerificationTokenRequest { + // phone_number in E.164 format + string phone_number = 1; +} + +message SendPhoneNumberVerificationTokenResponse { + // verification_id is used to VerifyPhoneNumberVerificationToken + string verification_id = 1; +} + +// Required fields: +// - phone_number +// - verification_id +// - token +message VerifyPhoneNumberVerificationTokenRequest { + // phone_number in E.164 format + string phone_number = 1; + // verification_id is returned by SendPhoneNumberVerificationToken + string verification_id = 2; + // token is the verification token from providers + string token = 3; +} + +message VerifyPhoneNumberVerificationTokenResponse { + // verified indicates if the verification was successful + bool verified = 1; +} + +message ListBlockedRepositoriesRequest { + // pagination contains the pagination options for listing blocked repositories + PaginationRequest pagination = 1; + + // sort contains the sort options for listing blocked repositories + // BlockedRepositories can be sorted by "urlRegexp" + repeated Sort sort = 2; + + // search_term is a search term to filter blocked repositories by url_regexp + string search_term = 3; +} + +message ListBlockedRepositoriesResponse { + // pagination contains the pagination options for listing blocked repositories + PaginationResponse pagination = 1; + + // blocked_repositories are the blocked repositories + repeated BlockedRepository blocked_repositories = 2; +} + +message CreateBlockedRepositoryRequest { + // url_regexp is the regular expression for the repository URL + string url_regexp = 1; + + // block_user indicates if the user should be blocked from accessing the + // repository + bool block_user = 2; +} + +message CreateBlockedRepositoryResponse { + BlockedRepository blocked_repository = 1; +} + +message DeleteBlockedRepositoryRequest { + // blocked_repository_id is the ID of the blocked repository + uint32 blocked_repository_id = 1; +} + +message DeleteBlockedRepositoryResponse {} + +message ListBlockedEmailDomainsRequest { + // pagination contains the pagination options for listing blocked email + // domains + PaginationRequest pagination = 1; +} + +message ListBlockedEmailDomainsResponse { + // pagination contains the pagination options for listing blocked email + // domains + PaginationResponse pagination = 1; + + // blocked_email_domains are the blocked email domains + repeated BlockedEmailDomain blocked_email_domains = 2; +} + +message CreateBlockedEmailDomainRequest { + // domain is the blocked email domain + string domain = 1; + + bool negative = 2; +} + +message CreateBlockedEmailDomainResponse { + BlockedEmailDomain blocked_email_domain = 1; +} + +message BlockedRepository { + // id is the ID of the blocked repository + uint32 id = 1; + + // url_regexp is the regular expression for the repository URL + string url_regexp = 2; + + // block_user indicates if the user should be blocked from accessing the + // repository + bool block_user = 3; + + google.protobuf.Timestamp creation_time = 4; + google.protobuf.Timestamp update_time = 5; +} + +message BlockedEmailDomain { + // id is the ID of the blocked email domain + string id = 1; + + // domain is the blocked email domain + string domain = 2; + + bool negative = 3; +} diff --git a/components/public-api/go/v1/scm_grpc.pb.go b/components/public-api/go/v1/scm_grpc.pb.go index 540522260e418e..96b8cfdc878b90 100644 --- a/components/public-api/go/v1/scm_grpc.pb.go +++ b/components/public-api/go/v1/scm_grpc.pb.go @@ -26,9 +26,17 @@ const _ = grpc.SupportPackageIsVersion7 // // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type SCMServiceClient interface { + // SearchSCMTokens allows clients to retrieve SCM tokens based on the + // specified host. SearchSCMTokens(ctx context.Context, in *SearchSCMTokensRequest, opts ...grpc.CallOption) (*SearchSCMTokensResponse, error) + // GuessTokenScopes allows clients to retrieve scopes their SCM token would + // require for the specified git command. GuessTokenScopes(ctx context.Context, in *GuessTokenScopesRequest, opts ...grpc.CallOption) (*GuessTokenScopesResponse, error) + // SearchRepositories allows clients to search for suggested repositories of + // SCM providers they are connected with. SearchRepositories(ctx context.Context, in *SearchRepositoriesRequest, opts ...grpc.CallOption) (*SearchRepositoriesResponse, error) + // ListSuggestedRepositories allows clients to list suggested repositories + // based on recent workspaces and accessible repo configurations. ListSuggestedRepositories(ctx context.Context, in *ListSuggestedRepositoriesRequest, opts ...grpc.CallOption) (*ListSuggestedRepositoriesResponse, error) } @@ -80,9 +88,17 @@ func (c *sCMServiceClient) ListSuggestedRepositories(ctx context.Context, in *Li // All implementations must embed UnimplementedSCMServiceServer // for forward compatibility type SCMServiceServer interface { + // SearchSCMTokens allows clients to retrieve SCM tokens based on the + // specified host. SearchSCMTokens(context.Context, *SearchSCMTokensRequest) (*SearchSCMTokensResponse, error) + // GuessTokenScopes allows clients to retrieve scopes their SCM token would + // require for the specified git command. GuessTokenScopes(context.Context, *GuessTokenScopesRequest) (*GuessTokenScopesResponse, error) + // SearchRepositories allows clients to search for suggested repositories of + // SCM providers they are connected with. SearchRepositories(context.Context, *SearchRepositoriesRequest) (*SearchRepositoriesResponse, error) + // ListSuggestedRepositories allows clients to list suggested repositories + // based on recent workspaces and accessible repo configurations. ListSuggestedRepositories(context.Context, *ListSuggestedRepositoriesRequest) (*ListSuggestedRepositoriesResponse, error) mustEmbedUnimplementedSCMServiceServer() } diff --git a/components/public-api/go/v1/v1connect/scm.connect.go b/components/public-api/go/v1/v1connect/scm.connect.go index 2cfa4e4086d811..c361543e5d0127 100644 --- a/components/public-api/go/v1/v1connect/scm.connect.go +++ b/components/public-api/go/v1/v1connect/scm.connect.go @@ -31,9 +31,17 @@ const ( // SCMServiceClient is a client for the gitpod.v1.SCMService service. type SCMServiceClient interface { + // SearchSCMTokens allows clients to retrieve SCM tokens based on the + // specified host. SearchSCMTokens(context.Context, *connect_go.Request[v1.SearchSCMTokensRequest]) (*connect_go.Response[v1.SearchSCMTokensResponse], error) + // GuessTokenScopes allows clients to retrieve scopes their SCM token would + // require for the specified git command. GuessTokenScopes(context.Context, *connect_go.Request[v1.GuessTokenScopesRequest]) (*connect_go.Response[v1.GuessTokenScopesResponse], error) + // SearchRepositories allows clients to search for suggested repositories of + // SCM providers they are connected with. SearchRepositories(context.Context, *connect_go.Request[v1.SearchRepositoriesRequest]) (*connect_go.Response[v1.SearchRepositoriesResponse], error) + // ListSuggestedRepositories allows clients to list suggested repositories + // based on recent workspaces and accessible repo configurations. ListSuggestedRepositories(context.Context, *connect_go.Request[v1.ListSuggestedRepositoriesRequest]) (*connect_go.Response[v1.ListSuggestedRepositoriesResponse], error) } @@ -100,9 +108,17 @@ func (c *sCMServiceClient) ListSuggestedRepositories(ctx context.Context, req *c // SCMServiceHandler is an implementation of the gitpod.v1.SCMService service. type SCMServiceHandler interface { + // SearchSCMTokens allows clients to retrieve SCM tokens based on the + // specified host. SearchSCMTokens(context.Context, *connect_go.Request[v1.SearchSCMTokensRequest]) (*connect_go.Response[v1.SearchSCMTokensResponse], error) + // GuessTokenScopes allows clients to retrieve scopes their SCM token would + // require for the specified git command. GuessTokenScopes(context.Context, *connect_go.Request[v1.GuessTokenScopesRequest]) (*connect_go.Response[v1.GuessTokenScopesResponse], error) + // SearchRepositories allows clients to search for suggested repositories of + // SCM providers they are connected with. SearchRepositories(context.Context, *connect_go.Request[v1.SearchRepositoriesRequest]) (*connect_go.Response[v1.SearchRepositoriesResponse], error) + // ListSuggestedRepositories allows clients to list suggested repositories + // based on recent workspaces and accessible repo configurations. ListSuggestedRepositories(context.Context, *connect_go.Request[v1.ListSuggestedRepositoriesRequest]) (*connect_go.Response[v1.ListSuggestedRepositoriesResponse], error) } diff --git a/components/public-api/go/v1/v1connect/verification.connect.go b/components/public-api/go/v1/v1connect/verification.connect.go new file mode 100644 index 00000000000000..99ad39f786ba41 --- /dev/null +++ b/components/public-api/go/v1/v1connect/verification.connect.go @@ -0,0 +1,242 @@ +// Copyright (c) 2023 Gitpod GmbH. All rights reserved. +// Licensed under the GNU Affero General Public License (AGPL). +// See License.AGPL.txt in the project root for license information. + +// Code generated by protoc-gen-connect-go. DO NOT EDIT. +// +// Source: gitpod/v1/verification.proto + +package v1connect + +import ( + context "context" + errors "errors" + connect_go "github.com/bufbuild/connect-go" + v1 "github.com/gitpod-io/gitpod/components/public-api/go/v1" + http "net/http" + strings "strings" +) + +// This is a compile-time assertion to ensure that this generated file and the connect package are +// compatible. If you get a compiler error that this constant is not defined, this code was +// generated with a version of connect newer than the one compiled into your binary. You can fix the +// problem by either regenerating this code with an older version of connect or updating the connect +// version compiled into your binary. +const _ = connect_go.IsAtLeastVersion0_1_0 + +const ( + // VerificationServiceName is the fully-qualified name of the VerificationService service. + VerificationServiceName = "gitpod.v1.VerificationService" +) + +// VerificationServiceClient is a client for the gitpod.v1.VerificationService service. +type VerificationServiceClient interface { + // SendPhoneNumberVerificationToken sends a verification token to the + // specified phone number. + SendPhoneNumberVerificationToken(context.Context, *connect_go.Request[v1.SendPhoneNumberVerificationTokenRequest]) (*connect_go.Response[v1.SendPhoneNumberVerificationTokenResponse], error) + // VerifyPhoneNumberVerificationToken verifies the specified verification + // token. + VerifyPhoneNumberVerificationToken(context.Context, *connect_go.Request[v1.VerifyPhoneNumberVerificationTokenRequest]) (*connect_go.Response[v1.VerifyPhoneNumberVerificationTokenResponse], error) + // ListBlockedRepositories lists blocked repositories. + ListBlockedRepositories(context.Context, *connect_go.Request[v1.ListBlockedRepositoriesRequest]) (*connect_go.Response[v1.ListBlockedRepositoriesResponse], error) + // CreateBlockedRepository creates a new blocked repository. + CreateBlockedRepository(context.Context, *connect_go.Request[v1.CreateBlockedRepositoryRequest]) (*connect_go.Response[v1.CreateBlockedRepositoryResponse], error) + // DeleteBlockedRepository deletes a blocked repository. + DeleteBlockedRepository(context.Context, *connect_go.Request[v1.DeleteBlockedRepositoryRequest]) (*connect_go.Response[v1.DeleteBlockedRepositoryResponse], error) + // ListBlockedEmailDomains lists blocked email domains. + ListBlockedEmailDomains(context.Context, *connect_go.Request[v1.ListBlockedEmailDomainsRequest]) (*connect_go.Response[v1.ListBlockedEmailDomainsResponse], error) + // CreateBlockedEmailDomain creates a new blocked email domain. + CreateBlockedEmailDomain(context.Context, *connect_go.Request[v1.CreateBlockedEmailDomainRequest]) (*connect_go.Response[v1.CreateBlockedEmailDomainResponse], error) +} + +// NewVerificationServiceClient constructs a client for the gitpod.v1.VerificationService service. +// By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped +// responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the +// connect.WithGRPC() or connect.WithGRPCWeb() options. +// +// The URL supplied here should be the base URL for the Connect or gRPC server (for example, +// http://api.acme.com or https://acme.com/grpc). +func NewVerificationServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) VerificationServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + return &verificationServiceClient{ + sendPhoneNumberVerificationToken: connect_go.NewClient[v1.SendPhoneNumberVerificationTokenRequest, v1.SendPhoneNumberVerificationTokenResponse]( + httpClient, + baseURL+"/gitpod.v1.VerificationService/SendPhoneNumberVerificationToken", + opts..., + ), + verifyPhoneNumberVerificationToken: connect_go.NewClient[v1.VerifyPhoneNumberVerificationTokenRequest, v1.VerifyPhoneNumberVerificationTokenResponse]( + httpClient, + baseURL+"/gitpod.v1.VerificationService/VerifyPhoneNumberVerificationToken", + opts..., + ), + listBlockedRepositories: connect_go.NewClient[v1.ListBlockedRepositoriesRequest, v1.ListBlockedRepositoriesResponse]( + httpClient, + baseURL+"/gitpod.v1.VerificationService/ListBlockedRepositories", + opts..., + ), + createBlockedRepository: connect_go.NewClient[v1.CreateBlockedRepositoryRequest, v1.CreateBlockedRepositoryResponse]( + httpClient, + baseURL+"/gitpod.v1.VerificationService/CreateBlockedRepository", + opts..., + ), + deleteBlockedRepository: connect_go.NewClient[v1.DeleteBlockedRepositoryRequest, v1.DeleteBlockedRepositoryResponse]( + httpClient, + baseURL+"/gitpod.v1.VerificationService/DeleteBlockedRepository", + opts..., + ), + listBlockedEmailDomains: connect_go.NewClient[v1.ListBlockedEmailDomainsRequest, v1.ListBlockedEmailDomainsResponse]( + httpClient, + baseURL+"/gitpod.v1.VerificationService/ListBlockedEmailDomains", + opts..., + ), + createBlockedEmailDomain: connect_go.NewClient[v1.CreateBlockedEmailDomainRequest, v1.CreateBlockedEmailDomainResponse]( + httpClient, + baseURL+"/gitpod.v1.VerificationService/CreateBlockedEmailDomain", + opts..., + ), + } +} + +// verificationServiceClient implements VerificationServiceClient. +type verificationServiceClient struct { + sendPhoneNumberVerificationToken *connect_go.Client[v1.SendPhoneNumberVerificationTokenRequest, v1.SendPhoneNumberVerificationTokenResponse] + verifyPhoneNumberVerificationToken *connect_go.Client[v1.VerifyPhoneNumberVerificationTokenRequest, v1.VerifyPhoneNumberVerificationTokenResponse] + listBlockedRepositories *connect_go.Client[v1.ListBlockedRepositoriesRequest, v1.ListBlockedRepositoriesResponse] + createBlockedRepository *connect_go.Client[v1.CreateBlockedRepositoryRequest, v1.CreateBlockedRepositoryResponse] + deleteBlockedRepository *connect_go.Client[v1.DeleteBlockedRepositoryRequest, v1.DeleteBlockedRepositoryResponse] + listBlockedEmailDomains *connect_go.Client[v1.ListBlockedEmailDomainsRequest, v1.ListBlockedEmailDomainsResponse] + createBlockedEmailDomain *connect_go.Client[v1.CreateBlockedEmailDomainRequest, v1.CreateBlockedEmailDomainResponse] +} + +// SendPhoneNumberVerificationToken calls +// gitpod.v1.VerificationService.SendPhoneNumberVerificationToken. +func (c *verificationServiceClient) SendPhoneNumberVerificationToken(ctx context.Context, req *connect_go.Request[v1.SendPhoneNumberVerificationTokenRequest]) (*connect_go.Response[v1.SendPhoneNumberVerificationTokenResponse], error) { + return c.sendPhoneNumberVerificationToken.CallUnary(ctx, req) +} + +// VerifyPhoneNumberVerificationToken calls +// gitpod.v1.VerificationService.VerifyPhoneNumberVerificationToken. +func (c *verificationServiceClient) VerifyPhoneNumberVerificationToken(ctx context.Context, req *connect_go.Request[v1.VerifyPhoneNumberVerificationTokenRequest]) (*connect_go.Response[v1.VerifyPhoneNumberVerificationTokenResponse], error) { + return c.verifyPhoneNumberVerificationToken.CallUnary(ctx, req) +} + +// ListBlockedRepositories calls gitpod.v1.VerificationService.ListBlockedRepositories. +func (c *verificationServiceClient) ListBlockedRepositories(ctx context.Context, req *connect_go.Request[v1.ListBlockedRepositoriesRequest]) (*connect_go.Response[v1.ListBlockedRepositoriesResponse], error) { + return c.listBlockedRepositories.CallUnary(ctx, req) +} + +// CreateBlockedRepository calls gitpod.v1.VerificationService.CreateBlockedRepository. +func (c *verificationServiceClient) CreateBlockedRepository(ctx context.Context, req *connect_go.Request[v1.CreateBlockedRepositoryRequest]) (*connect_go.Response[v1.CreateBlockedRepositoryResponse], error) { + return c.createBlockedRepository.CallUnary(ctx, req) +} + +// DeleteBlockedRepository calls gitpod.v1.VerificationService.DeleteBlockedRepository. +func (c *verificationServiceClient) DeleteBlockedRepository(ctx context.Context, req *connect_go.Request[v1.DeleteBlockedRepositoryRequest]) (*connect_go.Response[v1.DeleteBlockedRepositoryResponse], error) { + return c.deleteBlockedRepository.CallUnary(ctx, req) +} + +// ListBlockedEmailDomains calls gitpod.v1.VerificationService.ListBlockedEmailDomains. +func (c *verificationServiceClient) ListBlockedEmailDomains(ctx context.Context, req *connect_go.Request[v1.ListBlockedEmailDomainsRequest]) (*connect_go.Response[v1.ListBlockedEmailDomainsResponse], error) { + return c.listBlockedEmailDomains.CallUnary(ctx, req) +} + +// CreateBlockedEmailDomain calls gitpod.v1.VerificationService.CreateBlockedEmailDomain. +func (c *verificationServiceClient) CreateBlockedEmailDomain(ctx context.Context, req *connect_go.Request[v1.CreateBlockedEmailDomainRequest]) (*connect_go.Response[v1.CreateBlockedEmailDomainResponse], error) { + return c.createBlockedEmailDomain.CallUnary(ctx, req) +} + +// VerificationServiceHandler is an implementation of the gitpod.v1.VerificationService service. +type VerificationServiceHandler interface { + // SendPhoneNumberVerificationToken sends a verification token to the + // specified phone number. + SendPhoneNumberVerificationToken(context.Context, *connect_go.Request[v1.SendPhoneNumberVerificationTokenRequest]) (*connect_go.Response[v1.SendPhoneNumberVerificationTokenResponse], error) + // VerifyPhoneNumberVerificationToken verifies the specified verification + // token. + VerifyPhoneNumberVerificationToken(context.Context, *connect_go.Request[v1.VerifyPhoneNumberVerificationTokenRequest]) (*connect_go.Response[v1.VerifyPhoneNumberVerificationTokenResponse], error) + // ListBlockedRepositories lists blocked repositories. + ListBlockedRepositories(context.Context, *connect_go.Request[v1.ListBlockedRepositoriesRequest]) (*connect_go.Response[v1.ListBlockedRepositoriesResponse], error) + // CreateBlockedRepository creates a new blocked repository. + CreateBlockedRepository(context.Context, *connect_go.Request[v1.CreateBlockedRepositoryRequest]) (*connect_go.Response[v1.CreateBlockedRepositoryResponse], error) + // DeleteBlockedRepository deletes a blocked repository. + DeleteBlockedRepository(context.Context, *connect_go.Request[v1.DeleteBlockedRepositoryRequest]) (*connect_go.Response[v1.DeleteBlockedRepositoryResponse], error) + // ListBlockedEmailDomains lists blocked email domains. + ListBlockedEmailDomains(context.Context, *connect_go.Request[v1.ListBlockedEmailDomainsRequest]) (*connect_go.Response[v1.ListBlockedEmailDomainsResponse], error) + // CreateBlockedEmailDomain creates a new blocked email domain. + CreateBlockedEmailDomain(context.Context, *connect_go.Request[v1.CreateBlockedEmailDomainRequest]) (*connect_go.Response[v1.CreateBlockedEmailDomainResponse], error) +} + +// NewVerificationServiceHandler builds an HTTP handler from the service implementation. It returns +// the path on which to mount the handler and the handler itself. +// +// By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf +// and JSON codecs. They also support gzip compression. +func NewVerificationServiceHandler(svc VerificationServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler) { + mux := http.NewServeMux() + mux.Handle("/gitpod.v1.VerificationService/SendPhoneNumberVerificationToken", connect_go.NewUnaryHandler( + "/gitpod.v1.VerificationService/SendPhoneNumberVerificationToken", + svc.SendPhoneNumberVerificationToken, + opts..., + )) + mux.Handle("/gitpod.v1.VerificationService/VerifyPhoneNumberVerificationToken", connect_go.NewUnaryHandler( + "/gitpod.v1.VerificationService/VerifyPhoneNumberVerificationToken", + svc.VerifyPhoneNumberVerificationToken, + opts..., + )) + mux.Handle("/gitpod.v1.VerificationService/ListBlockedRepositories", connect_go.NewUnaryHandler( + "/gitpod.v1.VerificationService/ListBlockedRepositories", + svc.ListBlockedRepositories, + opts..., + )) + mux.Handle("/gitpod.v1.VerificationService/CreateBlockedRepository", connect_go.NewUnaryHandler( + "/gitpod.v1.VerificationService/CreateBlockedRepository", + svc.CreateBlockedRepository, + opts..., + )) + mux.Handle("/gitpod.v1.VerificationService/DeleteBlockedRepository", connect_go.NewUnaryHandler( + "/gitpod.v1.VerificationService/DeleteBlockedRepository", + svc.DeleteBlockedRepository, + opts..., + )) + mux.Handle("/gitpod.v1.VerificationService/ListBlockedEmailDomains", connect_go.NewUnaryHandler( + "/gitpod.v1.VerificationService/ListBlockedEmailDomains", + svc.ListBlockedEmailDomains, + opts..., + )) + mux.Handle("/gitpod.v1.VerificationService/CreateBlockedEmailDomain", connect_go.NewUnaryHandler( + "/gitpod.v1.VerificationService/CreateBlockedEmailDomain", + svc.CreateBlockedEmailDomain, + opts..., + )) + return "/gitpod.v1.VerificationService/", mux +} + +// UnimplementedVerificationServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedVerificationServiceHandler struct{} + +func (UnimplementedVerificationServiceHandler) SendPhoneNumberVerificationToken(context.Context, *connect_go.Request[v1.SendPhoneNumberVerificationTokenRequest]) (*connect_go.Response[v1.SendPhoneNumberVerificationTokenResponse], error) { + return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.VerificationService.SendPhoneNumberVerificationToken is not implemented")) +} + +func (UnimplementedVerificationServiceHandler) VerifyPhoneNumberVerificationToken(context.Context, *connect_go.Request[v1.VerifyPhoneNumberVerificationTokenRequest]) (*connect_go.Response[v1.VerifyPhoneNumberVerificationTokenResponse], error) { + return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.VerificationService.VerifyPhoneNumberVerificationToken is not implemented")) +} + +func (UnimplementedVerificationServiceHandler) ListBlockedRepositories(context.Context, *connect_go.Request[v1.ListBlockedRepositoriesRequest]) (*connect_go.Response[v1.ListBlockedRepositoriesResponse], error) { + return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.VerificationService.ListBlockedRepositories is not implemented")) +} + +func (UnimplementedVerificationServiceHandler) CreateBlockedRepository(context.Context, *connect_go.Request[v1.CreateBlockedRepositoryRequest]) (*connect_go.Response[v1.CreateBlockedRepositoryResponse], error) { + return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.VerificationService.CreateBlockedRepository is not implemented")) +} + +func (UnimplementedVerificationServiceHandler) DeleteBlockedRepository(context.Context, *connect_go.Request[v1.DeleteBlockedRepositoryRequest]) (*connect_go.Response[v1.DeleteBlockedRepositoryResponse], error) { + return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.VerificationService.DeleteBlockedRepository is not implemented")) +} + +func (UnimplementedVerificationServiceHandler) ListBlockedEmailDomains(context.Context, *connect_go.Request[v1.ListBlockedEmailDomainsRequest]) (*connect_go.Response[v1.ListBlockedEmailDomainsResponse], error) { + return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.VerificationService.ListBlockedEmailDomains is not implemented")) +} + +func (UnimplementedVerificationServiceHandler) CreateBlockedEmailDomain(context.Context, *connect_go.Request[v1.CreateBlockedEmailDomainRequest]) (*connect_go.Response[v1.CreateBlockedEmailDomainResponse], error) { + return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.VerificationService.CreateBlockedEmailDomain is not implemented")) +} diff --git a/components/public-api/go/v1/v1connect/verification.proxy.connect.go b/components/public-api/go/v1/v1connect/verification.proxy.connect.go new file mode 100644 index 00000000000000..1da9f7e5eb0222 --- /dev/null +++ b/components/public-api/go/v1/v1connect/verification.proxy.connect.go @@ -0,0 +1,90 @@ +// Copyright (c) 2023 Gitpod GmbH. All rights reserved. +// Licensed under the GNU Affero General Public License (AGPL). +// See License.AGPL.txt in the project root for license information. + +// Code generated by protoc-proxy-gen. DO NOT EDIT. + +package v1connect + +import ( + context "context" + connect_go "github.com/bufbuild/connect-go" + v1 "github.com/gitpod-io/gitpod/components/public-api/go/v1" +) + +var _ VerificationServiceHandler = (*ProxyVerificationServiceHandler)(nil) + +type ProxyVerificationServiceHandler struct { + Client v1.VerificationServiceClient + UnimplementedVerificationServiceHandler +} + +func (s *ProxyVerificationServiceHandler) SendPhoneNumberVerificationToken(ctx context.Context, req *connect_go.Request[v1.SendPhoneNumberVerificationTokenRequest]) (*connect_go.Response[v1.SendPhoneNumberVerificationTokenResponse], error) { + resp, err := s.Client.SendPhoneNumberVerificationToken(ctx, req.Msg) + if err != nil { + // TODO(milan): Convert to correct status code + return nil, err + } + + return connect_go.NewResponse(resp), nil +} + +func (s *ProxyVerificationServiceHandler) VerifyPhoneNumberVerificationToken(ctx context.Context, req *connect_go.Request[v1.VerifyPhoneNumberVerificationTokenRequest]) (*connect_go.Response[v1.VerifyPhoneNumberVerificationTokenResponse], error) { + resp, err := s.Client.VerifyPhoneNumberVerificationToken(ctx, req.Msg) + if err != nil { + // TODO(milan): Convert to correct status code + return nil, err + } + + return connect_go.NewResponse(resp), nil +} + +func (s *ProxyVerificationServiceHandler) ListBlockedRepositories(ctx context.Context, req *connect_go.Request[v1.ListBlockedRepositoriesRequest]) (*connect_go.Response[v1.ListBlockedRepositoriesResponse], error) { + resp, err := s.Client.ListBlockedRepositories(ctx, req.Msg) + if err != nil { + // TODO(milan): Convert to correct status code + return nil, err + } + + return connect_go.NewResponse(resp), nil +} + +func (s *ProxyVerificationServiceHandler) CreateBlockedRepository(ctx context.Context, req *connect_go.Request[v1.CreateBlockedRepositoryRequest]) (*connect_go.Response[v1.CreateBlockedRepositoryResponse], error) { + resp, err := s.Client.CreateBlockedRepository(ctx, req.Msg) + if err != nil { + // TODO(milan): Convert to correct status code + return nil, err + } + + return connect_go.NewResponse(resp), nil +} + +func (s *ProxyVerificationServiceHandler) DeleteBlockedRepository(ctx context.Context, req *connect_go.Request[v1.DeleteBlockedRepositoryRequest]) (*connect_go.Response[v1.DeleteBlockedRepositoryResponse], error) { + resp, err := s.Client.DeleteBlockedRepository(ctx, req.Msg) + if err != nil { + // TODO(milan): Convert to correct status code + return nil, err + } + + return connect_go.NewResponse(resp), nil +} + +func (s *ProxyVerificationServiceHandler) ListBlockedEmailDomains(ctx context.Context, req *connect_go.Request[v1.ListBlockedEmailDomainsRequest]) (*connect_go.Response[v1.ListBlockedEmailDomainsResponse], error) { + resp, err := s.Client.ListBlockedEmailDomains(ctx, req.Msg) + if err != nil { + // TODO(milan): Convert to correct status code + return nil, err + } + + return connect_go.NewResponse(resp), nil +} + +func (s *ProxyVerificationServiceHandler) CreateBlockedEmailDomain(ctx context.Context, req *connect_go.Request[v1.CreateBlockedEmailDomainRequest]) (*connect_go.Response[v1.CreateBlockedEmailDomainResponse], error) { + resp, err := s.Client.CreateBlockedEmailDomain(ctx, req.Msg) + if err != nil { + // TODO(milan): Convert to correct status code + return nil, err + } + + return connect_go.NewResponse(resp), nil +} diff --git a/components/public-api/go/v1/verification.pb.go b/components/public-api/go/v1/verification.pb.go new file mode 100644 index 00000000000000..997e418cf8741b --- /dev/null +++ b/components/public-api/go/v1/verification.pb.go @@ -0,0 +1,1394 @@ +// Copyright (c) 2023 Gitpod GmbH. All rights reserved. +// Licensed under the GNU Affero General Public License (AGPL). +// See License.AGPL.txt in the project root for license information. + +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc (unknown) +// source: gitpod/v1/verification.proto + +package v1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// Required fields: +// - phone_number +type SendPhoneNumberVerificationTokenRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // phone_number in E.164 format + PhoneNumber string `protobuf:"bytes,1,opt,name=phone_number,json=phoneNumber,proto3" json:"phone_number,omitempty"` +} + +func (x *SendPhoneNumberVerificationTokenRequest) Reset() { + *x = SendPhoneNumberVerificationTokenRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_verification_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SendPhoneNumberVerificationTokenRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SendPhoneNumberVerificationTokenRequest) ProtoMessage() {} + +func (x *SendPhoneNumberVerificationTokenRequest) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_verification_proto_msgTypes[0] + 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 SendPhoneNumberVerificationTokenRequest.ProtoReflect.Descriptor instead. +func (*SendPhoneNumberVerificationTokenRequest) Descriptor() ([]byte, []int) { + return file_gitpod_v1_verification_proto_rawDescGZIP(), []int{0} +} + +func (x *SendPhoneNumberVerificationTokenRequest) GetPhoneNumber() string { + if x != nil { + return x.PhoneNumber + } + return "" +} + +type SendPhoneNumberVerificationTokenResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // verification_id is used to VerifyPhoneNumberVerificationToken + VerificationId string `protobuf:"bytes,1,opt,name=verification_id,json=verificationId,proto3" json:"verification_id,omitempty"` +} + +func (x *SendPhoneNumberVerificationTokenResponse) Reset() { + *x = SendPhoneNumberVerificationTokenResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_verification_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SendPhoneNumberVerificationTokenResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SendPhoneNumberVerificationTokenResponse) ProtoMessage() {} + +func (x *SendPhoneNumberVerificationTokenResponse) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_verification_proto_msgTypes[1] + 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 SendPhoneNumberVerificationTokenResponse.ProtoReflect.Descriptor instead. +func (*SendPhoneNumberVerificationTokenResponse) Descriptor() ([]byte, []int) { + return file_gitpod_v1_verification_proto_rawDescGZIP(), []int{1} +} + +func (x *SendPhoneNumberVerificationTokenResponse) GetVerificationId() string { + if x != nil { + return x.VerificationId + } + return "" +} + +// Required fields: +// - phone_number +// - verification_id +// - token +type VerifyPhoneNumberVerificationTokenRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // phone_number in E.164 format + PhoneNumber string `protobuf:"bytes,1,opt,name=phone_number,json=phoneNumber,proto3" json:"phone_number,omitempty"` + // verification_id is returned by SendPhoneNumberVerificationToken + VerificationId string `protobuf:"bytes,2,opt,name=verification_id,json=verificationId,proto3" json:"verification_id,omitempty"` + // token is the verification token from providers + Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` +} + +func (x *VerifyPhoneNumberVerificationTokenRequest) Reset() { + *x = VerifyPhoneNumberVerificationTokenRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_verification_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VerifyPhoneNumberVerificationTokenRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VerifyPhoneNumberVerificationTokenRequest) ProtoMessage() {} + +func (x *VerifyPhoneNumberVerificationTokenRequest) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_verification_proto_msgTypes[2] + 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 VerifyPhoneNumberVerificationTokenRequest.ProtoReflect.Descriptor instead. +func (*VerifyPhoneNumberVerificationTokenRequest) Descriptor() ([]byte, []int) { + return file_gitpod_v1_verification_proto_rawDescGZIP(), []int{2} +} + +func (x *VerifyPhoneNumberVerificationTokenRequest) GetPhoneNumber() string { + if x != nil { + return x.PhoneNumber + } + return "" +} + +func (x *VerifyPhoneNumberVerificationTokenRequest) GetVerificationId() string { + if x != nil { + return x.VerificationId + } + return "" +} + +func (x *VerifyPhoneNumberVerificationTokenRequest) GetToken() string { + if x != nil { + return x.Token + } + return "" +} + +type VerifyPhoneNumberVerificationTokenResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // verified indicates if the verification was successful + Verified bool `protobuf:"varint,1,opt,name=verified,proto3" json:"verified,omitempty"` +} + +func (x *VerifyPhoneNumberVerificationTokenResponse) Reset() { + *x = VerifyPhoneNumberVerificationTokenResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_verification_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *VerifyPhoneNumberVerificationTokenResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*VerifyPhoneNumberVerificationTokenResponse) ProtoMessage() {} + +func (x *VerifyPhoneNumberVerificationTokenResponse) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_verification_proto_msgTypes[3] + 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 VerifyPhoneNumberVerificationTokenResponse.ProtoReflect.Descriptor instead. +func (*VerifyPhoneNumberVerificationTokenResponse) Descriptor() ([]byte, []int) { + return file_gitpod_v1_verification_proto_rawDescGZIP(), []int{3} +} + +func (x *VerifyPhoneNumberVerificationTokenResponse) GetVerified() bool { + if x != nil { + return x.Verified + } + return false +} + +type ListBlockedRepositoriesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // pagination contains the pagination options for listing blocked repositories + Pagination *PaginationRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` + // sort contains the sort options for listing blocked repositories + // BlockedRepositories can be sorted by "urlRegexp" + Sort []*Sort `protobuf:"bytes,2,rep,name=sort,proto3" json:"sort,omitempty"` + // search_term is a search term to filter blocked repositories by url_regexp + SearchTerm string `protobuf:"bytes,3,opt,name=search_term,json=searchTerm,proto3" json:"search_term,omitempty"` +} + +func (x *ListBlockedRepositoriesRequest) Reset() { + *x = ListBlockedRepositoriesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_verification_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListBlockedRepositoriesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListBlockedRepositoriesRequest) ProtoMessage() {} + +func (x *ListBlockedRepositoriesRequest) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_verification_proto_msgTypes[4] + 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 ListBlockedRepositoriesRequest.ProtoReflect.Descriptor instead. +func (*ListBlockedRepositoriesRequest) Descriptor() ([]byte, []int) { + return file_gitpod_v1_verification_proto_rawDescGZIP(), []int{4} +} + +func (x *ListBlockedRepositoriesRequest) GetPagination() *PaginationRequest { + if x != nil { + return x.Pagination + } + return nil +} + +func (x *ListBlockedRepositoriesRequest) GetSort() []*Sort { + if x != nil { + return x.Sort + } + return nil +} + +func (x *ListBlockedRepositoriesRequest) GetSearchTerm() string { + if x != nil { + return x.SearchTerm + } + return "" +} + +type ListBlockedRepositoriesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // pagination contains the pagination options for listing blocked repositories + Pagination *PaginationResponse `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` + // blocked_repositories are the blocked repositories + BlockedRepositories []*BlockedRepository `protobuf:"bytes,2,rep,name=blocked_repositories,json=blockedRepositories,proto3" json:"blocked_repositories,omitempty"` +} + +func (x *ListBlockedRepositoriesResponse) Reset() { + *x = ListBlockedRepositoriesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_verification_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListBlockedRepositoriesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListBlockedRepositoriesResponse) ProtoMessage() {} + +func (x *ListBlockedRepositoriesResponse) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_verification_proto_msgTypes[5] + 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 ListBlockedRepositoriesResponse.ProtoReflect.Descriptor instead. +func (*ListBlockedRepositoriesResponse) Descriptor() ([]byte, []int) { + return file_gitpod_v1_verification_proto_rawDescGZIP(), []int{5} +} + +func (x *ListBlockedRepositoriesResponse) GetPagination() *PaginationResponse { + if x != nil { + return x.Pagination + } + return nil +} + +func (x *ListBlockedRepositoriesResponse) GetBlockedRepositories() []*BlockedRepository { + if x != nil { + return x.BlockedRepositories + } + return nil +} + +type CreateBlockedRepositoryRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // url_regexp is the regular expression for the repository URL + UrlRegexp string `protobuf:"bytes,1,opt,name=url_regexp,json=urlRegexp,proto3" json:"url_regexp,omitempty"` + // block_user indicates if the user should be blocked from accessing the + // repository + BlockUser bool `protobuf:"varint,2,opt,name=block_user,json=blockUser,proto3" json:"block_user,omitempty"` +} + +func (x *CreateBlockedRepositoryRequest) Reset() { + *x = CreateBlockedRepositoryRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_verification_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateBlockedRepositoryRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateBlockedRepositoryRequest) ProtoMessage() {} + +func (x *CreateBlockedRepositoryRequest) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_verification_proto_msgTypes[6] + 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 CreateBlockedRepositoryRequest.ProtoReflect.Descriptor instead. +func (*CreateBlockedRepositoryRequest) Descriptor() ([]byte, []int) { + return file_gitpod_v1_verification_proto_rawDescGZIP(), []int{6} +} + +func (x *CreateBlockedRepositoryRequest) GetUrlRegexp() string { + if x != nil { + return x.UrlRegexp + } + return "" +} + +func (x *CreateBlockedRepositoryRequest) GetBlockUser() bool { + if x != nil { + return x.BlockUser + } + return false +} + +type CreateBlockedRepositoryResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BlockedRepository *BlockedRepository `protobuf:"bytes,1,opt,name=blocked_repository,json=blockedRepository,proto3" json:"blocked_repository,omitempty"` +} + +func (x *CreateBlockedRepositoryResponse) Reset() { + *x = CreateBlockedRepositoryResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_verification_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateBlockedRepositoryResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateBlockedRepositoryResponse) ProtoMessage() {} + +func (x *CreateBlockedRepositoryResponse) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_verification_proto_msgTypes[7] + 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 CreateBlockedRepositoryResponse.ProtoReflect.Descriptor instead. +func (*CreateBlockedRepositoryResponse) Descriptor() ([]byte, []int) { + return file_gitpod_v1_verification_proto_rawDescGZIP(), []int{7} +} + +func (x *CreateBlockedRepositoryResponse) GetBlockedRepository() *BlockedRepository { + if x != nil { + return x.BlockedRepository + } + return nil +} + +type DeleteBlockedRepositoryRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // blocked_repository_id is the ID of the blocked repository + BlockedRepositoryId uint32 `protobuf:"varint,1,opt,name=blocked_repository_id,json=blockedRepositoryId,proto3" json:"blocked_repository_id,omitempty"` +} + +func (x *DeleteBlockedRepositoryRequest) Reset() { + *x = DeleteBlockedRepositoryRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_verification_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteBlockedRepositoryRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteBlockedRepositoryRequest) ProtoMessage() {} + +func (x *DeleteBlockedRepositoryRequest) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_verification_proto_msgTypes[8] + 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 DeleteBlockedRepositoryRequest.ProtoReflect.Descriptor instead. +func (*DeleteBlockedRepositoryRequest) Descriptor() ([]byte, []int) { + return file_gitpod_v1_verification_proto_rawDescGZIP(), []int{8} +} + +func (x *DeleteBlockedRepositoryRequest) GetBlockedRepositoryId() uint32 { + if x != nil { + return x.BlockedRepositoryId + } + return 0 +} + +type DeleteBlockedRepositoryResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteBlockedRepositoryResponse) Reset() { + *x = DeleteBlockedRepositoryResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_verification_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteBlockedRepositoryResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteBlockedRepositoryResponse) ProtoMessage() {} + +func (x *DeleteBlockedRepositoryResponse) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_verification_proto_msgTypes[9] + 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 DeleteBlockedRepositoryResponse.ProtoReflect.Descriptor instead. +func (*DeleteBlockedRepositoryResponse) Descriptor() ([]byte, []int) { + return file_gitpod_v1_verification_proto_rawDescGZIP(), []int{9} +} + +type ListBlockedEmailDomainsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // pagination contains the pagination options for listing blocked email + // domains + Pagination *PaginationRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (x *ListBlockedEmailDomainsRequest) Reset() { + *x = ListBlockedEmailDomainsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_verification_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListBlockedEmailDomainsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListBlockedEmailDomainsRequest) ProtoMessage() {} + +func (x *ListBlockedEmailDomainsRequest) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_verification_proto_msgTypes[10] + 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 ListBlockedEmailDomainsRequest.ProtoReflect.Descriptor instead. +func (*ListBlockedEmailDomainsRequest) Descriptor() ([]byte, []int) { + return file_gitpod_v1_verification_proto_rawDescGZIP(), []int{10} +} + +func (x *ListBlockedEmailDomainsRequest) GetPagination() *PaginationRequest { + if x != nil { + return x.Pagination + } + return nil +} + +type ListBlockedEmailDomainsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // pagination contains the pagination options for listing blocked email + // domains + Pagination *PaginationResponse `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` + // blocked_email_domains are the blocked email domains + BlockedEmailDomains []*BlockedEmailDomain `protobuf:"bytes,2,rep,name=blocked_email_domains,json=blockedEmailDomains,proto3" json:"blocked_email_domains,omitempty"` +} + +func (x *ListBlockedEmailDomainsResponse) Reset() { + *x = ListBlockedEmailDomainsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_verification_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListBlockedEmailDomainsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListBlockedEmailDomainsResponse) ProtoMessage() {} + +func (x *ListBlockedEmailDomainsResponse) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_verification_proto_msgTypes[11] + 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 ListBlockedEmailDomainsResponse.ProtoReflect.Descriptor instead. +func (*ListBlockedEmailDomainsResponse) Descriptor() ([]byte, []int) { + return file_gitpod_v1_verification_proto_rawDescGZIP(), []int{11} +} + +func (x *ListBlockedEmailDomainsResponse) GetPagination() *PaginationResponse { + if x != nil { + return x.Pagination + } + return nil +} + +func (x *ListBlockedEmailDomainsResponse) GetBlockedEmailDomains() []*BlockedEmailDomain { + if x != nil { + return x.BlockedEmailDomains + } + return nil +} + +type CreateBlockedEmailDomainRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // domain is the blocked email domain + Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"` + Negative bool `protobuf:"varint,2,opt,name=negative,proto3" json:"negative,omitempty"` +} + +func (x *CreateBlockedEmailDomainRequest) Reset() { + *x = CreateBlockedEmailDomainRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_verification_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateBlockedEmailDomainRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateBlockedEmailDomainRequest) ProtoMessage() {} + +func (x *CreateBlockedEmailDomainRequest) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_verification_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 CreateBlockedEmailDomainRequest.ProtoReflect.Descriptor instead. +func (*CreateBlockedEmailDomainRequest) Descriptor() ([]byte, []int) { + return file_gitpod_v1_verification_proto_rawDescGZIP(), []int{12} +} + +func (x *CreateBlockedEmailDomainRequest) GetDomain() string { + if x != nil { + return x.Domain + } + return "" +} + +func (x *CreateBlockedEmailDomainRequest) GetNegative() bool { + if x != nil { + return x.Negative + } + return false +} + +type CreateBlockedEmailDomainResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + BlockedEmailDomain *BlockedEmailDomain `protobuf:"bytes,1,opt,name=blocked_email_domain,json=blockedEmailDomain,proto3" json:"blocked_email_domain,omitempty"` +} + +func (x *CreateBlockedEmailDomainResponse) Reset() { + *x = CreateBlockedEmailDomainResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_verification_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateBlockedEmailDomainResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateBlockedEmailDomainResponse) ProtoMessage() {} + +func (x *CreateBlockedEmailDomainResponse) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_verification_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 CreateBlockedEmailDomainResponse.ProtoReflect.Descriptor instead. +func (*CreateBlockedEmailDomainResponse) Descriptor() ([]byte, []int) { + return file_gitpod_v1_verification_proto_rawDescGZIP(), []int{13} +} + +func (x *CreateBlockedEmailDomainResponse) GetBlockedEmailDomain() *BlockedEmailDomain { + if x != nil { + return x.BlockedEmailDomain + } + return nil +} + +type BlockedRepository struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // id is the ID of the blocked repository + Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + // url_regexp is the regular expression for the repository URL + UrlRegexp string `protobuf:"bytes,2,opt,name=url_regexp,json=urlRegexp,proto3" json:"url_regexp,omitempty"` + // block_user indicates if the user should be blocked from accessing the + // repository + BlockUser bool `protobuf:"varint,3,opt,name=block_user,json=blockUser,proto3" json:"block_user,omitempty"` + CreationTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=creation_time,json=creationTime,proto3" json:"creation_time,omitempty"` + UpdateTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` +} + +func (x *BlockedRepository) Reset() { + *x = BlockedRepository{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_verification_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BlockedRepository) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockedRepository) ProtoMessage() {} + +func (x *BlockedRepository) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_verification_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 BlockedRepository.ProtoReflect.Descriptor instead. +func (*BlockedRepository) Descriptor() ([]byte, []int) { + return file_gitpod_v1_verification_proto_rawDescGZIP(), []int{14} +} + +func (x *BlockedRepository) GetId() uint32 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *BlockedRepository) GetUrlRegexp() string { + if x != nil { + return x.UrlRegexp + } + return "" +} + +func (x *BlockedRepository) GetBlockUser() bool { + if x != nil { + return x.BlockUser + } + return false +} + +func (x *BlockedRepository) GetCreationTime() *timestamppb.Timestamp { + if x != nil { + return x.CreationTime + } + return nil +} + +func (x *BlockedRepository) GetUpdateTime() *timestamppb.Timestamp { + if x != nil { + return x.UpdateTime + } + return nil +} + +type BlockedEmailDomain struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // id is the ID of the blocked email domain + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // domain is the blocked email domain + Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` + Negative bool `protobuf:"varint,3,opt,name=negative,proto3" json:"negative,omitempty"` +} + +func (x *BlockedEmailDomain) Reset() { + *x = BlockedEmailDomain{} + if protoimpl.UnsafeEnabled { + mi := &file_gitpod_v1_verification_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BlockedEmailDomain) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockedEmailDomain) ProtoMessage() {} + +func (x *BlockedEmailDomain) ProtoReflect() protoreflect.Message { + mi := &file_gitpod_v1_verification_proto_msgTypes[15] + 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 BlockedEmailDomain.ProtoReflect.Descriptor instead. +func (*BlockedEmailDomain) Descriptor() ([]byte, []int) { + return file_gitpod_v1_verification_proto_rawDescGZIP(), []int{15} +} + +func (x *BlockedEmailDomain) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *BlockedEmailDomain) GetDomain() string { + if x != nil { + return x.Domain + } + return "" +} + +func (x *BlockedEmailDomain) GetNegative() bool { + if x != nil { + return x.Negative + } + return false +} + +var File_gitpod_v1_verification_proto protoreflect.FileDescriptor + +var file_gitpod_v1_verification_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x65, 0x72, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, + 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x1a, 0x1a, 0x67, 0x69, 0x74, 0x70, 0x6f, + 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2f, 0x76, 0x31, + 0x2f, 0x73, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, + 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, + 0x4c, 0x0a, 0x27, 0x53, 0x65, 0x6e, 0x64, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x68, + 0x6f, 0x6e, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x53, 0x0a, + 0x28, 0x53, 0x65, 0x6e, 0x64, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x76, 0x65, 0x72, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0e, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x49, 0x64, 0x22, 0x8d, 0x01, 0x0a, 0x29, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x50, 0x68, 0x6f, + 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x76, 0x65, + 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, + 0x65, 0x6e, 0x22, 0x48, 0x0a, 0x2a, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x50, 0x68, 0x6f, 0x6e, + 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x1a, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x08, 0x52, 0x08, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x22, 0xa4, 0x01, 0x0a, + 0x1e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x3c, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, + 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x67, 0x69, + 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x52, 0x04, 0x73, 0x6f, + 0x72, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x74, 0x65, 0x72, + 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x54, + 0x65, 0x72, 0x6d, 0x22, 0xb1, 0x01, 0x0a, 0x1f, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x69, + 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, + 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4f, 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, + 0x64, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, + 0x72, 0x79, 0x52, 0x13, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x22, 0x5e, 0x0a, 0x1e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, + 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x72, 0x6c, + 0x5f, 0x72, 0x65, 0x67, 0x65, 0x78, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, + 0x72, 0x6c, 0x52, 0x65, 0x67, 0x65, 0x78, 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, + 0x6b, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x22, 0x6e, 0x0a, 0x1f, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, + 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x12, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x6f, 0x72, 0x79, 0x52, 0x11, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x22, 0x54, 0x0a, 0x1e, 0x44, 0x65, 0x6c, 0x65, 0x74, + 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, + 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x15, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x13, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, + 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x22, 0x21, 0x0a, + 0x1f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x5e, 0x0a, 0x1e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x45, + 0x6d, 0x61, 0x69, 0x6c, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x22, 0xb3, 0x01, 0x0a, 0x1f, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, + 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, + 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x51, 0x0a, 0x15, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x65, + 0x6d, 0x61, 0x69, 0x6c, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, + 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x44, 0x6f, 0x6d, 0x61, 0x69, + 0x6e, 0x52, 0x13, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x44, + 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x22, 0x55, 0x0a, 0x1f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x44, 0x6f, 0x6d, 0x61, + 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, + 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, + 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x08, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x22, 0x73, 0x0a, + 0x20, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x45, 0x6d, + 0x61, 0x69, 0x6c, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x4f, 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x65, 0x6d, 0x61, + 0x69, 0x6c, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x1d, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x65, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x12, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x44, 0x6f, 0x6d, 0x61, + 0x69, 0x6e, 0x22, 0xdf, 0x01, 0x0a, 0x11, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x72, 0x6c, 0x5f, + 0x72, 0x65, 0x67, 0x65, 0x78, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x72, + 0x6c, 0x52, 0x65, 0x67, 0x65, 0x78, 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x62, 0x6c, 0x6f, + 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x12, 0x3f, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 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, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 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, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x54, 0x69, 0x6d, 0x65, 0x22, 0x58, 0x0a, 0x12, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x45, + 0x6d, 0x61, 0x69, 0x6c, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, + 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, + 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x32, 0x82, + 0x07, 0x0a, 0x13, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, + 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x8d, 0x01, 0x0a, 0x20, 0x53, 0x65, 0x6e, 0x64, 0x50, + 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x32, 0x2e, 0x67, 0x69, + 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x50, 0x68, 0x6f, 0x6e, + 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x33, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, + 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x93, 0x01, 0x0a, 0x22, 0x56, 0x65, 0x72, 0x69, 0x66, + 0x79, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x34, 0x2e, + 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, + 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, + 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, + 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x72, 0x0a, 0x17, + 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x29, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, + 0x12, 0x72, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, + 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x29, 0x2e, 0x67, 0x69, + 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, + 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, + 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x12, 0x72, 0x0a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x6c, + 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, + 0x29, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x67, 0x69, 0x74, + 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x72, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, + 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x44, 0x6f, 0x6d, 0x61, + 0x69, 0x6e, 0x73, 0x12, 0x29, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, + 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, + 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, + 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x44, 0x6f, 0x6d, 0x61, 0x69, + 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x75, 0x0a, 0x18, + 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x45, 0x6d, 0x61, + 0x69, 0x6c, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x2a, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, + 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, + 0x65, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, + 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x45, 0x6d, + 0x61, 0x69, 0x6c, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2d, 0x69, 0x6f, 0x2f, 0x67, 0x69, 0x74, 0x70, + 0x6f, 0x64, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x70, 0x75, + 0x62, 0x6c, 0x69, 0x63, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_gitpod_v1_verification_proto_rawDescOnce sync.Once + file_gitpod_v1_verification_proto_rawDescData = file_gitpod_v1_verification_proto_rawDesc +) + +func file_gitpod_v1_verification_proto_rawDescGZIP() []byte { + file_gitpod_v1_verification_proto_rawDescOnce.Do(func() { + file_gitpod_v1_verification_proto_rawDescData = protoimpl.X.CompressGZIP(file_gitpod_v1_verification_proto_rawDescData) + }) + return file_gitpod_v1_verification_proto_rawDescData +} + +var file_gitpod_v1_verification_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_gitpod_v1_verification_proto_goTypes = []interface{}{ + (*SendPhoneNumberVerificationTokenRequest)(nil), // 0: gitpod.v1.SendPhoneNumberVerificationTokenRequest + (*SendPhoneNumberVerificationTokenResponse)(nil), // 1: gitpod.v1.SendPhoneNumberVerificationTokenResponse + (*VerifyPhoneNumberVerificationTokenRequest)(nil), // 2: gitpod.v1.VerifyPhoneNumberVerificationTokenRequest + (*VerifyPhoneNumberVerificationTokenResponse)(nil), // 3: gitpod.v1.VerifyPhoneNumberVerificationTokenResponse + (*ListBlockedRepositoriesRequest)(nil), // 4: gitpod.v1.ListBlockedRepositoriesRequest + (*ListBlockedRepositoriesResponse)(nil), // 5: gitpod.v1.ListBlockedRepositoriesResponse + (*CreateBlockedRepositoryRequest)(nil), // 6: gitpod.v1.CreateBlockedRepositoryRequest + (*CreateBlockedRepositoryResponse)(nil), // 7: gitpod.v1.CreateBlockedRepositoryResponse + (*DeleteBlockedRepositoryRequest)(nil), // 8: gitpod.v1.DeleteBlockedRepositoryRequest + (*DeleteBlockedRepositoryResponse)(nil), // 9: gitpod.v1.DeleteBlockedRepositoryResponse + (*ListBlockedEmailDomainsRequest)(nil), // 10: gitpod.v1.ListBlockedEmailDomainsRequest + (*ListBlockedEmailDomainsResponse)(nil), // 11: gitpod.v1.ListBlockedEmailDomainsResponse + (*CreateBlockedEmailDomainRequest)(nil), // 12: gitpod.v1.CreateBlockedEmailDomainRequest + (*CreateBlockedEmailDomainResponse)(nil), // 13: gitpod.v1.CreateBlockedEmailDomainResponse + (*BlockedRepository)(nil), // 14: gitpod.v1.BlockedRepository + (*BlockedEmailDomain)(nil), // 15: gitpod.v1.BlockedEmailDomain + (*PaginationRequest)(nil), // 16: gitpod.v1.PaginationRequest + (*Sort)(nil), // 17: gitpod.v1.Sort + (*PaginationResponse)(nil), // 18: gitpod.v1.PaginationResponse + (*timestamppb.Timestamp)(nil), // 19: google.protobuf.Timestamp +} +var file_gitpod_v1_verification_proto_depIdxs = []int32{ + 16, // 0: gitpod.v1.ListBlockedRepositoriesRequest.pagination:type_name -> gitpod.v1.PaginationRequest + 17, // 1: gitpod.v1.ListBlockedRepositoriesRequest.sort:type_name -> gitpod.v1.Sort + 18, // 2: gitpod.v1.ListBlockedRepositoriesResponse.pagination:type_name -> gitpod.v1.PaginationResponse + 14, // 3: gitpod.v1.ListBlockedRepositoriesResponse.blocked_repositories:type_name -> gitpod.v1.BlockedRepository + 14, // 4: gitpod.v1.CreateBlockedRepositoryResponse.blocked_repository:type_name -> gitpod.v1.BlockedRepository + 16, // 5: gitpod.v1.ListBlockedEmailDomainsRequest.pagination:type_name -> gitpod.v1.PaginationRequest + 18, // 6: gitpod.v1.ListBlockedEmailDomainsResponse.pagination:type_name -> gitpod.v1.PaginationResponse + 15, // 7: gitpod.v1.ListBlockedEmailDomainsResponse.blocked_email_domains:type_name -> gitpod.v1.BlockedEmailDomain + 15, // 8: gitpod.v1.CreateBlockedEmailDomainResponse.blocked_email_domain:type_name -> gitpod.v1.BlockedEmailDomain + 19, // 9: gitpod.v1.BlockedRepository.creation_time:type_name -> google.protobuf.Timestamp + 19, // 10: gitpod.v1.BlockedRepository.update_time:type_name -> google.protobuf.Timestamp + 0, // 11: gitpod.v1.VerificationService.SendPhoneNumberVerificationToken:input_type -> gitpod.v1.SendPhoneNumberVerificationTokenRequest + 2, // 12: gitpod.v1.VerificationService.VerifyPhoneNumberVerificationToken:input_type -> gitpod.v1.VerifyPhoneNumberVerificationTokenRequest + 4, // 13: gitpod.v1.VerificationService.ListBlockedRepositories:input_type -> gitpod.v1.ListBlockedRepositoriesRequest + 6, // 14: gitpod.v1.VerificationService.CreateBlockedRepository:input_type -> gitpod.v1.CreateBlockedRepositoryRequest + 8, // 15: gitpod.v1.VerificationService.DeleteBlockedRepository:input_type -> gitpod.v1.DeleteBlockedRepositoryRequest + 10, // 16: gitpod.v1.VerificationService.ListBlockedEmailDomains:input_type -> gitpod.v1.ListBlockedEmailDomainsRequest + 12, // 17: gitpod.v1.VerificationService.CreateBlockedEmailDomain:input_type -> gitpod.v1.CreateBlockedEmailDomainRequest + 1, // 18: gitpod.v1.VerificationService.SendPhoneNumberVerificationToken:output_type -> gitpod.v1.SendPhoneNumberVerificationTokenResponse + 3, // 19: gitpod.v1.VerificationService.VerifyPhoneNumberVerificationToken:output_type -> gitpod.v1.VerifyPhoneNumberVerificationTokenResponse + 5, // 20: gitpod.v1.VerificationService.ListBlockedRepositories:output_type -> gitpod.v1.ListBlockedRepositoriesResponse + 7, // 21: gitpod.v1.VerificationService.CreateBlockedRepository:output_type -> gitpod.v1.CreateBlockedRepositoryResponse + 9, // 22: gitpod.v1.VerificationService.DeleteBlockedRepository:output_type -> gitpod.v1.DeleteBlockedRepositoryResponse + 11, // 23: gitpod.v1.VerificationService.ListBlockedEmailDomains:output_type -> gitpod.v1.ListBlockedEmailDomainsResponse + 13, // 24: gitpod.v1.VerificationService.CreateBlockedEmailDomain:output_type -> gitpod.v1.CreateBlockedEmailDomainResponse + 18, // [18:25] is the sub-list for method output_type + 11, // [11:18] 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_gitpod_v1_verification_proto_init() } +func file_gitpod_v1_verification_proto_init() { + if File_gitpod_v1_verification_proto != nil { + return + } + file_gitpod_v1_pagination_proto_init() + file_gitpod_v1_sorting_proto_init() + if !protoimpl.UnsafeEnabled { + file_gitpod_v1_verification_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SendPhoneNumberVerificationTokenRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_verification_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SendPhoneNumberVerificationTokenResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_verification_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VerifyPhoneNumberVerificationTokenRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_verification_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*VerifyPhoneNumberVerificationTokenResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_verification_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListBlockedRepositoriesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_verification_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListBlockedRepositoriesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_verification_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateBlockedRepositoryRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_verification_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateBlockedRepositoryResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_verification_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteBlockedRepositoryRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_verification_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteBlockedRepositoryResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_verification_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListBlockedEmailDomainsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_verification_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListBlockedEmailDomainsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_verification_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateBlockedEmailDomainRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_verification_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateBlockedEmailDomainResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_verification_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockedRepository); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gitpod_v1_verification_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockedEmailDomain); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_gitpod_v1_verification_proto_rawDesc, + NumEnums: 0, + NumMessages: 16, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_gitpod_v1_verification_proto_goTypes, + DependencyIndexes: file_gitpod_v1_verification_proto_depIdxs, + MessageInfos: file_gitpod_v1_verification_proto_msgTypes, + }.Build() + File_gitpod_v1_verification_proto = out.File + file_gitpod_v1_verification_proto_rawDesc = nil + file_gitpod_v1_verification_proto_goTypes = nil + file_gitpod_v1_verification_proto_depIdxs = nil +} diff --git a/components/public-api/go/v1/verification_grpc.pb.go b/components/public-api/go/v1/verification_grpc.pb.go new file mode 100644 index 00000000000000..6b4c4a1b67f24b --- /dev/null +++ b/components/public-api/go/v1/verification_grpc.pb.go @@ -0,0 +1,343 @@ +// Copyright (c) 2023 Gitpod GmbH. All rights reserved. +// Licensed under the GNU Affero General Public License (AGPL). +// See License.AGPL.txt in the project root for license information. + +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc (unknown) +// source: gitpod/v1/verification.proto + +package v1 + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// VerificationServiceClient is the client API for VerificationService service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type VerificationServiceClient interface { + // SendPhoneNumberVerificationToken sends a verification token to the + // specified phone number. + SendPhoneNumberVerificationToken(ctx context.Context, in *SendPhoneNumberVerificationTokenRequest, opts ...grpc.CallOption) (*SendPhoneNumberVerificationTokenResponse, error) + // VerifyPhoneNumberVerificationToken verifies the specified verification + // token. + VerifyPhoneNumberVerificationToken(ctx context.Context, in *VerifyPhoneNumberVerificationTokenRequest, opts ...grpc.CallOption) (*VerifyPhoneNumberVerificationTokenResponse, error) + // ListBlockedRepositories lists blocked repositories. + ListBlockedRepositories(ctx context.Context, in *ListBlockedRepositoriesRequest, opts ...grpc.CallOption) (*ListBlockedRepositoriesResponse, error) + // CreateBlockedRepository creates a new blocked repository. + CreateBlockedRepository(ctx context.Context, in *CreateBlockedRepositoryRequest, opts ...grpc.CallOption) (*CreateBlockedRepositoryResponse, error) + // DeleteBlockedRepository deletes a blocked repository. + DeleteBlockedRepository(ctx context.Context, in *DeleteBlockedRepositoryRequest, opts ...grpc.CallOption) (*DeleteBlockedRepositoryResponse, error) + // ListBlockedEmailDomains lists blocked email domains. + ListBlockedEmailDomains(ctx context.Context, in *ListBlockedEmailDomainsRequest, opts ...grpc.CallOption) (*ListBlockedEmailDomainsResponse, error) + // CreateBlockedEmailDomain creates a new blocked email domain. + CreateBlockedEmailDomain(ctx context.Context, in *CreateBlockedEmailDomainRequest, opts ...grpc.CallOption) (*CreateBlockedEmailDomainResponse, error) +} + +type verificationServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewVerificationServiceClient(cc grpc.ClientConnInterface) VerificationServiceClient { + return &verificationServiceClient{cc} +} + +func (c *verificationServiceClient) SendPhoneNumberVerificationToken(ctx context.Context, in *SendPhoneNumberVerificationTokenRequest, opts ...grpc.CallOption) (*SendPhoneNumberVerificationTokenResponse, error) { + out := new(SendPhoneNumberVerificationTokenResponse) + err := c.cc.Invoke(ctx, "/gitpod.v1.VerificationService/SendPhoneNumberVerificationToken", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *verificationServiceClient) VerifyPhoneNumberVerificationToken(ctx context.Context, in *VerifyPhoneNumberVerificationTokenRequest, opts ...grpc.CallOption) (*VerifyPhoneNumberVerificationTokenResponse, error) { + out := new(VerifyPhoneNumberVerificationTokenResponse) + err := c.cc.Invoke(ctx, "/gitpod.v1.VerificationService/VerifyPhoneNumberVerificationToken", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *verificationServiceClient) ListBlockedRepositories(ctx context.Context, in *ListBlockedRepositoriesRequest, opts ...grpc.CallOption) (*ListBlockedRepositoriesResponse, error) { + out := new(ListBlockedRepositoriesResponse) + err := c.cc.Invoke(ctx, "/gitpod.v1.VerificationService/ListBlockedRepositories", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *verificationServiceClient) CreateBlockedRepository(ctx context.Context, in *CreateBlockedRepositoryRequest, opts ...grpc.CallOption) (*CreateBlockedRepositoryResponse, error) { + out := new(CreateBlockedRepositoryResponse) + err := c.cc.Invoke(ctx, "/gitpod.v1.VerificationService/CreateBlockedRepository", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *verificationServiceClient) DeleteBlockedRepository(ctx context.Context, in *DeleteBlockedRepositoryRequest, opts ...grpc.CallOption) (*DeleteBlockedRepositoryResponse, error) { + out := new(DeleteBlockedRepositoryResponse) + err := c.cc.Invoke(ctx, "/gitpod.v1.VerificationService/DeleteBlockedRepository", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *verificationServiceClient) ListBlockedEmailDomains(ctx context.Context, in *ListBlockedEmailDomainsRequest, opts ...grpc.CallOption) (*ListBlockedEmailDomainsResponse, error) { + out := new(ListBlockedEmailDomainsResponse) + err := c.cc.Invoke(ctx, "/gitpod.v1.VerificationService/ListBlockedEmailDomains", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *verificationServiceClient) CreateBlockedEmailDomain(ctx context.Context, in *CreateBlockedEmailDomainRequest, opts ...grpc.CallOption) (*CreateBlockedEmailDomainResponse, error) { + out := new(CreateBlockedEmailDomainResponse) + err := c.cc.Invoke(ctx, "/gitpod.v1.VerificationService/CreateBlockedEmailDomain", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// VerificationServiceServer is the server API for VerificationService service. +// All implementations must embed UnimplementedVerificationServiceServer +// for forward compatibility +type VerificationServiceServer interface { + // SendPhoneNumberVerificationToken sends a verification token to the + // specified phone number. + SendPhoneNumberVerificationToken(context.Context, *SendPhoneNumberVerificationTokenRequest) (*SendPhoneNumberVerificationTokenResponse, error) + // VerifyPhoneNumberVerificationToken verifies the specified verification + // token. + VerifyPhoneNumberVerificationToken(context.Context, *VerifyPhoneNumberVerificationTokenRequest) (*VerifyPhoneNumberVerificationTokenResponse, error) + // ListBlockedRepositories lists blocked repositories. + ListBlockedRepositories(context.Context, *ListBlockedRepositoriesRequest) (*ListBlockedRepositoriesResponse, error) + // CreateBlockedRepository creates a new blocked repository. + CreateBlockedRepository(context.Context, *CreateBlockedRepositoryRequest) (*CreateBlockedRepositoryResponse, error) + // DeleteBlockedRepository deletes a blocked repository. + DeleteBlockedRepository(context.Context, *DeleteBlockedRepositoryRequest) (*DeleteBlockedRepositoryResponse, error) + // ListBlockedEmailDomains lists blocked email domains. + ListBlockedEmailDomains(context.Context, *ListBlockedEmailDomainsRequest) (*ListBlockedEmailDomainsResponse, error) + // CreateBlockedEmailDomain creates a new blocked email domain. + CreateBlockedEmailDomain(context.Context, *CreateBlockedEmailDomainRequest) (*CreateBlockedEmailDomainResponse, error) + mustEmbedUnimplementedVerificationServiceServer() +} + +// UnimplementedVerificationServiceServer must be embedded to have forward compatible implementations. +type UnimplementedVerificationServiceServer struct { +} + +func (UnimplementedVerificationServiceServer) SendPhoneNumberVerificationToken(context.Context, *SendPhoneNumberVerificationTokenRequest) (*SendPhoneNumberVerificationTokenResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SendPhoneNumberVerificationToken not implemented") +} +func (UnimplementedVerificationServiceServer) VerifyPhoneNumberVerificationToken(context.Context, *VerifyPhoneNumberVerificationTokenRequest) (*VerifyPhoneNumberVerificationTokenResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method VerifyPhoneNumberVerificationToken not implemented") +} +func (UnimplementedVerificationServiceServer) ListBlockedRepositories(context.Context, *ListBlockedRepositoriesRequest) (*ListBlockedRepositoriesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListBlockedRepositories not implemented") +} +func (UnimplementedVerificationServiceServer) CreateBlockedRepository(context.Context, *CreateBlockedRepositoryRequest) (*CreateBlockedRepositoryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateBlockedRepository not implemented") +} +func (UnimplementedVerificationServiceServer) DeleteBlockedRepository(context.Context, *DeleteBlockedRepositoryRequest) (*DeleteBlockedRepositoryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteBlockedRepository not implemented") +} +func (UnimplementedVerificationServiceServer) ListBlockedEmailDomains(context.Context, *ListBlockedEmailDomainsRequest) (*ListBlockedEmailDomainsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListBlockedEmailDomains not implemented") +} +func (UnimplementedVerificationServiceServer) CreateBlockedEmailDomain(context.Context, *CreateBlockedEmailDomainRequest) (*CreateBlockedEmailDomainResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateBlockedEmailDomain not implemented") +} +func (UnimplementedVerificationServiceServer) mustEmbedUnimplementedVerificationServiceServer() {} + +// UnsafeVerificationServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to VerificationServiceServer will +// result in compilation errors. +type UnsafeVerificationServiceServer interface { + mustEmbedUnimplementedVerificationServiceServer() +} + +func RegisterVerificationServiceServer(s grpc.ServiceRegistrar, srv VerificationServiceServer) { + s.RegisterService(&VerificationService_ServiceDesc, srv) +} + +func _VerificationService_SendPhoneNumberVerificationToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(SendPhoneNumberVerificationTokenRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VerificationServiceServer).SendPhoneNumberVerificationToken(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gitpod.v1.VerificationService/SendPhoneNumberVerificationToken", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VerificationServiceServer).SendPhoneNumberVerificationToken(ctx, req.(*SendPhoneNumberVerificationTokenRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _VerificationService_VerifyPhoneNumberVerificationToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(VerifyPhoneNumberVerificationTokenRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VerificationServiceServer).VerifyPhoneNumberVerificationToken(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gitpod.v1.VerificationService/VerifyPhoneNumberVerificationToken", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VerificationServiceServer).VerifyPhoneNumberVerificationToken(ctx, req.(*VerifyPhoneNumberVerificationTokenRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _VerificationService_ListBlockedRepositories_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListBlockedRepositoriesRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VerificationServiceServer).ListBlockedRepositories(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gitpod.v1.VerificationService/ListBlockedRepositories", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VerificationServiceServer).ListBlockedRepositories(ctx, req.(*ListBlockedRepositoriesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _VerificationService_CreateBlockedRepository_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateBlockedRepositoryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VerificationServiceServer).CreateBlockedRepository(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gitpod.v1.VerificationService/CreateBlockedRepository", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VerificationServiceServer).CreateBlockedRepository(ctx, req.(*CreateBlockedRepositoryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _VerificationService_DeleteBlockedRepository_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteBlockedRepositoryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VerificationServiceServer).DeleteBlockedRepository(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gitpod.v1.VerificationService/DeleteBlockedRepository", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VerificationServiceServer).DeleteBlockedRepository(ctx, req.(*DeleteBlockedRepositoryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _VerificationService_ListBlockedEmailDomains_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ListBlockedEmailDomainsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VerificationServiceServer).ListBlockedEmailDomains(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gitpod.v1.VerificationService/ListBlockedEmailDomains", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VerificationServiceServer).ListBlockedEmailDomains(ctx, req.(*ListBlockedEmailDomainsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _VerificationService_CreateBlockedEmailDomain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateBlockedEmailDomainRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(VerificationServiceServer).CreateBlockedEmailDomain(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gitpod.v1.VerificationService/CreateBlockedEmailDomain", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(VerificationServiceServer).CreateBlockedEmailDomain(ctx, req.(*CreateBlockedEmailDomainRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// VerificationService_ServiceDesc is the grpc.ServiceDesc for VerificationService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var VerificationService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "gitpod.v1.VerificationService", + HandlerType: (*VerificationServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SendPhoneNumberVerificationToken", + Handler: _VerificationService_SendPhoneNumberVerificationToken_Handler, + }, + { + MethodName: "VerifyPhoneNumberVerificationToken", + Handler: _VerificationService_VerifyPhoneNumberVerificationToken_Handler, + }, + { + MethodName: "ListBlockedRepositories", + Handler: _VerificationService_ListBlockedRepositories_Handler, + }, + { + MethodName: "CreateBlockedRepository", + Handler: _VerificationService_CreateBlockedRepository_Handler, + }, + { + MethodName: "DeleteBlockedRepository", + Handler: _VerificationService_DeleteBlockedRepository_Handler, + }, + { + MethodName: "ListBlockedEmailDomains", + Handler: _VerificationService_ListBlockedEmailDomains_Handler, + }, + { + MethodName: "CreateBlockedEmailDomain", + Handler: _VerificationService_CreateBlockedEmailDomain_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "gitpod/v1/verification.proto", +} diff --git a/components/public-api/typescript/src/gitpod/v1/scm_connect.ts b/components/public-api/typescript/src/gitpod/v1/scm_connect.ts index 451ff7e341033a..d3aa713b514fe8 100644 --- a/components/public-api/typescript/src/gitpod/v1/scm_connect.ts +++ b/components/public-api/typescript/src/gitpod/v1/scm_connect.ts @@ -19,6 +19,9 @@ export const SCMService = { typeName: "gitpod.v1.SCMService", methods: { /** + * SearchSCMTokens allows clients to retrieve SCM tokens based on the + * specified host. + * * @generated from rpc gitpod.v1.SCMService.SearchSCMTokens */ searchSCMTokens: { @@ -28,6 +31,9 @@ export const SCMService = { kind: MethodKind.Unary, }, /** + * GuessTokenScopes allows clients to retrieve scopes their SCM token would + * require for the specified git command. + * * @generated from rpc gitpod.v1.SCMService.GuessTokenScopes */ guessTokenScopes: { @@ -37,6 +43,9 @@ export const SCMService = { kind: MethodKind.Unary, }, /** + * SearchRepositories allows clients to search for suggested repositories of + * SCM providers they are connected with. + * * @generated from rpc gitpod.v1.SCMService.SearchRepositories */ searchRepositories: { @@ -46,6 +55,9 @@ export const SCMService = { kind: MethodKind.Unary, }, /** + * ListSuggestedRepositories allows clients to list suggested repositories + * based on recent workspaces and accessible repo configurations. + * * @generated from rpc gitpod.v1.SCMService.ListSuggestedRepositories */ listSuggestedRepositories: { diff --git a/components/public-api/typescript/src/gitpod/v1/verification_connect.ts b/components/public-api/typescript/src/gitpod/v1/verification_connect.ts new file mode 100644 index 00000000000000..848a59213e56c7 --- /dev/null +++ b/components/public-api/typescript/src/gitpod/v1/verification_connect.ts @@ -0,0 +1,101 @@ +/** + * Copyright (c) 2023 Gitpod GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License.AGPL.txt in the project root for license information. + */ + +// @generated by protoc-gen-connect-es v1.1.2 with parameter "target=ts" +// @generated from file gitpod/v1/verification.proto (package gitpod.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { CreateBlockedEmailDomainRequest, CreateBlockedEmailDomainResponse, CreateBlockedRepositoryRequest, CreateBlockedRepositoryResponse, DeleteBlockedRepositoryRequest, DeleteBlockedRepositoryResponse, ListBlockedEmailDomainsRequest, ListBlockedEmailDomainsResponse, ListBlockedRepositoriesRequest, ListBlockedRepositoriesResponse, SendPhoneNumberVerificationTokenRequest, SendPhoneNumberVerificationTokenResponse, VerifyPhoneNumberVerificationTokenRequest, VerifyPhoneNumberVerificationTokenResponse } from "./verification_pb.js"; +import { MethodKind } from "@bufbuild/protobuf"; + +/** + * @generated from service gitpod.v1.VerificationService + */ +export const VerificationService = { + typeName: "gitpod.v1.VerificationService", + methods: { + /** + * SendPhoneNumberVerificationToken sends a verification token to the + * specified phone number. + * + * @generated from rpc gitpod.v1.VerificationService.SendPhoneNumberVerificationToken + */ + sendPhoneNumberVerificationToken: { + name: "SendPhoneNumberVerificationToken", + I: SendPhoneNumberVerificationTokenRequest, + O: SendPhoneNumberVerificationTokenResponse, + kind: MethodKind.Unary, + }, + /** + * VerifyPhoneNumberVerificationToken verifies the specified verification + * token. + * + * @generated from rpc gitpod.v1.VerificationService.VerifyPhoneNumberVerificationToken + */ + verifyPhoneNumberVerificationToken: { + name: "VerifyPhoneNumberVerificationToken", + I: VerifyPhoneNumberVerificationTokenRequest, + O: VerifyPhoneNumberVerificationTokenResponse, + kind: MethodKind.Unary, + }, + /** + * ListBlockedRepositories lists blocked repositories. + * + * @generated from rpc gitpod.v1.VerificationService.ListBlockedRepositories + */ + listBlockedRepositories: { + name: "ListBlockedRepositories", + I: ListBlockedRepositoriesRequest, + O: ListBlockedRepositoriesResponse, + kind: MethodKind.Unary, + }, + /** + * CreateBlockedRepository creates a new blocked repository. + * + * @generated from rpc gitpod.v1.VerificationService.CreateBlockedRepository + */ + createBlockedRepository: { + name: "CreateBlockedRepository", + I: CreateBlockedRepositoryRequest, + O: CreateBlockedRepositoryResponse, + kind: MethodKind.Unary, + }, + /** + * DeleteBlockedRepository deletes a blocked repository. + * + * @generated from rpc gitpod.v1.VerificationService.DeleteBlockedRepository + */ + deleteBlockedRepository: { + name: "DeleteBlockedRepository", + I: DeleteBlockedRepositoryRequest, + O: DeleteBlockedRepositoryResponse, + kind: MethodKind.Unary, + }, + /** + * ListBlockedEmailDomains lists blocked email domains. + * + * @generated from rpc gitpod.v1.VerificationService.ListBlockedEmailDomains + */ + listBlockedEmailDomains: { + name: "ListBlockedEmailDomains", + I: ListBlockedEmailDomainsRequest, + O: ListBlockedEmailDomainsResponse, + kind: MethodKind.Unary, + }, + /** + * CreateBlockedEmailDomain creates a new blocked email domain. + * + * @generated from rpc gitpod.v1.VerificationService.CreateBlockedEmailDomain + */ + createBlockedEmailDomain: { + name: "CreateBlockedEmailDomain", + I: CreateBlockedEmailDomainRequest, + O: CreateBlockedEmailDomainResponse, + kind: MethodKind.Unary, + }, + } +} as const; diff --git a/components/public-api/typescript/src/gitpod/v1/verification_pb.ts b/components/public-api/typescript/src/gitpod/v1/verification_pb.ts new file mode 100644 index 00000000000000..ef395adbda8e8b --- /dev/null +++ b/components/public-api/typescript/src/gitpod/v1/verification_pb.ts @@ -0,0 +1,744 @@ +/** + * Copyright (c) 2023 Gitpod GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License.AGPL.txt in the project root for license information. + */ + +// @generated by protoc-gen-es v1.3.3 with parameter "target=ts" +// @generated from file gitpod/v1/verification.proto (package gitpod.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; +import { Message, proto3, Timestamp } from "@bufbuild/protobuf"; +import { PaginationRequest, PaginationResponse } from "./pagination_pb.js"; +import { Sort } from "./sorting_pb.js"; + +/** + * Required fields: + * - phone_number + * + * @generated from message gitpod.v1.SendPhoneNumberVerificationTokenRequest + */ +export class SendPhoneNumberVerificationTokenRequest extends Message { + /** + * phone_number in E.164 format + * + * @generated from field: string phone_number = 1; + */ + phoneNumber = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.SendPhoneNumberVerificationTokenRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "phone_number", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SendPhoneNumberVerificationTokenRequest { + return new SendPhoneNumberVerificationTokenRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SendPhoneNumberVerificationTokenRequest { + return new SendPhoneNumberVerificationTokenRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SendPhoneNumberVerificationTokenRequest { + return new SendPhoneNumberVerificationTokenRequest().fromJsonString(jsonString, options); + } + + static equals(a: SendPhoneNumberVerificationTokenRequest | PlainMessage | undefined, b: SendPhoneNumberVerificationTokenRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(SendPhoneNumberVerificationTokenRequest, a, b); + } +} + +/** + * @generated from message gitpod.v1.SendPhoneNumberVerificationTokenResponse + */ +export class SendPhoneNumberVerificationTokenResponse extends Message { + /** + * verification_id is used to VerifyPhoneNumberVerificationToken + * + * @generated from field: string verification_id = 1; + */ + verificationId = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.SendPhoneNumberVerificationTokenResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "verification_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): SendPhoneNumberVerificationTokenResponse { + return new SendPhoneNumberVerificationTokenResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): SendPhoneNumberVerificationTokenResponse { + return new SendPhoneNumberVerificationTokenResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): SendPhoneNumberVerificationTokenResponse { + return new SendPhoneNumberVerificationTokenResponse().fromJsonString(jsonString, options); + } + + static equals(a: SendPhoneNumberVerificationTokenResponse | PlainMessage | undefined, b: SendPhoneNumberVerificationTokenResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(SendPhoneNumberVerificationTokenResponse, a, b); + } +} + +/** + * Required fields: + * - phone_number + * - verification_id + * - token + * + * @generated from message gitpod.v1.VerifyPhoneNumberVerificationTokenRequest + */ +export class VerifyPhoneNumberVerificationTokenRequest extends Message { + /** + * phone_number in E.164 format + * + * @generated from field: string phone_number = 1; + */ + phoneNumber = ""; + + /** + * verification_id is returned by SendPhoneNumberVerificationToken + * + * @generated from field: string verification_id = 2; + */ + verificationId = ""; + + /** + * token is the verification token from providers + * + * @generated from field: string token = 3; + */ + token = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.VerifyPhoneNumberVerificationTokenRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "phone_number", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "verification_id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "token", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): VerifyPhoneNumberVerificationTokenRequest { + return new VerifyPhoneNumberVerificationTokenRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): VerifyPhoneNumberVerificationTokenRequest { + return new VerifyPhoneNumberVerificationTokenRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): VerifyPhoneNumberVerificationTokenRequest { + return new VerifyPhoneNumberVerificationTokenRequest().fromJsonString(jsonString, options); + } + + static equals(a: VerifyPhoneNumberVerificationTokenRequest | PlainMessage | undefined, b: VerifyPhoneNumberVerificationTokenRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(VerifyPhoneNumberVerificationTokenRequest, a, b); + } +} + +/** + * @generated from message gitpod.v1.VerifyPhoneNumberVerificationTokenResponse + */ +export class VerifyPhoneNumberVerificationTokenResponse extends Message { + /** + * verified indicates if the verification was successful + * + * @generated from field: bool verified = 1; + */ + verified = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.VerifyPhoneNumberVerificationTokenResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "verified", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): VerifyPhoneNumberVerificationTokenResponse { + return new VerifyPhoneNumberVerificationTokenResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): VerifyPhoneNumberVerificationTokenResponse { + return new VerifyPhoneNumberVerificationTokenResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): VerifyPhoneNumberVerificationTokenResponse { + return new VerifyPhoneNumberVerificationTokenResponse().fromJsonString(jsonString, options); + } + + static equals(a: VerifyPhoneNumberVerificationTokenResponse | PlainMessage | undefined, b: VerifyPhoneNumberVerificationTokenResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(VerifyPhoneNumberVerificationTokenResponse, a, b); + } +} + +/** + * @generated from message gitpod.v1.ListBlockedRepositoriesRequest + */ +export class ListBlockedRepositoriesRequest extends Message { + /** + * pagination contains the pagination options for listing blocked repositories + * + * @generated from field: gitpod.v1.PaginationRequest pagination = 1; + */ + pagination?: PaginationRequest; + + /** + * sort contains the sort options for listing blocked repositories + * BlockedRepositories can be sorted by "urlRegexp" + * + * @generated from field: repeated gitpod.v1.Sort sort = 2; + */ + sort: Sort[] = []; + + /** + * search_term is a search term to filter blocked repositories by url_regexp + * + * @generated from field: string search_term = 3; + */ + searchTerm = ""; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.ListBlockedRepositoriesRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "pagination", kind: "message", T: PaginationRequest }, + { no: 2, name: "sort", kind: "message", T: Sort, repeated: true }, + { no: 3, name: "search_term", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListBlockedRepositoriesRequest { + return new ListBlockedRepositoriesRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListBlockedRepositoriesRequest { + return new ListBlockedRepositoriesRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListBlockedRepositoriesRequest { + return new ListBlockedRepositoriesRequest().fromJsonString(jsonString, options); + } + + static equals(a: ListBlockedRepositoriesRequest | PlainMessage | undefined, b: ListBlockedRepositoriesRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ListBlockedRepositoriesRequest, a, b); + } +} + +/** + * @generated from message gitpod.v1.ListBlockedRepositoriesResponse + */ +export class ListBlockedRepositoriesResponse extends Message { + /** + * pagination contains the pagination options for listing blocked repositories + * + * @generated from field: gitpod.v1.PaginationResponse pagination = 1; + */ + pagination?: PaginationResponse; + + /** + * blocked_repositories are the blocked repositories + * + * @generated from field: repeated gitpod.v1.BlockedRepository blocked_repositories = 2; + */ + blockedRepositories: BlockedRepository[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.ListBlockedRepositoriesResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "pagination", kind: "message", T: PaginationResponse }, + { no: 2, name: "blocked_repositories", kind: "message", T: BlockedRepository, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListBlockedRepositoriesResponse { + return new ListBlockedRepositoriesResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListBlockedRepositoriesResponse { + return new ListBlockedRepositoriesResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListBlockedRepositoriesResponse { + return new ListBlockedRepositoriesResponse().fromJsonString(jsonString, options); + } + + static equals(a: ListBlockedRepositoriesResponse | PlainMessage | undefined, b: ListBlockedRepositoriesResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ListBlockedRepositoriesResponse, a, b); + } +} + +/** + * @generated from message gitpod.v1.CreateBlockedRepositoryRequest + */ +export class CreateBlockedRepositoryRequest extends Message { + /** + * url_regexp is the regular expression for the repository URL + * + * @generated from field: string url_regexp = 1; + */ + urlRegexp = ""; + + /** + * block_user indicates if the user should be blocked from accessing the + * repository + * + * @generated from field: bool block_user = 2; + */ + blockUser = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.CreateBlockedRepositoryRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "url_regexp", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "block_user", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateBlockedRepositoryRequest { + return new CreateBlockedRepositoryRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateBlockedRepositoryRequest { + return new CreateBlockedRepositoryRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateBlockedRepositoryRequest { + return new CreateBlockedRepositoryRequest().fromJsonString(jsonString, options); + } + + static equals(a: CreateBlockedRepositoryRequest | PlainMessage | undefined, b: CreateBlockedRepositoryRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateBlockedRepositoryRequest, a, b); + } +} + +/** + * @generated from message gitpod.v1.CreateBlockedRepositoryResponse + */ +export class CreateBlockedRepositoryResponse extends Message { + /** + * @generated from field: gitpod.v1.BlockedRepository blocked_repository = 1; + */ + blockedRepository?: BlockedRepository; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.CreateBlockedRepositoryResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "blocked_repository", kind: "message", T: BlockedRepository }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateBlockedRepositoryResponse { + return new CreateBlockedRepositoryResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateBlockedRepositoryResponse { + return new CreateBlockedRepositoryResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateBlockedRepositoryResponse { + return new CreateBlockedRepositoryResponse().fromJsonString(jsonString, options); + } + + static equals(a: CreateBlockedRepositoryResponse | PlainMessage | undefined, b: CreateBlockedRepositoryResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateBlockedRepositoryResponse, a, b); + } +} + +/** + * @generated from message gitpod.v1.DeleteBlockedRepositoryRequest + */ +export class DeleteBlockedRepositoryRequest extends Message { + /** + * blocked_repository_id is the ID of the blocked repository + * + * @generated from field: uint32 blocked_repository_id = 1; + */ + blockedRepositoryId = 0; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.DeleteBlockedRepositoryRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "blocked_repository_id", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeleteBlockedRepositoryRequest { + return new DeleteBlockedRepositoryRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeleteBlockedRepositoryRequest { + return new DeleteBlockedRepositoryRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeleteBlockedRepositoryRequest { + return new DeleteBlockedRepositoryRequest().fromJsonString(jsonString, options); + } + + static equals(a: DeleteBlockedRepositoryRequest | PlainMessage | undefined, b: DeleteBlockedRepositoryRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(DeleteBlockedRepositoryRequest, a, b); + } +} + +/** + * @generated from message gitpod.v1.DeleteBlockedRepositoryResponse + */ +export class DeleteBlockedRepositoryResponse extends Message { + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.DeleteBlockedRepositoryResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): DeleteBlockedRepositoryResponse { + return new DeleteBlockedRepositoryResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): DeleteBlockedRepositoryResponse { + return new DeleteBlockedRepositoryResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): DeleteBlockedRepositoryResponse { + return new DeleteBlockedRepositoryResponse().fromJsonString(jsonString, options); + } + + static equals(a: DeleteBlockedRepositoryResponse | PlainMessage | undefined, b: DeleteBlockedRepositoryResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(DeleteBlockedRepositoryResponse, a, b); + } +} + +/** + * @generated from message gitpod.v1.ListBlockedEmailDomainsRequest + */ +export class ListBlockedEmailDomainsRequest extends Message { + /** + * pagination contains the pagination options for listing blocked email + * domains + * + * @generated from field: gitpod.v1.PaginationRequest pagination = 1; + */ + pagination?: PaginationRequest; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.ListBlockedEmailDomainsRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "pagination", kind: "message", T: PaginationRequest }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListBlockedEmailDomainsRequest { + return new ListBlockedEmailDomainsRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListBlockedEmailDomainsRequest { + return new ListBlockedEmailDomainsRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListBlockedEmailDomainsRequest { + return new ListBlockedEmailDomainsRequest().fromJsonString(jsonString, options); + } + + static equals(a: ListBlockedEmailDomainsRequest | PlainMessage | undefined, b: ListBlockedEmailDomainsRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(ListBlockedEmailDomainsRequest, a, b); + } +} + +/** + * @generated from message gitpod.v1.ListBlockedEmailDomainsResponse + */ +export class ListBlockedEmailDomainsResponse extends Message { + /** + * pagination contains the pagination options for listing blocked email + * domains + * + * @generated from field: gitpod.v1.PaginationResponse pagination = 1; + */ + pagination?: PaginationResponse; + + /** + * blocked_email_domains are the blocked email domains + * + * @generated from field: repeated gitpod.v1.BlockedEmailDomain blocked_email_domains = 2; + */ + blockedEmailDomains: BlockedEmailDomain[] = []; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.ListBlockedEmailDomainsResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "pagination", kind: "message", T: PaginationResponse }, + { no: 2, name: "blocked_email_domains", kind: "message", T: BlockedEmailDomain, repeated: true }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): ListBlockedEmailDomainsResponse { + return new ListBlockedEmailDomainsResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): ListBlockedEmailDomainsResponse { + return new ListBlockedEmailDomainsResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): ListBlockedEmailDomainsResponse { + return new ListBlockedEmailDomainsResponse().fromJsonString(jsonString, options); + } + + static equals(a: ListBlockedEmailDomainsResponse | PlainMessage | undefined, b: ListBlockedEmailDomainsResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(ListBlockedEmailDomainsResponse, a, b); + } +} + +/** + * @generated from message gitpod.v1.CreateBlockedEmailDomainRequest + */ +export class CreateBlockedEmailDomainRequest extends Message { + /** + * domain is the blocked email domain + * + * @generated from field: string domain = 1; + */ + domain = ""; + + /** + * @generated from field: bool negative = 2; + */ + negative = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.CreateBlockedEmailDomainRequest"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "domain", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "negative", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateBlockedEmailDomainRequest { + return new CreateBlockedEmailDomainRequest().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateBlockedEmailDomainRequest { + return new CreateBlockedEmailDomainRequest().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateBlockedEmailDomainRequest { + return new CreateBlockedEmailDomainRequest().fromJsonString(jsonString, options); + } + + static equals(a: CreateBlockedEmailDomainRequest | PlainMessage | undefined, b: CreateBlockedEmailDomainRequest | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateBlockedEmailDomainRequest, a, b); + } +} + +/** + * @generated from message gitpod.v1.CreateBlockedEmailDomainResponse + */ +export class CreateBlockedEmailDomainResponse extends Message { + /** + * @generated from field: gitpod.v1.BlockedEmailDomain blocked_email_domain = 1; + */ + blockedEmailDomain?: BlockedEmailDomain; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.CreateBlockedEmailDomainResponse"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "blocked_email_domain", kind: "message", T: BlockedEmailDomain }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): CreateBlockedEmailDomainResponse { + return new CreateBlockedEmailDomainResponse().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): CreateBlockedEmailDomainResponse { + return new CreateBlockedEmailDomainResponse().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): CreateBlockedEmailDomainResponse { + return new CreateBlockedEmailDomainResponse().fromJsonString(jsonString, options); + } + + static equals(a: CreateBlockedEmailDomainResponse | PlainMessage | undefined, b: CreateBlockedEmailDomainResponse | PlainMessage | undefined): boolean { + return proto3.util.equals(CreateBlockedEmailDomainResponse, a, b); + } +} + +/** + * @generated from message gitpod.v1.BlockedRepository + */ +export class BlockedRepository extends Message { + /** + * id is the ID of the blocked repository + * + * @generated from field: uint32 id = 1; + */ + id = 0; + + /** + * url_regexp is the regular expression for the repository URL + * + * @generated from field: string url_regexp = 2; + */ + urlRegexp = ""; + + /** + * block_user indicates if the user should be blocked from accessing the + * repository + * + * @generated from field: bool block_user = 3; + */ + blockUser = false; + + /** + * @generated from field: google.protobuf.Timestamp creation_time = 4; + */ + creationTime?: Timestamp; + + /** + * @generated from field: google.protobuf.Timestamp update_time = 5; + */ + updateTime?: Timestamp; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.BlockedRepository"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, + { no: 2, name: "url_regexp", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "block_user", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + { no: 4, name: "creation_time", kind: "message", T: Timestamp }, + { no: 5, name: "update_time", kind: "message", T: Timestamp }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): BlockedRepository { + return new BlockedRepository().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): BlockedRepository { + return new BlockedRepository().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): BlockedRepository { + return new BlockedRepository().fromJsonString(jsonString, options); + } + + static equals(a: BlockedRepository | PlainMessage | undefined, b: BlockedRepository | PlainMessage | undefined): boolean { + return proto3.util.equals(BlockedRepository, a, b); + } +} + +/** + * @generated from message gitpod.v1.BlockedEmailDomain + */ +export class BlockedEmailDomain extends Message { + /** + * id is the ID of the blocked email domain + * + * @generated from field: string id = 1; + */ + id = ""; + + /** + * domain is the blocked email domain + * + * @generated from field: string domain = 2; + */ + domain = ""; + + /** + * @generated from field: bool negative = 3; + */ + negative = false; + + constructor(data?: PartialMessage) { + super(); + proto3.util.initPartial(data, this); + } + + static readonly runtime: typeof proto3 = proto3; + static readonly typeName = "gitpod.v1.BlockedEmailDomain"; + static readonly fields: FieldList = proto3.util.newFieldList(() => [ + { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 2, name: "domain", kind: "scalar", T: 9 /* ScalarType.STRING */ }, + { no: 3, name: "negative", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, + ]); + + static fromBinary(bytes: Uint8Array, options?: Partial): BlockedEmailDomain { + return new BlockedEmailDomain().fromBinary(bytes, options); + } + + static fromJson(jsonValue: JsonValue, options?: Partial): BlockedEmailDomain { + return new BlockedEmailDomain().fromJson(jsonValue, options); + } + + static fromJsonString(jsonString: string, options?: Partial): BlockedEmailDomain { + return new BlockedEmailDomain().fromJsonString(jsonString, options); + } + + static equals(a: BlockedEmailDomain | PlainMessage | undefined, b: BlockedEmailDomain | PlainMessage | undefined): boolean { + return proto3.util.equals(BlockedEmailDomain, a, b); + } +} diff --git a/components/server/src/api/sorting.ts b/components/server/src/api/sorting.ts new file mode 100644 index 00000000000000..7b514dae53a15a --- /dev/null +++ b/components/server/src/api/sorting.ts @@ -0,0 +1,46 @@ +/** + * Copyright (c) 2023 Gitpod GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License.AGPL.txt in the project root for license information. + */ + +import { ApplicationError, ErrorCodes } from "@gitpod/gitpod-protocol/lib/messaging/error"; +import { Sort, SortOrder } from "@gitpod/public-api/lib/gitpod/v1/sorting_pb"; + +export type Sorting = { + orderBy: string; + orderDir: "asc" | "desc"; +}; + +export function parseSorting( + sortList?: Sort[], + opts?: { allowFields: string[]; defaultField?: string }, +): Sorting | undefined { + const defaultResult: Sorting | undefined = opts?.defaultField + ? { orderBy: opts.defaultField, orderDir: "asc" } + : undefined; + if (!sortList || (sortList?.length ?? 0) === 0) { + return defaultResult; + } + + // grab the first sort entry - only 1 supported here + const sort = sortList[0]; + if (!sort) { + return defaultResult; + } + // defaults to urlRegexp + const orderBy = sort.field || opts?.defaultField; + if (!orderBy) { + return defaultResult; + } + if (opts?.allowFields && !opts.allowFields.includes(orderBy)) { + throw new ApplicationError( + ErrorCodes.BAD_REQUEST, + `orderBy must be one of ${opts.allowFields.map((f) => "'" + f + "'").join(" or ")}`, + ); + } + // defaults to ascending + const orderDir: "asc" | "desc" = (sort.order || SortOrder.ASC) === SortOrder.DESC ? "desc" : "asc"; + + return { orderBy, orderDir }; +} diff --git a/components/server/src/api/verification-service-api.ts b/components/server/src/api/verification-service-api.ts new file mode 100644 index 00000000000000..c487d200d3ccbe --- /dev/null +++ b/components/server/src/api/verification-service-api.ts @@ -0,0 +1,203 @@ +/** + * Copyright (c) 2023 Gitpod GmbH. All rights reserved. + * Licensed under the GNU Affero General Public License (AGPL). + * See License.AGPL.txt in the project root for license information. + */ + +import { HandlerContext, ServiceImpl } from "@connectrpc/connect"; +import { ApplicationError, ErrorCodes } from "@gitpod/gitpod-protocol/lib/messaging/error"; +import { VerificationService as VerificationServiceInterface } from "@gitpod/public-api/lib/gitpod/v1/verification_connect"; +import { + CreateBlockedEmailDomainRequest, + CreateBlockedEmailDomainResponse, + CreateBlockedRepositoryRequest, + CreateBlockedRepositoryResponse, + DeleteBlockedRepositoryRequest, + DeleteBlockedRepositoryResponse, + ListBlockedEmailDomainsRequest, + ListBlockedEmailDomainsResponse, + ListBlockedRepositoriesRequest, + ListBlockedRepositoriesResponse, + SendPhoneNumberVerificationTokenRequest, + SendPhoneNumberVerificationTokenResponse, + VerifyPhoneNumberVerificationTokenRequest, + VerifyPhoneNumberVerificationTokenResponse, +} from "@gitpod/public-api/lib/gitpod/v1/verification_pb"; +import { inject, injectable } from "inversify"; +import { VerificationService } from "../auth/verification-service"; +import { getExperimentsClientForBackend } from "@gitpod/gitpod-protocol/lib/experiments/configcat-server"; +import { ctxUserId } from "../util/request-context"; +import { UserService } from "../user/user-service"; +import { formatPhoneNumber } from "../user/phone-numbers"; +import { validate as uuidValidate } from "uuid"; +import { UserDB } from "@gitpod/gitpod-db/lib"; +import { PaginationToken, generatePaginationToken, parsePaginationToken } from "./pagination"; +import { parseSorting } from "./sorting"; +import { PaginationResponse } from "@gitpod/public-api/lib/gitpod/v1/pagination_pb"; +import { PublicAPIConverter } from "@gitpod/gitpod-protocol/lib/public-api-converter"; + +@injectable() +export class VerificationServiceAPI implements ServiceImpl { + @inject(VerificationService) private readonly verificationService: VerificationService; + @inject(UserService) private readonly userService: UserService; + @inject(UserDB) private readonly userDB: UserDB; + + @inject(PublicAPIConverter) private readonly apiConverter: PublicAPIConverter; + + async sendPhoneNumberVerificationToken( + req: SendPhoneNumberVerificationTokenRequest, + _: HandlerContext, + ): Promise { + if (!req.phoneNumber) { + throw new ApplicationError(ErrorCodes.BAD_REQUEST, "phoneNumber is required"); + } + + const userId = ctxUserId(); + const user = await this.userService.findUserById(userId, userId); + + // Check if verify via call is enabled + const phoneVerificationByCall = await getExperimentsClientForBackend().getValueAsync( + "phoneVerificationByCall", + false, + { + user, + }, + ); + const channel = phoneVerificationByCall ? "call" : "sms"; + const { verificationId } = await this.verificationService.sendVerificationToken( + formatPhoneNumber(req.phoneNumber), + channel, + ); + return new SendPhoneNumberVerificationTokenResponse({ + verificationId, + }); + } + + async verifyPhoneNumberVerificationToken( + req: VerifyPhoneNumberVerificationTokenRequest, + _: HandlerContext, + ): Promise { + if (!req.phoneNumber) { + throw new ApplicationError(ErrorCodes.BAD_REQUEST, "phoneNumber is required"); + } + if (!req.verificationId || !uuidValidate(req.verificationId)) { + throw new ApplicationError(ErrorCodes.BAD_REQUEST, "verificationId is required"); + } + if (!req.token) { + throw new ApplicationError(ErrorCodes.BAD_REQUEST, "token is required"); + } + const phoneNumber = formatPhoneNumber(req.phoneNumber); + + const userId = ctxUserId(); + const user = await this.userService.findUserById(userId, userId); + + const { verified } = await this.verificationService.verifyVerificationToken( + phoneNumber, + req.token, + req.verificationId, + ); + if (verified) { + this.verificationService.markVerified(user); + user.verificationPhoneNumber = phoneNumber; + await this.userDB.updateUserPartial(user); + } + return new VerifyPhoneNumberVerificationTokenResponse({ + verified, + }); + } + + async listBlockedRepositories( + req: ListBlockedRepositoriesRequest, + _: HandlerContext, + ): Promise { + const paginationToken = parsePaginationToken(req.pagination?.token); + + const sorting = parseSorting(req.sort, { + allowFields: ["urlRegexp"], + defaultField: "urlRegexp", + })!; + const limit = req.pagination?.pageSize ?? 50; + const data = await this.verificationService.adminGetBlockedRepositories(ctxUserId(), { + offset: paginationToken.offset, + // We request 1 additional record to help determine if there are more results + limit: limit + 1, + orderBy: sorting.orderBy as any, + orderDir: sorting.orderDir, + searchTerm: req.searchTerm, + }); + + // Drop the extra record we requested to determine if there are more results + const pagedRows = data.rows.slice(0, limit); + + const response = new ListBlockedRepositoriesResponse({ + blockedRepositories: pagedRows.map((blockedRepository) => + this.apiConverter.toBlockedRepository(blockedRepository), + ), + }); + response.pagination = new PaginationResponse(); + if (data.rows.length > limit) { + const nextToken: PaginationToken = { + offset: paginationToken.offset + limit, + }; + response.pagination.nextToken = generatePaginationToken(nextToken); + } + return response; + } + + async createBlockedRepository( + req: CreateBlockedRepositoryRequest, + _: HandlerContext, + ): Promise { + if (!req.urlRegexp) { + throw new ApplicationError(ErrorCodes.BAD_REQUEST, "urlRegexp is required"); + } + const blockedRepository = await this.verificationService.adminCreateBlockedRepository(ctxUserId(), { + urlRegexp: req.urlRegexp, + blockUser: req.blockUser ?? false, + }); + return new CreateBlockedRepositoryResponse({ + blockedRepository: this.apiConverter.toBlockedRepository(blockedRepository), + }); + } + + async deleteBlockedRepository( + req: DeleteBlockedRepositoryRequest, + _: HandlerContext, + ): Promise { + if (!req.blockedRepositoryId) { + throw new ApplicationError(ErrorCodes.BAD_REQUEST, "blockedRepositoryId is required"); + } + await this.verificationService.adminDeleteBlockedRepository(ctxUserId(), req.blockedRepositoryId); + return new DeleteBlockedRepositoryResponse(); + } + + async listBlockedEmailDomains( + req: ListBlockedEmailDomainsRequest, + _: HandlerContext, + ): Promise { + const list = await this.verificationService.adminGetBlockedEmailDomains(ctxUserId()); + return new ListBlockedEmailDomainsResponse({ + blockedEmailDomains: list.map((item) => this.apiConverter.toBlockedEmailDomain(item)), + pagination: new PaginationResponse(), + }); + } + + async createBlockedEmailDomain( + req: CreateBlockedEmailDomainRequest, + _: HandlerContext, + ): Promise { + if (!req.domain) { + throw new ApplicationError(ErrorCodes.BAD_REQUEST, "domain is required"); + } + if (req.negative === undefined) { + throw new ApplicationError(ErrorCodes.BAD_REQUEST, "negative is required"); + } + const data = await this.verificationService.adminCreateBlockedEmailDomain(ctxUserId(), { + domain: req.domain, + negative: req.negative, + }); + return new CreateBlockedEmailDomainResponse({ + blockedEmailDomain: this.apiConverter.toBlockedEmailDomain(data), + }); + } +} diff --git a/components/server/src/auth/verification-service.ts b/components/server/src/auth/verification-service.ts index f7c66d7211647a..8b1b91ececb34c 100644 --- a/components/server/src/auth/verification-service.ts +++ b/components/server/src/auth/verification-service.ts @@ -4,17 +4,20 @@ * See License.AGPL.txt in the project root for license information. */ -import { User } from "@gitpod/gitpod-protocol"; +import { AdminGetListRequest, AdminGetListResult, EmailDomainFilterEntry, User } from "@gitpod/gitpod-protocol"; import { log } from "@gitpod/gitpod-protocol/lib/util/logging"; import { inject, injectable, postConstruct } from "inversify"; import { Config } from "../config"; import { Twilio } from "twilio"; import { ServiceContext } from "twilio/lib/rest/verify/v2/service"; -import { TeamDB, UserDB, WorkspaceDB } from "@gitpod/gitpod-db/lib"; +import { EmailDomainFilterDB, TeamDB, UserDB, WorkspaceDB } from "@gitpod/gitpod-db/lib"; import { ErrorCodes, ApplicationError } from "@gitpod/gitpod-protocol/lib/messaging/error"; import { VerificationInstance } from "twilio/lib/rest/verify/v2/service/verification"; import { v4 as uuidv4, validate as uuidValidate } from "uuid"; import { getExperimentsClientForBackend } from "@gitpod/gitpod-protocol/lib/experiments/configcat-server"; +import { BlockedRepository } from "@gitpod/gitpod-protocol/lib/blocked-repositories-protocol"; +import { Authorizer } from "../authorization/authorizer"; +import { BlockedRepositoryDB } from "@gitpod/gitpod-db/lib/blocked-repository-db"; @injectable() export class VerificationService { @@ -22,6 +25,9 @@ export class VerificationService { @inject(WorkspaceDB) protected workspaceDB: WorkspaceDB; @inject(UserDB) protected userDB: UserDB; @inject(TeamDB) protected teamDB: TeamDB; + @inject(Authorizer) private readonly auth: Authorizer; + @inject(BlockedRepositoryDB) private readonly blockedRepositoryDB: BlockedRepositoryDB; + @inject(EmailDomainFilterDB) private readonly emailDomainFilterDB: EmailDomainFilterDB; protected verifyService: ServiceContext; @@ -82,7 +88,7 @@ export class VerificationService { channel: "sms" | "call" = "sms", ): Promise<{ verification: VerificationInstance; verificationId: string }> { if (!this.verifyService) { - throw new Error("No verification service configured."); + throw new ApplicationError(ErrorCodes.INTERNAL_SERVER_ERROR, "No verification service configured."); } const isBlockedNumber = this.userDB.isBlockedPhoneNumber(phoneNumber); const usages = await this.userDB.countUsagesOfPhoneNumber(phoneNumber); @@ -156,4 +162,45 @@ export class VerificationService { channel: verification_check.channel, }; } + + public async adminGetBlockedRepositories( + userId: string, + opts: AdminGetListRequest, + ): Promise> { + await this.auth.checkPermissionOnInstallation(userId, "configure"); + const results = await this.blockedRepositoryDB.findAllBlockedRepositories( + opts.offset, + opts.limit, + opts.orderBy, + opts.orderDir === "asc" ? "ASC" : "DESC", + opts.searchTerm, + ); + return results; + } + + public async adminCreateBlockedRepository( + userId: string, + opts: Pick, + ): Promise { + await this.auth.checkPermissionOnInstallation(userId, "configure"); + return this.blockedRepositoryDB.createBlockedRepository(opts.urlRegexp, opts.blockUser); + } + + public async adminDeleteBlockedRepository(userId: string, blockedRepositoryId: number): Promise { + await this.auth.checkPermissionOnInstallation(userId, "configure"); + return this.blockedRepositoryDB.deleteBlockedRepository(blockedRepositoryId); + } + + public async adminGetBlockedEmailDomains(userId: string): Promise { + await this.auth.checkPermissionOnInstallation(userId, "configure"); + return this.emailDomainFilterDB.getFilterEntries(); + } + + public async adminCreateBlockedEmailDomain( + userId: string, + opts: EmailDomainFilterEntry, + ): Promise { + await this.auth.checkPermissionOnInstallation(userId, "configure"); + return this.emailDomainFilterDB.storeFilterEntry(opts); + } } diff --git a/components/server/src/workspace/gitpod-server-impl.ts b/components/server/src/workspace/gitpod-server-impl.ts index 4b947b237bc6fc..19157eecda86ce 100644 --- a/components/server/src/workspace/gitpod-server-impl.ts +++ b/components/server/src/workspace/gitpod-server-impl.ts @@ -1891,14 +1891,7 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { await this.auth.checkPermissionOnInstallation(admin.id, "configure"); try { - const res = await this.blockedRepostoryDB.findAllBlockedRepositories( - req.offset, - req.limit, - req.orderBy, - req.orderDir === "asc" ? "ASC" : "DESC", - req.searchTerm, - ); - return res; + return await this.verificationService.adminGetBlockedRepositories(admin.id, req); } catch (e) { throw new ApplicationError(ErrorCodes.INTERNAL_SERVER_ERROR, String(e)); } @@ -1918,7 +1911,10 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { ); await this.auth.checkPermissionOnInstallation(admin.id, "configure"); - return await this.blockedRepostoryDB.createBlockedRepository(urlRegexp, blockUser); + return await this.verificationService.adminCreateBlockedRepository(admin.id, { + urlRegexp, + blockUser, + }); } async adminDeleteBlockedRepository(ctx: TraceContext, id: number): Promise { @@ -1927,7 +1923,7 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { const admin = await this.guardAdminAccess("adminDeleteBlockedRepository", { id }, Permission.ADMIN_USERS); await this.auth.checkPermissionOnInstallation(admin.id, "configure"); - await this.blockedRepostoryDB.deleteBlockedRepository(id); + await this.verificationService.adminDeleteBlockedRepository(admin.id, id); } async adminBlockUser(ctx: TraceContext, req: AdminBlockUserRequest): Promise { @@ -2988,7 +2984,7 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { const user = await this.checkAndBlockUser("adminGetBlockedEmailDomains"); await this.guardAdminAccess("adminGetBlockedEmailDomains", { id: user.id }, Permission.ADMIN_USERS); await this.auth.checkPermissionOnInstallation(user.id, "configure"); - return await this.emailDomainFilterdb.getFilterEntries(); + return this.verificationService.adminGetBlockedEmailDomains(user.id); } async adminSaveBlockedEmailDomain( @@ -2998,6 +2994,6 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { const user = await this.checkAndBlockUser("adminSaveBlockedEmailDomain"); await this.guardAdminAccess("adminSaveBlockedEmailDomain", { id: user.id }, Permission.ADMIN_USERS); await this.auth.checkPermissionOnInstallation(user.id, "configure"); - await this.emailDomainFilterdb.storeFilterEntry(domainFilterentry); + await this.verificationService.adminCreateBlockedEmailDomain(user.id, domainFilterentry); } } From ae924cea4be989470d3385642f55dbce98da1b96 Mon Sep 17 00:00:00 2001 From: Huiwen Date: Mon, 27 Nov 2023 10:10:23 +0000 Subject: [PATCH 02/10] use on dashboard --- .../src/admin/BlockedEmailDomains.tsx | 13 +++-- .../src/admin/BlockedRepositories.tsx | 57 ++++++++++++------- .../dashboard/src/start/VerifyModal.tsx | 15 +++-- 3 files changed, 53 insertions(+), 32 deletions(-) diff --git a/components/dashboard/src/admin/BlockedEmailDomains.tsx b/components/dashboard/src/admin/BlockedEmailDomains.tsx index d664fa5c45572a..4fac823576b0a7 100644 --- a/components/dashboard/src/admin/BlockedEmailDomains.tsx +++ b/components/dashboard/src/admin/BlockedEmailDomains.tsx @@ -13,10 +13,10 @@ import { ItemFieldContextMenu } from "../components/ItemsList"; import Modal, { ModalBody, ModalFooter, ModalHeader } from "../components/Modal"; import { CheckboxInputField } from "../components/forms/CheckboxInputField"; import searchIcon from "../icons/search.svg"; -import { getGitpodService } from "../service/service"; import { AdminPageHeader } from "./AdminPageHeader"; import Pagination from "../Pagination/Pagination"; import { Button } from "@podkit/buttons/Button"; +import { verificationClient } from "../service/public-api"; export function BlockedEmailDomains() { return ( @@ -27,7 +27,7 @@ export function BlockedEmailDomains() { } function useBlockedEmailDomains() { - return useQuery(["blockedEmailDomains"], () => getGitpodService().server.adminGetBlockedEmailDomains(), { + return useQuery(["blockedEmailDomains"], () => verificationClient.listBlockedEmailDomains({}), { staleTime: 1000 * 60 * 5, // 5min }); } @@ -37,12 +37,15 @@ function useUpdateBlockedEmailDomainMutation() { const blockedEmailDomains = useBlockedEmailDomains(); return useMutation( async (blockedDomain: EmailDomainFilterEntry) => { - await getGitpodService().server.adminSaveBlockedEmailDomain(blockedDomain); + await verificationClient.createBlockedEmailDomain({ + domain: blockedDomain.domain, + negative: blockedDomain.negative, + }); }, { onSuccess: (_, blockedDomain) => { const updated = []; - for (const entry of blockedEmailDomains.data || []) { + for (const entry of blockedEmailDomains.data?.blockedEmailDomains || []) { if (entry.domain !== blockedDomain.domain) { updated.push(entry); } else { @@ -74,7 +77,7 @@ export function BlockedEmailDomainsList(props: Props) { if (!blockedEmailDomains.data) { return []; } - return blockedEmailDomains.data.filter((entry) => + return blockedEmailDomains.data.blockedEmailDomains.filter((entry) => entry.domain.toLowerCase().includes(searchTerm.toLowerCase()), ); }, [blockedEmailDomains.data, searchTerm]); diff --git a/components/dashboard/src/admin/BlockedRepositories.tsx b/components/dashboard/src/admin/BlockedRepositories.tsx index 66c9c92480fc35..8c93acd56d8e64 100644 --- a/components/dashboard/src/admin/BlockedRepositories.tsx +++ b/components/dashboard/src/admin/BlockedRepositories.tsx @@ -4,11 +4,8 @@ * See License.AGPL.txt in the project root for license information. */ -import { AdminGetListResult } from "@gitpod/gitpod-protocol"; import { useCallback, useEffect, useRef, useState } from "react"; -import { getGitpodService } from "../service/service"; import { AdminPageHeader } from "./AdminPageHeader"; -import { BlockedRepository } from "@gitpod/gitpod-protocol/lib/blocked-repositories-protocol"; import ConfirmationModal from "../components/ConfirmationModal"; import Modal, { ModalBody, ModalFooter, ModalHeader } from "../components/Modal"; import { CheckboxInputField } from "../components/forms/CheckboxInputField"; @@ -18,6 +15,11 @@ import Alert from "../components/Alert"; import { SpinnerLoader } from "../components/Loader"; import searchIcon from "../icons/search.svg"; import { Button } from "@podkit/buttons/Button"; +import { verificationClient } from "../service/public-api"; +import { PaginationRequest } from "@gitpod/public-api/lib/gitpod/v1/pagination_pb"; +import { Sort, SortOrder } from "@gitpod/public-api/lib/gitpod/v1/sorting_pb"; +import { BlockedRepository, ListBlockedRepositoriesResponse } from "@gitpod/public-api/lib/gitpod/v1/verification_pb"; +import { PartialMessage } from "@bufbuild/protobuf"; export function BlockedRepositories() { return ( @@ -27,20 +29,22 @@ export function BlockedRepositories() { ); } -type NewBlockedRepository = Pick; -type ExistingBlockedRepository = Pick; +type NewBlockedRepository = Pick, "urlRegexp" | "blockUser">; +type ExistingBlockedRepository = Pick, "id" | "urlRegexp" | "blockUser">; interface Props {} export function BlockedRepositoriesList(props: Props) { - const [searchResult, setSearchResult] = useState>({ rows: [], total: 0 }); + const [searchResult, setSearchResult] = useState>({ + blockedRepositories: [], + }); const [queryTerm, setQueryTerm] = useState(""); const [searching, setSearching] = useState(false); const [isAddModalVisible, setAddModalVisible] = useState(false); const [isDeleteModalVisible, setDeleteModalVisible] = useState(false); - const [currentBlockedRepository, setCurrentBlockedRepository] = useState({ + const [currentBlockedRepository, setCurrentBlockedRepository] = useState>({ id: 0, urlRegexp: "", blockUser: false, @@ -49,11 +53,17 @@ export function BlockedRepositoriesList(props: Props) { const search = async () => { setSearching(true); try { - const result = await getGitpodService().server.adminGetBlockedRepositories({ - limit: 100, - orderBy: "urlRegexp", - offset: 0, - orderDir: "asc", + const result = await verificationClient.listBlockedRepositories({ + pagination: new PaginationRequest({ + token: Buffer.from(JSON.stringify({ offset: 0 })).toString("base64"), + pageSize: 100, + }), + sort: [ + new Sort({ + field: "urlRegexp", + order: SortOrder.ASC, + }), + ], searchTerm: queryTerm, }); setSearchResult(result); @@ -76,10 +86,10 @@ export function BlockedRepositoriesList(props: Props) { }; const save = async (blockedRepository: NewBlockedRepository) => { - await getGitpodService().server.adminCreateBlockedRepository( - blockedRepository.urlRegexp, - blockedRepository.blockUser, - ); + await verificationClient.createBlockedRepository({ + urlRegexp: blockedRepository.urlRegexp ?? "", + blockUser: blockedRepository.blockUser ?? false, + }); setAddModalVisible(false); search(); }; @@ -91,11 +101,13 @@ export function BlockedRepositoriesList(props: Props) { }; const deleteBlockedRepository = async (blockedRepository: ExistingBlockedRepository) => { - await getGitpodService().server.adminDeleteBlockedRepository(blockedRepository.id); + await verificationClient.deleteBlockedRepository({ + blockedRepositoryId: blockedRepository.id, + }); search(); }; - const confirmDeleteBlockedRepository = (blockedRepository: ExistingBlockedRepository) => { + const confirmDeleteBlockedRepository = (blockedRepository: PartialMessage) => { setCurrentBlockedRepository(blockedRepository); setAddModalVisible(false); setDeleteModalVisible(true); @@ -158,7 +170,7 @@ export function BlockedRepositoriesList(props: Props) {
Block Users
- {searchResult.rows.map((br) => ( + {searchResult.blockedRepositories!.map((br) => ( ))} @@ -166,7 +178,10 @@ export function BlockedRepositoriesList(props: Props) { ); } -function BlockedRepositoryEntry(props: { br: BlockedRepository; confirmedDelete: (br: BlockedRepository) => void }) { +function BlockedRepositoryEntry(props: { + br: PartialMessage; + confirmedDelete: (br: PartialMessage) => void; +}) { const menuEntries: ContextMenuEntry[] = [ { title: "Delete", @@ -295,7 +310,7 @@ function Details(props: { { if (!!props.update) { diff --git a/components/dashboard/src/start/VerifyModal.tsx b/components/dashboard/src/start/VerifyModal.tsx index 0b9915a3aea443..77ccdfe6be69c6 100644 --- a/components/dashboard/src/start/VerifyModal.tsx +++ b/components/dashboard/src/start/VerifyModal.tsx @@ -7,13 +7,13 @@ import { useState } from "react"; import Alert, { AlertType } from "../components/Alert"; import Modal, { ModalBody, ModalFooter, ModalHeader } from "../components/Modal"; -import { getGitpodService } from "../service/service"; import PhoneInput from "react-intl-tel-input"; import "react-intl-tel-input/dist/main.css"; import "./phone-input.css"; import { Button } from "../components/Button"; import { LinkButton } from "../components/LinkButton"; import { useFeatureFlag } from "../data/featureflag-query"; +import { verificationClient } from "../service/public-api"; interface VerifyModalState { phoneNumber?: string; @@ -41,7 +41,9 @@ export function VerifyModal() { message: undefined, sending: true, }); - const resp = await getGitpodService().server.sendPhoneNumberVerificationToken(state.phoneNumber || ""); + const resp = await verificationClient.sendPhoneNumberVerificationToken({ + phoneNumber: state.phoneNumber || "", + }); setVerificationId(resp.verificationId); setState({ ...state, @@ -123,11 +125,12 @@ export function VerifyModal() { }; const verifyToken = async () => { try { - const verified = await getGitpodService().server.verifyPhoneNumberVerificationToken( - state.phoneNumber!, - state.token!, + const resp = await verificationClient.verifyPhoneNumberVerificationToken({ verificationId, - ); + token: state.token, + phoneNumber: state.phoneNumber, + }); + const verified = resp.verified; if (verified) { setState({ ...state, From caeb73076fdc61f24d85305166013cc235408b14 Mon Sep 17 00:00:00 2001 From: Huiwen Date: Mon, 27 Nov 2023 10:16:36 +0000 Subject: [PATCH 03/10] Add test case --- .../src/public-api-converter.spec.ts | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/components/gitpod-protocol/src/public-api-converter.spec.ts b/components/gitpod-protocol/src/public-api-converter.spec.ts index 3aefe7ec26c5c6..e96d7234a34892 100644 --- a/components/gitpod-protocol/src/public-api-converter.spec.ts +++ b/components/gitpod-protocol/src/public-api-converter.spec.ts @@ -25,6 +25,7 @@ import { import { AuthProviderEntry, AuthProviderInfo, + EmailDomainFilterEntry, ProjectEnvVar, SuggestedRepository, Token, @@ -64,6 +65,7 @@ import { TooManyRunningWorkspacesError, } from "@gitpod/public-api/lib/gitpod/v1/error_pb"; import { SSHPublicKey } from "@gitpod/public-api/lib/gitpod/v1/ssh_pb"; +import { BlockedRepository as ProtocolBlockedRepository } from "./blocked-repositories-protocol"; describe("PublicAPIConverter", () => { const converter = new PublicAPIConverter(); @@ -983,6 +985,40 @@ describe("PublicAPIConverter", () => { }); }); + describe("toBlockedRepository", () => { + it("should convert a token", () => { + const t1 = new Date(); + const t2 = new Date(); + const repo: ProtocolBlockedRepository = { + id: 2023, + urlRegexp: "*/*", + blockUser: false, + createdAt: t1.toISOString(), + updatedAt: t2.toISOString(), + }; + expect(converter.toBlockedRepository(repo).toJson()).to.deep.equal({ + id: 2023, + blockUser: false, + name: "*/*", + creationTime: t1.toISOString(), + updateTime: t2.toISOString(), + }); + }); + }); + + describe("toBlockedEmailDomain", () => { + it("should convert a token", () => { + const item: EmailDomainFilterEntry = { + domain: "example.com", + negative: false, + }; + expect(converter.toBlockedEmailDomain(item).toJson()).to.deep.equal({ + domain: "example.com", + negative: false, + }); + }); + }); + describe("toSCMToken", () => { it("should convert a token", () => { const t1 = new Date(); From dc3746906d123df139092f45e80df351f47a3fb3 Mon Sep 17 00:00:00 2001 From: Huiwen Date: Mon, 27 Nov 2023 10:35:26 +0000 Subject: [PATCH 04/10] fixup --- components/dashboard/src/admin/BlockedRepositories.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/components/dashboard/src/admin/BlockedRepositories.tsx b/components/dashboard/src/admin/BlockedRepositories.tsx index 8c93acd56d8e64..68d97ecf7cb905 100644 --- a/components/dashboard/src/admin/BlockedRepositories.tsx +++ b/components/dashboard/src/admin/BlockedRepositories.tsx @@ -16,7 +16,6 @@ import { SpinnerLoader } from "../components/Loader"; import searchIcon from "../icons/search.svg"; import { Button } from "@podkit/buttons/Button"; import { verificationClient } from "../service/public-api"; -import { PaginationRequest } from "@gitpod/public-api/lib/gitpod/v1/pagination_pb"; import { Sort, SortOrder } from "@gitpod/public-api/lib/gitpod/v1/sorting_pb"; import { BlockedRepository, ListBlockedRepositoriesResponse } from "@gitpod/public-api/lib/gitpod/v1/verification_pb"; import { PartialMessage } from "@bufbuild/protobuf"; @@ -54,10 +53,11 @@ export function BlockedRepositoriesList(props: Props) { setSearching(true); try { const result = await verificationClient.listBlockedRepositories({ - pagination: new PaginationRequest({ - token: Buffer.from(JSON.stringify({ offset: 0 })).toString("base64"), - pageSize: 100, - }), + // Don't need, added it in json-rpc implement to make life easier. + // pagination: new PaginationRequest({ + // token: Buffer.from(JSON.stringify({ offset: 0 })).toString("base64"), + // pageSize: 100, + // }), sort: [ new Sort({ field: "urlRegexp", From 72efffa07733c5bafc0cfb8384ab059e589d793c Mon Sep 17 00:00:00 2001 From: Huiwen Date: Mon, 27 Nov 2023 10:38:12 +0000 Subject: [PATCH 05/10] fix build --- .../server/src/workspace/gitpod-server-impl.ts | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/components/server/src/workspace/gitpod-server-impl.ts b/components/server/src/workspace/gitpod-server-impl.ts index 19157eecda86ce..0ad1bc528cfd91 100644 --- a/components/server/src/workspace/gitpod-server-impl.ts +++ b/components/server/src/workspace/gitpod-server-impl.ts @@ -4,16 +4,7 @@ * See License.AGPL.txt in the project root for license information. */ -import { - UserDB, - WorkspaceDB, - DBWithTracing, - TracedWorkspaceDB, - EmailDomainFilterDB, - TeamDB, - DBGitpodToken, -} from "@gitpod/gitpod-db/lib"; -import { BlockedRepositoryDB } from "@gitpod/gitpod-db/lib/blocked-repository-db"; +import { UserDB, WorkspaceDB, DBWithTracing, TracedWorkspaceDB, TeamDB, DBGitpodToken } from "@gitpod/gitpod-db/lib"; import { AuthProviderEntry, AuthProviderInfo, @@ -179,7 +170,6 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { private readonly workspaceManagerClientProvider: WorkspaceManagerClientProvider, @inject(UserDB) private readonly userDB: UserDB, - @inject(BlockedRepositoryDB) private readonly blockedRepostoryDB: BlockedRepositoryDB, @inject(UserAuthentication) private readonly userAuthentication: UserAuthentication, @inject(UserService) private readonly userService: UserService, @inject(IAnalyticsWriter) private readonly analytics: IAnalyticsWriter, @@ -209,7 +199,6 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { @inject(StripeService) private readonly stripeService: StripeService, @inject(UsageService) private readonly usageService: UsageService, @inject(BillingServiceDefinition.name) private readonly billingService: BillingServiceClient, - @inject(EmailDomainFilterDB) private emailDomainFilterdb: EmailDomainFilterDB, @inject(RedisSubscriber) private readonly subscriber: RedisSubscriber, From b3350b2c9680717721c31de280e42007f8e16622 Mon Sep 17 00:00:00 2001 From: Jean Pierre Huaroto Date: Mon, 27 Nov 2023 19:01:27 +0000 Subject: [PATCH 06/10] Update proto --- .../public-api/gitpod/v1/verification.proto | 110 -- .../go/v1/v1connect/verification.connect.go | 120 -- .../v1connect/verification.proxy.connect.go | 50 - .../public-api/go/v1/verification.pb.go | 1101 +---------------- .../public-api/go/v1/verification_grpc.pb.go | 190 --- .../src/gitpod/v1/verification_connect.ts | 57 +- .../src/gitpod/v1/verification_pb.ts | 553 +-------- 7 files changed, 57 insertions(+), 2124 deletions(-) diff --git a/components/public-api/gitpod/v1/verification.proto b/components/public-api/gitpod/v1/verification.proto index 50aa0888066213..7421a04ecdd016 100644 --- a/components/public-api/gitpod/v1/verification.proto +++ b/components/public-api/gitpod/v1/verification.proto @@ -2,10 +2,6 @@ syntax = "proto3"; package gitpod.v1; -import "gitpod/v1/pagination.proto"; -import "gitpod/v1/sorting.proto"; -import "google/protobuf/timestamp.proto"; - option go_package = "github.com/gitpod-io/gitpod/components/public-api/go/v1"; service VerificationService { @@ -16,21 +12,6 @@ service VerificationService { // VerifyPhoneNumberVerificationToken verifies the specified verification // token. rpc VerifyPhoneNumberVerificationToken(VerifyPhoneNumberVerificationTokenRequest) returns (VerifyPhoneNumberVerificationTokenResponse) {} - - // ListBlockedRepositories lists blocked repositories. - rpc ListBlockedRepositories(ListBlockedRepositoriesRequest) returns (ListBlockedRepositoriesResponse) {} - - // CreateBlockedRepository creates a new blocked repository. - rpc CreateBlockedRepository(CreateBlockedRepositoryRequest) returns (CreateBlockedRepositoryResponse) {} - - // DeleteBlockedRepository deletes a blocked repository. - rpc DeleteBlockedRepository(DeleteBlockedRepositoryRequest) returns (DeleteBlockedRepositoryResponse) {} - - // ListBlockedEmailDomains lists blocked email domains. - rpc ListBlockedEmailDomains(ListBlockedEmailDomainsRequest) returns (ListBlockedEmailDomainsResponse) {} - - // CreateBlockedEmailDomain creates a new blocked email domain. - rpc CreateBlockedEmailDomain(CreateBlockedEmailDomainRequest) returns (CreateBlockedEmailDomainResponse) {} } // Required fields: @@ -62,94 +43,3 @@ message VerifyPhoneNumberVerificationTokenResponse { // verified indicates if the verification was successful bool verified = 1; } - -message ListBlockedRepositoriesRequest { - // pagination contains the pagination options for listing blocked repositories - PaginationRequest pagination = 1; - - // sort contains the sort options for listing blocked repositories - // BlockedRepositories can be sorted by "urlRegexp" - repeated Sort sort = 2; - - // search_term is a search term to filter blocked repositories by url_regexp - string search_term = 3; -} - -message ListBlockedRepositoriesResponse { - // pagination contains the pagination options for listing blocked repositories - PaginationResponse pagination = 1; - - // blocked_repositories are the blocked repositories - repeated BlockedRepository blocked_repositories = 2; -} - -message CreateBlockedRepositoryRequest { - // url_regexp is the regular expression for the repository URL - string url_regexp = 1; - - // block_user indicates if the user should be blocked from accessing the - // repository - bool block_user = 2; -} - -message CreateBlockedRepositoryResponse { - BlockedRepository blocked_repository = 1; -} - -message DeleteBlockedRepositoryRequest { - // blocked_repository_id is the ID of the blocked repository - uint32 blocked_repository_id = 1; -} - -message DeleteBlockedRepositoryResponse {} - -message ListBlockedEmailDomainsRequest { - // pagination contains the pagination options for listing blocked email - // domains - PaginationRequest pagination = 1; -} - -message ListBlockedEmailDomainsResponse { - // pagination contains the pagination options for listing blocked email - // domains - PaginationResponse pagination = 1; - - // blocked_email_domains are the blocked email domains - repeated BlockedEmailDomain blocked_email_domains = 2; -} - -message CreateBlockedEmailDomainRequest { - // domain is the blocked email domain - string domain = 1; - - bool negative = 2; -} - -message CreateBlockedEmailDomainResponse { - BlockedEmailDomain blocked_email_domain = 1; -} - -message BlockedRepository { - // id is the ID of the blocked repository - uint32 id = 1; - - // url_regexp is the regular expression for the repository URL - string url_regexp = 2; - - // block_user indicates if the user should be blocked from accessing the - // repository - bool block_user = 3; - - google.protobuf.Timestamp creation_time = 4; - google.protobuf.Timestamp update_time = 5; -} - -message BlockedEmailDomain { - // id is the ID of the blocked email domain - string id = 1; - - // domain is the blocked email domain - string domain = 2; - - bool negative = 3; -} diff --git a/components/public-api/go/v1/v1connect/verification.connect.go b/components/public-api/go/v1/v1connect/verification.connect.go index 99ad39f786ba41..d1ddfa360ab6d3 100644 --- a/components/public-api/go/v1/v1connect/verification.connect.go +++ b/components/public-api/go/v1/v1connect/verification.connect.go @@ -37,16 +37,6 @@ type VerificationServiceClient interface { // VerifyPhoneNumberVerificationToken verifies the specified verification // token. VerifyPhoneNumberVerificationToken(context.Context, *connect_go.Request[v1.VerifyPhoneNumberVerificationTokenRequest]) (*connect_go.Response[v1.VerifyPhoneNumberVerificationTokenResponse], error) - // ListBlockedRepositories lists blocked repositories. - ListBlockedRepositories(context.Context, *connect_go.Request[v1.ListBlockedRepositoriesRequest]) (*connect_go.Response[v1.ListBlockedRepositoriesResponse], error) - // CreateBlockedRepository creates a new blocked repository. - CreateBlockedRepository(context.Context, *connect_go.Request[v1.CreateBlockedRepositoryRequest]) (*connect_go.Response[v1.CreateBlockedRepositoryResponse], error) - // DeleteBlockedRepository deletes a blocked repository. - DeleteBlockedRepository(context.Context, *connect_go.Request[v1.DeleteBlockedRepositoryRequest]) (*connect_go.Response[v1.DeleteBlockedRepositoryResponse], error) - // ListBlockedEmailDomains lists blocked email domains. - ListBlockedEmailDomains(context.Context, *connect_go.Request[v1.ListBlockedEmailDomainsRequest]) (*connect_go.Response[v1.ListBlockedEmailDomainsResponse], error) - // CreateBlockedEmailDomain creates a new blocked email domain. - CreateBlockedEmailDomain(context.Context, *connect_go.Request[v1.CreateBlockedEmailDomainRequest]) (*connect_go.Response[v1.CreateBlockedEmailDomainResponse], error) } // NewVerificationServiceClient constructs a client for the gitpod.v1.VerificationService service. @@ -69,31 +59,6 @@ func NewVerificationServiceClient(httpClient connect_go.HTTPClient, baseURL stri baseURL+"/gitpod.v1.VerificationService/VerifyPhoneNumberVerificationToken", opts..., ), - listBlockedRepositories: connect_go.NewClient[v1.ListBlockedRepositoriesRequest, v1.ListBlockedRepositoriesResponse]( - httpClient, - baseURL+"/gitpod.v1.VerificationService/ListBlockedRepositories", - opts..., - ), - createBlockedRepository: connect_go.NewClient[v1.CreateBlockedRepositoryRequest, v1.CreateBlockedRepositoryResponse]( - httpClient, - baseURL+"/gitpod.v1.VerificationService/CreateBlockedRepository", - opts..., - ), - deleteBlockedRepository: connect_go.NewClient[v1.DeleteBlockedRepositoryRequest, v1.DeleteBlockedRepositoryResponse]( - httpClient, - baseURL+"/gitpod.v1.VerificationService/DeleteBlockedRepository", - opts..., - ), - listBlockedEmailDomains: connect_go.NewClient[v1.ListBlockedEmailDomainsRequest, v1.ListBlockedEmailDomainsResponse]( - httpClient, - baseURL+"/gitpod.v1.VerificationService/ListBlockedEmailDomains", - opts..., - ), - createBlockedEmailDomain: connect_go.NewClient[v1.CreateBlockedEmailDomainRequest, v1.CreateBlockedEmailDomainResponse]( - httpClient, - baseURL+"/gitpod.v1.VerificationService/CreateBlockedEmailDomain", - opts..., - ), } } @@ -101,11 +66,6 @@ func NewVerificationServiceClient(httpClient connect_go.HTTPClient, baseURL stri type verificationServiceClient struct { sendPhoneNumberVerificationToken *connect_go.Client[v1.SendPhoneNumberVerificationTokenRequest, v1.SendPhoneNumberVerificationTokenResponse] verifyPhoneNumberVerificationToken *connect_go.Client[v1.VerifyPhoneNumberVerificationTokenRequest, v1.VerifyPhoneNumberVerificationTokenResponse] - listBlockedRepositories *connect_go.Client[v1.ListBlockedRepositoriesRequest, v1.ListBlockedRepositoriesResponse] - createBlockedRepository *connect_go.Client[v1.CreateBlockedRepositoryRequest, v1.CreateBlockedRepositoryResponse] - deleteBlockedRepository *connect_go.Client[v1.DeleteBlockedRepositoryRequest, v1.DeleteBlockedRepositoryResponse] - listBlockedEmailDomains *connect_go.Client[v1.ListBlockedEmailDomainsRequest, v1.ListBlockedEmailDomainsResponse] - createBlockedEmailDomain *connect_go.Client[v1.CreateBlockedEmailDomainRequest, v1.CreateBlockedEmailDomainResponse] } // SendPhoneNumberVerificationToken calls @@ -120,31 +80,6 @@ func (c *verificationServiceClient) VerifyPhoneNumberVerificationToken(ctx conte return c.verifyPhoneNumberVerificationToken.CallUnary(ctx, req) } -// ListBlockedRepositories calls gitpod.v1.VerificationService.ListBlockedRepositories. -func (c *verificationServiceClient) ListBlockedRepositories(ctx context.Context, req *connect_go.Request[v1.ListBlockedRepositoriesRequest]) (*connect_go.Response[v1.ListBlockedRepositoriesResponse], error) { - return c.listBlockedRepositories.CallUnary(ctx, req) -} - -// CreateBlockedRepository calls gitpod.v1.VerificationService.CreateBlockedRepository. -func (c *verificationServiceClient) CreateBlockedRepository(ctx context.Context, req *connect_go.Request[v1.CreateBlockedRepositoryRequest]) (*connect_go.Response[v1.CreateBlockedRepositoryResponse], error) { - return c.createBlockedRepository.CallUnary(ctx, req) -} - -// DeleteBlockedRepository calls gitpod.v1.VerificationService.DeleteBlockedRepository. -func (c *verificationServiceClient) DeleteBlockedRepository(ctx context.Context, req *connect_go.Request[v1.DeleteBlockedRepositoryRequest]) (*connect_go.Response[v1.DeleteBlockedRepositoryResponse], error) { - return c.deleteBlockedRepository.CallUnary(ctx, req) -} - -// ListBlockedEmailDomains calls gitpod.v1.VerificationService.ListBlockedEmailDomains. -func (c *verificationServiceClient) ListBlockedEmailDomains(ctx context.Context, req *connect_go.Request[v1.ListBlockedEmailDomainsRequest]) (*connect_go.Response[v1.ListBlockedEmailDomainsResponse], error) { - return c.listBlockedEmailDomains.CallUnary(ctx, req) -} - -// CreateBlockedEmailDomain calls gitpod.v1.VerificationService.CreateBlockedEmailDomain. -func (c *verificationServiceClient) CreateBlockedEmailDomain(ctx context.Context, req *connect_go.Request[v1.CreateBlockedEmailDomainRequest]) (*connect_go.Response[v1.CreateBlockedEmailDomainResponse], error) { - return c.createBlockedEmailDomain.CallUnary(ctx, req) -} - // VerificationServiceHandler is an implementation of the gitpod.v1.VerificationService service. type VerificationServiceHandler interface { // SendPhoneNumberVerificationToken sends a verification token to the @@ -153,16 +88,6 @@ type VerificationServiceHandler interface { // VerifyPhoneNumberVerificationToken verifies the specified verification // token. VerifyPhoneNumberVerificationToken(context.Context, *connect_go.Request[v1.VerifyPhoneNumberVerificationTokenRequest]) (*connect_go.Response[v1.VerifyPhoneNumberVerificationTokenResponse], error) - // ListBlockedRepositories lists blocked repositories. - ListBlockedRepositories(context.Context, *connect_go.Request[v1.ListBlockedRepositoriesRequest]) (*connect_go.Response[v1.ListBlockedRepositoriesResponse], error) - // CreateBlockedRepository creates a new blocked repository. - CreateBlockedRepository(context.Context, *connect_go.Request[v1.CreateBlockedRepositoryRequest]) (*connect_go.Response[v1.CreateBlockedRepositoryResponse], error) - // DeleteBlockedRepository deletes a blocked repository. - DeleteBlockedRepository(context.Context, *connect_go.Request[v1.DeleteBlockedRepositoryRequest]) (*connect_go.Response[v1.DeleteBlockedRepositoryResponse], error) - // ListBlockedEmailDomains lists blocked email domains. - ListBlockedEmailDomains(context.Context, *connect_go.Request[v1.ListBlockedEmailDomainsRequest]) (*connect_go.Response[v1.ListBlockedEmailDomainsResponse], error) - // CreateBlockedEmailDomain creates a new blocked email domain. - CreateBlockedEmailDomain(context.Context, *connect_go.Request[v1.CreateBlockedEmailDomainRequest]) (*connect_go.Response[v1.CreateBlockedEmailDomainResponse], error) } // NewVerificationServiceHandler builds an HTTP handler from the service implementation. It returns @@ -182,31 +107,6 @@ func NewVerificationServiceHandler(svc VerificationServiceHandler, opts ...conne svc.VerifyPhoneNumberVerificationToken, opts..., )) - mux.Handle("/gitpod.v1.VerificationService/ListBlockedRepositories", connect_go.NewUnaryHandler( - "/gitpod.v1.VerificationService/ListBlockedRepositories", - svc.ListBlockedRepositories, - opts..., - )) - mux.Handle("/gitpod.v1.VerificationService/CreateBlockedRepository", connect_go.NewUnaryHandler( - "/gitpod.v1.VerificationService/CreateBlockedRepository", - svc.CreateBlockedRepository, - opts..., - )) - mux.Handle("/gitpod.v1.VerificationService/DeleteBlockedRepository", connect_go.NewUnaryHandler( - "/gitpod.v1.VerificationService/DeleteBlockedRepository", - svc.DeleteBlockedRepository, - opts..., - )) - mux.Handle("/gitpod.v1.VerificationService/ListBlockedEmailDomains", connect_go.NewUnaryHandler( - "/gitpod.v1.VerificationService/ListBlockedEmailDomains", - svc.ListBlockedEmailDomains, - opts..., - )) - mux.Handle("/gitpod.v1.VerificationService/CreateBlockedEmailDomain", connect_go.NewUnaryHandler( - "/gitpod.v1.VerificationService/CreateBlockedEmailDomain", - svc.CreateBlockedEmailDomain, - opts..., - )) return "/gitpod.v1.VerificationService/", mux } @@ -220,23 +120,3 @@ func (UnimplementedVerificationServiceHandler) SendPhoneNumberVerificationToken( func (UnimplementedVerificationServiceHandler) VerifyPhoneNumberVerificationToken(context.Context, *connect_go.Request[v1.VerifyPhoneNumberVerificationTokenRequest]) (*connect_go.Response[v1.VerifyPhoneNumberVerificationTokenResponse], error) { return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.VerificationService.VerifyPhoneNumberVerificationToken is not implemented")) } - -func (UnimplementedVerificationServiceHandler) ListBlockedRepositories(context.Context, *connect_go.Request[v1.ListBlockedRepositoriesRequest]) (*connect_go.Response[v1.ListBlockedRepositoriesResponse], error) { - return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.VerificationService.ListBlockedRepositories is not implemented")) -} - -func (UnimplementedVerificationServiceHandler) CreateBlockedRepository(context.Context, *connect_go.Request[v1.CreateBlockedRepositoryRequest]) (*connect_go.Response[v1.CreateBlockedRepositoryResponse], error) { - return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.VerificationService.CreateBlockedRepository is not implemented")) -} - -func (UnimplementedVerificationServiceHandler) DeleteBlockedRepository(context.Context, *connect_go.Request[v1.DeleteBlockedRepositoryRequest]) (*connect_go.Response[v1.DeleteBlockedRepositoryResponse], error) { - return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.VerificationService.DeleteBlockedRepository is not implemented")) -} - -func (UnimplementedVerificationServiceHandler) ListBlockedEmailDomains(context.Context, *connect_go.Request[v1.ListBlockedEmailDomainsRequest]) (*connect_go.Response[v1.ListBlockedEmailDomainsResponse], error) { - return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.VerificationService.ListBlockedEmailDomains is not implemented")) -} - -func (UnimplementedVerificationServiceHandler) CreateBlockedEmailDomain(context.Context, *connect_go.Request[v1.CreateBlockedEmailDomainRequest]) (*connect_go.Response[v1.CreateBlockedEmailDomainResponse], error) { - return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.VerificationService.CreateBlockedEmailDomain is not implemented")) -} diff --git a/components/public-api/go/v1/v1connect/verification.proxy.connect.go b/components/public-api/go/v1/v1connect/verification.proxy.connect.go index 1da9f7e5eb0222..25473e044e5012 100644 --- a/components/public-api/go/v1/v1connect/verification.proxy.connect.go +++ b/components/public-api/go/v1/v1connect/verification.proxy.connect.go @@ -38,53 +38,3 @@ func (s *ProxyVerificationServiceHandler) VerifyPhoneNumberVerificationToken(ctx return connect_go.NewResponse(resp), nil } - -func (s *ProxyVerificationServiceHandler) ListBlockedRepositories(ctx context.Context, req *connect_go.Request[v1.ListBlockedRepositoriesRequest]) (*connect_go.Response[v1.ListBlockedRepositoriesResponse], error) { - resp, err := s.Client.ListBlockedRepositories(ctx, req.Msg) - if err != nil { - // TODO(milan): Convert to correct status code - return nil, err - } - - return connect_go.NewResponse(resp), nil -} - -func (s *ProxyVerificationServiceHandler) CreateBlockedRepository(ctx context.Context, req *connect_go.Request[v1.CreateBlockedRepositoryRequest]) (*connect_go.Response[v1.CreateBlockedRepositoryResponse], error) { - resp, err := s.Client.CreateBlockedRepository(ctx, req.Msg) - if err != nil { - // TODO(milan): Convert to correct status code - return nil, err - } - - return connect_go.NewResponse(resp), nil -} - -func (s *ProxyVerificationServiceHandler) DeleteBlockedRepository(ctx context.Context, req *connect_go.Request[v1.DeleteBlockedRepositoryRequest]) (*connect_go.Response[v1.DeleteBlockedRepositoryResponse], error) { - resp, err := s.Client.DeleteBlockedRepository(ctx, req.Msg) - if err != nil { - // TODO(milan): Convert to correct status code - return nil, err - } - - return connect_go.NewResponse(resp), nil -} - -func (s *ProxyVerificationServiceHandler) ListBlockedEmailDomains(ctx context.Context, req *connect_go.Request[v1.ListBlockedEmailDomainsRequest]) (*connect_go.Response[v1.ListBlockedEmailDomainsResponse], error) { - resp, err := s.Client.ListBlockedEmailDomains(ctx, req.Msg) - if err != nil { - // TODO(milan): Convert to correct status code - return nil, err - } - - return connect_go.NewResponse(resp), nil -} - -func (s *ProxyVerificationServiceHandler) CreateBlockedEmailDomain(ctx context.Context, req *connect_go.Request[v1.CreateBlockedEmailDomainRequest]) (*connect_go.Response[v1.CreateBlockedEmailDomainResponse], error) { - resp, err := s.Client.CreateBlockedEmailDomain(ctx, req.Msg) - if err != nil { - // TODO(milan): Convert to correct status code - return nil, err - } - - return connect_go.NewResponse(resp), nil -} diff --git a/components/public-api/go/v1/verification.pb.go b/components/public-api/go/v1/verification.pb.go index 997e418cf8741b..f951db3a04dfb1 100644 --- a/components/public-api/go/v1/verification.pb.go +++ b/components/public-api/go/v1/verification.pb.go @@ -13,7 +13,6 @@ package v1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" reflect "reflect" sync "sync" ) @@ -241,867 +240,60 @@ func (x *VerifyPhoneNumberVerificationTokenResponse) GetVerified() bool { return false } -type ListBlockedRepositoriesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // pagination contains the pagination options for listing blocked repositories - Pagination *PaginationRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` - // sort contains the sort options for listing blocked repositories - // BlockedRepositories can be sorted by "urlRegexp" - Sort []*Sort `protobuf:"bytes,2,rep,name=sort,proto3" json:"sort,omitempty"` - // search_term is a search term to filter blocked repositories by url_regexp - SearchTerm string `protobuf:"bytes,3,opt,name=search_term,json=searchTerm,proto3" json:"search_term,omitempty"` -} - -func (x *ListBlockedRepositoriesRequest) Reset() { - *x = ListBlockedRepositoriesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_verification_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListBlockedRepositoriesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListBlockedRepositoriesRequest) ProtoMessage() {} - -func (x *ListBlockedRepositoriesRequest) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_verification_proto_msgTypes[4] - 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 ListBlockedRepositoriesRequest.ProtoReflect.Descriptor instead. -func (*ListBlockedRepositoriesRequest) Descriptor() ([]byte, []int) { - return file_gitpod_v1_verification_proto_rawDescGZIP(), []int{4} -} - -func (x *ListBlockedRepositoriesRequest) GetPagination() *PaginationRequest { - if x != nil { - return x.Pagination - } - return nil -} - -func (x *ListBlockedRepositoriesRequest) GetSort() []*Sort { - if x != nil { - return x.Sort - } - return nil -} - -func (x *ListBlockedRepositoriesRequest) GetSearchTerm() string { - if x != nil { - return x.SearchTerm - } - return "" -} - -type ListBlockedRepositoriesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // pagination contains the pagination options for listing blocked repositories - Pagination *PaginationResponse `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` - // blocked_repositories are the blocked repositories - BlockedRepositories []*BlockedRepository `protobuf:"bytes,2,rep,name=blocked_repositories,json=blockedRepositories,proto3" json:"blocked_repositories,omitempty"` -} - -func (x *ListBlockedRepositoriesResponse) Reset() { - *x = ListBlockedRepositoriesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_verification_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListBlockedRepositoriesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListBlockedRepositoriesResponse) ProtoMessage() {} - -func (x *ListBlockedRepositoriesResponse) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_verification_proto_msgTypes[5] - 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 ListBlockedRepositoriesResponse.ProtoReflect.Descriptor instead. -func (*ListBlockedRepositoriesResponse) Descriptor() ([]byte, []int) { - return file_gitpod_v1_verification_proto_rawDescGZIP(), []int{5} -} - -func (x *ListBlockedRepositoriesResponse) GetPagination() *PaginationResponse { - if x != nil { - return x.Pagination - } - return nil -} - -func (x *ListBlockedRepositoriesResponse) GetBlockedRepositories() []*BlockedRepository { - if x != nil { - return x.BlockedRepositories - } - return nil -} - -type CreateBlockedRepositoryRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // url_regexp is the regular expression for the repository URL - UrlRegexp string `protobuf:"bytes,1,opt,name=url_regexp,json=urlRegexp,proto3" json:"url_regexp,omitempty"` - // block_user indicates if the user should be blocked from accessing the - // repository - BlockUser bool `protobuf:"varint,2,opt,name=block_user,json=blockUser,proto3" json:"block_user,omitempty"` -} - -func (x *CreateBlockedRepositoryRequest) Reset() { - *x = CreateBlockedRepositoryRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_verification_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateBlockedRepositoryRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateBlockedRepositoryRequest) ProtoMessage() {} - -func (x *CreateBlockedRepositoryRequest) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_verification_proto_msgTypes[6] - 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 CreateBlockedRepositoryRequest.ProtoReflect.Descriptor instead. -func (*CreateBlockedRepositoryRequest) Descriptor() ([]byte, []int) { - return file_gitpod_v1_verification_proto_rawDescGZIP(), []int{6} -} - -func (x *CreateBlockedRepositoryRequest) GetUrlRegexp() string { - if x != nil { - return x.UrlRegexp - } - return "" -} - -func (x *CreateBlockedRepositoryRequest) GetBlockUser() bool { - if x != nil { - return x.BlockUser - } - return false -} - -type CreateBlockedRepositoryResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BlockedRepository *BlockedRepository `protobuf:"bytes,1,opt,name=blocked_repository,json=blockedRepository,proto3" json:"blocked_repository,omitempty"` -} - -func (x *CreateBlockedRepositoryResponse) Reset() { - *x = CreateBlockedRepositoryResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_verification_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateBlockedRepositoryResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateBlockedRepositoryResponse) ProtoMessage() {} - -func (x *CreateBlockedRepositoryResponse) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_verification_proto_msgTypes[7] - 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 CreateBlockedRepositoryResponse.ProtoReflect.Descriptor instead. -func (*CreateBlockedRepositoryResponse) Descriptor() ([]byte, []int) { - return file_gitpod_v1_verification_proto_rawDescGZIP(), []int{7} -} - -func (x *CreateBlockedRepositoryResponse) GetBlockedRepository() *BlockedRepository { - if x != nil { - return x.BlockedRepository - } - return nil -} - -type DeleteBlockedRepositoryRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // blocked_repository_id is the ID of the blocked repository - BlockedRepositoryId uint32 `protobuf:"varint,1,opt,name=blocked_repository_id,json=blockedRepositoryId,proto3" json:"blocked_repository_id,omitempty"` -} - -func (x *DeleteBlockedRepositoryRequest) Reset() { - *x = DeleteBlockedRepositoryRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_verification_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteBlockedRepositoryRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteBlockedRepositoryRequest) ProtoMessage() {} - -func (x *DeleteBlockedRepositoryRequest) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_verification_proto_msgTypes[8] - 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 DeleteBlockedRepositoryRequest.ProtoReflect.Descriptor instead. -func (*DeleteBlockedRepositoryRequest) Descriptor() ([]byte, []int) { - return file_gitpod_v1_verification_proto_rawDescGZIP(), []int{8} -} - -func (x *DeleteBlockedRepositoryRequest) GetBlockedRepositoryId() uint32 { - if x != nil { - return x.BlockedRepositoryId - } - return 0 -} - -type DeleteBlockedRepositoryResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *DeleteBlockedRepositoryResponse) Reset() { - *x = DeleteBlockedRepositoryResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_verification_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteBlockedRepositoryResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteBlockedRepositoryResponse) ProtoMessage() {} - -func (x *DeleteBlockedRepositoryResponse) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_verification_proto_msgTypes[9] - 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 DeleteBlockedRepositoryResponse.ProtoReflect.Descriptor instead. -func (*DeleteBlockedRepositoryResponse) Descriptor() ([]byte, []int) { - return file_gitpod_v1_verification_proto_rawDescGZIP(), []int{9} -} - -type ListBlockedEmailDomainsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // pagination contains the pagination options for listing blocked email - // domains - Pagination *PaginationRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` -} - -func (x *ListBlockedEmailDomainsRequest) Reset() { - *x = ListBlockedEmailDomainsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_verification_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListBlockedEmailDomainsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListBlockedEmailDomainsRequest) ProtoMessage() {} - -func (x *ListBlockedEmailDomainsRequest) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_verification_proto_msgTypes[10] - 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 ListBlockedEmailDomainsRequest.ProtoReflect.Descriptor instead. -func (*ListBlockedEmailDomainsRequest) Descriptor() ([]byte, []int) { - return file_gitpod_v1_verification_proto_rawDescGZIP(), []int{10} -} - -func (x *ListBlockedEmailDomainsRequest) GetPagination() *PaginationRequest { - if x != nil { - return x.Pagination - } - return nil -} - -type ListBlockedEmailDomainsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // pagination contains the pagination options for listing blocked email - // domains - Pagination *PaginationResponse `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` - // blocked_email_domains are the blocked email domains - BlockedEmailDomains []*BlockedEmailDomain `protobuf:"bytes,2,rep,name=blocked_email_domains,json=blockedEmailDomains,proto3" json:"blocked_email_domains,omitempty"` -} - -func (x *ListBlockedEmailDomainsResponse) Reset() { - *x = ListBlockedEmailDomainsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_verification_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListBlockedEmailDomainsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListBlockedEmailDomainsResponse) ProtoMessage() {} - -func (x *ListBlockedEmailDomainsResponse) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_verification_proto_msgTypes[11] - 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 ListBlockedEmailDomainsResponse.ProtoReflect.Descriptor instead. -func (*ListBlockedEmailDomainsResponse) Descriptor() ([]byte, []int) { - return file_gitpod_v1_verification_proto_rawDescGZIP(), []int{11} -} - -func (x *ListBlockedEmailDomainsResponse) GetPagination() *PaginationResponse { - if x != nil { - return x.Pagination - } - return nil -} - -func (x *ListBlockedEmailDomainsResponse) GetBlockedEmailDomains() []*BlockedEmailDomain { - if x != nil { - return x.BlockedEmailDomains - } - return nil -} - -type CreateBlockedEmailDomainRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // domain is the blocked email domain - Domain string `protobuf:"bytes,1,opt,name=domain,proto3" json:"domain,omitempty"` - Negative bool `protobuf:"varint,2,opt,name=negative,proto3" json:"negative,omitempty"` -} - -func (x *CreateBlockedEmailDomainRequest) Reset() { - *x = CreateBlockedEmailDomainRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_verification_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateBlockedEmailDomainRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateBlockedEmailDomainRequest) ProtoMessage() {} - -func (x *CreateBlockedEmailDomainRequest) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_verification_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 CreateBlockedEmailDomainRequest.ProtoReflect.Descriptor instead. -func (*CreateBlockedEmailDomainRequest) Descriptor() ([]byte, []int) { - return file_gitpod_v1_verification_proto_rawDescGZIP(), []int{12} -} - -func (x *CreateBlockedEmailDomainRequest) GetDomain() string { - if x != nil { - return x.Domain - } - return "" -} - -func (x *CreateBlockedEmailDomainRequest) GetNegative() bool { - if x != nil { - return x.Negative - } - return false -} - -type CreateBlockedEmailDomainResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - BlockedEmailDomain *BlockedEmailDomain `protobuf:"bytes,1,opt,name=blocked_email_domain,json=blockedEmailDomain,proto3" json:"blocked_email_domain,omitempty"` -} - -func (x *CreateBlockedEmailDomainResponse) Reset() { - *x = CreateBlockedEmailDomainResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_verification_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateBlockedEmailDomainResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateBlockedEmailDomainResponse) ProtoMessage() {} - -func (x *CreateBlockedEmailDomainResponse) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_verification_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 CreateBlockedEmailDomainResponse.ProtoReflect.Descriptor instead. -func (*CreateBlockedEmailDomainResponse) Descriptor() ([]byte, []int) { - return file_gitpod_v1_verification_proto_rawDescGZIP(), []int{13} -} - -func (x *CreateBlockedEmailDomainResponse) GetBlockedEmailDomain() *BlockedEmailDomain { - if x != nil { - return x.BlockedEmailDomain - } - return nil -} - -type BlockedRepository struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // id is the ID of the blocked repository - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - // url_regexp is the regular expression for the repository URL - UrlRegexp string `protobuf:"bytes,2,opt,name=url_regexp,json=urlRegexp,proto3" json:"url_regexp,omitempty"` - // block_user indicates if the user should be blocked from accessing the - // repository - BlockUser bool `protobuf:"varint,3,opt,name=block_user,json=blockUser,proto3" json:"block_user,omitempty"` - CreationTime *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=creation_time,json=creationTime,proto3" json:"creation_time,omitempty"` - UpdateTime *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=update_time,json=updateTime,proto3" json:"update_time,omitempty"` -} - -func (x *BlockedRepository) Reset() { - *x = BlockedRepository{} - if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_verification_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BlockedRepository) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BlockedRepository) ProtoMessage() {} - -func (x *BlockedRepository) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_verification_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 BlockedRepository.ProtoReflect.Descriptor instead. -func (*BlockedRepository) Descriptor() ([]byte, []int) { - return file_gitpod_v1_verification_proto_rawDescGZIP(), []int{14} -} - -func (x *BlockedRepository) GetId() uint32 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *BlockedRepository) GetUrlRegexp() string { - if x != nil { - return x.UrlRegexp - } - return "" -} - -func (x *BlockedRepository) GetBlockUser() bool { - if x != nil { - return x.BlockUser - } - return false -} - -func (x *BlockedRepository) GetCreationTime() *timestamppb.Timestamp { - if x != nil { - return x.CreationTime - } - return nil -} - -func (x *BlockedRepository) GetUpdateTime() *timestamppb.Timestamp { - if x != nil { - return x.UpdateTime - } - return nil -} - -type BlockedEmailDomain struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // id is the ID of the blocked email domain - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // domain is the blocked email domain - Domain string `protobuf:"bytes,2,opt,name=domain,proto3" json:"domain,omitempty"` - Negative bool `protobuf:"varint,3,opt,name=negative,proto3" json:"negative,omitempty"` -} - -func (x *BlockedEmailDomain) Reset() { - *x = BlockedEmailDomain{} - if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_verification_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BlockedEmailDomain) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BlockedEmailDomain) ProtoMessage() {} - -func (x *BlockedEmailDomain) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_verification_proto_msgTypes[15] - 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 BlockedEmailDomain.ProtoReflect.Descriptor instead. -func (*BlockedEmailDomain) Descriptor() ([]byte, []int) { - return file_gitpod_v1_verification_proto_rawDescGZIP(), []int{15} -} - -func (x *BlockedEmailDomain) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *BlockedEmailDomain) GetDomain() string { - if x != nil { - return x.Domain - } - return "" -} - -func (x *BlockedEmailDomain) GetNegative() bool { - if x != nil { - return x.Negative - } - return false -} - var File_gitpod_v1_verification_proto protoreflect.FileDescriptor var file_gitpod_v1_verification_proto_rawDesc = []byte{ 0x0a, 0x1c, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, - 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x1a, 0x1a, 0x67, 0x69, 0x74, 0x70, 0x6f, - 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x17, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2f, 0x76, 0x31, - 0x2f, 0x73, 0x6f, 0x72, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, - 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0x4c, 0x0a, 0x27, 0x53, 0x65, 0x6e, 0x64, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, + 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x22, 0x4c, 0x0a, 0x27, 0x53, 0x65, 0x6e, + 0x64, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x5f, 0x6e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x68, 0x6f, 0x6e, + 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x53, 0x0a, 0x28, 0x53, 0x65, 0x6e, 0x64, 0x50, + 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x76, 0x65, + 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x8d, 0x01, 0x0a, + 0x29, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0x53, 0x0a, - 0x28, 0x53, 0x65, 0x6e, 0x64, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x76, 0x65, 0x72, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x0e, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x49, 0x64, 0x22, 0x8d, 0x01, 0x0a, 0x29, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x50, 0x68, 0x6f, - 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x0f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x76, 0x65, - 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, - 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, - 0x65, 0x6e, 0x22, 0x48, 0x0a, 0x2a, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x50, 0x68, 0x6f, 0x6e, - 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x1a, 0x0a, 0x08, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x08, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x22, 0xa4, 0x01, 0x0a, - 0x1e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x3c, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, - 0x04, 0x73, 0x6f, 0x72, 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x67, 0x69, - 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x6f, 0x72, 0x74, 0x52, 0x04, 0x73, 0x6f, - 0x72, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x5f, 0x74, 0x65, 0x72, - 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x61, 0x72, 0x63, 0x68, 0x54, - 0x65, 0x72, 0x6d, 0x22, 0xb1, 0x01, 0x0a, 0x1f, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x69, - 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, - 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x4f, 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, - 0x64, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, - 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x52, 0x13, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x22, 0x5e, 0x0a, 0x1e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x72, 0x6c, - 0x5f, 0x72, 0x65, 0x67, 0x65, 0x78, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, - 0x72, 0x6c, 0x52, 0x65, 0x67, 0x65, 0x78, 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, - 0x6b, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x22, 0x6e, 0x0a, 0x1f, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x12, 0x62, 0x6c, - 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, - 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x79, 0x52, 0x11, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x22, 0x54, 0x0a, 0x1e, 0x44, 0x65, 0x6c, 0x65, 0x74, - 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, - 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x15, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x5f, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x13, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, - 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x49, 0x64, 0x22, 0x21, 0x0a, - 0x1f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x5e, 0x0a, 0x1e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x45, - 0x6d, 0x61, 0x69, 0x6c, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, - 0x76, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x22, 0xb3, 0x01, 0x0a, 0x1f, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, - 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x52, 0x0a, 0x70, 0x61, 0x67, 0x69, 0x6e, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x51, 0x0a, 0x15, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x65, - 0x6d, 0x61, 0x69, 0x6c, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x44, 0x6f, 0x6d, 0x61, 0x69, - 0x6e, 0x52, 0x13, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x44, - 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x22, 0x55, 0x0a, 0x1f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x44, 0x6f, 0x6d, 0x61, - 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, 0x6d, - 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, 0x69, - 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x08, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x22, 0x73, 0x0a, - 0x20, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x45, 0x6d, - 0x61, 0x69, 0x6c, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x4f, 0x0a, 0x14, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x65, 0x6d, 0x61, - 0x69, 0x6c, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x1d, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, - 0x6b, 0x65, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x12, - 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x44, 0x6f, 0x6d, 0x61, - 0x69, 0x6e, 0x22, 0xdf, 0x01, 0x0a, 0x11, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, - 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x72, 0x6c, 0x5f, - 0x72, 0x65, 0x67, 0x65, 0x78, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x72, - 0x6c, 0x52, 0x65, 0x67, 0x65, 0x78, 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6c, 0x6f, 0x63, 0x6b, - 0x5f, 0x75, 0x73, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x55, 0x73, 0x65, 0x72, 0x12, 0x3f, 0x0a, 0x0d, 0x63, 0x72, 0x65, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x04, 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, 0x52, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x05, 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, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x54, 0x69, 0x6d, 0x65, 0x22, 0x58, 0x0a, 0x12, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x45, - 0x6d, 0x61, 0x69, 0x6c, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x6f, - 0x6d, 0x61, 0x69, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x6f, 0x6d, 0x61, - 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x6e, 0x65, 0x67, 0x61, 0x74, 0x69, 0x76, 0x65, 0x32, 0x82, - 0x07, 0x0a, 0x13, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, - 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x8d, 0x01, 0x0a, 0x20, 0x53, 0x65, 0x6e, 0x64, 0x50, - 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x32, 0x2e, 0x67, 0x69, - 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x50, 0x68, 0x6f, 0x6e, - 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x33, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, - 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x93, 0x01, 0x0a, 0x22, 0x56, 0x65, 0x72, 0x69, 0x66, - 0x79, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, - 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x34, 0x2e, - 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, - 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x52, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x27, 0x0a, + 0x0f, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x48, 0x0a, 0x2a, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x72, 0x0a, 0x17, - 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x12, 0x29, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, - 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, - 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4c, - 0x69, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x6f, 0x72, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, - 0x12, 0x72, 0x0a, 0x17, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, - 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x29, 0x2e, 0x67, 0x69, - 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, - 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x00, 0x12, 0x72, 0x0a, 0x17, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x6c, - 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, - 0x29, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, - 0x74, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x6f, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x67, 0x69, 0x74, - 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x6c, 0x6f, - 0x63, 0x6b, 0x65, 0x64, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x72, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, - 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x44, 0x6f, 0x6d, 0x61, - 0x69, 0x6e, 0x73, 0x12, 0x29, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, - 0x4c, 0x69, 0x73, 0x74, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, - 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, - 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x42, - 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x44, 0x6f, 0x6d, 0x61, 0x69, - 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x75, 0x0a, 0x18, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x45, 0x6d, 0x61, - 0x69, 0x6c, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x2a, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, - 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, - 0x65, 0x64, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, - 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x45, 0x6d, - 0x61, 0x69, 0x6c, 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x00, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, - 0x6d, 0x2f, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2d, 0x69, 0x6f, 0x2f, 0x67, 0x69, 0x74, 0x70, - 0x6f, 0x64, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x70, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x76, 0x65, + 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x76, 0x65, + 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x32, 0xbb, 0x02, 0x0a, 0x13, 0x56, 0x65, 0x72, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x8d, + 0x01, 0x0a, 0x20, 0x53, 0x65, 0x6e, 0x64, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, + 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, + 0x6b, 0x65, 0x6e, 0x12, 0x32, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x65, 0x6e, 0x64, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x56, + 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x33, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, + 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6e, 0x64, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x93, + 0x01, 0x0a, 0x22, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, + 0x6d, 0x62, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x34, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, + 0x31, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x35, 0x2e, 0x67, 0x69, + 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x65, 0x72, 0x69, 0x66, 0x79, 0x50, 0x68, + 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x56, 0x65, 0x72, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2d, 0x69, 0x6f, 0x2f, 0x67, 0x69, 0x74, + 0x70, 0x6f, 0x64, 0x2f, 0x63, 0x6f, 0x6d, 0x70, 0x6f, 0x6e, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x70, + 0x75, 0x62, 0x6c, 0x69, 0x63, 0x2d, 0x61, 0x70, 0x69, 0x2f, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1116,60 +308,23 @@ func file_gitpod_v1_verification_proto_rawDescGZIP() []byte { return file_gitpod_v1_verification_proto_rawDescData } -var file_gitpod_v1_verification_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_gitpod_v1_verification_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_gitpod_v1_verification_proto_goTypes = []interface{}{ (*SendPhoneNumberVerificationTokenRequest)(nil), // 0: gitpod.v1.SendPhoneNumberVerificationTokenRequest (*SendPhoneNumberVerificationTokenResponse)(nil), // 1: gitpod.v1.SendPhoneNumberVerificationTokenResponse (*VerifyPhoneNumberVerificationTokenRequest)(nil), // 2: gitpod.v1.VerifyPhoneNumberVerificationTokenRequest (*VerifyPhoneNumberVerificationTokenResponse)(nil), // 3: gitpod.v1.VerifyPhoneNumberVerificationTokenResponse - (*ListBlockedRepositoriesRequest)(nil), // 4: gitpod.v1.ListBlockedRepositoriesRequest - (*ListBlockedRepositoriesResponse)(nil), // 5: gitpod.v1.ListBlockedRepositoriesResponse - (*CreateBlockedRepositoryRequest)(nil), // 6: gitpod.v1.CreateBlockedRepositoryRequest - (*CreateBlockedRepositoryResponse)(nil), // 7: gitpod.v1.CreateBlockedRepositoryResponse - (*DeleteBlockedRepositoryRequest)(nil), // 8: gitpod.v1.DeleteBlockedRepositoryRequest - (*DeleteBlockedRepositoryResponse)(nil), // 9: gitpod.v1.DeleteBlockedRepositoryResponse - (*ListBlockedEmailDomainsRequest)(nil), // 10: gitpod.v1.ListBlockedEmailDomainsRequest - (*ListBlockedEmailDomainsResponse)(nil), // 11: gitpod.v1.ListBlockedEmailDomainsResponse - (*CreateBlockedEmailDomainRequest)(nil), // 12: gitpod.v1.CreateBlockedEmailDomainRequest - (*CreateBlockedEmailDomainResponse)(nil), // 13: gitpod.v1.CreateBlockedEmailDomainResponse - (*BlockedRepository)(nil), // 14: gitpod.v1.BlockedRepository - (*BlockedEmailDomain)(nil), // 15: gitpod.v1.BlockedEmailDomain - (*PaginationRequest)(nil), // 16: gitpod.v1.PaginationRequest - (*Sort)(nil), // 17: gitpod.v1.Sort - (*PaginationResponse)(nil), // 18: gitpod.v1.PaginationResponse - (*timestamppb.Timestamp)(nil), // 19: google.protobuf.Timestamp } var file_gitpod_v1_verification_proto_depIdxs = []int32{ - 16, // 0: gitpod.v1.ListBlockedRepositoriesRequest.pagination:type_name -> gitpod.v1.PaginationRequest - 17, // 1: gitpod.v1.ListBlockedRepositoriesRequest.sort:type_name -> gitpod.v1.Sort - 18, // 2: gitpod.v1.ListBlockedRepositoriesResponse.pagination:type_name -> gitpod.v1.PaginationResponse - 14, // 3: gitpod.v1.ListBlockedRepositoriesResponse.blocked_repositories:type_name -> gitpod.v1.BlockedRepository - 14, // 4: gitpod.v1.CreateBlockedRepositoryResponse.blocked_repository:type_name -> gitpod.v1.BlockedRepository - 16, // 5: gitpod.v1.ListBlockedEmailDomainsRequest.pagination:type_name -> gitpod.v1.PaginationRequest - 18, // 6: gitpod.v1.ListBlockedEmailDomainsResponse.pagination:type_name -> gitpod.v1.PaginationResponse - 15, // 7: gitpod.v1.ListBlockedEmailDomainsResponse.blocked_email_domains:type_name -> gitpod.v1.BlockedEmailDomain - 15, // 8: gitpod.v1.CreateBlockedEmailDomainResponse.blocked_email_domain:type_name -> gitpod.v1.BlockedEmailDomain - 19, // 9: gitpod.v1.BlockedRepository.creation_time:type_name -> google.protobuf.Timestamp - 19, // 10: gitpod.v1.BlockedRepository.update_time:type_name -> google.protobuf.Timestamp - 0, // 11: gitpod.v1.VerificationService.SendPhoneNumberVerificationToken:input_type -> gitpod.v1.SendPhoneNumberVerificationTokenRequest - 2, // 12: gitpod.v1.VerificationService.VerifyPhoneNumberVerificationToken:input_type -> gitpod.v1.VerifyPhoneNumberVerificationTokenRequest - 4, // 13: gitpod.v1.VerificationService.ListBlockedRepositories:input_type -> gitpod.v1.ListBlockedRepositoriesRequest - 6, // 14: gitpod.v1.VerificationService.CreateBlockedRepository:input_type -> gitpod.v1.CreateBlockedRepositoryRequest - 8, // 15: gitpod.v1.VerificationService.DeleteBlockedRepository:input_type -> gitpod.v1.DeleteBlockedRepositoryRequest - 10, // 16: gitpod.v1.VerificationService.ListBlockedEmailDomains:input_type -> gitpod.v1.ListBlockedEmailDomainsRequest - 12, // 17: gitpod.v1.VerificationService.CreateBlockedEmailDomain:input_type -> gitpod.v1.CreateBlockedEmailDomainRequest - 1, // 18: gitpod.v1.VerificationService.SendPhoneNumberVerificationToken:output_type -> gitpod.v1.SendPhoneNumberVerificationTokenResponse - 3, // 19: gitpod.v1.VerificationService.VerifyPhoneNumberVerificationToken:output_type -> gitpod.v1.VerifyPhoneNumberVerificationTokenResponse - 5, // 20: gitpod.v1.VerificationService.ListBlockedRepositories:output_type -> gitpod.v1.ListBlockedRepositoriesResponse - 7, // 21: gitpod.v1.VerificationService.CreateBlockedRepository:output_type -> gitpod.v1.CreateBlockedRepositoryResponse - 9, // 22: gitpod.v1.VerificationService.DeleteBlockedRepository:output_type -> gitpod.v1.DeleteBlockedRepositoryResponse - 11, // 23: gitpod.v1.VerificationService.ListBlockedEmailDomains:output_type -> gitpod.v1.ListBlockedEmailDomainsResponse - 13, // 24: gitpod.v1.VerificationService.CreateBlockedEmailDomain:output_type -> gitpod.v1.CreateBlockedEmailDomainResponse - 18, // [18:25] is the sub-list for method output_type - 11, // [11:18] 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 + 0, // 0: gitpod.v1.VerificationService.SendPhoneNumberVerificationToken:input_type -> gitpod.v1.SendPhoneNumberVerificationTokenRequest + 2, // 1: gitpod.v1.VerificationService.VerifyPhoneNumberVerificationToken:input_type -> gitpod.v1.VerifyPhoneNumberVerificationTokenRequest + 1, // 2: gitpod.v1.VerificationService.SendPhoneNumberVerificationToken:output_type -> gitpod.v1.SendPhoneNumberVerificationTokenResponse + 3, // 3: gitpod.v1.VerificationService.VerifyPhoneNumberVerificationToken:output_type -> gitpod.v1.VerifyPhoneNumberVerificationTokenResponse + 2, // [2:4] is the sub-list for method output_type + 0, // [0:2] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name } func init() { file_gitpod_v1_verification_proto_init() } @@ -1177,8 +332,6 @@ func file_gitpod_v1_verification_proto_init() { if File_gitpod_v1_verification_proto != nil { return } - file_gitpod_v1_pagination_proto_init() - file_gitpod_v1_sorting_proto_init() if !protoimpl.UnsafeEnabled { file_gitpod_v1_verification_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SendPhoneNumberVerificationTokenRequest); i { @@ -1228,150 +381,6 @@ func file_gitpod_v1_verification_proto_init() { return nil } } - file_gitpod_v1_verification_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListBlockedRepositoriesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gitpod_v1_verification_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListBlockedRepositoriesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gitpod_v1_verification_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateBlockedRepositoryRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gitpod_v1_verification_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateBlockedRepositoryResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gitpod_v1_verification_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteBlockedRepositoryRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gitpod_v1_verification_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteBlockedRepositoryResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gitpod_v1_verification_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListBlockedEmailDomainsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gitpod_v1_verification_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListBlockedEmailDomainsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gitpod_v1_verification_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateBlockedEmailDomainRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gitpod_v1_verification_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateBlockedEmailDomainResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gitpod_v1_verification_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlockedRepository); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gitpod_v1_verification_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlockedEmailDomain); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } } type x struct{} out := protoimpl.TypeBuilder{ @@ -1379,7 +388,7 @@ func file_gitpod_v1_verification_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_gitpod_v1_verification_proto_rawDesc, NumEnums: 0, - NumMessages: 16, + NumMessages: 4, NumExtensions: 0, NumServices: 1, }, diff --git a/components/public-api/go/v1/verification_grpc.pb.go b/components/public-api/go/v1/verification_grpc.pb.go index 6b4c4a1b67f24b..cccea279d5d455 100644 --- a/components/public-api/go/v1/verification_grpc.pb.go +++ b/components/public-api/go/v1/verification_grpc.pb.go @@ -32,16 +32,6 @@ type VerificationServiceClient interface { // VerifyPhoneNumberVerificationToken verifies the specified verification // token. VerifyPhoneNumberVerificationToken(ctx context.Context, in *VerifyPhoneNumberVerificationTokenRequest, opts ...grpc.CallOption) (*VerifyPhoneNumberVerificationTokenResponse, error) - // ListBlockedRepositories lists blocked repositories. - ListBlockedRepositories(ctx context.Context, in *ListBlockedRepositoriesRequest, opts ...grpc.CallOption) (*ListBlockedRepositoriesResponse, error) - // CreateBlockedRepository creates a new blocked repository. - CreateBlockedRepository(ctx context.Context, in *CreateBlockedRepositoryRequest, opts ...grpc.CallOption) (*CreateBlockedRepositoryResponse, error) - // DeleteBlockedRepository deletes a blocked repository. - DeleteBlockedRepository(ctx context.Context, in *DeleteBlockedRepositoryRequest, opts ...grpc.CallOption) (*DeleteBlockedRepositoryResponse, error) - // ListBlockedEmailDomains lists blocked email domains. - ListBlockedEmailDomains(ctx context.Context, in *ListBlockedEmailDomainsRequest, opts ...grpc.CallOption) (*ListBlockedEmailDomainsResponse, error) - // CreateBlockedEmailDomain creates a new blocked email domain. - CreateBlockedEmailDomain(ctx context.Context, in *CreateBlockedEmailDomainRequest, opts ...grpc.CallOption) (*CreateBlockedEmailDomainResponse, error) } type verificationServiceClient struct { @@ -70,51 +60,6 @@ func (c *verificationServiceClient) VerifyPhoneNumberVerificationToken(ctx conte return out, nil } -func (c *verificationServiceClient) ListBlockedRepositories(ctx context.Context, in *ListBlockedRepositoriesRequest, opts ...grpc.CallOption) (*ListBlockedRepositoriesResponse, error) { - out := new(ListBlockedRepositoriesResponse) - err := c.cc.Invoke(ctx, "/gitpod.v1.VerificationService/ListBlockedRepositories", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *verificationServiceClient) CreateBlockedRepository(ctx context.Context, in *CreateBlockedRepositoryRequest, opts ...grpc.CallOption) (*CreateBlockedRepositoryResponse, error) { - out := new(CreateBlockedRepositoryResponse) - err := c.cc.Invoke(ctx, "/gitpod.v1.VerificationService/CreateBlockedRepository", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *verificationServiceClient) DeleteBlockedRepository(ctx context.Context, in *DeleteBlockedRepositoryRequest, opts ...grpc.CallOption) (*DeleteBlockedRepositoryResponse, error) { - out := new(DeleteBlockedRepositoryResponse) - err := c.cc.Invoke(ctx, "/gitpod.v1.VerificationService/DeleteBlockedRepository", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *verificationServiceClient) ListBlockedEmailDomains(ctx context.Context, in *ListBlockedEmailDomainsRequest, opts ...grpc.CallOption) (*ListBlockedEmailDomainsResponse, error) { - out := new(ListBlockedEmailDomainsResponse) - err := c.cc.Invoke(ctx, "/gitpod.v1.VerificationService/ListBlockedEmailDomains", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *verificationServiceClient) CreateBlockedEmailDomain(ctx context.Context, in *CreateBlockedEmailDomainRequest, opts ...grpc.CallOption) (*CreateBlockedEmailDomainResponse, error) { - out := new(CreateBlockedEmailDomainResponse) - err := c.cc.Invoke(ctx, "/gitpod.v1.VerificationService/CreateBlockedEmailDomain", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - // VerificationServiceServer is the server API for VerificationService service. // All implementations must embed UnimplementedVerificationServiceServer // for forward compatibility @@ -125,16 +70,6 @@ type VerificationServiceServer interface { // VerifyPhoneNumberVerificationToken verifies the specified verification // token. VerifyPhoneNumberVerificationToken(context.Context, *VerifyPhoneNumberVerificationTokenRequest) (*VerifyPhoneNumberVerificationTokenResponse, error) - // ListBlockedRepositories lists blocked repositories. - ListBlockedRepositories(context.Context, *ListBlockedRepositoriesRequest) (*ListBlockedRepositoriesResponse, error) - // CreateBlockedRepository creates a new blocked repository. - CreateBlockedRepository(context.Context, *CreateBlockedRepositoryRequest) (*CreateBlockedRepositoryResponse, error) - // DeleteBlockedRepository deletes a blocked repository. - DeleteBlockedRepository(context.Context, *DeleteBlockedRepositoryRequest) (*DeleteBlockedRepositoryResponse, error) - // ListBlockedEmailDomains lists blocked email domains. - ListBlockedEmailDomains(context.Context, *ListBlockedEmailDomainsRequest) (*ListBlockedEmailDomainsResponse, error) - // CreateBlockedEmailDomain creates a new blocked email domain. - CreateBlockedEmailDomain(context.Context, *CreateBlockedEmailDomainRequest) (*CreateBlockedEmailDomainResponse, error) mustEmbedUnimplementedVerificationServiceServer() } @@ -148,21 +83,6 @@ func (UnimplementedVerificationServiceServer) SendPhoneNumberVerificationToken(c func (UnimplementedVerificationServiceServer) VerifyPhoneNumberVerificationToken(context.Context, *VerifyPhoneNumberVerificationTokenRequest) (*VerifyPhoneNumberVerificationTokenResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method VerifyPhoneNumberVerificationToken not implemented") } -func (UnimplementedVerificationServiceServer) ListBlockedRepositories(context.Context, *ListBlockedRepositoriesRequest) (*ListBlockedRepositoriesResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListBlockedRepositories not implemented") -} -func (UnimplementedVerificationServiceServer) CreateBlockedRepository(context.Context, *CreateBlockedRepositoryRequest) (*CreateBlockedRepositoryResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateBlockedRepository not implemented") -} -func (UnimplementedVerificationServiceServer) DeleteBlockedRepository(context.Context, *DeleteBlockedRepositoryRequest) (*DeleteBlockedRepositoryResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteBlockedRepository not implemented") -} -func (UnimplementedVerificationServiceServer) ListBlockedEmailDomains(context.Context, *ListBlockedEmailDomainsRequest) (*ListBlockedEmailDomainsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ListBlockedEmailDomains not implemented") -} -func (UnimplementedVerificationServiceServer) CreateBlockedEmailDomain(context.Context, *CreateBlockedEmailDomainRequest) (*CreateBlockedEmailDomainResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateBlockedEmailDomain not implemented") -} func (UnimplementedVerificationServiceServer) mustEmbedUnimplementedVerificationServiceServer() {} // UnsafeVerificationServiceServer may be embedded to opt out of forward compatibility for this service. @@ -212,96 +132,6 @@ func _VerificationService_VerifyPhoneNumberVerificationToken_Handler(srv interfa return interceptor(ctx, in, info, handler) } -func _VerificationService_ListBlockedRepositories_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListBlockedRepositoriesRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(VerificationServiceServer).ListBlockedRepositories(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gitpod.v1.VerificationService/ListBlockedRepositories", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VerificationServiceServer).ListBlockedRepositories(ctx, req.(*ListBlockedRepositoriesRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _VerificationService_CreateBlockedRepository_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateBlockedRepositoryRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(VerificationServiceServer).CreateBlockedRepository(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gitpod.v1.VerificationService/CreateBlockedRepository", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VerificationServiceServer).CreateBlockedRepository(ctx, req.(*CreateBlockedRepositoryRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _VerificationService_DeleteBlockedRepository_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteBlockedRepositoryRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(VerificationServiceServer).DeleteBlockedRepository(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gitpod.v1.VerificationService/DeleteBlockedRepository", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VerificationServiceServer).DeleteBlockedRepository(ctx, req.(*DeleteBlockedRepositoryRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _VerificationService_ListBlockedEmailDomains_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ListBlockedEmailDomainsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(VerificationServiceServer).ListBlockedEmailDomains(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gitpod.v1.VerificationService/ListBlockedEmailDomains", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VerificationServiceServer).ListBlockedEmailDomains(ctx, req.(*ListBlockedEmailDomainsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -func _VerificationService_CreateBlockedEmailDomain_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateBlockedEmailDomainRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(VerificationServiceServer).CreateBlockedEmailDomain(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gitpod.v1.VerificationService/CreateBlockedEmailDomain", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(VerificationServiceServer).CreateBlockedEmailDomain(ctx, req.(*CreateBlockedEmailDomainRequest)) - } - return interceptor(ctx, in, info, handler) -} - // VerificationService_ServiceDesc is the grpc.ServiceDesc for VerificationService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -317,26 +147,6 @@ var VerificationService_ServiceDesc = grpc.ServiceDesc{ MethodName: "VerifyPhoneNumberVerificationToken", Handler: _VerificationService_VerifyPhoneNumberVerificationToken_Handler, }, - { - MethodName: "ListBlockedRepositories", - Handler: _VerificationService_ListBlockedRepositories_Handler, - }, - { - MethodName: "CreateBlockedRepository", - Handler: _VerificationService_CreateBlockedRepository_Handler, - }, - { - MethodName: "DeleteBlockedRepository", - Handler: _VerificationService_DeleteBlockedRepository_Handler, - }, - { - MethodName: "ListBlockedEmailDomains", - Handler: _VerificationService_ListBlockedEmailDomains_Handler, - }, - { - MethodName: "CreateBlockedEmailDomain", - Handler: _VerificationService_CreateBlockedEmailDomain_Handler, - }, }, Streams: []grpc.StreamDesc{}, Metadata: "gitpod/v1/verification.proto", diff --git a/components/public-api/typescript/src/gitpod/v1/verification_connect.ts b/components/public-api/typescript/src/gitpod/v1/verification_connect.ts index 848a59213e56c7..7899904ebcaca5 100644 --- a/components/public-api/typescript/src/gitpod/v1/verification_connect.ts +++ b/components/public-api/typescript/src/gitpod/v1/verification_connect.ts @@ -9,7 +9,7 @@ /* eslint-disable */ // @ts-nocheck -import { CreateBlockedEmailDomainRequest, CreateBlockedEmailDomainResponse, CreateBlockedRepositoryRequest, CreateBlockedRepositoryResponse, DeleteBlockedRepositoryRequest, DeleteBlockedRepositoryResponse, ListBlockedEmailDomainsRequest, ListBlockedEmailDomainsResponse, ListBlockedRepositoriesRequest, ListBlockedRepositoriesResponse, SendPhoneNumberVerificationTokenRequest, SendPhoneNumberVerificationTokenResponse, VerifyPhoneNumberVerificationTokenRequest, VerifyPhoneNumberVerificationTokenResponse } from "./verification_pb.js"; +import { SendPhoneNumberVerificationTokenRequest, SendPhoneNumberVerificationTokenResponse, VerifyPhoneNumberVerificationTokenRequest, VerifyPhoneNumberVerificationTokenResponse } from "./verification_pb.js"; import { MethodKind } from "@bufbuild/protobuf"; /** @@ -42,60 +42,5 @@ export const VerificationService = { O: VerifyPhoneNumberVerificationTokenResponse, kind: MethodKind.Unary, }, - /** - * ListBlockedRepositories lists blocked repositories. - * - * @generated from rpc gitpod.v1.VerificationService.ListBlockedRepositories - */ - listBlockedRepositories: { - name: "ListBlockedRepositories", - I: ListBlockedRepositoriesRequest, - O: ListBlockedRepositoriesResponse, - kind: MethodKind.Unary, - }, - /** - * CreateBlockedRepository creates a new blocked repository. - * - * @generated from rpc gitpod.v1.VerificationService.CreateBlockedRepository - */ - createBlockedRepository: { - name: "CreateBlockedRepository", - I: CreateBlockedRepositoryRequest, - O: CreateBlockedRepositoryResponse, - kind: MethodKind.Unary, - }, - /** - * DeleteBlockedRepository deletes a blocked repository. - * - * @generated from rpc gitpod.v1.VerificationService.DeleteBlockedRepository - */ - deleteBlockedRepository: { - name: "DeleteBlockedRepository", - I: DeleteBlockedRepositoryRequest, - O: DeleteBlockedRepositoryResponse, - kind: MethodKind.Unary, - }, - /** - * ListBlockedEmailDomains lists blocked email domains. - * - * @generated from rpc gitpod.v1.VerificationService.ListBlockedEmailDomains - */ - listBlockedEmailDomains: { - name: "ListBlockedEmailDomains", - I: ListBlockedEmailDomainsRequest, - O: ListBlockedEmailDomainsResponse, - kind: MethodKind.Unary, - }, - /** - * CreateBlockedEmailDomain creates a new blocked email domain. - * - * @generated from rpc gitpod.v1.VerificationService.CreateBlockedEmailDomain - */ - createBlockedEmailDomain: { - name: "CreateBlockedEmailDomain", - I: CreateBlockedEmailDomainRequest, - O: CreateBlockedEmailDomainResponse, - kind: MethodKind.Unary, - }, } } as const; diff --git a/components/public-api/typescript/src/gitpod/v1/verification_pb.ts b/components/public-api/typescript/src/gitpod/v1/verification_pb.ts index ef395adbda8e8b..ed3b664a10aaef 100644 --- a/components/public-api/typescript/src/gitpod/v1/verification_pb.ts +++ b/components/public-api/typescript/src/gitpod/v1/verification_pb.ts @@ -10,9 +10,7 @@ // @ts-nocheck import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3, Timestamp } from "@bufbuild/protobuf"; -import { PaginationRequest, PaginationResponse } from "./pagination_pb.js"; -import { Sort } from "./sorting_pb.js"; +import { Message, proto3 } from "@bufbuild/protobuf"; /** * Required fields: @@ -193,552 +191,3 @@ export class VerifyPhoneNumberVerificationTokenResponse extends Message { - /** - * pagination contains the pagination options for listing blocked repositories - * - * @generated from field: gitpod.v1.PaginationRequest pagination = 1; - */ - pagination?: PaginationRequest; - - /** - * sort contains the sort options for listing blocked repositories - * BlockedRepositories can be sorted by "urlRegexp" - * - * @generated from field: repeated gitpod.v1.Sort sort = 2; - */ - sort: Sort[] = []; - - /** - * search_term is a search term to filter blocked repositories by url_regexp - * - * @generated from field: string search_term = 3; - */ - searchTerm = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "gitpod.v1.ListBlockedRepositoriesRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "pagination", kind: "message", T: PaginationRequest }, - { no: 2, name: "sort", kind: "message", T: Sort, repeated: true }, - { no: 3, name: "search_term", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ListBlockedRepositoriesRequest { - return new ListBlockedRepositoriesRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ListBlockedRepositoriesRequest { - return new ListBlockedRepositoriesRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ListBlockedRepositoriesRequest { - return new ListBlockedRepositoriesRequest().fromJsonString(jsonString, options); - } - - static equals(a: ListBlockedRepositoriesRequest | PlainMessage | undefined, b: ListBlockedRepositoriesRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(ListBlockedRepositoriesRequest, a, b); - } -} - -/** - * @generated from message gitpod.v1.ListBlockedRepositoriesResponse - */ -export class ListBlockedRepositoriesResponse extends Message { - /** - * pagination contains the pagination options for listing blocked repositories - * - * @generated from field: gitpod.v1.PaginationResponse pagination = 1; - */ - pagination?: PaginationResponse; - - /** - * blocked_repositories are the blocked repositories - * - * @generated from field: repeated gitpod.v1.BlockedRepository blocked_repositories = 2; - */ - blockedRepositories: BlockedRepository[] = []; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "gitpod.v1.ListBlockedRepositoriesResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "pagination", kind: "message", T: PaginationResponse }, - { no: 2, name: "blocked_repositories", kind: "message", T: BlockedRepository, repeated: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ListBlockedRepositoriesResponse { - return new ListBlockedRepositoriesResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ListBlockedRepositoriesResponse { - return new ListBlockedRepositoriesResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ListBlockedRepositoriesResponse { - return new ListBlockedRepositoriesResponse().fromJsonString(jsonString, options); - } - - static equals(a: ListBlockedRepositoriesResponse | PlainMessage | undefined, b: ListBlockedRepositoriesResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(ListBlockedRepositoriesResponse, a, b); - } -} - -/** - * @generated from message gitpod.v1.CreateBlockedRepositoryRequest - */ -export class CreateBlockedRepositoryRequest extends Message { - /** - * url_regexp is the regular expression for the repository URL - * - * @generated from field: string url_regexp = 1; - */ - urlRegexp = ""; - - /** - * block_user indicates if the user should be blocked from accessing the - * repository - * - * @generated from field: bool block_user = 2; - */ - blockUser = false; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "gitpod.v1.CreateBlockedRepositoryRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "url_regexp", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "block_user", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): CreateBlockedRepositoryRequest { - return new CreateBlockedRepositoryRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): CreateBlockedRepositoryRequest { - return new CreateBlockedRepositoryRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): CreateBlockedRepositoryRequest { - return new CreateBlockedRepositoryRequest().fromJsonString(jsonString, options); - } - - static equals(a: CreateBlockedRepositoryRequest | PlainMessage | undefined, b: CreateBlockedRepositoryRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(CreateBlockedRepositoryRequest, a, b); - } -} - -/** - * @generated from message gitpod.v1.CreateBlockedRepositoryResponse - */ -export class CreateBlockedRepositoryResponse extends Message { - /** - * @generated from field: gitpod.v1.BlockedRepository blocked_repository = 1; - */ - blockedRepository?: BlockedRepository; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "gitpod.v1.CreateBlockedRepositoryResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "blocked_repository", kind: "message", T: BlockedRepository }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): CreateBlockedRepositoryResponse { - return new CreateBlockedRepositoryResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): CreateBlockedRepositoryResponse { - return new CreateBlockedRepositoryResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): CreateBlockedRepositoryResponse { - return new CreateBlockedRepositoryResponse().fromJsonString(jsonString, options); - } - - static equals(a: CreateBlockedRepositoryResponse | PlainMessage | undefined, b: CreateBlockedRepositoryResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(CreateBlockedRepositoryResponse, a, b); - } -} - -/** - * @generated from message gitpod.v1.DeleteBlockedRepositoryRequest - */ -export class DeleteBlockedRepositoryRequest extends Message { - /** - * blocked_repository_id is the ID of the blocked repository - * - * @generated from field: uint32 blocked_repository_id = 1; - */ - blockedRepositoryId = 0; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "gitpod.v1.DeleteBlockedRepositoryRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "blocked_repository_id", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): DeleteBlockedRepositoryRequest { - return new DeleteBlockedRepositoryRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): DeleteBlockedRepositoryRequest { - return new DeleteBlockedRepositoryRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): DeleteBlockedRepositoryRequest { - return new DeleteBlockedRepositoryRequest().fromJsonString(jsonString, options); - } - - static equals(a: DeleteBlockedRepositoryRequest | PlainMessage | undefined, b: DeleteBlockedRepositoryRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(DeleteBlockedRepositoryRequest, a, b); - } -} - -/** - * @generated from message gitpod.v1.DeleteBlockedRepositoryResponse - */ -export class DeleteBlockedRepositoryResponse extends Message { - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "gitpod.v1.DeleteBlockedRepositoryResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): DeleteBlockedRepositoryResponse { - return new DeleteBlockedRepositoryResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): DeleteBlockedRepositoryResponse { - return new DeleteBlockedRepositoryResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): DeleteBlockedRepositoryResponse { - return new DeleteBlockedRepositoryResponse().fromJsonString(jsonString, options); - } - - static equals(a: DeleteBlockedRepositoryResponse | PlainMessage | undefined, b: DeleteBlockedRepositoryResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(DeleteBlockedRepositoryResponse, a, b); - } -} - -/** - * @generated from message gitpod.v1.ListBlockedEmailDomainsRequest - */ -export class ListBlockedEmailDomainsRequest extends Message { - /** - * pagination contains the pagination options for listing blocked email - * domains - * - * @generated from field: gitpod.v1.PaginationRequest pagination = 1; - */ - pagination?: PaginationRequest; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "gitpod.v1.ListBlockedEmailDomainsRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "pagination", kind: "message", T: PaginationRequest }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ListBlockedEmailDomainsRequest { - return new ListBlockedEmailDomainsRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ListBlockedEmailDomainsRequest { - return new ListBlockedEmailDomainsRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ListBlockedEmailDomainsRequest { - return new ListBlockedEmailDomainsRequest().fromJsonString(jsonString, options); - } - - static equals(a: ListBlockedEmailDomainsRequest | PlainMessage | undefined, b: ListBlockedEmailDomainsRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(ListBlockedEmailDomainsRequest, a, b); - } -} - -/** - * @generated from message gitpod.v1.ListBlockedEmailDomainsResponse - */ -export class ListBlockedEmailDomainsResponse extends Message { - /** - * pagination contains the pagination options for listing blocked email - * domains - * - * @generated from field: gitpod.v1.PaginationResponse pagination = 1; - */ - pagination?: PaginationResponse; - - /** - * blocked_email_domains are the blocked email domains - * - * @generated from field: repeated gitpod.v1.BlockedEmailDomain blocked_email_domains = 2; - */ - blockedEmailDomains: BlockedEmailDomain[] = []; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "gitpod.v1.ListBlockedEmailDomainsResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "pagination", kind: "message", T: PaginationResponse }, - { no: 2, name: "blocked_email_domains", kind: "message", T: BlockedEmailDomain, repeated: true }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ListBlockedEmailDomainsResponse { - return new ListBlockedEmailDomainsResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ListBlockedEmailDomainsResponse { - return new ListBlockedEmailDomainsResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ListBlockedEmailDomainsResponse { - return new ListBlockedEmailDomainsResponse().fromJsonString(jsonString, options); - } - - static equals(a: ListBlockedEmailDomainsResponse | PlainMessage | undefined, b: ListBlockedEmailDomainsResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(ListBlockedEmailDomainsResponse, a, b); - } -} - -/** - * @generated from message gitpod.v1.CreateBlockedEmailDomainRequest - */ -export class CreateBlockedEmailDomainRequest extends Message { - /** - * domain is the blocked email domain - * - * @generated from field: string domain = 1; - */ - domain = ""; - - /** - * @generated from field: bool negative = 2; - */ - negative = false; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "gitpod.v1.CreateBlockedEmailDomainRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "domain", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "negative", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): CreateBlockedEmailDomainRequest { - return new CreateBlockedEmailDomainRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): CreateBlockedEmailDomainRequest { - return new CreateBlockedEmailDomainRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): CreateBlockedEmailDomainRequest { - return new CreateBlockedEmailDomainRequest().fromJsonString(jsonString, options); - } - - static equals(a: CreateBlockedEmailDomainRequest | PlainMessage | undefined, b: CreateBlockedEmailDomainRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(CreateBlockedEmailDomainRequest, a, b); - } -} - -/** - * @generated from message gitpod.v1.CreateBlockedEmailDomainResponse - */ -export class CreateBlockedEmailDomainResponse extends Message { - /** - * @generated from field: gitpod.v1.BlockedEmailDomain blocked_email_domain = 1; - */ - blockedEmailDomain?: BlockedEmailDomain; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "gitpod.v1.CreateBlockedEmailDomainResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "blocked_email_domain", kind: "message", T: BlockedEmailDomain }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): CreateBlockedEmailDomainResponse { - return new CreateBlockedEmailDomainResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): CreateBlockedEmailDomainResponse { - return new CreateBlockedEmailDomainResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): CreateBlockedEmailDomainResponse { - return new CreateBlockedEmailDomainResponse().fromJsonString(jsonString, options); - } - - static equals(a: CreateBlockedEmailDomainResponse | PlainMessage | undefined, b: CreateBlockedEmailDomainResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(CreateBlockedEmailDomainResponse, a, b); - } -} - -/** - * @generated from message gitpod.v1.BlockedRepository - */ -export class BlockedRepository extends Message { - /** - * id is the ID of the blocked repository - * - * @generated from field: uint32 id = 1; - */ - id = 0; - - /** - * url_regexp is the regular expression for the repository URL - * - * @generated from field: string url_regexp = 2; - */ - urlRegexp = ""; - - /** - * block_user indicates if the user should be blocked from accessing the - * repository - * - * @generated from field: bool block_user = 3; - */ - blockUser = false; - - /** - * @generated from field: google.protobuf.Timestamp creation_time = 4; - */ - creationTime?: Timestamp; - - /** - * @generated from field: google.protobuf.Timestamp update_time = 5; - */ - updateTime?: Timestamp; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "gitpod.v1.BlockedRepository"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "id", kind: "scalar", T: 13 /* ScalarType.UINT32 */ }, - { no: 2, name: "url_regexp", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "block_user", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - { no: 4, name: "creation_time", kind: "message", T: Timestamp }, - { no: 5, name: "update_time", kind: "message", T: Timestamp }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): BlockedRepository { - return new BlockedRepository().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): BlockedRepository { - return new BlockedRepository().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): BlockedRepository { - return new BlockedRepository().fromJsonString(jsonString, options); - } - - static equals(a: BlockedRepository | PlainMessage | undefined, b: BlockedRepository | PlainMessage | undefined): boolean { - return proto3.util.equals(BlockedRepository, a, b); - } -} - -/** - * @generated from message gitpod.v1.BlockedEmailDomain - */ -export class BlockedEmailDomain extends Message { - /** - * id is the ID of the blocked email domain - * - * @generated from field: string id = 1; - */ - id = ""; - - /** - * domain is the blocked email domain - * - * @generated from field: string domain = 2; - */ - domain = ""; - - /** - * @generated from field: bool negative = 3; - */ - negative = false; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "gitpod.v1.BlockedEmailDomain"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "id", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "domain", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "negative", kind: "scalar", T: 8 /* ScalarType.BOOL */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): BlockedEmailDomain { - return new BlockedEmailDomain().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): BlockedEmailDomain { - return new BlockedEmailDomain().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): BlockedEmailDomain { - return new BlockedEmailDomain().fromJsonString(jsonString, options); - } - - static equals(a: BlockedEmailDomain | PlainMessage | undefined, b: BlockedEmailDomain | PlainMessage | undefined): boolean { - return proto3.util.equals(BlockedEmailDomain, a, b); - } -} From faf58f4ec220553f56eb2461df678c59da930374 Mon Sep 17 00:00:00 2001 From: Jean Pierre Huaroto Date: Mon, 27 Nov 2023 21:29:11 +0000 Subject: [PATCH 07/10] Update --- .../src/admin/BlockedEmailDomains.tsx | 13 +- .../src/admin/BlockedRepositories.tsx | 57 ++++----- .../service/json-rpc-verification-client.ts | 86 ------------- .../gitpod-db/src/email-domain-filter-db.ts | 2 +- .../typeorm/email-domain-filter-db-impl.ts | 4 +- .../src/public-api-converter.spec.ts | 36 ------ .../src/public-api-converter.ts | 21 ---- components/server/src/api/sorting.ts | 46 ------- .../src/api/verification-service-api.ts | 119 +----------------- .../server/src/auth/verification-service.ts | 51 +++++--- components/server/src/user/user-service.ts | 9 ++ .../src/workspace/gitpod-server-impl.ts | 68 ++++------ 12 files changed, 98 insertions(+), 414 deletions(-) delete mode 100644 components/server/src/api/sorting.ts diff --git a/components/dashboard/src/admin/BlockedEmailDomains.tsx b/components/dashboard/src/admin/BlockedEmailDomains.tsx index 4fac823576b0a7..d664fa5c45572a 100644 --- a/components/dashboard/src/admin/BlockedEmailDomains.tsx +++ b/components/dashboard/src/admin/BlockedEmailDomains.tsx @@ -13,10 +13,10 @@ import { ItemFieldContextMenu } from "../components/ItemsList"; import Modal, { ModalBody, ModalFooter, ModalHeader } from "../components/Modal"; import { CheckboxInputField } from "../components/forms/CheckboxInputField"; import searchIcon from "../icons/search.svg"; +import { getGitpodService } from "../service/service"; import { AdminPageHeader } from "./AdminPageHeader"; import Pagination from "../Pagination/Pagination"; import { Button } from "@podkit/buttons/Button"; -import { verificationClient } from "../service/public-api"; export function BlockedEmailDomains() { return ( @@ -27,7 +27,7 @@ export function BlockedEmailDomains() { } function useBlockedEmailDomains() { - return useQuery(["blockedEmailDomains"], () => verificationClient.listBlockedEmailDomains({}), { + return useQuery(["blockedEmailDomains"], () => getGitpodService().server.adminGetBlockedEmailDomains(), { staleTime: 1000 * 60 * 5, // 5min }); } @@ -37,15 +37,12 @@ function useUpdateBlockedEmailDomainMutation() { const blockedEmailDomains = useBlockedEmailDomains(); return useMutation( async (blockedDomain: EmailDomainFilterEntry) => { - await verificationClient.createBlockedEmailDomain({ - domain: blockedDomain.domain, - negative: blockedDomain.negative, - }); + await getGitpodService().server.adminSaveBlockedEmailDomain(blockedDomain); }, { onSuccess: (_, blockedDomain) => { const updated = []; - for (const entry of blockedEmailDomains.data?.blockedEmailDomains || []) { + for (const entry of blockedEmailDomains.data || []) { if (entry.domain !== blockedDomain.domain) { updated.push(entry); } else { @@ -77,7 +74,7 @@ export function BlockedEmailDomainsList(props: Props) { if (!blockedEmailDomains.data) { return []; } - return blockedEmailDomains.data.blockedEmailDomains.filter((entry) => + return blockedEmailDomains.data.filter((entry) => entry.domain.toLowerCase().includes(searchTerm.toLowerCase()), ); }, [blockedEmailDomains.data, searchTerm]); diff --git a/components/dashboard/src/admin/BlockedRepositories.tsx b/components/dashboard/src/admin/BlockedRepositories.tsx index 68d97ecf7cb905..66c9c92480fc35 100644 --- a/components/dashboard/src/admin/BlockedRepositories.tsx +++ b/components/dashboard/src/admin/BlockedRepositories.tsx @@ -4,8 +4,11 @@ * See License.AGPL.txt in the project root for license information. */ +import { AdminGetListResult } from "@gitpod/gitpod-protocol"; import { useCallback, useEffect, useRef, useState } from "react"; +import { getGitpodService } from "../service/service"; import { AdminPageHeader } from "./AdminPageHeader"; +import { BlockedRepository } from "@gitpod/gitpod-protocol/lib/blocked-repositories-protocol"; import ConfirmationModal from "../components/ConfirmationModal"; import Modal, { ModalBody, ModalFooter, ModalHeader } from "../components/Modal"; import { CheckboxInputField } from "../components/forms/CheckboxInputField"; @@ -15,10 +18,6 @@ import Alert from "../components/Alert"; import { SpinnerLoader } from "../components/Loader"; import searchIcon from "../icons/search.svg"; import { Button } from "@podkit/buttons/Button"; -import { verificationClient } from "../service/public-api"; -import { Sort, SortOrder } from "@gitpod/public-api/lib/gitpod/v1/sorting_pb"; -import { BlockedRepository, ListBlockedRepositoriesResponse } from "@gitpod/public-api/lib/gitpod/v1/verification_pb"; -import { PartialMessage } from "@bufbuild/protobuf"; export function BlockedRepositories() { return ( @@ -28,22 +27,20 @@ export function BlockedRepositories() { ); } -type NewBlockedRepository = Pick, "urlRegexp" | "blockUser">; -type ExistingBlockedRepository = Pick, "id" | "urlRegexp" | "blockUser">; +type NewBlockedRepository = Pick; +type ExistingBlockedRepository = Pick; interface Props {} export function BlockedRepositoriesList(props: Props) { - const [searchResult, setSearchResult] = useState>({ - blockedRepositories: [], - }); + const [searchResult, setSearchResult] = useState>({ rows: [], total: 0 }); const [queryTerm, setQueryTerm] = useState(""); const [searching, setSearching] = useState(false); const [isAddModalVisible, setAddModalVisible] = useState(false); const [isDeleteModalVisible, setDeleteModalVisible] = useState(false); - const [currentBlockedRepository, setCurrentBlockedRepository] = useState>({ + const [currentBlockedRepository, setCurrentBlockedRepository] = useState({ id: 0, urlRegexp: "", blockUser: false, @@ -52,18 +49,11 @@ export function BlockedRepositoriesList(props: Props) { const search = async () => { setSearching(true); try { - const result = await verificationClient.listBlockedRepositories({ - // Don't need, added it in json-rpc implement to make life easier. - // pagination: new PaginationRequest({ - // token: Buffer.from(JSON.stringify({ offset: 0 })).toString("base64"), - // pageSize: 100, - // }), - sort: [ - new Sort({ - field: "urlRegexp", - order: SortOrder.ASC, - }), - ], + const result = await getGitpodService().server.adminGetBlockedRepositories({ + limit: 100, + orderBy: "urlRegexp", + offset: 0, + orderDir: "asc", searchTerm: queryTerm, }); setSearchResult(result); @@ -86,10 +76,10 @@ export function BlockedRepositoriesList(props: Props) { }; const save = async (blockedRepository: NewBlockedRepository) => { - await verificationClient.createBlockedRepository({ - urlRegexp: blockedRepository.urlRegexp ?? "", - blockUser: blockedRepository.blockUser ?? false, - }); + await getGitpodService().server.adminCreateBlockedRepository( + blockedRepository.urlRegexp, + blockedRepository.blockUser, + ); setAddModalVisible(false); search(); }; @@ -101,13 +91,11 @@ export function BlockedRepositoriesList(props: Props) { }; const deleteBlockedRepository = async (blockedRepository: ExistingBlockedRepository) => { - await verificationClient.deleteBlockedRepository({ - blockedRepositoryId: blockedRepository.id, - }); + await getGitpodService().server.adminDeleteBlockedRepository(blockedRepository.id); search(); }; - const confirmDeleteBlockedRepository = (blockedRepository: PartialMessage) => { + const confirmDeleteBlockedRepository = (blockedRepository: ExistingBlockedRepository) => { setCurrentBlockedRepository(blockedRepository); setAddModalVisible(false); setDeleteModalVisible(true); @@ -170,7 +158,7 @@ export function BlockedRepositoriesList(props: Props) {
Block Users
- {searchResult.blockedRepositories!.map((br) => ( + {searchResult.rows.map((br) => ( ))} @@ -178,10 +166,7 @@ export function BlockedRepositoriesList(props: Props) { ); } -function BlockedRepositoryEntry(props: { - br: PartialMessage; - confirmedDelete: (br: PartialMessage) => void; -}) { +function BlockedRepositoryEntry(props: { br: BlockedRepository; confirmedDelete: (br: BlockedRepository) => void }) { const menuEntries: ContextMenuEntry[] = [ { title: "Delete", @@ -310,7 +295,7 @@ function Details(props: { { if (!!props.update) { diff --git a/components/dashboard/src/service/json-rpc-verification-client.ts b/components/dashboard/src/service/json-rpc-verification-client.ts index 3f8b7a3e9f5d2e..dfac3543af5b5f 100644 --- a/components/dashboard/src/service/json-rpc-verification-client.ts +++ b/components/dashboard/src/service/json-rpc-verification-client.ts @@ -12,22 +12,10 @@ import { SendPhoneNumberVerificationTokenResponse, VerifyPhoneNumberVerificationTokenRequest, VerifyPhoneNumberVerificationTokenResponse, - ListBlockedRepositoriesRequest, - ListBlockedRepositoriesResponse, - CreateBlockedRepositoryRequest, - CreateBlockedRepositoryResponse, - DeleteBlockedRepositoryRequest, - DeleteBlockedRepositoryResponse, - ListBlockedEmailDomainsRequest, - ListBlockedEmailDomainsResponse, - CreateBlockedEmailDomainRequest, - CreateBlockedEmailDomainResponse, } from "@gitpod/public-api/lib/gitpod/v1/verification_pb"; import { ApplicationError, ErrorCodes } from "@gitpod/gitpod-protocol/lib/messaging/error"; import { getGitpodService } from "./service"; import { validate as uuidValidate } from "uuid"; -import { converter } from "./public-api"; -import { PaginationResponse } from "@gitpod/public-api/lib/gitpod/v1/pagination_pb"; export class JsonRpcVerificationClient implements PromiseClient { async sendPhoneNumberVerificationToken( @@ -65,78 +53,4 @@ export class JsonRpcVerificationClient implements PromiseClient, - _options?: CallOptions | undefined, - ): Promise { - // dashboard params is constant, no need to implement - const info = await getGitpodService().server.adminGetBlockedRepositories({ - limit: 100, - offset: 0, - orderBy: "urlRegexp", - orderDir: "asc", - searchTerm: request.searchTerm, - }); - return new ListBlockedRepositoriesResponse({ - blockedRepositories: info.rows.map((item) => converter.toBlockedRepository(item)), - pagination: new PaginationResponse(), - }); - } - - async createBlockedRepository( - request: PartialMessage, - _options?: CallOptions | undefined, - ): Promise { - if (!request.urlRegexp) { - throw new ApplicationError(ErrorCodes.BAD_REQUEST, "urlRegexp is required"); - } - if (!request.blockUser) { - throw new ApplicationError(ErrorCodes.BAD_REQUEST, "blockUser is required"); - } - const info = await getGitpodService().server.adminCreateBlockedRepository(request.urlRegexp, request.blockUser); - return new CreateBlockedRepositoryResponse({ - blockedRepository: converter.toBlockedRepository(info), - }); - } - - async deleteBlockedRepository( - request: PartialMessage, - _options?: CallOptions | undefined, - ): Promise { - if (!request.blockedRepositoryId) { - throw new ApplicationError(ErrorCodes.BAD_REQUEST, "blockedRepositoryId is required"); - } - await getGitpodService().server.adminDeleteBlockedRepository(request.blockedRepositoryId); - return new DeleteBlockedRepositoryResponse(); - } - - async listBlockedEmailDomains( - request: PartialMessage, - _options?: CallOptions | undefined, - ): Promise { - const info = await getGitpodService().server.adminGetBlockedEmailDomains(); - return new ListBlockedEmailDomainsResponse({ - blockedEmailDomains: info.map((item) => converter.toBlockedEmailDomain(item)), - pagination: new PaginationResponse(), - }); - } - - async createBlockedEmailDomain( - request: PartialMessage, - _options?: CallOptions | undefined, - ): Promise { - if (!request.domain) { - throw new ApplicationError(ErrorCodes.BAD_REQUEST, "domain is required"); - } - if (request.negative === undefined) { - throw new ApplicationError(ErrorCodes.BAD_REQUEST, "negative is required"); - } - await getGitpodService().server.adminSaveBlockedEmailDomain({ - domain: request.domain, - negative: request.negative, - }); - // There's no way to get blockedEmailDomain, just ignore it since dashboard don't care about the response data - return new CreateBlockedEmailDomainResponse({}); - } } diff --git a/components/gitpod-db/src/email-domain-filter-db.ts b/components/gitpod-db/src/email-domain-filter-db.ts index e9962d0daa6ed3..e4f245f4669f3e 100644 --- a/components/gitpod-db/src/email-domain-filter-db.ts +++ b/components/gitpod-db/src/email-domain-filter-db.ts @@ -8,7 +8,7 @@ import { EmailDomainFilterEntry } from "@gitpod/gitpod-protocol"; export const EmailDomainFilterDB = Symbol("EmailDomainFilterDB"); export interface EmailDomainFilterDB { - storeFilterEntry(entry: EmailDomainFilterEntry): Promise; + storeFilterEntry(entry: EmailDomainFilterEntry): Promise; getFilterEntries(): Promise; /** diff --git a/components/gitpod-db/src/typeorm/email-domain-filter-db-impl.ts b/components/gitpod-db/src/typeorm/email-domain-filter-db-impl.ts index 2d2eff2310f353..ba7d70b5b34229 100644 --- a/components/gitpod-db/src/typeorm/email-domain-filter-db-impl.ts +++ b/components/gitpod-db/src/typeorm/email-domain-filter-db-impl.ts @@ -24,9 +24,9 @@ export class EmailDomainFilterDBImpl implements EmailDomainFilterDB { return (await this.getManager()).getRepository(DBEmailDomainFilterEntry); } - async storeFilterEntry(entry: EmailDomainFilterEntry): Promise { + async storeFilterEntry(entry: EmailDomainFilterEntry): Promise { const repo = await this.getRepo(); - return await repo.save(entry); + await repo.save(entry); } async getFilterEntries(): Promise { diff --git a/components/gitpod-protocol/src/public-api-converter.spec.ts b/components/gitpod-protocol/src/public-api-converter.spec.ts index e96d7234a34892..3aefe7ec26c5c6 100644 --- a/components/gitpod-protocol/src/public-api-converter.spec.ts +++ b/components/gitpod-protocol/src/public-api-converter.spec.ts @@ -25,7 +25,6 @@ import { import { AuthProviderEntry, AuthProviderInfo, - EmailDomainFilterEntry, ProjectEnvVar, SuggestedRepository, Token, @@ -65,7 +64,6 @@ import { TooManyRunningWorkspacesError, } from "@gitpod/public-api/lib/gitpod/v1/error_pb"; import { SSHPublicKey } from "@gitpod/public-api/lib/gitpod/v1/ssh_pb"; -import { BlockedRepository as ProtocolBlockedRepository } from "./blocked-repositories-protocol"; describe("PublicAPIConverter", () => { const converter = new PublicAPIConverter(); @@ -985,40 +983,6 @@ describe("PublicAPIConverter", () => { }); }); - describe("toBlockedRepository", () => { - it("should convert a token", () => { - const t1 = new Date(); - const t2 = new Date(); - const repo: ProtocolBlockedRepository = { - id: 2023, - urlRegexp: "*/*", - blockUser: false, - createdAt: t1.toISOString(), - updatedAt: t2.toISOString(), - }; - expect(converter.toBlockedRepository(repo).toJson()).to.deep.equal({ - id: 2023, - blockUser: false, - name: "*/*", - creationTime: t1.toISOString(), - updateTime: t2.toISOString(), - }); - }); - }); - - describe("toBlockedEmailDomain", () => { - it("should convert a token", () => { - const item: EmailDomainFilterEntry = { - domain: "example.com", - negative: false, - }; - expect(converter.toBlockedEmailDomain(item).toJson()).to.deep.equal({ - domain: "example.com", - negative: false, - }); - }); - }); - describe("toSCMToken", () => { it("should convert a token", () => { const t1 = new Date(); diff --git a/components/gitpod-protocol/src/public-api-converter.ts b/components/gitpod-protocol/src/public-api-converter.ts index ed2e71d065bd5e..b5f81e51321bd5 100644 --- a/components/gitpod-protocol/src/public-api-converter.ts +++ b/components/gitpod-protocol/src/public-api-converter.ts @@ -51,7 +51,6 @@ import { WorkspacePort_Protocol, WorkspaceStatus, } from "@gitpod/public-api/lib/gitpod/v1/workspace_pb"; -import { BlockedEmailDomain, BlockedRepository } from "@gitpod/public-api/lib/gitpod/v1/verification_pb"; import { SSHPublicKey } from "@gitpod/public-api/lib/gitpod/v1/ssh_pb"; import { ConfigurationEnvironmentVariable, @@ -90,7 +89,6 @@ import { Token, SuggestedRepository as SuggestedRepositoryProtocol, UserSSHPublicKeyValue, - EmailDomainFilterEntry, } from "./protocol"; import { OrgMemberInfo, @@ -111,7 +109,6 @@ import { } from "./workspace-instance"; import { Author, Commit } from "@gitpod/public-api/lib/gitpod/v1/scm_pb"; import type { DeepPartial } from "./util/deep-partial"; -import { BlockedRepository as ProtocolBlockedRepository } from "./blocked-repositories-protocol"; export type PartialConfiguration = DeepPartial & Pick; @@ -882,24 +879,6 @@ export class PublicAPIConverter { return PrebuildPhase_Phase.UNSPECIFIED; } - toBlockedRepository(repo: ProtocolBlockedRepository): BlockedRepository { - return new BlockedRepository({ - id: repo.id, - urlRegexp: repo.urlRegexp, - blockUser: repo.blockUser, - creationTime: Timestamp.fromDate(new Date(repo.createdAt)), - updateTime: Timestamp.fromDate(new Date(repo.updatedAt)), - }); - } - - toBlockedEmailDomain(item: EmailDomainFilterEntry): BlockedEmailDomain { - return new BlockedEmailDomain({ - id: "", - domain: item.domain, - negative: item.negative, - }); - } - toSCMToken(t: Token): SCMToken { return new SCMToken({ username: t.username, diff --git a/components/server/src/api/sorting.ts b/components/server/src/api/sorting.ts deleted file mode 100644 index 7b514dae53a15a..00000000000000 --- a/components/server/src/api/sorting.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Copyright (c) 2023 Gitpod GmbH. All rights reserved. - * Licensed under the GNU Affero General Public License (AGPL). - * See License.AGPL.txt in the project root for license information. - */ - -import { ApplicationError, ErrorCodes } from "@gitpod/gitpod-protocol/lib/messaging/error"; -import { Sort, SortOrder } from "@gitpod/public-api/lib/gitpod/v1/sorting_pb"; - -export type Sorting = { - orderBy: string; - orderDir: "asc" | "desc"; -}; - -export function parseSorting( - sortList?: Sort[], - opts?: { allowFields: string[]; defaultField?: string }, -): Sorting | undefined { - const defaultResult: Sorting | undefined = opts?.defaultField - ? { orderBy: opts.defaultField, orderDir: "asc" } - : undefined; - if (!sortList || (sortList?.length ?? 0) === 0) { - return defaultResult; - } - - // grab the first sort entry - only 1 supported here - const sort = sortList[0]; - if (!sort) { - return defaultResult; - } - // defaults to urlRegexp - const orderBy = sort.field || opts?.defaultField; - if (!orderBy) { - return defaultResult; - } - if (opts?.allowFields && !opts.allowFields.includes(orderBy)) { - throw new ApplicationError( - ErrorCodes.BAD_REQUEST, - `orderBy must be one of ${opts.allowFields.map((f) => "'" + f + "'").join(" or ")}`, - ); - } - // defaults to ascending - const orderDir: "asc" | "desc" = (sort.order || SortOrder.ASC) === SortOrder.DESC ? "desc" : "asc"; - - return { orderBy, orderDir }; -} diff --git a/components/server/src/api/verification-service-api.ts b/components/server/src/api/verification-service-api.ts index c487d200d3ccbe..89e98618d4b8c0 100644 --- a/components/server/src/api/verification-service-api.ts +++ b/components/server/src/api/verification-service-api.ts @@ -8,16 +8,6 @@ import { HandlerContext, ServiceImpl } from "@connectrpc/connect"; import { ApplicationError, ErrorCodes } from "@gitpod/gitpod-protocol/lib/messaging/error"; import { VerificationService as VerificationServiceInterface } from "@gitpod/public-api/lib/gitpod/v1/verification_connect"; import { - CreateBlockedEmailDomainRequest, - CreateBlockedEmailDomainResponse, - CreateBlockedRepositoryRequest, - CreateBlockedRepositoryResponse, - DeleteBlockedRepositoryRequest, - DeleteBlockedRepositoryResponse, - ListBlockedEmailDomainsRequest, - ListBlockedEmailDomainsResponse, - ListBlockedRepositoriesRequest, - ListBlockedRepositoriesResponse, SendPhoneNumberVerificationTokenRequest, SendPhoneNumberVerificationTokenResponse, VerifyPhoneNumberVerificationTokenRequest, @@ -31,10 +21,6 @@ import { UserService } from "../user/user-service"; import { formatPhoneNumber } from "../user/phone-numbers"; import { validate as uuidValidate } from "uuid"; import { UserDB } from "@gitpod/gitpod-db/lib"; -import { PaginationToken, generatePaginationToken, parsePaginationToken } from "./pagination"; -import { parseSorting } from "./sorting"; -import { PaginationResponse } from "@gitpod/public-api/lib/gitpod/v1/pagination_pb"; -import { PublicAPIConverter } from "@gitpod/gitpod-protocol/lib/public-api-converter"; @injectable() export class VerificationServiceAPI implements ServiceImpl { @@ -42,8 +28,6 @@ export class VerificationServiceAPI implements ServiceImpl { - const paginationToken = parsePaginationToken(req.pagination?.token); - - const sorting = parseSorting(req.sort, { - allowFields: ["urlRegexp"], - defaultField: "urlRegexp", - })!; - const limit = req.pagination?.pageSize ?? 50; - const data = await this.verificationService.adminGetBlockedRepositories(ctxUserId(), { - offset: paginationToken.offset, - // We request 1 additional record to help determine if there are more results - limit: limit + 1, - orderBy: sorting.orderBy as any, - orderDir: sorting.orderDir, - searchTerm: req.searchTerm, - }); - - // Drop the extra record we requested to determine if there are more results - const pagedRows = data.rows.slice(0, limit); - - const response = new ListBlockedRepositoriesResponse({ - blockedRepositories: pagedRows.map((blockedRepository) => - this.apiConverter.toBlockedRepository(blockedRepository), - ), - }); - response.pagination = new PaginationResponse(); - if (data.rows.length > limit) { - const nextToken: PaginationToken = { - offset: paginationToken.offset + limit, - }; - response.pagination.nextToken = generatePaginationToken(nextToken); - } - return response; - } - - async createBlockedRepository( - req: CreateBlockedRepositoryRequest, - _: HandlerContext, - ): Promise { - if (!req.urlRegexp) { - throw new ApplicationError(ErrorCodes.BAD_REQUEST, "urlRegexp is required"); - } - const blockedRepository = await this.verificationService.adminCreateBlockedRepository(ctxUserId(), { - urlRegexp: req.urlRegexp, - blockUser: req.blockUser ?? false, - }); - return new CreateBlockedRepositoryResponse({ - blockedRepository: this.apiConverter.toBlockedRepository(blockedRepository), - }); - } - - async deleteBlockedRepository( - req: DeleteBlockedRepositoryRequest, - _: HandlerContext, - ): Promise { - if (!req.blockedRepositoryId) { - throw new ApplicationError(ErrorCodes.BAD_REQUEST, "blockedRepositoryId is required"); - } - await this.verificationService.adminDeleteBlockedRepository(ctxUserId(), req.blockedRepositoryId); - return new DeleteBlockedRepositoryResponse(); - } - - async listBlockedEmailDomains( - req: ListBlockedEmailDomainsRequest, - _: HandlerContext, - ): Promise { - const list = await this.verificationService.adminGetBlockedEmailDomains(ctxUserId()); - return new ListBlockedEmailDomainsResponse({ - blockedEmailDomains: list.map((item) => this.apiConverter.toBlockedEmailDomain(item)), - pagination: new PaginationResponse(), - }); - } - - async createBlockedEmailDomain( - req: CreateBlockedEmailDomainRequest, - _: HandlerContext, - ): Promise { - if (!req.domain) { - throw new ApplicationError(ErrorCodes.BAD_REQUEST, "domain is required"); - } - if (req.negative === undefined) { - throw new ApplicationError(ErrorCodes.BAD_REQUEST, "negative is required"); - } - const data = await this.verificationService.adminCreateBlockedEmailDomain(ctxUserId(), { - domain: req.domain, - negative: req.negative, - }); - return new CreateBlockedEmailDomainResponse({ - blockedEmailDomain: this.apiConverter.toBlockedEmailDomain(data), - }); - } } diff --git a/components/server/src/auth/verification-service.ts b/components/server/src/auth/verification-service.ts index 8b1b91ececb34c..89da013b60f002 100644 --- a/components/server/src/auth/verification-service.ts +++ b/components/server/src/auth/verification-service.ts @@ -18,6 +18,8 @@ import { getExperimentsClientForBackend } from "@gitpod/gitpod-protocol/lib/expe import { BlockedRepository } from "@gitpod/gitpod-protocol/lib/blocked-repositories-protocol"; import { Authorizer } from "../authorization/authorizer"; import { BlockedRepositoryDB } from "@gitpod/gitpod-db/lib/blocked-repository-db"; +import { IAnalyticsWriter } from "@gitpod/gitpod-protocol/lib/analytics"; +import { UserService } from "../user/user-service"; @injectable() export class VerificationService { @@ -28,6 +30,8 @@ export class VerificationService { @inject(Authorizer) private readonly auth: Authorizer; @inject(BlockedRepositoryDB) private readonly blockedRepositoryDB: BlockedRepositoryDB; @inject(EmailDomainFilterDB) private readonly emailDomainFilterDB: EmailDomainFilterDB; + @inject(IAnalyticsWriter) private readonly analytics: IAnalyticsWriter; + @inject(UserService) private readonly userService: UserService; protected verifyService: ServiceContext; @@ -60,29 +64,16 @@ export class VerificationService { return isPhoneVerificationEnabled; } - public markVerified(user: User): User { - user.lastVerificationTime = new Date().toISOString(); - return user; - } - public async verifyOrgMembers(organizationId: string): Promise { const members = await this.teamDB.findMembersByTeam(organizationId); for (const member of members) { const user = await this.userDB.findUserById(member.userId); - if (user) { - await this.verifyUser(user); + if (user && (await this.needsVerification(user))) { + await this.userService.markUserAsVerified(user, undefined); } } } - public async verifyUser(user: User): Promise { - if (await this.needsVerification(user)) { - user = await this.userDB.storeUser(this.markVerified(user)); - log.info("User verified", { userId: user.id }); - } - return user; - } - public async sendVerificationToken( phoneNumber: string, channel: "sms" | "call" = "sms", @@ -134,10 +125,11 @@ export class VerificationService { } public async verifyVerificationToken( + user: User, phoneNumber: string, oneTimePassword: string, verificationId: string, - ): Promise<{ verified: boolean; channel: string }> { + ): Promise { if (!this.verifyService) { throw new Error("No verification service configured."); } @@ -157,10 +149,29 @@ export class VerificationService { channel: verification_check.channel, }); - return { - verified: verification_check.status === "approved", - channel: verification_check.channel, - }; + const verified = verification_check.status === "approved"; + if (verified) { + await this.userService.markUserAsVerified(user, phoneNumber); + this.analytics.track({ + event: "phone_verification_completed", + userId: user.id, + properties: { + channel: verification_check.channel, + verification_id: verificationId, + }, + }); + } else { + this.analytics.track({ + event: "phone_verification_failed", + userId: user.id, + properties: { + channel: verification_check.channel, + verification_id: verificationId, + }, + }); + } + + return verified; } public async adminGetBlockedRepositories( diff --git a/components/server/src/user/user-service.ts b/components/server/src/user/user-service.ts index 7ee6c97e757493..d83c917854c719 100644 --- a/components/server/src/user/user-service.ts +++ b/components/server/src/user/user-service.ts @@ -302,4 +302,13 @@ export class UserService { }, }); } + + public async markUserAsVerified(user: User, phoneNumber: string | undefined) { + user.lastVerificationTime = new Date().toISOString(); + if (phoneNumber) { + user.verificationPhoneNumber = phoneNumber; + } + await this.userDb.updateUserPartial(user); + log.info("User verified", { userId: user.id }); + } } diff --git a/components/server/src/workspace/gitpod-server-impl.ts b/components/server/src/workspace/gitpod-server-impl.ts index 0ad1bc528cfd91..edf729df4400c1 100644 --- a/components/server/src/workspace/gitpod-server-impl.ts +++ b/components/server/src/workspace/gitpod-server-impl.ts @@ -4,7 +4,16 @@ * See License.AGPL.txt in the project root for license information. */ -import { UserDB, WorkspaceDB, DBWithTracing, TracedWorkspaceDB, TeamDB, DBGitpodToken } from "@gitpod/gitpod-db/lib"; +import { + UserDB, + WorkspaceDB, + DBWithTracing, + TracedWorkspaceDB, + EmailDomainFilterDB, + TeamDB, + DBGitpodToken, +} from "@gitpod/gitpod-db/lib"; +import { BlockedRepositoryDB } from "@gitpod/gitpod-db/lib/blocked-repository-db"; import { AuthProviderEntry, AuthProviderInfo, @@ -170,6 +179,7 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { private readonly workspaceManagerClientProvider: WorkspaceManagerClientProvider, @inject(UserDB) private readonly userDB: UserDB, + @inject(BlockedRepositoryDB) private readonly blockedRepostoryDB: BlockedRepositoryDB, @inject(UserAuthentication) private readonly userAuthentication: UserAuthentication, @inject(UserService) private readonly userService: UserService, @inject(IAnalyticsWriter) private readonly analytics: IAnalyticsWriter, @@ -199,6 +209,7 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { @inject(StripeService) private readonly stripeService: StripeService, @inject(UsageService) private readonly usageService: UsageService, @inject(BillingServiceDefinition.name) private readonly billingService: BillingServiceClient, + @inject(EmailDomainFilterDB) private emailDomainFilterdb: EmailDomainFilterDB, @inject(RedisSubscriber) private readonly subscriber: RedisSubscriber, @@ -491,34 +502,7 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { const phoneNumber = formatPhoneNumber(rawPhoneNumber); const user = await this.checkUser("verifyPhoneNumberVerificationToken"); - const { verified, channel } = await this.verificationService.verifyVerificationToken( - phoneNumber, - token, - verificationId, - ); - if (!verified) { - this.analytics.track({ - event: "phone_verification_failed", - userId: user.id, - properties: { - channel, - verification_id: verificationId, - }, - }); - return false; - } - this.verificationService.markVerified(user); - user.verificationPhoneNumber = phoneNumber; - await this.userDB.updateUserPartial(user); - this.analytics.track({ - event: "phone_verification_completed", - userId: user.id, - properties: { - channel, - verification_id: verificationId, - }, - }); - return true; + return await this.verificationService.verifyVerificationToken(user, phoneNumber, token, verificationId); } public async getClientRegion(ctx: TraceContext): Promise { @@ -1547,7 +1531,7 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { AttributionId.render({ kind: "team", teamId: org.id }), )) !== undefined ) { - await this.verificationService.verifyUser(user); + await this.userService.markUserAsVerified(user, undefined); } } catch (e) { log.warn("Failed to verify new org member", e); @@ -1880,7 +1864,14 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { await this.auth.checkPermissionOnInstallation(admin.id, "configure"); try { - return await this.verificationService.adminGetBlockedRepositories(admin.id, req); + const res = await this.blockedRepostoryDB.findAllBlockedRepositories( + req.offset, + req.limit, + req.orderBy, + req.orderDir === "asc" ? "ASC" : "DESC", + req.searchTerm, + ); + return res; } catch (e) { throw new ApplicationError(ErrorCodes.INTERNAL_SERVER_ERROR, String(e)); } @@ -1900,10 +1891,7 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { ); await this.auth.checkPermissionOnInstallation(admin.id, "configure"); - return await this.verificationService.adminCreateBlockedRepository(admin.id, { - urlRegexp, - blockUser, - }); + return await this.blockedRepostoryDB.createBlockedRepository(urlRegexp, blockUser); } async adminDeleteBlockedRepository(ctx: TraceContext, id: number): Promise { @@ -1912,7 +1900,7 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { const admin = await this.guardAdminAccess("adminDeleteBlockedRepository", { id }, Permission.ADMIN_USERS); await this.auth.checkPermissionOnInstallation(admin.id, "configure"); - await this.verificationService.adminDeleteBlockedRepository(admin.id, id); + await this.blockedRepostoryDB.deleteBlockedRepository(id); } async adminBlockUser(ctx: TraceContext, req: AdminBlockUserRequest): Promise { @@ -1950,9 +1938,7 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { const admin = await this.guardAdminAccess("adminVerifyUser", { id: userId }, Permission.ADMIN_USERS); await this.auth.checkPermissionOnUser(admin.id, "admin_control", userId); const user = await this.userService.findUserById(admin.id, userId); - - this.verificationService.markVerified(user); - await this.userDB.updateUserPartial(user); + await this.userService.markUserAsVerified(user, undefined); return user; } @@ -2973,7 +2959,7 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { const user = await this.checkAndBlockUser("adminGetBlockedEmailDomains"); await this.guardAdminAccess("adminGetBlockedEmailDomains", { id: user.id }, Permission.ADMIN_USERS); await this.auth.checkPermissionOnInstallation(user.id, "configure"); - return this.verificationService.adminGetBlockedEmailDomains(user.id); + return await this.emailDomainFilterdb.getFilterEntries(); } async adminSaveBlockedEmailDomain( @@ -2983,6 +2969,6 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { const user = await this.checkAndBlockUser("adminSaveBlockedEmailDomain"); await this.guardAdminAccess("adminSaveBlockedEmailDomain", { id: user.id }, Permission.ADMIN_USERS); await this.auth.checkPermissionOnInstallation(user.id, "configure"); - await this.verificationService.adminCreateBlockedEmailDomain(user.id, domainFilterentry); + await this.emailDomainFilterdb.storeFilterEntry(domainFilterentry); } } From bcea33983e0cb78969d3c7ca3cb1cd25291a6f93 Mon Sep 17 00:00:00 2001 From: Jean Pierre Huaroto Date: Mon, 27 Nov 2023 21:34:33 +0000 Subject: [PATCH 08/10] :lipstick: --- .../src/api/verification-service-api.ts | 2 - .../server/src/auth/verification-service.ts | 51 +------------------ 2 files changed, 2 insertions(+), 51 deletions(-) diff --git a/components/server/src/api/verification-service-api.ts b/components/server/src/api/verification-service-api.ts index 89e98618d4b8c0..cd4eb54269d105 100644 --- a/components/server/src/api/verification-service-api.ts +++ b/components/server/src/api/verification-service-api.ts @@ -20,13 +20,11 @@ import { ctxUserId } from "../util/request-context"; import { UserService } from "../user/user-service"; import { formatPhoneNumber } from "../user/phone-numbers"; import { validate as uuidValidate } from "uuid"; -import { UserDB } from "@gitpod/gitpod-db/lib"; @injectable() export class VerificationServiceAPI implements ServiceImpl { @inject(VerificationService) private readonly verificationService: VerificationService; @inject(UserService) private readonly userService: UserService; - @inject(UserDB) private readonly userDB: UserDB; async sendPhoneNumberVerificationToken( req: SendPhoneNumberVerificationTokenRequest, diff --git a/components/server/src/auth/verification-service.ts b/components/server/src/auth/verification-service.ts index 89da013b60f002..36335ab65a1428 100644 --- a/components/server/src/auth/verification-service.ts +++ b/components/server/src/auth/verification-service.ts @@ -4,20 +4,17 @@ * See License.AGPL.txt in the project root for license information. */ -import { AdminGetListRequest, AdminGetListResult, EmailDomainFilterEntry, User } from "@gitpod/gitpod-protocol"; +import { User } from "@gitpod/gitpod-protocol"; import { log } from "@gitpod/gitpod-protocol/lib/util/logging"; import { inject, injectable, postConstruct } from "inversify"; import { Config } from "../config"; import { Twilio } from "twilio"; import { ServiceContext } from "twilio/lib/rest/verify/v2/service"; -import { EmailDomainFilterDB, TeamDB, UserDB, WorkspaceDB } from "@gitpod/gitpod-db/lib"; +import { TeamDB, UserDB, WorkspaceDB } from "@gitpod/gitpod-db/lib"; import { ErrorCodes, ApplicationError } from "@gitpod/gitpod-protocol/lib/messaging/error"; import { VerificationInstance } from "twilio/lib/rest/verify/v2/service/verification"; import { v4 as uuidv4, validate as uuidValidate } from "uuid"; import { getExperimentsClientForBackend } from "@gitpod/gitpod-protocol/lib/experiments/configcat-server"; -import { BlockedRepository } from "@gitpod/gitpod-protocol/lib/blocked-repositories-protocol"; -import { Authorizer } from "../authorization/authorizer"; -import { BlockedRepositoryDB } from "@gitpod/gitpod-db/lib/blocked-repository-db"; import { IAnalyticsWriter } from "@gitpod/gitpod-protocol/lib/analytics"; import { UserService } from "../user/user-service"; @@ -27,9 +24,6 @@ export class VerificationService { @inject(WorkspaceDB) protected workspaceDB: WorkspaceDB; @inject(UserDB) protected userDB: UserDB; @inject(TeamDB) protected teamDB: TeamDB; - @inject(Authorizer) private readonly auth: Authorizer; - @inject(BlockedRepositoryDB) private readonly blockedRepositoryDB: BlockedRepositoryDB; - @inject(EmailDomainFilterDB) private readonly emailDomainFilterDB: EmailDomainFilterDB; @inject(IAnalyticsWriter) private readonly analytics: IAnalyticsWriter; @inject(UserService) private readonly userService: UserService; @@ -173,45 +167,4 @@ export class VerificationService { return verified; } - - public async adminGetBlockedRepositories( - userId: string, - opts: AdminGetListRequest, - ): Promise> { - await this.auth.checkPermissionOnInstallation(userId, "configure"); - const results = await this.blockedRepositoryDB.findAllBlockedRepositories( - opts.offset, - opts.limit, - opts.orderBy, - opts.orderDir === "asc" ? "ASC" : "DESC", - opts.searchTerm, - ); - return results; - } - - public async adminCreateBlockedRepository( - userId: string, - opts: Pick, - ): Promise { - await this.auth.checkPermissionOnInstallation(userId, "configure"); - return this.blockedRepositoryDB.createBlockedRepository(opts.urlRegexp, opts.blockUser); - } - - public async adminDeleteBlockedRepository(userId: string, blockedRepositoryId: number): Promise { - await this.auth.checkPermissionOnInstallation(userId, "configure"); - return this.blockedRepositoryDB.deleteBlockedRepository(blockedRepositoryId); - } - - public async adminGetBlockedEmailDomains(userId: string): Promise { - await this.auth.checkPermissionOnInstallation(userId, "configure"); - return this.emailDomainFilterDB.getFilterEntries(); - } - - public async adminCreateBlockedEmailDomain( - userId: string, - opts: EmailDomainFilterEntry, - ): Promise { - await this.auth.checkPermissionOnInstallation(userId, "configure"); - return this.emailDomainFilterDB.storeFilterEntry(opts); - } } From 360b310b5a5e3c1975c427a2bed09d7872314484 Mon Sep 17 00:00:00 2001 From: Jean Pierre Huaroto Date: Mon, 27 Nov 2023 22:16:17 +0000 Subject: [PATCH 09/10] :lipstick: --- components/server/src/auth/generic-auth-provider.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/server/src/auth/generic-auth-provider.ts b/components/server/src/auth/generic-auth-provider.ts index 30270b95b89ce2..d7e62fe333d614 100644 --- a/components/server/src/auth/generic-auth-provider.ts +++ b/components/server/src/auth/generic-auth-provider.ts @@ -489,7 +489,8 @@ export abstract class GenericAuthProvider implements AuthProvider { isDateSmaller(authUser.created_at, daysBefore(new Date().toISOString(), 30)) ) { // people with an account older than 30 days are treated as trusted - this.verificationService.markVerified(newUser); + // see this.userService.markUserAsVerified + user.lastVerificationTime = new Date().toISOString(); } }, }); From 01196ecc9fe75270c08b7a35afdeb86932c1ccf6 Mon Sep 17 00:00:00 2001 From: Sven Efftinge Date: Tue, 28 Nov 2023 15:34:09 +0000 Subject: [PATCH 10/10] [verificationservice] added mock impl for previews --- .../src/api/verification-service-api.ts | 2 +- .../server/src/auth/generic-auth-provider.ts | 3 +- .../server/src/auth/verification-service.ts | 172 +++++++++++------- .../src/workspace/gitpod-server-impl.ts | 12 +- 4 files changed, 115 insertions(+), 74 deletions(-) diff --git a/components/server/src/api/verification-service-api.ts b/components/server/src/api/verification-service-api.ts index cd4eb54269d105..1f88b6044d56ce 100644 --- a/components/server/src/api/verification-service-api.ts +++ b/components/server/src/api/verification-service-api.ts @@ -46,7 +46,7 @@ export class VerificationServiceAPI implements ServiceImpl; + verifyToken(phoneNumber: string, oneTimePassword: string, verificationId: string): Promise; +} - protected verifyService: ServiceContext; +class TwilioVerificationEndpoint implements VerificationEndpoint { + constructor(private readonly config: Config) {} - @postConstruct() - protected initialize(): void { - if (this.config.twilioConfig) { + private _twilioService: ServiceContext; + private get twilioService(): ServiceContext { + if (!this._twilioService && this.config.twilioConfig) { const client = new Twilio(this.config.twilioConfig.accountSID, this.config.twilioConfig.authToken); - this.verifyService = client.verify.v2.services(this.config.twilioConfig.serviceID); + this._twilioService = client.verify.v2.services(this.config.twilioConfig.serviceID); + } + return this._twilioService; + } + + public async sendToken(phoneNumber: string, channel: "sms" | "call"): Promise { + if (!this.twilioService) { + throw new Error("No verification service configured."); + } + const verification = await this.twilioService.verifications.create({ to: phoneNumber, channel }); + + // Create a unique id to correlate starting/completing of verification flow + // Clients receive this and send it back when they call send the verification code + const verificationId = uuidv4(); + + log.info("Verification code sent", { + verificationId, + phoneNumber, + status: verification.status, + // actual channel verification was created on + channel: verification.channel, + // channel we requested - these could differ if a channel is not enabled in a specific country + requestedChannel: channel, + }); + + // Help us identify if verification codes are not able to send via requested channel + if (channel !== verification.channel) { + log.info("Verification code sent via different channel than system requested", { + verificationId, + phoneNumber, + status: verification.status, + // actual channel verification was created on + channel: verification.channel, + // channel we requested - these could differ if a channel is not enabled in a specific country + requestedChannel: channel, + }); + } + return verificationId; + } + public async verifyToken(phoneNumber: string, oneTimePassword: string, verificationId: string): Promise { + const verification_check = await this.twilioService.verificationChecks.create({ + to: phoneNumber, + code: oneTimePassword, + }); + + log.info("Verification code checked", { + verificationId, + phoneNumber, + status: verification_check.status, + channel: verification_check.channel, + }); + + return verification_check.status === "approved"; + } +} + +class MockVerificationEndpoint implements VerificationEndpoint { + private verificationId = uuidv4(); + + public async sendToken(phoneNumber: string, channel: "sms" | "call"): Promise { + return this.verificationId; + } + + public async verifyToken(phoneNumber: string, oneTimePassword: string, verificationId: string): Promise { + if (verificationId !== this.verificationId) { + return false; } + return oneTimePassword === "123456"; } +} + +@injectable() +export class VerificationService { + constructor( + @inject(Config) private config: Config, + @inject(UserDB) private userDB: UserDB, + @inject(TeamDB) private teamDB: TeamDB, + @inject(IAnalyticsWriter) private readonly analytics: IAnalyticsWriter, + @inject(UserService) private readonly userService: UserService, + ) { + if (this.config.twilioConfig) { + this.verifyService = new TwilioVerificationEndpoint(this.config); + } else if (this.config.devBranch && !this.config.isSingleOrgInstallation) { + // preview environments get the mock verification endpoint + this.verifyService = new MockVerificationEndpoint(); + } + } + + private verifyService?: VerificationEndpoint; public async needsVerification(user: User): Promise { - if (!this.config.twilioConfig) { + if (!this.verifyService) { return false; } if (!!user.lastVerificationTime) { @@ -69,9 +151,10 @@ export class VerificationService { } public async sendVerificationToken( + userId: string, phoneNumber: string, channel: "sms" | "call" = "sms", - ): Promise<{ verification: VerificationInstance; verificationId: string }> { + ): Promise { if (!this.verifyService) { throw new ApplicationError(ErrorCodes.INTERNAL_SERVER_ERROR, "No verification service configured."); } @@ -86,36 +169,17 @@ export class VerificationService { if (await isBlockedNumber) { throw new ApplicationError(ErrorCodes.INVALID_VALUE, "The given phone number is blocked due to abuse."); } - const verification = await this.verifyService.verifications.create({ to: phoneNumber, channel }); - - // Create a unique id to correlate starting/completing of verification flow - // Clients receive this and send it back when they call send the verification code - const verificationId = uuidv4(); - - log.info("Verification code sent", { - verificationId, - phoneNumber, - status: verification.status, - // actual channel verification was created on - channel: verification.channel, - // channel we requested - these could differ if a channel is not enabled in a specific country - requestedChannel: channel, + const verificationId = this.verifyService.sendToken(phoneNumber, channel); + this.analytics.track({ + event: "phone_verification_sent", + userId, + properties: { + verification_id: verificationId, + requested_channel: channel, + }, }); - // Help us identify if verification codes are not able to send via requested channel - if (channel !== verification.channel) { - log.info("Verification code sent via different channel than system requested", { - verificationId, - phoneNumber, - status: verification.status, - // actual channel verification was created on - channel: verification.channel, - // channel we requested - these could differ if a channel is not enabled in a specific country - requestedChannel: channel, - }); - } - - return { verification, verificationId }; + return verificationId; } public async verifyVerificationToken( @@ -131,26 +195,14 @@ export class VerificationService { throw new ApplicationError(ErrorCodes.BAD_REQUEST, "Verification ID must be a valid UUID"); } - const verification_check = await this.verifyService.verificationChecks.create({ - to: phoneNumber, - code: oneTimePassword, - }); - - log.info("Verification code checked", { - verificationId, - phoneNumber, - status: verification_check.status, - channel: verification_check.channel, - }); + const verified = await this.verifyService.verifyToken(phoneNumber, oneTimePassword, verificationId); - const verified = verification_check.status === "approved"; if (verified) { await this.userService.markUserAsVerified(user, phoneNumber); this.analytics.track({ event: "phone_verification_completed", userId: user.id, properties: { - channel: verification_check.channel, verification_id: verificationId, }, }); @@ -159,12 +211,10 @@ export class VerificationService { event: "phone_verification_failed", userId: user.id, properties: { - channel: verification_check.channel, verification_id: verificationId, }, }); } - return verified; } } diff --git a/components/server/src/workspace/gitpod-server-impl.ts b/components/server/src/workspace/gitpod-server-impl.ts index edf729df4400c1..7a579c6dfe79d4 100644 --- a/components/server/src/workspace/gitpod-server-impl.ts +++ b/components/server/src/workspace/gitpod-server-impl.ts @@ -474,19 +474,11 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { const channel = phoneVerificationByCall ? "call" : "sms"; - const { verification, verificationId } = await this.verificationService.sendVerificationToken( + const verificationId = await this.verificationService.sendVerificationToken( + user.id, formatPhoneNumber(rawPhoneNumber), channel, ); - this.analytics.track({ - event: "phone_verification_sent", - userId: user.id, - properties: { - verification_id: verificationId, - channel: verification.channel, - requested_channel: channel, - }, - }); return { verificationId,