diff --git a/components/dashboard/src/admin/BlockedEmailDomains.tsx b/components/dashboard/src/admin/BlockedEmailDomains.tsx index d664fa5c45572a..1c96a53dc37bde 100644 --- a/components/dashboard/src/admin/BlockedEmailDomains.tsx +++ b/components/dashboard/src/admin/BlockedEmailDomains.tsx @@ -13,10 +13,11 @@ 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 { installationClient } from "../service/public-api"; +import { ListBlockedEmailDomainsResponse } from "@gitpod/public-api/lib/gitpod/v1/installation_pb"; export function BlockedEmailDomains() { return ( @@ -27,7 +28,7 @@ export function BlockedEmailDomains() { } function useBlockedEmailDomains() { - return useQuery(["blockedEmailDomains"], () => getGitpodService().server.adminGetBlockedEmailDomains(), { + return useQuery(["blockedEmailDomains"], () => installationClient.listBlockedEmailDomains({}), { staleTime: 1000 * 60 * 5, // 5min }); } @@ -37,19 +38,21 @@ function useUpdateBlockedEmailDomainMutation() { const blockedEmailDomains = useBlockedEmailDomains(); return useMutation( async (blockedDomain: EmailDomainFilterEntry) => { - await getGitpodService().server.adminSaveBlockedEmailDomain(blockedDomain); + await installationClient.createBlockedEmailDomain({ + domain: blockedDomain.domain, + negative: blockedDomain.negative ?? false, + }); }, { onSuccess: (_, blockedDomain) => { - const updated = []; - for (const entry of blockedEmailDomains.data || []) { + const data = new ListBlockedEmailDomainsResponse(blockedEmailDomains.data); + data.blockedEmailDomains.map((entry) => { if (entry.domain !== blockedDomain.domain) { - updated.push(entry); - } else { - updated.push(blockedDomain); + return entry; } - } - queryClient.setQueryData(["blockedEmailDomains"], updated); + return blockedDomain; + }); + queryClient.setQueryData(["blockedEmailDomains"], data); blockedEmailDomains.refetch(); }, }, @@ -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..ee8e30c1c20ae8 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,9 @@ import Alert from "../components/Alert"; import { SpinnerLoader } from "../components/Loader"; import searchIcon from "../icons/search.svg"; import { Button } from "@podkit/buttons/Button"; +import { installationClient } 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/installation_pb"; export function BlockedRepositories() { return ( @@ -33,27 +33,40 @@ type ExistingBlockedRepository = Pick>({ rows: [], total: 0 }); + const [searchResult, setSearchResult] = useState( + new ListBlockedRepositoriesResponse({ + blockedRepositories: [], + }), + ); const [queryTerm, setQueryTerm] = useState(""); const [searching, setSearching] = useState(false); const [isAddModalVisible, setAddModalVisible] = useState(false); const [isDeleteModalVisible, setDeleteModalVisible] = useState(false); - const [currentBlockedRepository, setCurrentBlockedRepository] = useState({ - id: 0, - urlRegexp: "", - blockUser: false, - }); + const [currentBlockedRepository, setCurrentBlockedRepository] = useState( + new BlockedRepository({ + id: 0, + urlRegexp: "", + blockUser: false, + }), + ); const search = async () => { setSearching(true); try { - const result = await getGitpodService().server.adminGetBlockedRepositories({ - limit: 100, - orderBy: "urlRegexp", - offset: 0, - orderDir: "asc", + const result = await installationClient.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, + }), + ], searchTerm: queryTerm, }); setSearchResult(result); @@ -67,19 +80,21 @@ export function BlockedRepositoriesList(props: Props) { }, []); const add = () => { - setCurrentBlockedRepository({ - id: 0, - urlRegexp: "", - blockUser: false, - }); + setCurrentBlockedRepository( + new BlockedRepository({ + id: 0, + urlRegexp: "", + blockUser: false, + }), + ); setAddModalVisible(true); }; const save = async (blockedRepository: NewBlockedRepository) => { - await getGitpodService().server.adminCreateBlockedRepository( - blockedRepository.urlRegexp, - blockedRepository.blockUser, - ); + await installationClient.createBlockedRepository({ + urlRegexp: blockedRepository.urlRegexp ?? "", + blockUser: blockedRepository.blockUser ?? false, + }); setAddModalVisible(false); search(); }; @@ -91,11 +106,13 @@ export function BlockedRepositoriesList(props: Props) { }; const deleteBlockedRepository = async (blockedRepository: ExistingBlockedRepository) => { - await getGitpodService().server.adminDeleteBlockedRepository(blockedRepository.id); + await installationClient.deleteBlockedRepository({ + blockedRepositoryId: blockedRepository.id, + }); search(); }; - const confirmDeleteBlockedRepository = (blockedRepository: ExistingBlockedRepository) => { + const confirmDeleteBlockedRepository = (blockedRepository: BlockedRepository) => { setCurrentBlockedRepository(blockedRepository); setAddModalVisible(false); setDeleteModalVisible(true); @@ -158,7 +175,7 @@ export function BlockedRepositoriesList(props: Props) {
Block Users
- {searchResult.rows.map((br) => ( + {searchResult.blockedRepositories.map((br) => ( ))} diff --git a/components/dashboard/src/data/setup.tsx b/components/dashboard/src/data/setup.tsx index b023b6f6f0417d..0fe84690c9c5dd 100644 --- a/components/dashboard/src/data/setup.tsx +++ b/components/dashboard/src/data/setup.tsx @@ -25,13 +25,14 @@ import * as AuthProviderClasses from "@gitpod/public-api/lib/gitpod/v1/authprovi 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 InstallationClasses from "@gitpod/public-api/lib/gitpod/v1/installation_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 = "11"; +const CACHE_VERSION = "12"; export function noPersistence(queryKey: QueryKey): QueryKey { return [...queryKey, "no-persistence"]; @@ -154,6 +155,7 @@ function initializeMessages() { ...Object.values(EnvVarClasses), ...Object.values(PrebuildClasses), ...Object.values(VerificationClasses), + ...Object.values(InstallationClasses), ...Object.values(SCMClasses), ...Object.values(SSHClasses), ]; diff --git a/components/dashboard/src/service/json-rpc-installation-client.ts b/components/dashboard/src/service/json-rpc-installation-client.ts new file mode 100644 index 00000000000000..27bca1bd8a790d --- /dev/null +++ b/components/dashboard/src/service/json-rpc-installation-client.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. + */ + +import { CallOptions, PromiseClient } from "@connectrpc/connect"; +import { PartialMessage } from "@bufbuild/protobuf"; +import { InstallationService } from "@gitpod/public-api/lib/gitpod/v1/installation_connect"; +import { + ListBlockedRepositoriesRequest, + ListBlockedRepositoriesResponse, + CreateBlockedRepositoryRequest, + CreateBlockedRepositoryResponse, + DeleteBlockedRepositoryRequest, + DeleteBlockedRepositoryResponse, + ListBlockedEmailDomainsRequest, + ListBlockedEmailDomainsResponse, + CreateBlockedEmailDomainRequest, + CreateBlockedEmailDomainResponse, +} from "@gitpod/public-api/lib/gitpod/v1/installation_pb"; +import { ApplicationError, ErrorCodes } from "@gitpod/gitpod-protocol/lib/messaging/error"; +import { getGitpodService } from "./service"; +import { converter } from "./public-api"; +import { PaginationResponse } from "@gitpod/public-api/lib/gitpod/v1/pagination_pb"; + +export class JsonRpcInstallationClient implements PromiseClient { + 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 === undefined) { + 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 59f00913c942d6..a13866e9430b18 100644 --- a/components/dashboard/src/service/public-api.ts +++ b/components/dashboard/src/service/public-api.ts @@ -38,6 +38,8 @@ 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"; +import { JsonRpcInstallationClient } from "./json-rpc-installation-client"; +import { InstallationService } from "@gitpod/public-api/lib/gitpod/v1/installation_connect"; const transport = createConnectTransport({ baseUrl: `${window.location.protocol}//${window.location.host}/public-api`, @@ -66,6 +68,7 @@ export const organizationClient = createServiceClient(OrganizationService, { client: new JsonRpcOrganizationClient(), featureFlagSuffix: "organization", }); + // No jsonrcp client for the configuration service as it's only used in new UI of the dashboard export const configurationClient = createServiceClient(ConfigurationService); export const prebuildClient = createServiceClient(PrebuildService, { @@ -98,6 +101,11 @@ export const verificationClient = createServiceClient(VerificationService, { featureFlagSuffix: "verification", }); +export const installationClient = createServiceClient(InstallationService, { + client: new JsonRpcInstallationClient(), + featureFlagSuffix: "installation", +}); + 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/public-api/gitpod/v1/installation.proto b/components/public-api/gitpod/v1/installation.proto new file mode 100644 index 00000000000000..3b3761958ea5d1 --- /dev/null +++ b/components/public-api/gitpod/v1/installation.proto @@ -0,0 +1,117 @@ +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 InstallationService { + // 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) {} +} + +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/context.pb.go b/components/public-api/go/v1/context.pb.go deleted file mode 100644 index f5585f75096875..00000000000000 --- a/components/public-api/go/v1/context.pb.go +++ /dev/null @@ -1,305 +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. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc (unknown) -// source: gitpod/v1/context.proto - -package v1 - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - 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) -) - -type ParseContextRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` -} - -func (x *ParseContextRequest) Reset() { - *x = ParseContextRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_context_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ParseContextRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ParseContextRequest) ProtoMessage() {} - -func (x *ParseContextRequest) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_context_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 ParseContextRequest.ProtoReflect.Descriptor instead. -func (*ParseContextRequest) Descriptor() ([]byte, []int) { - return file_gitpod_v1_context_proto_rawDescGZIP(), []int{0} -} - -func (x *ParseContextRequest) GetUrl() string { - if x != nil { - return x.Url - } - return "" -} - -type ParseContextResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Context *Context `protobuf:"bytes,1,opt,name=context,proto3" json:"context,omitempty"` -} - -func (x *ParseContextResponse) Reset() { - *x = ParseContextResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_context_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ParseContextResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ParseContextResponse) ProtoMessage() {} - -func (x *ParseContextResponse) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_context_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 ParseContextResponse.ProtoReflect.Descriptor instead. -func (*ParseContextResponse) Descriptor() ([]byte, []int) { - return file_gitpod_v1_context_proto_rawDescGZIP(), []int{1} -} - -func (x *ParseContextResponse) GetContext() *Context { - if x != nil { - return x.Context - } - return nil -} - -type Context struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Title string `protobuf:"bytes,1,opt,name=title,proto3" json:"title,omitempty"` - NormalizedUrl string `protobuf:"bytes,2,opt,name=normalized_url,json=normalizedUrl,proto3" json:"normalized_url,omitempty"` - Ref string `protobuf:"bytes,3,opt,name=ref,proto3" json:"ref,omitempty"` -} - -func (x *Context) Reset() { - *x = Context{} - if protoimpl.UnsafeEnabled { - mi := &file_gitpod_v1_context_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Context) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Context) ProtoMessage() {} - -func (x *Context) ProtoReflect() protoreflect.Message { - mi := &file_gitpod_v1_context_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 Context.ProtoReflect.Descriptor instead. -func (*Context) Descriptor() ([]byte, []int) { - return file_gitpod_v1_context_proto_rawDescGZIP(), []int{2} -} - -func (x *Context) GetTitle() string { - if x != nil { - return x.Title - } - return "" -} - -func (x *Context) GetNormalizedUrl() string { - if x != nil { - return x.NormalizedUrl - } - return "" -} - -func (x *Context) GetRef() string { - if x != nil { - return x.Ref - } - return "" -} - -var File_gitpod_v1_context_proto protoreflect.FileDescriptor - -var file_gitpod_v1_context_proto_rawDesc = []byte{ - 0x0a, 0x17, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x74, - 0x65, 0x78, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x09, 0x67, 0x69, 0x74, 0x70, 0x6f, - 0x64, 0x2e, 0x76, 0x31, 0x22, 0x27, 0x0a, 0x13, 0x50, 0x61, 0x72, 0x73, 0x65, 0x43, 0x6f, 0x6e, - 0x74, 0x65, 0x78, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75, - 0x72, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x22, 0x44, 0x0a, - 0x14, 0x50, 0x61, 0x72, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, - 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, - 0x65, 0x78, 0x74, 0x22, 0x58, 0x0a, 0x07, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, 0x14, - 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, - 0x69, 0x74, 0x6c, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6e, 0x6f, 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, - 0x65, 0x64, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x6f, - 0x72, 0x6d, 0x61, 0x6c, 0x69, 0x7a, 0x65, 0x64, 0x55, 0x72, 0x6c, 0x12, 0x10, 0x0a, 0x03, 0x72, - 0x65, 0x66, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x72, 0x65, 0x66, 0x32, 0x63, 0x0a, - 0x0e, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, - 0x51, 0x0a, 0x0c, 0x50, 0x61, 0x72, 0x73, 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x12, - 0x1e, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x73, - 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1f, 0x2e, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x73, - 0x65, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x78, 0x74, 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_context_proto_rawDescOnce sync.Once - file_gitpod_v1_context_proto_rawDescData = file_gitpod_v1_context_proto_rawDesc -) - -func file_gitpod_v1_context_proto_rawDescGZIP() []byte { - file_gitpod_v1_context_proto_rawDescOnce.Do(func() { - file_gitpod_v1_context_proto_rawDescData = protoimpl.X.CompressGZIP(file_gitpod_v1_context_proto_rawDescData) - }) - return file_gitpod_v1_context_proto_rawDescData -} - -var file_gitpod_v1_context_proto_msgTypes = make([]protoimpl.MessageInfo, 3) -var file_gitpod_v1_context_proto_goTypes = []interface{}{ - (*ParseContextRequest)(nil), // 0: gitpod.v1.ParseContextRequest - (*ParseContextResponse)(nil), // 1: gitpod.v1.ParseContextResponse - (*Context)(nil), // 2: gitpod.v1.Context -} -var file_gitpod_v1_context_proto_depIdxs = []int32{ - 2, // 0: gitpod.v1.ParseContextResponse.context:type_name -> gitpod.v1.Context - 0, // 1: gitpod.v1.ContextService.ParseContext:input_type -> gitpod.v1.ParseContextRequest - 1, // 2: gitpod.v1.ContextService.ParseContext:output_type -> gitpod.v1.ParseContextResponse - 2, // [2:3] is the sub-list for method output_type - 1, // [1:2] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_gitpod_v1_context_proto_init() } -func file_gitpod_v1_context_proto_init() { - if File_gitpod_v1_context_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_gitpod_v1_context_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ParseContextRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gitpod_v1_context_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ParseContextResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gitpod_v1_context_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Context); 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_context_proto_rawDesc, - NumEnums: 0, - NumMessages: 3, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_gitpod_v1_context_proto_goTypes, - DependencyIndexes: file_gitpod_v1_context_proto_depIdxs, - MessageInfos: file_gitpod_v1_context_proto_msgTypes, - }.Build() - File_gitpod_v1_context_proto = out.File - file_gitpod_v1_context_proto_rawDesc = nil - file_gitpod_v1_context_proto_goTypes = nil - file_gitpod_v1_context_proto_depIdxs = nil -} diff --git a/components/public-api/go/v1/context_grpc.pb.go b/components/public-api/go/v1/context_grpc.pb.go deleted file mode 100644 index d0783796bcdacd..00000000000000 --- a/components/public-api/go/v1/context_grpc.pb.go +++ /dev/null @@ -1,111 +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. - -// Code generated by protoc-gen-go-grpc. DO NOT EDIT. -// versions: -// - protoc-gen-go-grpc v1.2.0 -// - protoc (unknown) -// source: gitpod/v1/context.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 - -// ContextServiceClient is the client API for ContextService 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 ContextServiceClient interface { - // ParseContext parses the url and returns the context - ParseContext(ctx context.Context, in *ParseContextRequest, opts ...grpc.CallOption) (*ParseContextResponse, error) -} - -type contextServiceClient struct { - cc grpc.ClientConnInterface -} - -func NewContextServiceClient(cc grpc.ClientConnInterface) ContextServiceClient { - return &contextServiceClient{cc} -} - -func (c *contextServiceClient) ParseContext(ctx context.Context, in *ParseContextRequest, opts ...grpc.CallOption) (*ParseContextResponse, error) { - out := new(ParseContextResponse) - err := c.cc.Invoke(ctx, "/gitpod.v1.ContextService/ParseContext", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// ContextServiceServer is the server API for ContextService service. -// All implementations must embed UnimplementedContextServiceServer -// for forward compatibility -type ContextServiceServer interface { - // ParseContext parses the url and returns the context - ParseContext(context.Context, *ParseContextRequest) (*ParseContextResponse, error) - mustEmbedUnimplementedContextServiceServer() -} - -// UnimplementedContextServiceServer must be embedded to have forward compatible implementations. -type UnimplementedContextServiceServer struct { -} - -func (UnimplementedContextServiceServer) ParseContext(context.Context, *ParseContextRequest) (*ParseContextResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ParseContext not implemented") -} -func (UnimplementedContextServiceServer) mustEmbedUnimplementedContextServiceServer() {} - -// UnsafeContextServiceServer may be embedded to opt out of forward compatibility for this service. -// Use of this interface is not recommended, as added methods to ContextServiceServer will -// result in compilation errors. -type UnsafeContextServiceServer interface { - mustEmbedUnimplementedContextServiceServer() -} - -func RegisterContextServiceServer(s grpc.ServiceRegistrar, srv ContextServiceServer) { - s.RegisterService(&ContextService_ServiceDesc, srv) -} - -func _ContextService_ParseContext_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ParseContextRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(ContextServiceServer).ParseContext(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/gitpod.v1.ContextService/ParseContext", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(ContextServiceServer).ParseContext(ctx, req.(*ParseContextRequest)) - } - return interceptor(ctx, in, info, handler) -} - -// ContextService_ServiceDesc is the grpc.ServiceDesc for ContextService service. -// It's only intended for direct use with grpc.RegisterService, -// and not to be introspected or modified (even as a copy) -var ContextService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "gitpod.v1.ContextService", - HandlerType: (*ContextServiceServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "ParseContext", - Handler: _ContextService_ParseContext_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "gitpod/v1/context.proto", -} diff --git a/components/public-api/go/v1/installation.pb.go b/components/public-api/go/v1/installation.pb.go new file mode 100644 index 00000000000000..7e1920bd5d0e2a --- /dev/null +++ b/components/public-api/go/v1/installation.pb.go @@ -0,0 +1,1080 @@ +// 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/installation.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) +) + +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_installation_proto_msgTypes[0] + 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_installation_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 ListBlockedRepositoriesRequest.ProtoReflect.Descriptor instead. +func (*ListBlockedRepositoriesRequest) Descriptor() ([]byte, []int) { + return file_gitpod_v1_installation_proto_rawDescGZIP(), []int{0} +} + +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_installation_proto_msgTypes[1] + 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_installation_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 ListBlockedRepositoriesResponse.ProtoReflect.Descriptor instead. +func (*ListBlockedRepositoriesResponse) Descriptor() ([]byte, []int) { + return file_gitpod_v1_installation_proto_rawDescGZIP(), []int{1} +} + +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_installation_proto_msgTypes[2] + 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_installation_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 CreateBlockedRepositoryRequest.ProtoReflect.Descriptor instead. +func (*CreateBlockedRepositoryRequest) Descriptor() ([]byte, []int) { + return file_gitpod_v1_installation_proto_rawDescGZIP(), []int{2} +} + +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_installation_proto_msgTypes[3] + 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_installation_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 CreateBlockedRepositoryResponse.ProtoReflect.Descriptor instead. +func (*CreateBlockedRepositoryResponse) Descriptor() ([]byte, []int) { + return file_gitpod_v1_installation_proto_rawDescGZIP(), []int{3} +} + +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_installation_proto_msgTypes[4] + 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_installation_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 DeleteBlockedRepositoryRequest.ProtoReflect.Descriptor instead. +func (*DeleteBlockedRepositoryRequest) Descriptor() ([]byte, []int) { + return file_gitpod_v1_installation_proto_rawDescGZIP(), []int{4} +} + +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_installation_proto_msgTypes[5] + 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_installation_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 DeleteBlockedRepositoryResponse.ProtoReflect.Descriptor instead. +func (*DeleteBlockedRepositoryResponse) Descriptor() ([]byte, []int) { + return file_gitpod_v1_installation_proto_rawDescGZIP(), []int{5} +} + +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_installation_proto_msgTypes[6] + 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_installation_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 ListBlockedEmailDomainsRequest.ProtoReflect.Descriptor instead. +func (*ListBlockedEmailDomainsRequest) Descriptor() ([]byte, []int) { + return file_gitpod_v1_installation_proto_rawDescGZIP(), []int{6} +} + +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_installation_proto_msgTypes[7] + 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_installation_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 ListBlockedEmailDomainsResponse.ProtoReflect.Descriptor instead. +func (*ListBlockedEmailDomainsResponse) Descriptor() ([]byte, []int) { + return file_gitpod_v1_installation_proto_rawDescGZIP(), []int{7} +} + +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_installation_proto_msgTypes[8] + 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_installation_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 CreateBlockedEmailDomainRequest.ProtoReflect.Descriptor instead. +func (*CreateBlockedEmailDomainRequest) Descriptor() ([]byte, []int) { + return file_gitpod_v1_installation_proto_rawDescGZIP(), []int{8} +} + +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_installation_proto_msgTypes[9] + 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_installation_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 CreateBlockedEmailDomainResponse.ProtoReflect.Descriptor instead. +func (*CreateBlockedEmailDomainResponse) Descriptor() ([]byte, []int) { + return file_gitpod_v1_installation_proto_rawDescGZIP(), []int{9} +} + +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_installation_proto_msgTypes[10] + 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_installation_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 BlockedRepository.ProtoReflect.Descriptor instead. +func (*BlockedRepository) Descriptor() ([]byte, []int) { + return file_gitpod_v1_installation_proto_rawDescGZIP(), []int{10} +} + +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_installation_proto_msgTypes[11] + 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_installation_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 BlockedEmailDomain.ProtoReflect.Descriptor instead. +func (*BlockedEmailDomain) Descriptor() ([]byte, []int) { + return file_gitpod_v1_installation_proto_rawDescGZIP(), []int{11} +} + +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_installation_proto protoreflect.FileDescriptor + +var file_gitpod_v1_installation_proto_rawDesc = []byte{ + 0x0a, 0x1c, 0x67, 0x69, 0x74, 0x70, 0x6f, 0x64, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x73, 0x74, + 0x61, 0x6c, 0x6c, 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, + 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, 0xdc, 0x04, 0x0a, 0x13, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x61, 0x74, 0x69, + 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 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_installation_proto_rawDescOnce sync.Once + file_gitpod_v1_installation_proto_rawDescData = file_gitpod_v1_installation_proto_rawDesc +) + +func file_gitpod_v1_installation_proto_rawDescGZIP() []byte { + file_gitpod_v1_installation_proto_rawDescOnce.Do(func() { + file_gitpod_v1_installation_proto_rawDescData = protoimpl.X.CompressGZIP(file_gitpod_v1_installation_proto_rawDescData) + }) + return file_gitpod_v1_installation_proto_rawDescData +} + +var file_gitpod_v1_installation_proto_msgTypes = make([]protoimpl.MessageInfo, 12) +var file_gitpod_v1_installation_proto_goTypes = []interface{}{ + (*ListBlockedRepositoriesRequest)(nil), // 0: gitpod.v1.ListBlockedRepositoriesRequest + (*ListBlockedRepositoriesResponse)(nil), // 1: gitpod.v1.ListBlockedRepositoriesResponse + (*CreateBlockedRepositoryRequest)(nil), // 2: gitpod.v1.CreateBlockedRepositoryRequest + (*CreateBlockedRepositoryResponse)(nil), // 3: gitpod.v1.CreateBlockedRepositoryResponse + (*DeleteBlockedRepositoryRequest)(nil), // 4: gitpod.v1.DeleteBlockedRepositoryRequest + (*DeleteBlockedRepositoryResponse)(nil), // 5: gitpod.v1.DeleteBlockedRepositoryResponse + (*ListBlockedEmailDomainsRequest)(nil), // 6: gitpod.v1.ListBlockedEmailDomainsRequest + (*ListBlockedEmailDomainsResponse)(nil), // 7: gitpod.v1.ListBlockedEmailDomainsResponse + (*CreateBlockedEmailDomainRequest)(nil), // 8: gitpod.v1.CreateBlockedEmailDomainRequest + (*CreateBlockedEmailDomainResponse)(nil), // 9: gitpod.v1.CreateBlockedEmailDomainResponse + (*BlockedRepository)(nil), // 10: gitpod.v1.BlockedRepository + (*BlockedEmailDomain)(nil), // 11: gitpod.v1.BlockedEmailDomain + (*PaginationRequest)(nil), // 12: gitpod.v1.PaginationRequest + (*Sort)(nil), // 13: gitpod.v1.Sort + (*PaginationResponse)(nil), // 14: gitpod.v1.PaginationResponse + (*timestamppb.Timestamp)(nil), // 15: google.protobuf.Timestamp +} +var file_gitpod_v1_installation_proto_depIdxs = []int32{ + 12, // 0: gitpod.v1.ListBlockedRepositoriesRequest.pagination:type_name -> gitpod.v1.PaginationRequest + 13, // 1: gitpod.v1.ListBlockedRepositoriesRequest.sort:type_name -> gitpod.v1.Sort + 14, // 2: gitpod.v1.ListBlockedRepositoriesResponse.pagination:type_name -> gitpod.v1.PaginationResponse + 10, // 3: gitpod.v1.ListBlockedRepositoriesResponse.blocked_repositories:type_name -> gitpod.v1.BlockedRepository + 10, // 4: gitpod.v1.CreateBlockedRepositoryResponse.blocked_repository:type_name -> gitpod.v1.BlockedRepository + 12, // 5: gitpod.v1.ListBlockedEmailDomainsRequest.pagination:type_name -> gitpod.v1.PaginationRequest + 14, // 6: gitpod.v1.ListBlockedEmailDomainsResponse.pagination:type_name -> gitpod.v1.PaginationResponse + 11, // 7: gitpod.v1.ListBlockedEmailDomainsResponse.blocked_email_domains:type_name -> gitpod.v1.BlockedEmailDomain + 11, // 8: gitpod.v1.CreateBlockedEmailDomainResponse.blocked_email_domain:type_name -> gitpod.v1.BlockedEmailDomain + 15, // 9: gitpod.v1.BlockedRepository.creation_time:type_name -> google.protobuf.Timestamp + 15, // 10: gitpod.v1.BlockedRepository.update_time:type_name -> google.protobuf.Timestamp + 0, // 11: gitpod.v1.InstallationService.ListBlockedRepositories:input_type -> gitpod.v1.ListBlockedRepositoriesRequest + 2, // 12: gitpod.v1.InstallationService.CreateBlockedRepository:input_type -> gitpod.v1.CreateBlockedRepositoryRequest + 4, // 13: gitpod.v1.InstallationService.DeleteBlockedRepository:input_type -> gitpod.v1.DeleteBlockedRepositoryRequest + 6, // 14: gitpod.v1.InstallationService.ListBlockedEmailDomains:input_type -> gitpod.v1.ListBlockedEmailDomainsRequest + 8, // 15: gitpod.v1.InstallationService.CreateBlockedEmailDomain:input_type -> gitpod.v1.CreateBlockedEmailDomainRequest + 1, // 16: gitpod.v1.InstallationService.ListBlockedRepositories:output_type -> gitpod.v1.ListBlockedRepositoriesResponse + 3, // 17: gitpod.v1.InstallationService.CreateBlockedRepository:output_type -> gitpod.v1.CreateBlockedRepositoryResponse + 5, // 18: gitpod.v1.InstallationService.DeleteBlockedRepository:output_type -> gitpod.v1.DeleteBlockedRepositoryResponse + 7, // 19: gitpod.v1.InstallationService.ListBlockedEmailDomains:output_type -> gitpod.v1.ListBlockedEmailDomainsResponse + 9, // 20: gitpod.v1.InstallationService.CreateBlockedEmailDomain:output_type -> gitpod.v1.CreateBlockedEmailDomainResponse + 16, // [16:21] is the sub-list for method output_type + 11, // [11:16] 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_installation_proto_init() } +func file_gitpod_v1_installation_proto_init() { + if File_gitpod_v1_installation_proto != nil { + return + } + file_gitpod_v1_pagination_proto_init() + file_gitpod_v1_sorting_proto_init() + if !protoimpl.UnsafeEnabled { + file_gitpod_v1_installation_proto_msgTypes[0].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_installation_proto_msgTypes[1].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_installation_proto_msgTypes[2].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_installation_proto_msgTypes[3].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_installation_proto_msgTypes[4].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_installation_proto_msgTypes[5].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_installation_proto_msgTypes[6].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_installation_proto_msgTypes[7].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_installation_proto_msgTypes[8].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_installation_proto_msgTypes[9].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_installation_proto_msgTypes[10].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_installation_proto_msgTypes[11].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_installation_proto_rawDesc, + NumEnums: 0, + NumMessages: 12, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_gitpod_v1_installation_proto_goTypes, + DependencyIndexes: file_gitpod_v1_installation_proto_depIdxs, + MessageInfos: file_gitpod_v1_installation_proto_msgTypes, + }.Build() + File_gitpod_v1_installation_proto = out.File + file_gitpod_v1_installation_proto_rawDesc = nil + file_gitpod_v1_installation_proto_goTypes = nil + file_gitpod_v1_installation_proto_depIdxs = nil +} diff --git a/components/public-api/go/v1/installation_grpc.pb.go b/components/public-api/go/v1/installation_grpc.pb.go new file mode 100644 index 00000000000000..eb0c2493f053c8 --- /dev/null +++ b/components/public-api/go/v1/installation_grpc.pb.go @@ -0,0 +1,263 @@ +// 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/installation.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 + +// InstallationServiceClient is the client API for InstallationService 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 InstallationServiceClient interface { + // 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 installationServiceClient struct { + cc grpc.ClientConnInterface +} + +func NewInstallationServiceClient(cc grpc.ClientConnInterface) InstallationServiceClient { + return &installationServiceClient{cc} +} + +func (c *installationServiceClient) ListBlockedRepositories(ctx context.Context, in *ListBlockedRepositoriesRequest, opts ...grpc.CallOption) (*ListBlockedRepositoriesResponse, error) { + out := new(ListBlockedRepositoriesResponse) + err := c.cc.Invoke(ctx, "/gitpod.v1.InstallationService/ListBlockedRepositories", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *installationServiceClient) CreateBlockedRepository(ctx context.Context, in *CreateBlockedRepositoryRequest, opts ...grpc.CallOption) (*CreateBlockedRepositoryResponse, error) { + out := new(CreateBlockedRepositoryResponse) + err := c.cc.Invoke(ctx, "/gitpod.v1.InstallationService/CreateBlockedRepository", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *installationServiceClient) DeleteBlockedRepository(ctx context.Context, in *DeleteBlockedRepositoryRequest, opts ...grpc.CallOption) (*DeleteBlockedRepositoryResponse, error) { + out := new(DeleteBlockedRepositoryResponse) + err := c.cc.Invoke(ctx, "/gitpod.v1.InstallationService/DeleteBlockedRepository", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *installationServiceClient) ListBlockedEmailDomains(ctx context.Context, in *ListBlockedEmailDomainsRequest, opts ...grpc.CallOption) (*ListBlockedEmailDomainsResponse, error) { + out := new(ListBlockedEmailDomainsResponse) + err := c.cc.Invoke(ctx, "/gitpod.v1.InstallationService/ListBlockedEmailDomains", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *installationServiceClient) CreateBlockedEmailDomain(ctx context.Context, in *CreateBlockedEmailDomainRequest, opts ...grpc.CallOption) (*CreateBlockedEmailDomainResponse, error) { + out := new(CreateBlockedEmailDomainResponse) + err := c.cc.Invoke(ctx, "/gitpod.v1.InstallationService/CreateBlockedEmailDomain", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// InstallationServiceServer is the server API for InstallationService service. +// All implementations must embed UnimplementedInstallationServiceServer +// for forward compatibility +type InstallationServiceServer interface { + // 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) + mustEmbedUnimplementedInstallationServiceServer() +} + +// UnimplementedInstallationServiceServer must be embedded to have forward compatible implementations. +type UnimplementedInstallationServiceServer struct { +} + +func (UnimplementedInstallationServiceServer) ListBlockedRepositories(context.Context, *ListBlockedRepositoriesRequest) (*ListBlockedRepositoriesResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListBlockedRepositories not implemented") +} +func (UnimplementedInstallationServiceServer) CreateBlockedRepository(context.Context, *CreateBlockedRepositoryRequest) (*CreateBlockedRepositoryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateBlockedRepository not implemented") +} +func (UnimplementedInstallationServiceServer) DeleteBlockedRepository(context.Context, *DeleteBlockedRepositoryRequest) (*DeleteBlockedRepositoryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteBlockedRepository not implemented") +} +func (UnimplementedInstallationServiceServer) ListBlockedEmailDomains(context.Context, *ListBlockedEmailDomainsRequest) (*ListBlockedEmailDomainsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListBlockedEmailDomains not implemented") +} +func (UnimplementedInstallationServiceServer) CreateBlockedEmailDomain(context.Context, *CreateBlockedEmailDomainRequest) (*CreateBlockedEmailDomainResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateBlockedEmailDomain not implemented") +} +func (UnimplementedInstallationServiceServer) mustEmbedUnimplementedInstallationServiceServer() {} + +// UnsafeInstallationServiceServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to InstallationServiceServer will +// result in compilation errors. +type UnsafeInstallationServiceServer interface { + mustEmbedUnimplementedInstallationServiceServer() +} + +func RegisterInstallationServiceServer(s grpc.ServiceRegistrar, srv InstallationServiceServer) { + s.RegisterService(&InstallationService_ServiceDesc, srv) +} + +func _InstallationService_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.(InstallationServiceServer).ListBlockedRepositories(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gitpod.v1.InstallationService/ListBlockedRepositories", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InstallationServiceServer).ListBlockedRepositories(ctx, req.(*ListBlockedRepositoriesRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _InstallationService_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.(InstallationServiceServer).CreateBlockedRepository(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gitpod.v1.InstallationService/CreateBlockedRepository", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InstallationServiceServer).CreateBlockedRepository(ctx, req.(*CreateBlockedRepositoryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _InstallationService_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.(InstallationServiceServer).DeleteBlockedRepository(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gitpod.v1.InstallationService/DeleteBlockedRepository", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InstallationServiceServer).DeleteBlockedRepository(ctx, req.(*DeleteBlockedRepositoryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _InstallationService_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.(InstallationServiceServer).ListBlockedEmailDomains(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gitpod.v1.InstallationService/ListBlockedEmailDomains", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InstallationServiceServer).ListBlockedEmailDomains(ctx, req.(*ListBlockedEmailDomainsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _InstallationService_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.(InstallationServiceServer).CreateBlockedEmailDomain(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gitpod.v1.InstallationService/CreateBlockedEmailDomain", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(InstallationServiceServer).CreateBlockedEmailDomain(ctx, req.(*CreateBlockedEmailDomainRequest)) + } + return interceptor(ctx, in, info, handler) +} + +// InstallationService_ServiceDesc is the grpc.ServiceDesc for InstallationService service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var InstallationService_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "gitpod.v1.InstallationService", + HandlerType: (*InstallationServiceServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "ListBlockedRepositories", + Handler: _InstallationService_ListBlockedRepositories_Handler, + }, + { + MethodName: "CreateBlockedRepository", + Handler: _InstallationService_CreateBlockedRepository_Handler, + }, + { + MethodName: "DeleteBlockedRepository", + Handler: _InstallationService_DeleteBlockedRepository_Handler, + }, + { + MethodName: "ListBlockedEmailDomains", + Handler: _InstallationService_ListBlockedEmailDomains_Handler, + }, + { + MethodName: "CreateBlockedEmailDomain", + Handler: _InstallationService_CreateBlockedEmailDomain_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "gitpod/v1/installation.proto", +} diff --git a/components/public-api/go/v1/v1connect/context.connect.go b/components/public-api/go/v1/v1connect/context.connect.go deleted file mode 100644 index 4222b534bb562f..00000000000000 --- a/components/public-api/go/v1/v1connect/context.connect.go +++ /dev/null @@ -1,92 +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. - -// Code generated by protoc-gen-connect-go. DO NOT EDIT. -// -// Source: gitpod/v1/context.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 ( - // ContextServiceName is the fully-qualified name of the ContextService service. - ContextServiceName = "gitpod.v1.ContextService" -) - -// ContextServiceClient is a client for the gitpod.v1.ContextService service. -type ContextServiceClient interface { - // ParseContext parses the url and returns the context - ParseContext(context.Context, *connect_go.Request[v1.ParseContextRequest]) (*connect_go.Response[v1.ParseContextResponse], error) -} - -// NewContextServiceClient constructs a client for the gitpod.v1.ContextService 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 NewContextServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) ContextServiceClient { - baseURL = strings.TrimRight(baseURL, "/") - return &contextServiceClient{ - parseContext: connect_go.NewClient[v1.ParseContextRequest, v1.ParseContextResponse]( - httpClient, - baseURL+"/gitpod.v1.ContextService/ParseContext", - opts..., - ), - } -} - -// contextServiceClient implements ContextServiceClient. -type contextServiceClient struct { - parseContext *connect_go.Client[v1.ParseContextRequest, v1.ParseContextResponse] -} - -// ParseContext calls gitpod.v1.ContextService.ParseContext. -func (c *contextServiceClient) ParseContext(ctx context.Context, req *connect_go.Request[v1.ParseContextRequest]) (*connect_go.Response[v1.ParseContextResponse], error) { - return c.parseContext.CallUnary(ctx, req) -} - -// ContextServiceHandler is an implementation of the gitpod.v1.ContextService service. -type ContextServiceHandler interface { - // ParseContext parses the url and returns the context - ParseContext(context.Context, *connect_go.Request[v1.ParseContextRequest]) (*connect_go.Response[v1.ParseContextResponse], error) -} - -// NewContextServiceHandler 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 NewContextServiceHandler(svc ContextServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler) { - mux := http.NewServeMux() - mux.Handle("/gitpod.v1.ContextService/ParseContext", connect_go.NewUnaryHandler( - "/gitpod.v1.ContextService/ParseContext", - svc.ParseContext, - opts..., - )) - return "/gitpod.v1.ContextService/", mux -} - -// UnimplementedContextServiceHandler returns CodeUnimplemented from all methods. -type UnimplementedContextServiceHandler struct{} - -func (UnimplementedContextServiceHandler) ParseContext(context.Context, *connect_go.Request[v1.ParseContextRequest]) (*connect_go.Response[v1.ParseContextResponse], error) { - return nil, connect_go.NewError(connect_go.CodeUnimplemented, errors.New("gitpod.v1.ContextService.ParseContext is not implemented")) -} diff --git a/components/public-api/go/v1/v1connect/context.proxy.connect.go b/components/public-api/go/v1/v1connect/context.proxy.connect.go deleted file mode 100644 index 6c22c915d0153e..00000000000000 --- a/components/public-api/go/v1/v1connect/context.proxy.connect.go +++ /dev/null @@ -1,30 +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. - -// 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 _ ContextServiceHandler = (*ProxyContextServiceHandler)(nil) - -type ProxyContextServiceHandler struct { - Client v1.ContextServiceClient - UnimplementedContextServiceHandler -} - -func (s *ProxyContextServiceHandler) ParseContext(ctx context.Context, req *connect_go.Request[v1.ParseContextRequest]) (*connect_go.Response[v1.ParseContextResponse], error) { - resp, err := s.Client.ParseContext(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/v1connect/installation.connect.go b/components/public-api/go/v1/v1connect/installation.connect.go new file mode 100644 index 00000000000000..3080aba499d296 --- /dev/null +++ b/components/public-api/go/v1/v1connect/installation.connect.go @@ -0,0 +1,188 @@ +// 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/installation.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 ( + // InstallationServiceName is the fully-qualified name of the InstallationService service. + InstallationServiceName = "gitpod.v1.InstallationService" +) + +// InstallationServiceClient is a client for the gitpod.v1.InstallationService service. +type InstallationServiceClient interface { + // 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) +} + +// NewInstallationServiceClient constructs a client for the gitpod.v1.InstallationService 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 NewInstallationServiceClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) InstallationServiceClient { + baseURL = strings.TrimRight(baseURL, "/") + return &installationServiceClient{ + listBlockedRepositories: connect_go.NewClient[v1.ListBlockedRepositoriesRequest, v1.ListBlockedRepositoriesResponse]( + httpClient, + baseURL+"/gitpod.v1.InstallationService/ListBlockedRepositories", + opts..., + ), + createBlockedRepository: connect_go.NewClient[v1.CreateBlockedRepositoryRequest, v1.CreateBlockedRepositoryResponse]( + httpClient, + baseURL+"/gitpod.v1.InstallationService/CreateBlockedRepository", + opts..., + ), + deleteBlockedRepository: connect_go.NewClient[v1.DeleteBlockedRepositoryRequest, v1.DeleteBlockedRepositoryResponse]( + httpClient, + baseURL+"/gitpod.v1.InstallationService/DeleteBlockedRepository", + opts..., + ), + listBlockedEmailDomains: connect_go.NewClient[v1.ListBlockedEmailDomainsRequest, v1.ListBlockedEmailDomainsResponse]( + httpClient, + baseURL+"/gitpod.v1.InstallationService/ListBlockedEmailDomains", + opts..., + ), + createBlockedEmailDomain: connect_go.NewClient[v1.CreateBlockedEmailDomainRequest, v1.CreateBlockedEmailDomainResponse]( + httpClient, + baseURL+"/gitpod.v1.InstallationService/CreateBlockedEmailDomain", + opts..., + ), + } +} + +// installationServiceClient implements InstallationServiceClient. +type installationServiceClient struct { + 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] +} + +// ListBlockedRepositories calls gitpod.v1.InstallationService.ListBlockedRepositories. +func (c *installationServiceClient) 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.InstallationService.CreateBlockedRepository. +func (c *installationServiceClient) 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.InstallationService.DeleteBlockedRepository. +func (c *installationServiceClient) 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.InstallationService.ListBlockedEmailDomains. +func (c *installationServiceClient) 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.InstallationService.CreateBlockedEmailDomain. +func (c *installationServiceClient) CreateBlockedEmailDomain(ctx context.Context, req *connect_go.Request[v1.CreateBlockedEmailDomainRequest]) (*connect_go.Response[v1.CreateBlockedEmailDomainResponse], error) { + return c.createBlockedEmailDomain.CallUnary(ctx, req) +} + +// InstallationServiceHandler is an implementation of the gitpod.v1.InstallationService service. +type InstallationServiceHandler interface { + // 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) +} + +// NewInstallationServiceHandler 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 NewInstallationServiceHandler(svc InstallationServiceHandler, opts ...connect_go.HandlerOption) (string, http.Handler) { + mux := http.NewServeMux() + mux.Handle("/gitpod.v1.InstallationService/ListBlockedRepositories", connect_go.NewUnaryHandler( + "/gitpod.v1.InstallationService/ListBlockedRepositories", + svc.ListBlockedRepositories, + opts..., + )) + mux.Handle("/gitpod.v1.InstallationService/CreateBlockedRepository", connect_go.NewUnaryHandler( + "/gitpod.v1.InstallationService/CreateBlockedRepository", + svc.CreateBlockedRepository, + opts..., + )) + mux.Handle("/gitpod.v1.InstallationService/DeleteBlockedRepository", connect_go.NewUnaryHandler( + "/gitpod.v1.InstallationService/DeleteBlockedRepository", + svc.DeleteBlockedRepository, + opts..., + )) + mux.Handle("/gitpod.v1.InstallationService/ListBlockedEmailDomains", connect_go.NewUnaryHandler( + "/gitpod.v1.InstallationService/ListBlockedEmailDomains", + svc.ListBlockedEmailDomains, + opts..., + )) + mux.Handle("/gitpod.v1.InstallationService/CreateBlockedEmailDomain", connect_go.NewUnaryHandler( + "/gitpod.v1.InstallationService/CreateBlockedEmailDomain", + svc.CreateBlockedEmailDomain, + opts..., + )) + return "/gitpod.v1.InstallationService/", mux +} + +// UnimplementedInstallationServiceHandler returns CodeUnimplemented from all methods. +type UnimplementedInstallationServiceHandler struct{} + +func (UnimplementedInstallationServiceHandler) 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.InstallationService.ListBlockedRepositories is not implemented")) +} + +func (UnimplementedInstallationServiceHandler) 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.InstallationService.CreateBlockedRepository is not implemented")) +} + +func (UnimplementedInstallationServiceHandler) 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.InstallationService.DeleteBlockedRepository is not implemented")) +} + +func (UnimplementedInstallationServiceHandler) 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.InstallationService.ListBlockedEmailDomains is not implemented")) +} + +func (UnimplementedInstallationServiceHandler) 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.InstallationService.CreateBlockedEmailDomain is not implemented")) +} diff --git a/components/public-api/go/v1/v1connect/installation.proxy.connect.go b/components/public-api/go/v1/v1connect/installation.proxy.connect.go new file mode 100644 index 00000000000000..f2bd3cbc48810f --- /dev/null +++ b/components/public-api/go/v1/v1connect/installation.proxy.connect.go @@ -0,0 +1,70 @@ +// 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 _ InstallationServiceHandler = (*ProxyInstallationServiceHandler)(nil) + +type ProxyInstallationServiceHandler struct { + Client v1.InstallationServiceClient + UnimplementedInstallationServiceHandler +} + +func (s *ProxyInstallationServiceHandler) 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 *ProxyInstallationServiceHandler) 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 *ProxyInstallationServiceHandler) 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 *ProxyInstallationServiceHandler) 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 *ProxyInstallationServiceHandler) 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/typescript-common/src/public-api-converter.spec.ts b/components/public-api/typescript-common/src/public-api-converter.spec.ts index 64898cd3f954df..2f31eddf8fe25d 100644 --- a/components/public-api/typescript-common/src/public-api-converter.spec.ts +++ b/components/public-api/typescript-common/src/public-api-converter.spec.ts @@ -29,6 +29,7 @@ import { import { AuthProviderEntry, AuthProviderInfo, + EmailDomainFilterEntry, ProjectEnvVar, SuggestedRepository, Token, @@ -64,6 +65,8 @@ 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 "@gitpod/gitpod-protocol/lib/blocked-repositories-protocol"; +import { BlockedEmailDomain, BlockedRepository } from "@gitpod/public-api/lib/gitpod/v1/installation_pb"; describe("PublicAPIConverter", () => { const converter = new PublicAPIConverter(); @@ -1073,6 +1076,43 @@ 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(), + }; + const blockedRepo = new BlockedRepository({ + id: 2023, + urlRegexp: "*/*", + blockUser: false, + creationTime: Timestamp.fromDate(new Date(repo.createdAt)), + updateTime: Timestamp.fromDate(new Date(repo.updatedAt)), + }); + expect(converter.toBlockedRepository(repo)).to.deep.equal(blockedRepo); + }); + }); + + describe("toBlockedEmailDomain", () => { + it("should convert a token", () => { + const item: EmailDomainFilterEntry = { + domain: "example.com", + negative: false, + }; + const blockedEmail = new BlockedEmailDomain({ + id: "", + domain: item.domain, + negative: item.negative, + }); + expect(converter.toBlockedEmailDomain(item)).to.deep.equal(blockedEmail); + }); + }); + describe("toSCMToken", () => { it("should convert a token", () => { const t1 = new Date(); diff --git a/components/public-api/typescript-common/src/public-api-converter.ts b/components/public-api/typescript-common/src/public-api-converter.ts index 0cdf16d09b0616..dfe75265994a93 100644 --- a/components/public-api/typescript-common/src/public-api-converter.ts +++ b/components/public-api/typescript-common/src/public-api-converter.ts @@ -60,6 +60,7 @@ import { WorkspaceStatus_WorkspaceConditions, } from "@gitpod/public-api/lib/gitpod/v1/workspace_pb"; import { EditorReference } from "@gitpod/public-api/lib/gitpod/v1/editor_pb"; +import { BlockedEmailDomain, BlockedRepository } from "@gitpod/public-api/lib/gitpod/v1/installation_pb"; import { SSHPublicKey } from "@gitpod/public-api/lib/gitpod/v1/ssh_pb"; import { ConfigurationEnvironmentVariable, @@ -95,7 +96,8 @@ import { SuggestedRepository as SuggestedRepositoryProtocol, UserSSHPublicKeyValue, SnapshotContext, -} from "@gitpod/gitpod-protocol/lib//protocol"; + EmailDomainFilterEntry, +} from "@gitpod/gitpod-protocol/lib/protocol"; import { OrgMemberInfo, OrgMemberRole, @@ -105,7 +107,7 @@ import { PrebuildWithStatus, Project, Organization as ProtocolOrganization, -} from "@gitpod/gitpod-protocol/lib//teams-projects-protocol"; +} from "@gitpod/gitpod-protocol/lib/teams-projects-protocol"; import { ConfigurationIdeConfig, PortProtocol, @@ -115,6 +117,7 @@ import { } from "@gitpod/gitpod-protocol/lib//workspace-instance"; import { Author, Commit } from "@gitpod/public-api/lib/gitpod/v1/scm_pb"; import type { DeepPartial } from "@gitpod/gitpod-protocol/lib/util/deep-partial"; +import { BlockedRepository as ProtocolBlockedRepository } from "@gitpod/gitpod-protocol/lib/blocked-repositories-protocol"; export type PartialConfiguration = DeepPartial & Pick; @@ -974,6 +977,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/typescript/src/gitpod/v1/context_connect.ts b/components/public-api/typescript/src/gitpod/v1/context_connect.ts deleted file mode 100644 index a3ad5e09287d11..00000000000000 --- a/components/public-api/typescript/src/gitpod/v1/context_connect.ts +++ /dev/null @@ -1,33 +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. - */ - -// @generated by protoc-gen-connect-es v1.1.2 with parameter "target=ts" -// @generated from file gitpod/v1/context.proto (package gitpod.v1, syntax proto3) -/* eslint-disable */ -// @ts-nocheck - -import { ParseContextRequest, ParseContextResponse } from "./context_pb.js"; -import { MethodKind } from "@bufbuild/protobuf"; - -/** - * @generated from service gitpod.v1.ContextService - */ -export const ContextService = { - typeName: "gitpod.v1.ContextService", - methods: { - /** - * ParseContext parses the url and returns the context - * - * @generated from rpc gitpod.v1.ContextService.ParseContext - */ - parseContext: { - name: "ParseContext", - I: ParseContextRequest, - O: ParseContextResponse, - kind: MethodKind.Unary, - }, - } -} as const; diff --git a/components/public-api/typescript/src/gitpod/v1/context_pb.ts b/components/public-api/typescript/src/gitpod/v1/context_pb.ts deleted file mode 100644 index 410ff6f2d669fe..00000000000000 --- a/components/public-api/typescript/src/gitpod/v1/context_pb.ts +++ /dev/null @@ -1,136 +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. - */ - -// @generated by protoc-gen-es v1.3.3 with parameter "target=ts" -// @generated from file gitpod/v1/context.proto (package gitpod.v1, syntax proto3) -/* eslint-disable */ -// @ts-nocheck - -import type { BinaryReadOptions, FieldList, JsonReadOptions, JsonValue, PartialMessage, PlainMessage } from "@bufbuild/protobuf"; -import { Message, proto3 } from "@bufbuild/protobuf"; - -/** - * @generated from message gitpod.v1.ParseContextRequest - */ -export class ParseContextRequest extends Message { - /** - * @generated from field: string url = 1; - */ - url = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "gitpod.v1.ParseContextRequest"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ParseContextRequest { - return new ParseContextRequest().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ParseContextRequest { - return new ParseContextRequest().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ParseContextRequest { - return new ParseContextRequest().fromJsonString(jsonString, options); - } - - static equals(a: ParseContextRequest | PlainMessage | undefined, b: ParseContextRequest | PlainMessage | undefined): boolean { - return proto3.util.equals(ParseContextRequest, a, b); - } -} - -/** - * @generated from message gitpod.v1.ParseContextResponse - */ -export class ParseContextResponse extends Message { - /** - * @generated from field: gitpod.v1.Context context = 1; - */ - context?: Context; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "gitpod.v1.ParseContextResponse"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "context", kind: "message", T: Context }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): ParseContextResponse { - return new ParseContextResponse().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): ParseContextResponse { - return new ParseContextResponse().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): ParseContextResponse { - return new ParseContextResponse().fromJsonString(jsonString, options); - } - - static equals(a: ParseContextResponse | PlainMessage | undefined, b: ParseContextResponse | PlainMessage | undefined): boolean { - return proto3.util.equals(ParseContextResponse, a, b); - } -} - -/** - * @generated from message gitpod.v1.Context - */ -export class Context extends Message { - /** - * @generated from field: string title = 1; - */ - title = ""; - - /** - * @generated from field: string normalized_url = 2; - */ - normalizedUrl = ""; - - /** - * @generated from field: string ref = 3; - */ - ref = ""; - - constructor(data?: PartialMessage) { - super(); - proto3.util.initPartial(data, this); - } - - static readonly runtime: typeof proto3 = proto3; - static readonly typeName = "gitpod.v1.Context"; - static readonly fields: FieldList = proto3.util.newFieldList(() => [ - { no: 1, name: "title", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 2, name: "normalized_url", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - { no: 3, name: "ref", kind: "scalar", T: 9 /* ScalarType.STRING */ }, - ]); - - static fromBinary(bytes: Uint8Array, options?: Partial): Context { - return new Context().fromBinary(bytes, options); - } - - static fromJson(jsonValue: JsonValue, options?: Partial): Context { - return new Context().fromJson(jsonValue, options); - } - - static fromJsonString(jsonString: string, options?: Partial): Context { - return new Context().fromJsonString(jsonString, options); - } - - static equals(a: Context | PlainMessage | undefined, b: Context | PlainMessage | undefined): boolean { - return proto3.util.equals(Context, a, b); - } -} diff --git a/components/public-api/typescript/src/gitpod/v1/installation_connect.ts b/components/public-api/typescript/src/gitpod/v1/installation_connect.ts new file mode 100644 index 00000000000000..d0e50b75d62a9a --- /dev/null +++ b/components/public-api/typescript/src/gitpod/v1/installation_connect.ts @@ -0,0 +1,77 @@ +/** + * 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/installation.proto (package gitpod.v1, syntax proto3) +/* eslint-disable */ +// @ts-nocheck + +import { CreateBlockedEmailDomainRequest, CreateBlockedEmailDomainResponse, CreateBlockedRepositoryRequest, CreateBlockedRepositoryResponse, DeleteBlockedRepositoryRequest, DeleteBlockedRepositoryResponse, ListBlockedEmailDomainsRequest, ListBlockedEmailDomainsResponse, ListBlockedRepositoriesRequest, ListBlockedRepositoriesResponse } from "./installation_pb.js"; +import { MethodKind } from "@bufbuild/protobuf"; + +/** + * @generated from service gitpod.v1.InstallationService + */ +export const InstallationService = { + typeName: "gitpod.v1.InstallationService", + methods: { + /** + * ListBlockedRepositories lists blocked repositories. + * + * @generated from rpc gitpod.v1.InstallationService.ListBlockedRepositories + */ + listBlockedRepositories: { + name: "ListBlockedRepositories", + I: ListBlockedRepositoriesRequest, + O: ListBlockedRepositoriesResponse, + kind: MethodKind.Unary, + }, + /** + * CreateBlockedRepository creates a new blocked repository. + * + * @generated from rpc gitpod.v1.InstallationService.CreateBlockedRepository + */ + createBlockedRepository: { + name: "CreateBlockedRepository", + I: CreateBlockedRepositoryRequest, + O: CreateBlockedRepositoryResponse, + kind: MethodKind.Unary, + }, + /** + * DeleteBlockedRepository deletes a blocked repository. + * + * @generated from rpc gitpod.v1.InstallationService.DeleteBlockedRepository + */ + deleteBlockedRepository: { + name: "DeleteBlockedRepository", + I: DeleteBlockedRepositoryRequest, + O: DeleteBlockedRepositoryResponse, + kind: MethodKind.Unary, + }, + /** + * ListBlockedEmailDomains lists blocked email domains. + * + * @generated from rpc gitpod.v1.InstallationService.ListBlockedEmailDomains + */ + listBlockedEmailDomains: { + name: "ListBlockedEmailDomains", + I: ListBlockedEmailDomainsRequest, + O: ListBlockedEmailDomainsResponse, + kind: MethodKind.Unary, + }, + /** + * CreateBlockedEmailDomain creates a new blocked email domain. + * + * @generated from rpc gitpod.v1.InstallationService.CreateBlockedEmailDomain + */ + createBlockedEmailDomain: { + name: "CreateBlockedEmailDomain", + I: CreateBlockedEmailDomainRequest, + O: CreateBlockedEmailDomainResponse, + kind: MethodKind.Unary, + }, + } +} as const; diff --git a/components/public-api/typescript/src/gitpod/v1/installation_pb.ts b/components/public-api/typescript/src/gitpod/v1/installation_pb.ts new file mode 100644 index 00000000000000..37575957c2d661 --- /dev/null +++ b/components/public-api/typescript/src/gitpod/v1/installation_pb.ts @@ -0,0 +1,564 @@ +/** + * 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/installation.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"; + +/** + * @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/installation-service-api.ts b/components/server/src/api/installation-service-api.ts new file mode 100644 index 00000000000000..eb614195f3246a --- /dev/null +++ b/components/server/src/api/installation-service-api.ts @@ -0,0 +1,130 @@ +/** + * 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 { InstallationService as InstallationServiceInterface } from "@gitpod/public-api/lib/gitpod/v1/installation_connect"; +import { + CreateBlockedEmailDomainRequest, + CreateBlockedEmailDomainResponse, + CreateBlockedRepositoryRequest, + CreateBlockedRepositoryResponse, + DeleteBlockedRepositoryRequest, + DeleteBlockedRepositoryResponse, + ListBlockedEmailDomainsRequest, + ListBlockedEmailDomainsResponse, + ListBlockedRepositoriesRequest, + ListBlockedRepositoriesResponse, +} from "@gitpod/public-api/lib/gitpod/v1/installation_pb"; +import { inject, injectable } from "inversify"; +import { InstallationService } from "../auth/installation-service"; +import { ctxUserId } from "../util/request-context"; +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/public-api-common/lib/public-api-converter"; + +@injectable() +export class InstallationServiceAPI implements ServiceImpl { + @inject(InstallationService) private readonly installationService: InstallationService; + + @inject(PublicAPIConverter) private readonly apiConverter: PublicAPIConverter; + + 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.installationService.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.installationService.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.installationService.adminDeleteBlockedRepository(ctxUserId(), req.blockedRepositoryId); + return new DeleteBlockedRepositoryResponse(); + } + + async listBlockedEmailDomains( + req: ListBlockedEmailDomainsRequest, + _: HandlerContext, + ): Promise { + const list = await this.installationService.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.installationService.adminCreateBlockedEmailDomain(ctxUserId(), { + domain: req.domain, + negative: req.negative, + }); + return new CreateBlockedEmailDomainResponse({ + blockedEmailDomain: this.apiConverter.toBlockedEmailDomain(data), + }); + } +} 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/auth/installation-service.ts b/components/server/src/auth/installation-service.ts new file mode 100644 index 00000000000000..ce56469a68e081 --- /dev/null +++ b/components/server/src/auth/installation-service.ts @@ -0,0 +1,60 @@ +/** + * 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 { AdminGetListRequest, AdminGetListResult, EmailDomainFilterEntry } from "@gitpod/gitpod-protocol"; +import { inject, injectable } from "inversify"; +import { EmailDomainFilterDB } from "@gitpod/gitpod-db/lib"; +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 InstallationService { + @inject(Authorizer) private readonly auth: Authorizer; + @inject(BlockedRepositoryDB) private readonly blockedRepositoryDB: BlockedRepositoryDB; + @inject(EmailDomainFilterDB) private readonly emailDomainFilterDB: EmailDomainFilterDB; + + 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/container-module.ts b/components/server/src/container-module.ts index fc58eaedb03035..e80687bf3a4b58 100644 --- a/components/server/src/container-module.ts +++ b/components/server/src/container-module.ts @@ -47,6 +47,7 @@ import { HostContextProviderImpl } from "./auth/host-context-provider-impl"; import { AuthJWT, SignInJWT } from "./auth/jwt"; import { LoginCompletionHandler } from "./auth/login-completion-handler"; import { VerificationService } from "./auth/verification-service"; +import { InstallationService } from "./auth/installation-service"; import { Authorizer, createInitializingAuthorizer } from "./authorization/authorizer"; import { RelationshipUpdater } from "./authorization/relationship-updater"; import { RelationshipUpdateJob } from "./authorization/relationship-updater-job"; @@ -303,6 +304,8 @@ export const productionContainerModule = new ContainerModule( bind(VerificationService).toSelf().inSingletonScope(); + bind(InstallationService).toSelf().inSingletonScope(); + bind(UsageService).toSelf().inSingletonScope(); bind(LinkedInService).toSelf().inSingletonScope(); diff --git a/components/server/src/workspace/gitpod-server-impl.ts b/components/server/src/workspace/gitpod-server-impl.ts index 7a579c6dfe79d4..ecc3014103cb64 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, @@ -121,6 +112,7 @@ import { } from "@gitpod/gitpod-protocol/lib/protocol"; import { ListUsageRequest, ListUsageResponse } from "@gitpod/gitpod-protocol/lib/usage"; import { VerificationService } from "../auth/verification-service"; +import { InstallationService } from "../auth/installation-service"; import { BillingMode } from "@gitpod/gitpod-protocol/lib/billing-mode"; import { formatPhoneNumber } from "../user/phone-numbers"; import { IDEService } from "../ide-service"; @@ -179,7 +171,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, @@ -201,6 +192,8 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { @inject(VerificationService) private readonly verificationService: VerificationService, + @inject(InstallationService) private readonly installationService: InstallationService, + @inject(Authorizer) private readonly auth: Authorizer, @inject(ScmService) private readonly scmService: ScmService, @@ -209,7 +202,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, @@ -1853,17 +1845,9 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { traceAPIParams(ctx, { req: censor(req, "searchTerm") }); // searchTerm may contain PII const admin = await this.guardAdminAccess("adminGetBlockedRepositories", { req }, Permission.ADMIN_USERS); - 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.installationService.adminGetBlockedRepositories(admin.id, req); } catch (e) { throw new ApplicationError(ErrorCodes.INTERNAL_SERVER_ERROR, String(e)); } @@ -1881,18 +1865,19 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { { urlRegexp, blockUser }, Permission.ADMIN_USERS, ); - await this.auth.checkPermissionOnInstallation(admin.id, "configure"); - return await this.blockedRepostoryDB.createBlockedRepository(urlRegexp, blockUser); + return await this.installationService.adminCreateBlockedRepository(admin.id, { + urlRegexp, + blockUser, + }); } async adminDeleteBlockedRepository(ctx: TraceContext, id: number): Promise { traceAPIParams(ctx, { id }); const admin = await this.guardAdminAccess("adminDeleteBlockedRepository", { id }, Permission.ADMIN_USERS); - await this.auth.checkPermissionOnInstallation(admin.id, "configure"); - await this.blockedRepostoryDB.deleteBlockedRepository(id); + await this.installationService.adminDeleteBlockedRepository(admin.id, id); } async adminBlockUser(ctx: TraceContext, req: AdminBlockUserRequest): Promise { @@ -2950,8 +2935,7 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { async adminGetBlockedEmailDomains(ctx: TraceContextWithSpan): Promise { 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 await this.installationService.adminGetBlockedEmailDomains(user.id); } async adminSaveBlockedEmailDomain( @@ -2960,7 +2944,6 @@ export class GitpodServerImpl implements GitpodServerWithTracing, Disposable { ): Promise { 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.installationService.adminCreateBlockedEmailDomain(user.id, domainFilterentry); } }