lib/enterpriseportal: initial service API for RFC 885 (#62263)

See [RFC 885 Sourcegraph Enterprise Portal (go/enterprise-portal)](https://docs.google.com/document/d/1tiaW1IVKm_YSSYhH-z7Q8sv4HSO_YJ_Uu6eYDjX7uU4/edit#heading=h.tdaxc5h34u7q) - closes CORE-6. The only files requiring in-depth review are the `.proto` files, as everything else is generated:

- `lib/enterpriseportal/subscriptions/v1/subscriptions.proto`
- `lib/enterpriseportal/codyaccess/v1/codyaccess.proto`

This PR only introduces API definitions - implementation will come as subsequent PRs, tracked in the ["Launch Enterprise Portal" Linear project](https://linear.app/sourcegraph/project/launch-sourcegraph-enterprise-portal-ee5d9ea105c2).

Before reviewing the diffs, **please review this PR description in depth**.

### Design goals

This initial schema aims to help achieve CORE-97 by adding our initial "get subscription Cody access", as well our general Stage 1 goal of providing read-only access to our existing enterprise subscription mechanisms. In doing so, we can start to reshape the API in a way that accommodates future growth and addresses some debt we have accumulated over time, before the Stage 2 goal of having the new Enterprise Portal be the source-of-truth for all things subscriptions.

I am also aiming for a conservative approach with the Cody Gateway access related RPCs, to ease migration risks and allow for Cody teams to follow up quickly with more drastic changes in a V2 of the service after a Core-Services-driven migration to use the new service: https://github.com/sourcegraph/sourcegraph/pull/62263#issuecomment-2101874114

### Design overview

- **Multiple services**: Enterprise Portal aims to be the home of most Enterprise-related subscription and access management, but each component should be defined as a separate service to maintain clear boundaries between "core" capabilities and future extensions. One problem we see in the `dotcom { productSubscriptions }` is the embedding of additional concepts like Cody Gateway access makes the API surface unwieldy and brittle, and encourages an internal design that bundles everything together (the `product_subscriptions` table has 10 `cody_gateway_*` columns today). More concretely, this PR designs 2 services that Enterprise Portal will implement:
  - `EnterprisePortalSubscriptionsService` (`subscriptions.proto`): subscriptions and licenses CRUD
  - `EnterprisePortalCodyGatewayService` (`codygateway.proto`): Enterprise Cody Gateway access
- **Multiple protocols**: We use [ConnectRPC](https://connectrpc.com/) to generate traditional gRPC handlers for service-to-service use, but also a plain HTTP/1 "REST"-ish protocol (the ["Connect Protocol"](https://connectrpc.com/docs/protocol)) that works for web clients and simple integrations. Go bindings for the Connect protocol are generated into the `v1connect` subpackages.
- **Future licensing model/mechanism changes**: The _Subscription_ model is designed to remain static, but _Licenses_ are designed to accommodate future changes -`EnterpriseSubscriptionLicenseType` and `EnterpriseSubscriptionLicense` in this PR describe only the current type of license, referred to as "classic licenses", but we can extend this in the future for e.g. new models (refreshable licenses?) or new products (Cody-only? PLG enterprise?), or existing problems (test instance licenses?)
- **Granular history**: Instead of a `createdAt`, `isArchived`, `revokedAt` and  and so on, the new API defines Kubernetes-style `conditions` for licenses and subscriptions to describe creation, archival, and revocation events respectively, and can be more flexibly extended for future events and a lightweight audit log of major changes to a subscription or license. In particular, `revokedAt` already has a `revokedReason` - this allows us to extend these important events with additional metadata in a flexible manner.
- **Pagination**: I couldn't find a shared internal or off-the-shelf representation of pagination attributes, but each `List*` RPC describes `page_size`, `page_token`, and `next_page_token`
- **Querying/filtering**: I couldn't find a strong standard for this either, but in general:
  - `Get*` accepts `query` that is a `oneof`, with the goal of providing exact matches only.
  - `List*` accepts `repeated filter`, where each `filter` is a `oneof` a set of strategies relevant to a particular `List*` RPC. Multiple filters are treated as `AND`-concatenated.

Some major changes from the existing model:

- **Downgrade the concept of "subscription access token"**: this was built for Cody Gateway but I am not sure it has aged well, as the mechanism is still tied to individual licenses, did not find new non-Cody-Gateway use cases (except for license checks, though those do not require an "access token" model either), and today are still not "true" access tokens as they cannot be expired/managed properly. This PR relegates the concept to remain Cody-specific as it effectively is today so that we might be able to introduce a better subscription-wide model if the use case arises. Over time, we may want to make this even more opaque, relying entirely on zero-config instead (generating from license keys).
- **Subscriptions are no longer attached to a single dotcom user**: Most of these users today are not real users anyway, as our license creation process asks that you create a fake user account (["User account: [...] We create a company-level account for this."](https://handbook.sourcegraph.com/departments/technical-success/ce/process/license_keys/#license-key-mechanics)). The new API removes the concept entirely, in favour of a true user access management system in CORE-102.
- **Database/GraphQL IDs** are no longer exposed - we use external, prefixed UUIDs for representing entities over APIs in a universal manner.
- **Per-subscription Cody Gateway access no longer exposes `allowed models`**: I suggested this to  @rafax in light of recent problems with propagating new models to Enterprise customers. He agreed that the general product direction is "model options as a selling point" - it no longer makes sense to configure these at a per-subscription level. Instead, the Cody Gateway service should configure globally allowed models directly, and each Sourcegraph instance can determine what models they trust. If we really need this back we can add it later, but for now I think this removal is the right direction.

### Direct translations

`cmd/cody-gateway/internal/dotcom/operations.graphql` defines our key dependencies for achieving CORE-97. The concepts referred in `operations.graphql` translate to this new API as follows: 

- `dotcom { productSubscriptionByAccessToken(accessToken) }`: `codygateway.v1.GetCodyGatewayAccess({ access_token })`
- `dotcom { productSubscriptions }`: `codygateway.v1.ListCodyGatewayAccess()`
- `fragment ProductSubscriptionState`:
  - `id`: **n/a**
  - `uuid`: `subscriptions.v1.EnterpriseSubscription.id`
  - `account { username }`: `subscriptions.v1.EnterpriseSubscription.display_name`
  - `isArchived`: `subscriptions.v1.EnterpriseSubscription.conditions`
  - `codyGatewayAccess { ... }`: **separate RPC to `codygateway.v1.GetCodyGatewayAccess`**
  - `activeLicense { ... }`: **separate RPC to `subscriptions.v1.ListEnterpriseSubscriptionLicenses`**

### Why `lib/enterpriseportal`?

We recently had to move another Telemetry Gateway to `lib`: #62061. Inevitably, there will be services that live outside the monorepo that want to integrate with Enterprise Portal (one is on our roadmap: Cody Analytics in https://github.com/sourcegraph/cody-analytics). This allows us to share generated bindings and some useful helpers, while keeping things in the monorepo.

### Implications for Cody Clients

For now (and in the future), nothing is likely to change. Here's how I imagine things playing out:

```mermaid
graph TD
  cc["Cody Clients"] -- unified API --> cg[services like Cody Gateway]
  cg -- PLG users --> ssc[Self-Serve Cody]
  cg -- Enterprise users --> ep[Enterprise Portal]
```

## Test plan

CI passes, the schemas can be generated by hand:

```
sg gen buf \
  lib/enterpriseportal/subscriptions/v1/buf.gen.yaml \
  lib/enterpriseportal/codyaccess/v1/buf.gen.yaml
```

---------

Co-authored-by: Joe Chen <joe@sourcegraph.com>
Co-authored-by: Chris Smith <chrsmith@users.noreply.github.com>
This commit is contained in:
Robert Lin 2024-05-15 12:58:55 -07:00 committed by GitHub
parent 553121c5a1
commit d05d4d218f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
25 changed files with 3682 additions and 15 deletions

View File

@ -468,7 +468,7 @@ rules_buf_dependencies()
rules_buf_toolchains(
sha256 = "05dfb45d2330559d258e1230f5a25e154f0a328afda2a434348b5ba4c124ece7",
version = "v1.28.1",
version = "v1.33.0",
)
load("@rules_buf//gazelle/buf:repositories.bzl", "gazelle_buf_dependencies")

View File

@ -31,10 +31,10 @@ func createAnalyzer() *analysis.Analyzer {
Deny[fmt.Sprintf("github.com/google/go-github/v%d/github$", i)] = "Use github.com/google/go-github/v55/github instead. To convert between v48 and v55, use the internal/extsvc/github/githubconvert package"
}
// We don't provide anything for the Files attribute, which means the "Main" list will apply
// to all files. If we wanted to restrict our Deny list to a subset of files, we would add
// Files: []string{"dev/**"}, which would mean it will only deny the import of some packages
// in code under dev/**, thus ignore the rest of the code base.
// If we wanted to restrict our Deny list to a subset of files, we would add
// a new List with Files: []string{"dev/**"}, which would mean it will only
// deny the import of some packages in code under dev/**, thus ignore the
// rest of the code base.
//
// You can also create other lists, that apply different deny/allow lists. Ie:
// "Test": &depguard.List{
@ -46,6 +46,12 @@ func createAnalyzer() *analysis.Analyzer {
settings := &depguard.LinterSettings{
"Main": &depguard.List{
Deny: Deny,
Files: []string{
"$all",
// Don't check generated connectrpc code
"!**/v1/v1connect/**",
},
},
}
analyzer, err := depguard.NewAnalyzer(settings)

View File

@ -19,7 +19,7 @@ import (
var dependencies = []dependency{
"github.com/bufbuild/buf/cmd/buf@v1.11.0",
"github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@v1.5.1",
"google.golang.org/protobuf/cmd/protoc-gen-go@v1.28.1",
"google.golang.org/protobuf/cmd/protoc-gen-go@v1.33.0",
}
type dependency string

7
lib/buf.yaml Normal file
View File

@ -0,0 +1,7 @@
version: v1
breaking:
use:
- FILE
lint:
use:
- DEFAULT

View File

@ -0,0 +1,13 @@
# Enterprise Portal services
`lib/enterpriseportal` defines the gRPC services implemented by Enterprise Portal. Core functionality are defined in `subscriptions/v1`, with extensions defined as separate services implemented by Enterprise Portal, such as `codyaccess/v1`.
To regenerate all relevant bindings:
```sh
sg gen buf \
lib/enterpriseportal/subscriptions/v1/buf.gen.yaml \
lib/enterpriseportal/codyaccess/v1/buf.gen.yaml
```
> **EVERYTHING HERE IS IN A DRAFT STATE** - see [RFC 885](https://docs.google.com/document/d/1tiaW1IVKm_YSSYhH-z7Q8sv4HSO_YJ_Uu6eYDjX7uU4/edit#heading=h.tdaxc5h34u7q).

View File

@ -0,0 +1,42 @@
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("@rules_buf//buf:defs.bzl", "buf_lint_test")
# Bazel-generated files are different from what is generated locally by buf and
# causes compilation errors - the next line disables Gazelle-generated Bazel
# configuration that overrides the generated code that gets committed.
# https://github.com/sourcegraph/devx-support/issues/932#issuecomment-2103608521
# gazelle:proto disable_global
proto_library(
name = "v1_proto",
srcs = ["codyaccess.proto"],
strip_import_prefix = "/lib", # keep
visibility = ["//visibility:public"],
deps = ["@com_google_protobuf//:duration_proto"],
)
go_library(
name = "codyaccess",
srcs = [
"codyaccess.pb.go",
"codyaccess_grpc.pb.go",
],
importpath = "github.com/sourcegraph/sourcegraph/lib/enterpriseportal/codyaccess/v1",
visibility = ["//visibility:public"],
deps = [
"@org_golang_google_grpc//:grpc",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//status",
"@org_golang_google_protobuf//reflect/protoreflect",
"@org_golang_google_protobuf//runtime/protoimpl",
"@org_golang_google_protobuf//types/known/durationpb",
],
)
buf_lint_test(
name = "v1_proto_lint",
timeout = "short",
config = "//internal:buf.yaml",
targets = [":v1_proto"],
)

View File

@ -0,0 +1,17 @@
# Configuration file for https://buf.build/, which we use for Protobuf code generation.
version: v1
plugins:
- plugin: buf.build/grpc/go:v1.3.0
out: .
opt:
- paths=source_relative
- plugin: buf.build/protocolbuffers/go:v1.33.0
out: .
opt:
- paths=source_relative
# Generate connectrpc bindings in Go
- plugin: buf.build/connectrpc/go:v1.16.1
out: .
opt:
- paths=source_relative

View File

@ -0,0 +1,830 @@
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.33.0
// protoc (unknown)
// source: codyaccess.proto
package v1
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
durationpb "google.golang.org/protobuf/types/known/durationpb"
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 CodyGatewayRateLimitSource int32
const (
CodyGatewayRateLimitSource_CODY_GATEWAY_RATE_LIMIT_SOURCE_UNSPECIFIED CodyGatewayRateLimitSource = 0
// Indicates that a custom override for the rate limit has been configured
// and applied.
CodyGatewayRateLimitSource_CODY_GATEWAY_RATE_LIMIT_SOURCE_OVERRIDE CodyGatewayRateLimitSource = 1
// Indicates that the rate limit is inferred by the subscription's active plan.
CodyGatewayRateLimitSource_CODY_GATEWAY_RATE_LIMIT_SOURCE_PLAN CodyGatewayRateLimitSource = 2
)
// Enum value maps for CodyGatewayRateLimitSource.
var (
CodyGatewayRateLimitSource_name = map[int32]string{
0: "CODY_GATEWAY_RATE_LIMIT_SOURCE_UNSPECIFIED",
1: "CODY_GATEWAY_RATE_LIMIT_SOURCE_OVERRIDE",
2: "CODY_GATEWAY_RATE_LIMIT_SOURCE_PLAN",
}
CodyGatewayRateLimitSource_value = map[string]int32{
"CODY_GATEWAY_RATE_LIMIT_SOURCE_UNSPECIFIED": 0,
"CODY_GATEWAY_RATE_LIMIT_SOURCE_OVERRIDE": 1,
"CODY_GATEWAY_RATE_LIMIT_SOURCE_PLAN": 2,
}
)
func (x CodyGatewayRateLimitSource) Enum() *CodyGatewayRateLimitSource {
p := new(CodyGatewayRateLimitSource)
*p = x
return p
}
func (x CodyGatewayRateLimitSource) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (CodyGatewayRateLimitSource) Descriptor() protoreflect.EnumDescriptor {
return file_codyaccess_proto_enumTypes[0].Descriptor()
}
func (CodyGatewayRateLimitSource) Type() protoreflect.EnumType {
return &file_codyaccess_proto_enumTypes[0]
}
func (x CodyGatewayRateLimitSource) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use CodyGatewayRateLimitSource.Descriptor instead.
func (CodyGatewayRateLimitSource) EnumDescriptor() ([]byte, []int) {
return file_codyaccess_proto_rawDescGZIP(), []int{0}
}
type GetCodyGatewayAccessRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Types that are assignable to Query:
//
// *GetCodyGatewayAccessRequest_SubscriptionId
// *GetCodyGatewayAccessRequest_AccessToken
Query isGetCodyGatewayAccessRequest_Query `protobuf_oneof:"query"`
}
func (x *GetCodyGatewayAccessRequest) Reset() {
*x = GetCodyGatewayAccessRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_codyaccess_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetCodyGatewayAccessRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetCodyGatewayAccessRequest) ProtoMessage() {}
func (x *GetCodyGatewayAccessRequest) ProtoReflect() protoreflect.Message {
mi := &file_codyaccess_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 GetCodyGatewayAccessRequest.ProtoReflect.Descriptor instead.
func (*GetCodyGatewayAccessRequest) Descriptor() ([]byte, []int) {
return file_codyaccess_proto_rawDescGZIP(), []int{0}
}
func (m *GetCodyGatewayAccessRequest) GetQuery() isGetCodyGatewayAccessRequest_Query {
if m != nil {
return m.Query
}
return nil
}
func (x *GetCodyGatewayAccessRequest) GetSubscriptionId() string {
if x, ok := x.GetQuery().(*GetCodyGatewayAccessRequest_SubscriptionId); ok {
return x.SubscriptionId
}
return ""
}
func (x *GetCodyGatewayAccessRequest) GetAccessToken() string {
if x, ok := x.GetQuery().(*GetCodyGatewayAccessRequest_AccessToken); ok {
return x.AccessToken
}
return ""
}
type isGetCodyGatewayAccessRequest_Query interface {
isGetCodyGatewayAccessRequest_Query()
}
type GetCodyGatewayAccessRequest_SubscriptionId struct {
// The external, prefixed UUID-format identifier of an Enterprise subscription.
SubscriptionId string `protobuf:"bytes,1,opt,name=subscription_id,json=subscriptionId,proto3,oneof"`
}
type GetCodyGatewayAccessRequest_AccessToken struct {
// An license-based access token that is valid for an Enterprise subscription's
// Cody Gateway access, e.g. 'slk_...'
AccessToken string `protobuf:"bytes,2,opt,name=access_token,json=accessToken,proto3,oneof"`
}
func (*GetCodyGatewayAccessRequest_SubscriptionId) isGetCodyGatewayAccessRequest_Query() {}
func (*GetCodyGatewayAccessRequest_AccessToken) isGetCodyGatewayAccessRequest_Query() {}
type GetCodyGatewayAccessResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Access *CodyGatewayAccess `protobuf:"bytes,1,opt,name=access,proto3" json:"access,omitempty"`
}
func (x *GetCodyGatewayAccessResponse) Reset() {
*x = GetCodyGatewayAccessResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_codyaccess_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetCodyGatewayAccessResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetCodyGatewayAccessResponse) ProtoMessage() {}
func (x *GetCodyGatewayAccessResponse) ProtoReflect() protoreflect.Message {
mi := &file_codyaccess_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 GetCodyGatewayAccessResponse.ProtoReflect.Descriptor instead.
func (*GetCodyGatewayAccessResponse) Descriptor() ([]byte, []int) {
return file_codyaccess_proto_rawDescGZIP(), []int{1}
}
func (x *GetCodyGatewayAccessResponse) GetAccess() *CodyGatewayAccess {
if x != nil {
return x.Access
}
return nil
}
type CodyGatewayRateLimit struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The source of the rate limit configuration.
Source CodyGatewayRateLimitSource `protobuf:"varint,1,opt,name=source,proto3,enum=enterpriseportal.codyaccess.v1.CodyGatewayRateLimitSource" json:"source,omitempty"`
// Requests per time interval.
Limit int64 `protobuf:"varint,2,opt,name=limit,proto3" json:"limit,omitempty"`
// Interval for rate limiting.
IntervalDuration *durationpb.Duration `protobuf:"bytes,3,opt,name=interval_duration,json=intervalDuration,proto3" json:"interval_duration,omitempty"`
}
func (x *CodyGatewayRateLimit) Reset() {
*x = CodyGatewayRateLimit{}
if protoimpl.UnsafeEnabled {
mi := &file_codyaccess_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CodyGatewayRateLimit) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CodyGatewayRateLimit) ProtoMessage() {}
func (x *CodyGatewayRateLimit) ProtoReflect() protoreflect.Message {
mi := &file_codyaccess_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 CodyGatewayRateLimit.ProtoReflect.Descriptor instead.
func (*CodyGatewayRateLimit) Descriptor() ([]byte, []int) {
return file_codyaccess_proto_rawDescGZIP(), []int{2}
}
func (x *CodyGatewayRateLimit) GetSource() CodyGatewayRateLimitSource {
if x != nil {
return x.Source
}
return CodyGatewayRateLimitSource_CODY_GATEWAY_RATE_LIMIT_SOURCE_UNSPECIFIED
}
func (x *CodyGatewayRateLimit) GetLimit() int64 {
if x != nil {
return x.Limit
}
return 0
}
func (x *CodyGatewayRateLimit) GetIntervalDuration() *durationpb.Duration {
if x != nil {
return x.IntervalDuration
}
return nil
}
type CodyGatewayAccessToken struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Access token for authenticating as the subscription holder with managed
// Sourcegraph services.
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
}
func (x *CodyGatewayAccessToken) Reset() {
*x = CodyGatewayAccessToken{}
if protoimpl.UnsafeEnabled {
mi := &file_codyaccess_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CodyGatewayAccessToken) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CodyGatewayAccessToken) ProtoMessage() {}
func (x *CodyGatewayAccessToken) ProtoReflect() protoreflect.Message {
mi := &file_codyaccess_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 CodyGatewayAccessToken.ProtoReflect.Descriptor instead.
func (*CodyGatewayAccessToken) Descriptor() ([]byte, []int) {
return file_codyaccess_proto_rawDescGZIP(), []int{3}
}
func (x *CodyGatewayAccessToken) GetToken() string {
if x != nil {
return x.Token
}
return ""
}
type CodyGatewayAccess struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// The external, prefixed UUID-format identifier for the Enterprise
// subscription corresponding to this Cody Gateway access description.
SubscriptionId string `protobuf:"bytes,1,opt,name=subscription_id,json=subscriptionId,proto3" json:"subscription_id,omitempty"`
// Whether or not a subscription has Cody Gateway access enabled.
Enabled bool `protobuf:"varint,2,opt,name=enabled,proto3" json:"enabled,omitempty"`
// Rate limit for chat completions access, or null if not enabled.
ChatCompletionsRateLimit *CodyGatewayRateLimit `protobuf:"bytes,3,opt,name=chat_completions_rate_limit,json=chatCompletionsRateLimit,proto3,oneof" json:"chat_completions_rate_limit,omitempty"`
// Rate limit for code completions access, or null if not enabled.
CodeCompletionsRateLimit *CodyGatewayRateLimit `protobuf:"bytes,4,opt,name=code_completions_rate_limit,json=codeCompletionsRateLimit,proto3,oneof" json:"code_completions_rate_limit,omitempty"`
// Rate limit for embedding text chunks, or null if not enabled.
EmbeddingsRateLimt *CodyGatewayRateLimit `protobuf:"bytes,5,opt,name=embeddings_rate_limt,json=embeddingsRateLimt,proto3,oneof" json:"embeddings_rate_limt,omitempty"`
// Available access tokens for authenticating as the subscription holder with
// Cody Gateway.
AccessTokens []*CodyGatewayAccessToken `protobuf:"bytes,6,rep,name=access_tokens,json=accessTokens,proto3" json:"access_tokens,omitempty"`
}
func (x *CodyGatewayAccess) Reset() {
*x = CodyGatewayAccess{}
if protoimpl.UnsafeEnabled {
mi := &file_codyaccess_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CodyGatewayAccess) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CodyGatewayAccess) ProtoMessage() {}
func (x *CodyGatewayAccess) ProtoReflect() protoreflect.Message {
mi := &file_codyaccess_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 CodyGatewayAccess.ProtoReflect.Descriptor instead.
func (*CodyGatewayAccess) Descriptor() ([]byte, []int) {
return file_codyaccess_proto_rawDescGZIP(), []int{4}
}
func (x *CodyGatewayAccess) GetSubscriptionId() string {
if x != nil {
return x.SubscriptionId
}
return ""
}
func (x *CodyGatewayAccess) GetEnabled() bool {
if x != nil {
return x.Enabled
}
return false
}
func (x *CodyGatewayAccess) GetChatCompletionsRateLimit() *CodyGatewayRateLimit {
if x != nil {
return x.ChatCompletionsRateLimit
}
return nil
}
func (x *CodyGatewayAccess) GetCodeCompletionsRateLimit() *CodyGatewayRateLimit {
if x != nil {
return x.CodeCompletionsRateLimit
}
return nil
}
func (x *CodyGatewayAccess) GetEmbeddingsRateLimt() *CodyGatewayRateLimit {
if x != nil {
return x.EmbeddingsRateLimt
}
return nil
}
func (x *CodyGatewayAccess) GetAccessTokens() []*CodyGatewayAccessToken {
if x != nil {
return x.AccessTokens
}
return nil
}
type ListCodyGatewayAccessesRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Clients use this field to specify the maximum number of results to be
// returned by the server. The server may further constrain the maximum number
// of results returned in a single page. If the page_size is 0, the server
// will decide the number of results to be returned.
//
// See pagination concepts from https://cloud.google.com/apis/design/design_patterns#list_pagination
PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
// The client uses this field to request a specific page of the list results.
//
// See pagination concepts from https://cloud.google.com/apis/design/design_patterns#list_pagination
PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`
}
func (x *ListCodyGatewayAccessesRequest) Reset() {
*x = ListCodyGatewayAccessesRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_codyaccess_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListCodyGatewayAccessesRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListCodyGatewayAccessesRequest) ProtoMessage() {}
func (x *ListCodyGatewayAccessesRequest) ProtoReflect() protoreflect.Message {
mi := &file_codyaccess_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 ListCodyGatewayAccessesRequest.ProtoReflect.Descriptor instead.
func (*ListCodyGatewayAccessesRequest) Descriptor() ([]byte, []int) {
return file_codyaccess_proto_rawDescGZIP(), []int{5}
}
func (x *ListCodyGatewayAccessesRequest) GetPageSize() int32 {
if x != nil {
return x.PageSize
}
return 0
}
func (x *ListCodyGatewayAccessesRequest) GetPageToken() string {
if x != nil {
return x.PageToken
}
return ""
}
type ListCodyGatewayAccessesResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// This field represents the pagination token to retrieve the next page of
// results. If the value is "", it means no further results for the request.
NextPageToken string `protobuf:"bytes,1,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`
// The list of Cody Gateway access that matched the given query.
Accesses []*CodyGatewayAccess `protobuf:"bytes,2,rep,name=accesses,proto3" json:"accesses,omitempty"`
}
func (x *ListCodyGatewayAccessesResponse) Reset() {
*x = ListCodyGatewayAccessesResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_codyaccess_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ListCodyGatewayAccessesResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ListCodyGatewayAccessesResponse) ProtoMessage() {}
func (x *ListCodyGatewayAccessesResponse) ProtoReflect() protoreflect.Message {
mi := &file_codyaccess_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 ListCodyGatewayAccessesResponse.ProtoReflect.Descriptor instead.
func (*ListCodyGatewayAccessesResponse) Descriptor() ([]byte, []int) {
return file_codyaccess_proto_rawDescGZIP(), []int{6}
}
func (x *ListCodyGatewayAccessesResponse) GetNextPageToken() string {
if x != nil {
return x.NextPageToken
}
return ""
}
func (x *ListCodyGatewayAccessesResponse) GetAccesses() []*CodyGatewayAccess {
if x != nil {
return x.Accesses
}
return nil
}
var File_codyaccess_proto protoreflect.FileDescriptor
var file_codyaccess_proto_rawDesc = []byte{
0x0a, 0x10, 0x63, 0x6f, 0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x12, 0x1e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f,
0x72, 0x74, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e,
0x76, 0x31, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x22, 0x76, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74,
0x65, 0x77, 0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x29, 0x0a, 0x0f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f,
0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0e, 0x73, 0x75,
0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x0c,
0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65,
0x6e, 0x42, 0x07, 0x0a, 0x05, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x69, 0x0a, 0x1c, 0x47, 0x65,
0x74, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x63, 0x63, 0x65,
0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x49, 0x0a, 0x06, 0x61, 0x63,
0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65, 0x6e, 0x74,
0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x63, 0x6f,
0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x64, 0x79,
0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52, 0x06, 0x61,
0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0xc8, 0x01, 0x0a, 0x14, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61,
0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x52,
0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3a,
0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61,
0x6c, 0x2e, 0x63, 0x6f, 0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x2e,
0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x61, 0x74, 0x65, 0x4c,
0x69, 0x6d, 0x69, 0x74, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72,
0x63, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28,
0x03, 0x52, 0x05, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x46, 0x0a, 0x11, 0x69, 0x6e, 0x74, 0x65,
0x72, 0x76, 0x61, 0x6c, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x10,
0x69, 0x6e, 0x74, 0x65, 0x72, 0x76, 0x61, 0x6c, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x22, 0x2e, 0x0a, 0x16, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41,
0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f,
0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e,
0x22, 0xed, 0x04, 0x0a, 0x11, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79,
0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x27, 0x0a, 0x0f, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72,
0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0e, 0x73, 0x75, 0x62, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12,
0x18, 0x0a, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08,
0x52, 0x07, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x78, 0x0a, 0x1b, 0x63, 0x68, 0x61,
0x74, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x61,
0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34,
0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61,
0x6c, 0x2e, 0x63, 0x6f, 0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x2e,
0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x61, 0x74, 0x65, 0x4c,
0x69, 0x6d, 0x69, 0x74, 0x48, 0x00, 0x52, 0x18, 0x63, 0x68, 0x61, 0x74, 0x43, 0x6f, 0x6d, 0x70,
0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74,
0x88, 0x01, 0x01, 0x12, 0x78, 0x0a, 0x1b, 0x63, 0x6f, 0x64, 0x65, 0x5f, 0x63, 0x6f, 0x6d, 0x70,
0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d,
0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72,
0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x64, 0x79,
0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61,
0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x48, 0x01,
0x52, 0x18, 0x63, 0x6f, 0x64, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x88, 0x01, 0x01, 0x12, 0x6b, 0x0a,
0x14, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x5f, 0x72, 0x61, 0x74, 0x65,
0x5f, 0x6c, 0x69, 0x6d, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x65, 0x6e,
0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x63,
0x6f, 0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f, 0x64,
0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x69,
0x74, 0x48, 0x02, 0x52, 0x12, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x52,
0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d, 0x74, 0x88, 0x01, 0x01, 0x12, 0x5b, 0x0a, 0x0d, 0x61, 0x63,
0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x36, 0x2e, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f,
0x72, 0x74, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e,
0x76, 0x31, 0x2e, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x63,
0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73,
0x73, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x63, 0x68, 0x61, 0x74,
0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x61, 0x74,
0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x42, 0x1e, 0x0a, 0x1c, 0x5f, 0x63, 0x6f, 0x64, 0x65,
0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x72, 0x61, 0x74,
0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x42, 0x17, 0x0a, 0x15, 0x5f, 0x65, 0x6d, 0x62, 0x65,
0x64, 0x64, 0x69, 0x6e, 0x67, 0x73, 0x5f, 0x72, 0x61, 0x74, 0x65, 0x5f, 0x6c, 0x69, 0x6d, 0x74,
0x22, 0x5c, 0x0a, 0x1e, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65,
0x77, 0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18,
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x12,
0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x98,
0x01, 0x0a, 0x1f, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77,
0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f,
0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78,
0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x12, 0x4d, 0x0a, 0x08, 0x61, 0x63,
0x63, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x65,
0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e,
0x63, 0x6f, 0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6f,
0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x52,
0x08, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x65, 0x73, 0x2a, 0xa2, 0x01, 0x0a, 0x1a, 0x43, 0x6f,
0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x52, 0x61, 0x74, 0x65, 0x4c, 0x69, 0x6d,
0x69, 0x74, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x12, 0x2e, 0x0a, 0x2a, 0x43, 0x4f, 0x44, 0x59,
0x5f, 0x47, 0x41, 0x54, 0x45, 0x57, 0x41, 0x59, 0x5f, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x4c, 0x49,
0x4d, 0x49, 0x54, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45,
0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x2b, 0x0a, 0x27, 0x43, 0x4f, 0x44, 0x59,
0x5f, 0x47, 0x41, 0x54, 0x45, 0x57, 0x41, 0x59, 0x5f, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x4c, 0x49,
0x4d, 0x49, 0x54, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x4f, 0x56, 0x45, 0x52, 0x52,
0x49, 0x44, 0x45, 0x10, 0x01, 0x12, 0x27, 0x0a, 0x23, 0x43, 0x4f, 0x44, 0x59, 0x5f, 0x47, 0x41,
0x54, 0x45, 0x57, 0x41, 0x59, 0x5f, 0x52, 0x41, 0x54, 0x45, 0x5f, 0x4c, 0x49, 0x4d, 0x49, 0x54,
0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x50, 0x4c, 0x41, 0x4e, 0x10, 0x02, 0x32, 0xce,
0x02, 0x0a, 0x11, 0x43, 0x6f, 0x64, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x53, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x12, 0x96, 0x01, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x43, 0x6f, 0x64, 0x79,
0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x3b, 0x2e,
0x65, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c,
0x2e, 0x63, 0x6f, 0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47,
0x65, 0x74, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x63, 0x63,
0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3c, 0x2e, 0x65, 0x6e, 0x74,
0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x63, 0x6f,
0x64, 0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x43,
0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x12, 0x9f, 0x01,
0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61,
0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x3e, 0x2e, 0x65, 0x6e, 0x74, 0x65,
0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x64,
0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43,
0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73,
0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x3f, 0x2e, 0x65, 0x6e, 0x74, 0x65,
0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2e, 0x63, 0x6f, 0x64,
0x79, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x43,
0x6f, 0x64, 0x79, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x41, 0x63, 0x63, 0x65, 0x73, 0x73,
0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x03, 0x90, 0x02, 0x01, 0x42,
0x47, 0x5a, 0x45, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6f,
0x75, 0x72, 0x63, 0x65, 0x67, 0x72, 0x61, 0x70, 0x68, 0x2f, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
0x67, 0x72, 0x61, 0x70, 0x68, 0x2f, 0x6c, 0x69, 0x62, 0x2f, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x70,
0x72, 0x69, 0x73, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x61, 0x6c, 0x2f, 0x63, 0x6f, 0x64, 0x79, 0x61,
0x63, 0x63, 0x65, 0x73, 0x73, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_codyaccess_proto_rawDescOnce sync.Once
file_codyaccess_proto_rawDescData = file_codyaccess_proto_rawDesc
)
func file_codyaccess_proto_rawDescGZIP() []byte {
file_codyaccess_proto_rawDescOnce.Do(func() {
file_codyaccess_proto_rawDescData = protoimpl.X.CompressGZIP(file_codyaccess_proto_rawDescData)
})
return file_codyaccess_proto_rawDescData
}
var file_codyaccess_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_codyaccess_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_codyaccess_proto_goTypes = []interface{}{
(CodyGatewayRateLimitSource)(0), // 0: enterpriseportal.codyaccess.v1.CodyGatewayRateLimitSource
(*GetCodyGatewayAccessRequest)(nil), // 1: enterpriseportal.codyaccess.v1.GetCodyGatewayAccessRequest
(*GetCodyGatewayAccessResponse)(nil), // 2: enterpriseportal.codyaccess.v1.GetCodyGatewayAccessResponse
(*CodyGatewayRateLimit)(nil), // 3: enterpriseportal.codyaccess.v1.CodyGatewayRateLimit
(*CodyGatewayAccessToken)(nil), // 4: enterpriseportal.codyaccess.v1.CodyGatewayAccessToken
(*CodyGatewayAccess)(nil), // 5: enterpriseportal.codyaccess.v1.CodyGatewayAccess
(*ListCodyGatewayAccessesRequest)(nil), // 6: enterpriseportal.codyaccess.v1.ListCodyGatewayAccessesRequest
(*ListCodyGatewayAccessesResponse)(nil), // 7: enterpriseportal.codyaccess.v1.ListCodyGatewayAccessesResponse
(*durationpb.Duration)(nil), // 8: google.protobuf.Duration
}
var file_codyaccess_proto_depIdxs = []int32{
5, // 0: enterpriseportal.codyaccess.v1.GetCodyGatewayAccessResponse.access:type_name -> enterpriseportal.codyaccess.v1.CodyGatewayAccess
0, // 1: enterpriseportal.codyaccess.v1.CodyGatewayRateLimit.source:type_name -> enterpriseportal.codyaccess.v1.CodyGatewayRateLimitSource
8, // 2: enterpriseportal.codyaccess.v1.CodyGatewayRateLimit.interval_duration:type_name -> google.protobuf.Duration
3, // 3: enterpriseportal.codyaccess.v1.CodyGatewayAccess.chat_completions_rate_limit:type_name -> enterpriseportal.codyaccess.v1.CodyGatewayRateLimit
3, // 4: enterpriseportal.codyaccess.v1.CodyGatewayAccess.code_completions_rate_limit:type_name -> enterpriseportal.codyaccess.v1.CodyGatewayRateLimit
3, // 5: enterpriseportal.codyaccess.v1.CodyGatewayAccess.embeddings_rate_limt:type_name -> enterpriseportal.codyaccess.v1.CodyGatewayRateLimit
4, // 6: enterpriseportal.codyaccess.v1.CodyGatewayAccess.access_tokens:type_name -> enterpriseportal.codyaccess.v1.CodyGatewayAccessToken
5, // 7: enterpriseportal.codyaccess.v1.ListCodyGatewayAccessesResponse.accesses:type_name -> enterpriseportal.codyaccess.v1.CodyGatewayAccess
1, // 8: enterpriseportal.codyaccess.v1.CodyAccessService.GetCodyGatewayAccess:input_type -> enterpriseportal.codyaccess.v1.GetCodyGatewayAccessRequest
6, // 9: enterpriseportal.codyaccess.v1.CodyAccessService.ListCodyGatewayAccesses:input_type -> enterpriseportal.codyaccess.v1.ListCodyGatewayAccessesRequest
2, // 10: enterpriseportal.codyaccess.v1.CodyAccessService.GetCodyGatewayAccess:output_type -> enterpriseportal.codyaccess.v1.GetCodyGatewayAccessResponse
7, // 11: enterpriseportal.codyaccess.v1.CodyAccessService.ListCodyGatewayAccesses:output_type -> enterpriseportal.codyaccess.v1.ListCodyGatewayAccessesResponse
10, // [10:12] is the sub-list for method output_type
8, // [8:10] is the sub-list for method input_type
8, // [8:8] is the sub-list for extension type_name
8, // [8:8] is the sub-list for extension extendee
0, // [0:8] is the sub-list for field type_name
}
func init() { file_codyaccess_proto_init() }
func file_codyaccess_proto_init() {
if File_codyaccess_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_codyaccess_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetCodyGatewayAccessRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_codyaccess_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetCodyGatewayAccessResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_codyaccess_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CodyGatewayRateLimit); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_codyaccess_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CodyGatewayAccessToken); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_codyaccess_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CodyGatewayAccess); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_codyaccess_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListCodyGatewayAccessesRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_codyaccess_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ListCodyGatewayAccessesResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
file_codyaccess_proto_msgTypes[0].OneofWrappers = []interface{}{
(*GetCodyGatewayAccessRequest_SubscriptionId)(nil),
(*GetCodyGatewayAccessRequest_AccessToken)(nil),
}
file_codyaccess_proto_msgTypes[4].OneofWrappers = []interface{}{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_codyaccess_proto_rawDesc,
NumEnums: 1,
NumMessages: 7,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_codyaccess_proto_goTypes,
DependencyIndexes: file_codyaccess_proto_depIdxs,
EnumInfos: file_codyaccess_proto_enumTypes,
MessageInfos: file_codyaccess_proto_msgTypes,
}.Build()
File_codyaccess_proto = out.File
file_codyaccess_proto_rawDesc = nil
file_codyaccess_proto_goTypes = nil
file_codyaccess_proto_depIdxs = nil
}

View File

@ -0,0 +1,105 @@
syntax = "proto3";
package enterpriseportal.codyaccess.v1;
import "google/protobuf/duration.proto";
option go_package = "github.com/sourcegraph/sourcegraph/lib/enterpriseportal/codyaccess/v1";
// CodyAccessService is an extension to Enterprise Portal that serves Cody
// Gateway access management capabilities (e.g. access quotas). It is not the
// Cody Gateway service API itself - it serves capabilities that Cody Gateway
// depends on.
//
// DRAFT STATE - see RFC 885: https://docs.google.com/document/d/1tiaW1IVKm_YSSYhH-z7Q8sv4HSO_YJ_Uu6eYDjX7uU4/edit#heading=h.tdaxc5h34u7q
service CodyAccessService {
// Retrieve Cody Gateway access granted to an Enterprise subscription.
rpc GetCodyGatewayAccess(GetCodyGatewayAccessRequest) returns (GetCodyGatewayAccessResponse) {
option idempotency_level = NO_SIDE_EFFECTS;
}
// List all Cody Gateway accesses granted to any Enterprise subscription.
rpc ListCodyGatewayAccesses(ListCodyGatewayAccessesRequest) returns (ListCodyGatewayAccessesResponse) {
option idempotency_level = NO_SIDE_EFFECTS;
}
}
message GetCodyGatewayAccessRequest {
oneof query {
// The external, prefixed UUID-format identifier of an Enterprise subscription.
string subscription_id = 1;
// An license-based access token that is valid for an Enterprise subscription's
// Cody Gateway access, e.g. 'slk_...'
string access_token = 2;
}
}
message GetCodyGatewayAccessResponse {
CodyGatewayAccess access = 1;
}
enum CodyGatewayRateLimitSource {
CODY_GATEWAY_RATE_LIMIT_SOURCE_UNSPECIFIED = 0;
// Indicates that a custom override for the rate limit has been configured
// and applied.
CODY_GATEWAY_RATE_LIMIT_SOURCE_OVERRIDE = 1;
// Indicates that the rate limit is inferred by the subscription's active plan.
CODY_GATEWAY_RATE_LIMIT_SOURCE_PLAN = 2;
}
message CodyGatewayRateLimit {
// The source of the rate limit configuration.
CodyGatewayRateLimitSource source = 1;
// Requests per time interval.
int64 limit = 2;
// Interval for rate limiting.
google.protobuf.Duration interval_duration = 3;
}
message CodyGatewayAccessToken {
// Access token for authenticating as the subscription holder with managed
// Sourcegraph services.
string token = 1;
}
message CodyGatewayAccess {
// The external, prefixed UUID-format identifier for the Enterprise
// subscription corresponding to this Cody Gateway access description.
string subscription_id = 1;
// Whether or not a subscription has Cody Gateway access enabled.
bool enabled = 2;
// Rate limit for chat completions access, or null if not enabled.
optional CodyGatewayRateLimit chat_completions_rate_limit = 3;
// Rate limit for code completions access, or null if not enabled.
optional CodyGatewayRateLimit code_completions_rate_limit = 4;
// Rate limit for embedding text chunks, or null if not enabled.
optional CodyGatewayRateLimit embeddings_rate_limt = 5;
// Available access tokens for authenticating as the subscription holder with
// Cody Gateway.
repeated CodyGatewayAccessToken access_tokens = 6;
}
message ListCodyGatewayAccessesRequest {
// Clients use this field to specify the maximum number of results to be
// returned by the server. The server may further constrain the maximum number
// of results returned in a single page. If the page_size is 0, the server
// will decide the number of results to be returned.
//
// See pagination concepts from https://cloud.google.com/apis/design/design_patterns#list_pagination
int32 page_size = 1;
// The client uses this field to request a specific page of the list results.
//
// See pagination concepts from https://cloud.google.com/apis/design/design_patterns#list_pagination
string page_token = 2;
}
message ListCodyGatewayAccessesResponse {
// This field represents the pagination token to retrieve the next page of
// results. If the value is "", it means no further results for the request.
string next_page_token = 1;
// The list of Cody Gateway access that matched the given query.
repeated CodyGatewayAccess accesses = 2;
}

View File

@ -0,0 +1,150 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: codyaccess.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
const (
CodyAccessService_GetCodyGatewayAccess_FullMethodName = "/enterpriseportal.codyaccess.v1.CodyAccessService/GetCodyGatewayAccess"
CodyAccessService_ListCodyGatewayAccesses_FullMethodName = "/enterpriseportal.codyaccess.v1.CodyAccessService/ListCodyGatewayAccesses"
)
// CodyAccessServiceClient is the client API for CodyAccessService 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 CodyAccessServiceClient interface {
// Retrieve Cody Gateway access granted to an Enterprise subscription.
GetCodyGatewayAccess(ctx context.Context, in *GetCodyGatewayAccessRequest, opts ...grpc.CallOption) (*GetCodyGatewayAccessResponse, error)
// List all Cody Gateway accesses granted to any Enterprise subscription.
ListCodyGatewayAccesses(ctx context.Context, in *ListCodyGatewayAccessesRequest, opts ...grpc.CallOption) (*ListCodyGatewayAccessesResponse, error)
}
type codyAccessServiceClient struct {
cc grpc.ClientConnInterface
}
func NewCodyAccessServiceClient(cc grpc.ClientConnInterface) CodyAccessServiceClient {
return &codyAccessServiceClient{cc}
}
func (c *codyAccessServiceClient) GetCodyGatewayAccess(ctx context.Context, in *GetCodyGatewayAccessRequest, opts ...grpc.CallOption) (*GetCodyGatewayAccessResponse, error) {
out := new(GetCodyGatewayAccessResponse)
err := c.cc.Invoke(ctx, CodyAccessService_GetCodyGatewayAccess_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *codyAccessServiceClient) ListCodyGatewayAccesses(ctx context.Context, in *ListCodyGatewayAccessesRequest, opts ...grpc.CallOption) (*ListCodyGatewayAccessesResponse, error) {
out := new(ListCodyGatewayAccessesResponse)
err := c.cc.Invoke(ctx, CodyAccessService_ListCodyGatewayAccesses_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// CodyAccessServiceServer is the server API for CodyAccessService service.
// All implementations must embed UnimplementedCodyAccessServiceServer
// for forward compatibility
type CodyAccessServiceServer interface {
// Retrieve Cody Gateway access granted to an Enterprise subscription.
GetCodyGatewayAccess(context.Context, *GetCodyGatewayAccessRequest) (*GetCodyGatewayAccessResponse, error)
// List all Cody Gateway accesses granted to any Enterprise subscription.
ListCodyGatewayAccesses(context.Context, *ListCodyGatewayAccessesRequest) (*ListCodyGatewayAccessesResponse, error)
mustEmbedUnimplementedCodyAccessServiceServer()
}
// UnimplementedCodyAccessServiceServer must be embedded to have forward compatible implementations.
type UnimplementedCodyAccessServiceServer struct {
}
func (UnimplementedCodyAccessServiceServer) GetCodyGatewayAccess(context.Context, *GetCodyGatewayAccessRequest) (*GetCodyGatewayAccessResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetCodyGatewayAccess not implemented")
}
func (UnimplementedCodyAccessServiceServer) ListCodyGatewayAccesses(context.Context, *ListCodyGatewayAccessesRequest) (*ListCodyGatewayAccessesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListCodyGatewayAccesses not implemented")
}
func (UnimplementedCodyAccessServiceServer) mustEmbedUnimplementedCodyAccessServiceServer() {}
// UnsafeCodyAccessServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to CodyAccessServiceServer will
// result in compilation errors.
type UnsafeCodyAccessServiceServer interface {
mustEmbedUnimplementedCodyAccessServiceServer()
}
func RegisterCodyAccessServiceServer(s grpc.ServiceRegistrar, srv CodyAccessServiceServer) {
s.RegisterService(&CodyAccessService_ServiceDesc, srv)
}
func _CodyAccessService_GetCodyGatewayAccess_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetCodyGatewayAccessRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CodyAccessServiceServer).GetCodyGatewayAccess(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: CodyAccessService_GetCodyGatewayAccess_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CodyAccessServiceServer).GetCodyGatewayAccess(ctx, req.(*GetCodyGatewayAccessRequest))
}
return interceptor(ctx, in, info, handler)
}
func _CodyAccessService_ListCodyGatewayAccesses_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListCodyGatewayAccessesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(CodyAccessServiceServer).ListCodyGatewayAccesses(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: CodyAccessService_ListCodyGatewayAccesses_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(CodyAccessServiceServer).ListCodyGatewayAccesses(ctx, req.(*ListCodyGatewayAccessesRequest))
}
return interceptor(ctx, in, info, handler)
}
// CodyAccessService_ServiceDesc is the grpc.ServiceDesc for CodyAccessService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var CodyAccessService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "enterpriseportal.codyaccess.v1.CodyAccessService",
HandlerType: (*CodyAccessServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetCodyGatewayAccess",
Handler: _CodyAccessService_GetCodyGatewayAccess_Handler,
},
{
MethodName: "ListCodyGatewayAccesses",
Handler: _CodyAccessService_ListCodyGatewayAccesses_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "codyaccess.proto",
}

View File

@ -0,0 +1,12 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "v1connect",
srcs = ["codyaccess.connect.go"],
importpath = "github.com/sourcegraph/sourcegraph/lib/enterpriseportal/codyaccess/v1/v1connect",
visibility = ["//visibility:public"],
deps = [
"//lib/enterpriseportal/codyaccess/v1:codyaccess",
"@com_connectrpc_connect//:connect",
],
)

View File

@ -0,0 +1,155 @@
// Code generated by protoc-gen-connect-go. DO NOT EDIT.
//
// Source: codyaccess.proto
package v1connect
import (
connect "connectrpc.com/connect"
context "context"
errors "errors"
v1 "github.com/sourcegraph/sourcegraph/lib/enterpriseportal/codyaccess/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.IsAtLeastVersion1_13_0
const (
// CodyAccessServiceName is the fully-qualified name of the CodyAccessService service.
CodyAccessServiceName = "enterpriseportal.codyaccess.v1.CodyAccessService"
)
// These constants are the fully-qualified names of the RPCs defined in this package. They're
// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
//
// Note that these are different from the fully-qualified method names used by
// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
// period.
const (
// CodyAccessServiceGetCodyGatewayAccessProcedure is the fully-qualified name of the
// CodyAccessService's GetCodyGatewayAccess RPC.
CodyAccessServiceGetCodyGatewayAccessProcedure = "/enterpriseportal.codyaccess.v1.CodyAccessService/GetCodyGatewayAccess"
// CodyAccessServiceListCodyGatewayAccessesProcedure is the fully-qualified name of the
// CodyAccessService's ListCodyGatewayAccesses RPC.
CodyAccessServiceListCodyGatewayAccessesProcedure = "/enterpriseportal.codyaccess.v1.CodyAccessService/ListCodyGatewayAccesses"
)
// These variables are the protoreflect.Descriptor objects for the RPCs defined in this package.
var (
codyAccessServiceServiceDescriptor = v1.File_codyaccess_proto.Services().ByName("CodyAccessService")
codyAccessServiceGetCodyGatewayAccessMethodDescriptor = codyAccessServiceServiceDescriptor.Methods().ByName("GetCodyGatewayAccess")
codyAccessServiceListCodyGatewayAccessesMethodDescriptor = codyAccessServiceServiceDescriptor.Methods().ByName("ListCodyGatewayAccesses")
)
// CodyAccessServiceClient is a client for the enterpriseportal.codyaccess.v1.CodyAccessService
// service.
type CodyAccessServiceClient interface {
// Retrieve Cody Gateway access granted to an Enterprise subscription.
GetCodyGatewayAccess(context.Context, *connect.Request[v1.GetCodyGatewayAccessRequest]) (*connect.Response[v1.GetCodyGatewayAccessResponse], error)
// List all Cody Gateway accesses granted to any Enterprise subscription.
ListCodyGatewayAccesses(context.Context, *connect.Request[v1.ListCodyGatewayAccessesRequest]) (*connect.Response[v1.ListCodyGatewayAccessesResponse], error)
}
// NewCodyAccessServiceClient constructs a client for the
// enterpriseportal.codyaccess.v1.CodyAccessService 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 NewCodyAccessServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) CodyAccessServiceClient {
baseURL = strings.TrimRight(baseURL, "/")
return &codyAccessServiceClient{
getCodyGatewayAccess: connect.NewClient[v1.GetCodyGatewayAccessRequest, v1.GetCodyGatewayAccessResponse](
httpClient,
baseURL+CodyAccessServiceGetCodyGatewayAccessProcedure,
connect.WithSchema(codyAccessServiceGetCodyGatewayAccessMethodDescriptor),
connect.WithIdempotency(connect.IdempotencyNoSideEffects),
connect.WithClientOptions(opts...),
),
listCodyGatewayAccesses: connect.NewClient[v1.ListCodyGatewayAccessesRequest, v1.ListCodyGatewayAccessesResponse](
httpClient,
baseURL+CodyAccessServiceListCodyGatewayAccessesProcedure,
connect.WithSchema(codyAccessServiceListCodyGatewayAccessesMethodDescriptor),
connect.WithIdempotency(connect.IdempotencyNoSideEffects),
connect.WithClientOptions(opts...),
),
}
}
// codyAccessServiceClient implements CodyAccessServiceClient.
type codyAccessServiceClient struct {
getCodyGatewayAccess *connect.Client[v1.GetCodyGatewayAccessRequest, v1.GetCodyGatewayAccessResponse]
listCodyGatewayAccesses *connect.Client[v1.ListCodyGatewayAccessesRequest, v1.ListCodyGatewayAccessesResponse]
}
// GetCodyGatewayAccess calls enterpriseportal.codyaccess.v1.CodyAccessService.GetCodyGatewayAccess.
func (c *codyAccessServiceClient) GetCodyGatewayAccess(ctx context.Context, req *connect.Request[v1.GetCodyGatewayAccessRequest]) (*connect.Response[v1.GetCodyGatewayAccessResponse], error) {
return c.getCodyGatewayAccess.CallUnary(ctx, req)
}
// ListCodyGatewayAccesses calls
// enterpriseportal.codyaccess.v1.CodyAccessService.ListCodyGatewayAccesses.
func (c *codyAccessServiceClient) ListCodyGatewayAccesses(ctx context.Context, req *connect.Request[v1.ListCodyGatewayAccessesRequest]) (*connect.Response[v1.ListCodyGatewayAccessesResponse], error) {
return c.listCodyGatewayAccesses.CallUnary(ctx, req)
}
// CodyAccessServiceHandler is an implementation of the
// enterpriseportal.codyaccess.v1.CodyAccessService service.
type CodyAccessServiceHandler interface {
// Retrieve Cody Gateway access granted to an Enterprise subscription.
GetCodyGatewayAccess(context.Context, *connect.Request[v1.GetCodyGatewayAccessRequest]) (*connect.Response[v1.GetCodyGatewayAccessResponse], error)
// List all Cody Gateway accesses granted to any Enterprise subscription.
ListCodyGatewayAccesses(context.Context, *connect.Request[v1.ListCodyGatewayAccessesRequest]) (*connect.Response[v1.ListCodyGatewayAccessesResponse], error)
}
// NewCodyAccessServiceHandler 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 NewCodyAccessServiceHandler(svc CodyAccessServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
codyAccessServiceGetCodyGatewayAccessHandler := connect.NewUnaryHandler(
CodyAccessServiceGetCodyGatewayAccessProcedure,
svc.GetCodyGatewayAccess,
connect.WithSchema(codyAccessServiceGetCodyGatewayAccessMethodDescriptor),
connect.WithIdempotency(connect.IdempotencyNoSideEffects),
connect.WithHandlerOptions(opts...),
)
codyAccessServiceListCodyGatewayAccessesHandler := connect.NewUnaryHandler(
CodyAccessServiceListCodyGatewayAccessesProcedure,
svc.ListCodyGatewayAccesses,
connect.WithSchema(codyAccessServiceListCodyGatewayAccessesMethodDescriptor),
connect.WithIdempotency(connect.IdempotencyNoSideEffects),
connect.WithHandlerOptions(opts...),
)
return "/enterpriseportal.codyaccess.v1.CodyAccessService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
switch r.URL.Path {
case CodyAccessServiceGetCodyGatewayAccessProcedure:
codyAccessServiceGetCodyGatewayAccessHandler.ServeHTTP(w, r)
case CodyAccessServiceListCodyGatewayAccessesProcedure:
codyAccessServiceListCodyGatewayAccessesHandler.ServeHTTP(w, r)
default:
http.NotFound(w, r)
}
})
}
// UnimplementedCodyAccessServiceHandler returns CodeUnimplemented from all methods.
type UnimplementedCodyAccessServiceHandler struct{}
func (UnimplementedCodyAccessServiceHandler) GetCodyGatewayAccess(context.Context, *connect.Request[v1.GetCodyGatewayAccessRequest]) (*connect.Response[v1.GetCodyGatewayAccessResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("enterpriseportal.codyaccess.v1.CodyAccessService.GetCodyGatewayAccess is not implemented"))
}
func (UnimplementedCodyAccessServiceHandler) ListCodyGatewayAccesses(context.Context, *connect.Request[v1.ListCodyGatewayAccessesRequest]) (*connect.Response[v1.ListCodyGatewayAccessesResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("enterpriseportal.codyaccess.v1.CodyAccessService.ListCodyGatewayAccesses is not implemented"))
}

View File

@ -0,0 +1,43 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@rules_proto_grpc//doc:defs.bzl", "doc_template_compile")
load("@rules_buf//buf:defs.bzl", "buf_lint_test")
# Bazel-generated files are different from what is generated locally by buf and
# causes compilation errors - the next line disables Gazelle-generated Bazel
# configuration that overrides the generated code that gets committed.
# https://github.com/sourcegraph/devx-support/issues/932#issuecomment-2103608521
# gazelle:proto disable_global
proto_library(
name = "v1_proto",
srcs = ["subscriptions.proto"],
strip_import_prefix = "/lib", # keep
visibility = ["//visibility:public"],
deps = ["@com_google_protobuf//:timestamp_proto"],
)
go_library(
name = "subscriptions",
srcs = [
"subscriptions.pb.go",
"subscriptions_grpc.pb.go",
],
importpath = "github.com/sourcegraph/sourcegraph/lib/enterpriseportal/subscriptions/v1",
visibility = ["//visibility:public"],
deps = [
"@org_golang_google_grpc//:grpc",
"@org_golang_google_grpc//codes",
"@org_golang_google_grpc//status",
"@org_golang_google_protobuf//reflect/protoreflect",
"@org_golang_google_protobuf//runtime/protoimpl",
"@org_golang_google_protobuf//types/known/timestamppb",
],
)
buf_lint_test(
name = "v1_proto_lint",
timeout = "short",
config = "//internal:buf.yaml",
targets = [":v1_proto"],
)

View File

@ -0,0 +1,17 @@
# Configuration file for https://buf.build/, which we use for Protobuf code generation.
version: v1
plugins:
- plugin: buf.build/grpc/go:v1.3.0
out: .
opt:
- paths=source_relative
- plugin: buf.build/protocolbuffers/go:v1.33.0
out: .
opt:
- paths=source_relative
# Generate connectrpc bindings in Go
- plugin: buf.build/connectrpc/go:v1.16.1
out: .
opt:
- paths=source_relative

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,224 @@
syntax = "proto3";
package enterpriseportal.subscriptions.v1;
import "google/protobuf/timestamp.proto";
option go_package = "github.com/sourcegraph/sourcegraph/lib/enterpriseportal/subscriptions/v1";
// SubscriptionsService is the service API specification for Enterprise Portal's
// core Enterprise subscription and Enterprise license management capabilities.
//
// Extensions to support additional Enterprise services are expected to be
// defined as separate gRPC services in 'lib/enterpriseportal' - these are
// generally all be implemented by the Enterprise Portal Service directly for
// now.
//
// DRAFT STATE - see RFC 885: https://docs.google.com/document/d/1tiaW1IVKm_YSSYhH-z7Q8sv4HSO_YJ_Uu6eYDjX7uU4/edit#heading=h.tdaxc5h34u7q
service SubscriptionsService {
// GetEnterpriseSubscription retrieves an exact match on an Enterprise subscription.
rpc GetEnterpriseSubscription(GetEnterpriseSubscriptionRequest) returns (GetEnterpriseSubscriptionResponse) {
option idempotency_level = NO_SIDE_EFFECTS;
}
// ListEnterpriseSubscriptions queries for Enterprise subscriptions.
rpc ListEnterpriseSubscriptions(ListEnterpriseSubscriptionsRequest) returns (ListEnterpriseSubscriptionsResponse) {
option idempotency_level = NO_SIDE_EFFECTS;
}
// ListEnterpriseSubscriptionLicenses queries for licenses associated with
// Enterprise subscription licenses, with the ability to list licenses across
// all subscriptions, or just a specific subscription.
//
// Each subscription owns a collection of licenses, typically a series of
// licenses with the most recent one being a subscription's active license.
rpc ListEnterpriseSubscriptionLicenses(ListEnterpriseSubscriptionLicensesRequest) returns (ListEnterpriseSubscriptionLicensesResponse) {
option idempotency_level = NO_SIDE_EFFECTS;
}
}
message EnterpriseSubscriptionCondition {
enum Status {
STATUS_UNSPECIFIED = 0;
// License creation status.
STATUS_CREATED = 1;
// License archival status. i.e. 'is_archived'
STATUS_ARCHIVED = 2;
}
// The time this subscription transitioned into this status.
google.protobuf.Timestamp last_transition_time = 1;
// Status is the type of status corresponding to this condition.
Status status = 2;
// Message is a description of the status transition and why it happened.
string message = 3;
}
// EnterpriseSubscription represents a Sourcegraph Enterprise subscription.
message EnterpriseSubscription {
// ID is the external, prefixed UUID-format identifier for this subscription.
string id = 1;
// Timeline of key events corresponding to this subscription.
repeated EnterpriseSubscriptionCondition conditions = 2;
// Display name of this subscription, e.g. "Acme, Inc."
string display_name = 3;
}
// EnterpriseSubscriptionLicenseKey is the classic offline Sourcegraph license
// key, and corresponds to ENTERPRISE_SUBSCRIPTION_LICENSE_TYPE_KEY.
message EnterpriseSubscriptionLicenseKey {
// Information embedded into the license key.
message Info {
// The tags that indicate which features are activated by this license.
repeated string tags = 1;
// The number of users for which this product subscription is valid.
uint64 user_count = 2;
// The expiration date of this product license. In license data, this is
// called 'expires_at', expressed as the number of seconds since the epoch.
google.protobuf.Timestamp expire_time = 3;
// The Salesforce subscription ID associated with this product license.
string salesforce_subscription_id = 4;
// The Salesforce opportunity ID associated with this product license.
string salesforce_opportunity_id = 5;
}
// Version of this classic license's information schema. It is incremented
// whenever a major change is made to the shape of Info to indicate what
// fields can be expected from the information embedded in the license key.
uint32 info_version = 1;
// Information embedded into the license key.
Info info = 2;
// The license key.
string license_key = 3;
// UUID of the known instance using this license key, self-reported from
// online license checks and pings. Also known as 'site ID'.
string instance_id = 4;
}
message EnterpriseSubscriptionLicenseCondition {
enum Status {
STATUS_UNSPECIFIED = 0;
// License creation status.
STATUS_CREATED = 1;
// License archival status. i.e. 'is_archived'
STATUS_ARCHIVED = 2;
// License revocation status, i.e. 'is_revoked'
STATUS_REVOKED = 3;
}
// The time this subscription transitioned into this status.
google.protobuf.Timestamp last_transition_time = 1;
// Status is the type of status corresponding to this condition.
Status status = 2;
// Message is a description of the status transition and why it happened.
string message = 3;
}
// EnterpriseSubscriptionLicense represents a license for a Sourcegraph
// Enterprise product. Multiple licenses are associated with a single
// subscription, typically a series of licenses with the most recent one being
// a subscription's active license.
message EnterpriseSubscriptionLicense {
// ID is the external, prefixed UUID-format identifier for this license key.
string id = 1;
// The external, prefixed UUID-format identifier for the subscription that
// owns this license.
string subscription_id = 2;
// Timeline of key events corresponding to this license.
repeated EnterpriseSubscriptionLicenseCondition conditions = 3;
// License data, based on the type of the license.
oneof license {
EnterpriseSubscriptionLicenseKey key = 4;
}
}
message GetEnterpriseSubscriptionRequest {
// Query specifies the lookup strategy for this get request.
oneof query {
// Look up a subscription using its external, prefixed UUID-format identifier.
string id = 1;
}
}
message GetEnterpriseSubscriptionResponse {
EnterpriseSubscription subscription = 1;
}
// EnterpriseSubscriptionLicenseType can be used to denote different types of
// licenses.
enum EnterpriseSubscriptionLicenseType {
ENTERPRISE_SUBSCRIPTION_LICENSE_TYPE_UNSPECIFIED = 0;
// The 'license key' type is the classic licensing mechanism that Sourcegraph
// has always had. They are signed by a private key and offline-validated by
// a public key that ships with all Sourcegraph builds.
//
// Each Subscription is expected to have at most one active Sourcegraph classic
// license used by a Sourcegraph instance at a time.
ENTERPRISE_SUBSCRIPTION_LICENSE_TYPE_KEY = 1;
}
message ListEnterpriseSubscriptionsRequest {
// Clients use this field to specify the maximum number of results to be
// returned by the server. The server may further constrain the maximum number
// of results returned in a single page. If the page_size is 0, the server
// will decide the number of results to be returned.
//
// See pagination concepts from https://cloud.google.com/apis/design/design_patterns#list_pagination
int32 page_size = 1;
// The client uses this field to request a specific page of the list results.
//
// See pagination concepts from https://cloud.google.com/apis/design/design_patterns#list_pagination
string page_token = 2;
}
message ListEnterpriseSubscriptionsResponse {
// This field represents the pagination token to retrieve the next page of
// results. If the value is "", it means no further results for the request.
string next_page_token = 1;
// The list of subscriptions that matched the given query.
repeated EnterpriseSubscription subscriptions = 2;
}
message ListEnterpriseSubscriptionLicensesFilter {
oneof filter {
// Return only licenses corresponding to the given subscription ID, with the
// most recently issued licenses first.
string subscription_id = 1;
// Return only licenses of the given type.
EnterpriseSubscriptionLicenseType type = 2;
// Return only licenses with the given archival status.
bool is_archived = 3;
// Return only product subscriptions whose license key contains this
// substring.
string license_key_substring = 4;
}
}
message ListEnterpriseSubscriptionLicensesRequest {
// Clients use this field to specify the maximum number of results to be
// returned by the server. The server may further constrain the maximum number
// of results returned in a single page. If the page_size is 0, the server
// will decide the number of results to be returned.
//
// See pagination concepts from https://cloud.google.com/apis/design/design_patterns#list_pagination
int32 page_size = 1;
// The client uses this field to request a specific page of the list results.
// A zero value requests the first page.
//
// See pagination concepts from https://cloud.google.com/apis/design/design_patterns#list_pagination
//
// TODO: Create an internal pagination token type: https://protobuf.dev/programming-guides/api/#encode-opaque-data-in-strings
string page_token = 2;
// Filters define the lookup strategy for this list request. Multiple filters
// are treated as AND-concatenated.
repeated ListEnterpriseSubscriptionLicensesFilter filters = 3;
}
message ListEnterpriseSubscriptionLicensesResponse {
// This field represents the pagination token to retrieve the next page of
// results. If the value is "", it means no further results for the request.
string next_page_token = 1;
// The list of licenses that matched the given query.
repeated EnterpriseSubscriptionLicense licenses = 2;
}

View File

@ -0,0 +1,199 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: subscriptions.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
const (
SubscriptionsService_GetEnterpriseSubscription_FullMethodName = "/enterpriseportal.subscriptions.v1.SubscriptionsService/GetEnterpriseSubscription"
SubscriptionsService_ListEnterpriseSubscriptions_FullMethodName = "/enterpriseportal.subscriptions.v1.SubscriptionsService/ListEnterpriseSubscriptions"
SubscriptionsService_ListEnterpriseSubscriptionLicenses_FullMethodName = "/enterpriseportal.subscriptions.v1.SubscriptionsService/ListEnterpriseSubscriptionLicenses"
)
// SubscriptionsServiceClient is the client API for SubscriptionsService 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 SubscriptionsServiceClient interface {
// GetEnterpriseSubscription retrieves an exact match on an Enterprise subscription.
GetEnterpriseSubscription(ctx context.Context, in *GetEnterpriseSubscriptionRequest, opts ...grpc.CallOption) (*GetEnterpriseSubscriptionResponse, error)
// ListEnterpriseSubscriptions queries for Enterprise subscriptions.
ListEnterpriseSubscriptions(ctx context.Context, in *ListEnterpriseSubscriptionsRequest, opts ...grpc.CallOption) (*ListEnterpriseSubscriptionsResponse, error)
// ListEnterpriseSubscriptionLicenses queries for licenses associated with
// Enterprise subscription licenses, with the ability to list licenses across
// all subscriptions, or just a specific subscription.
//
// Each subscription owns a collection of licenses, typically a series of
// licenses with the most recent one being a subscription's active license.
ListEnterpriseSubscriptionLicenses(ctx context.Context, in *ListEnterpriseSubscriptionLicensesRequest, opts ...grpc.CallOption) (*ListEnterpriseSubscriptionLicensesResponse, error)
}
type subscriptionsServiceClient struct {
cc grpc.ClientConnInterface
}
func NewSubscriptionsServiceClient(cc grpc.ClientConnInterface) SubscriptionsServiceClient {
return &subscriptionsServiceClient{cc}
}
func (c *subscriptionsServiceClient) GetEnterpriseSubscription(ctx context.Context, in *GetEnterpriseSubscriptionRequest, opts ...grpc.CallOption) (*GetEnterpriseSubscriptionResponse, error) {
out := new(GetEnterpriseSubscriptionResponse)
err := c.cc.Invoke(ctx, SubscriptionsService_GetEnterpriseSubscription_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *subscriptionsServiceClient) ListEnterpriseSubscriptions(ctx context.Context, in *ListEnterpriseSubscriptionsRequest, opts ...grpc.CallOption) (*ListEnterpriseSubscriptionsResponse, error) {
out := new(ListEnterpriseSubscriptionsResponse)
err := c.cc.Invoke(ctx, SubscriptionsService_ListEnterpriseSubscriptions_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *subscriptionsServiceClient) ListEnterpriseSubscriptionLicenses(ctx context.Context, in *ListEnterpriseSubscriptionLicensesRequest, opts ...grpc.CallOption) (*ListEnterpriseSubscriptionLicensesResponse, error) {
out := new(ListEnterpriseSubscriptionLicensesResponse)
err := c.cc.Invoke(ctx, SubscriptionsService_ListEnterpriseSubscriptionLicenses_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// SubscriptionsServiceServer is the server API for SubscriptionsService service.
// All implementations must embed UnimplementedSubscriptionsServiceServer
// for forward compatibility
type SubscriptionsServiceServer interface {
// GetEnterpriseSubscription retrieves an exact match on an Enterprise subscription.
GetEnterpriseSubscription(context.Context, *GetEnterpriseSubscriptionRequest) (*GetEnterpriseSubscriptionResponse, error)
// ListEnterpriseSubscriptions queries for Enterprise subscriptions.
ListEnterpriseSubscriptions(context.Context, *ListEnterpriseSubscriptionsRequest) (*ListEnterpriseSubscriptionsResponse, error)
// ListEnterpriseSubscriptionLicenses queries for licenses associated with
// Enterprise subscription licenses, with the ability to list licenses across
// all subscriptions, or just a specific subscription.
//
// Each subscription owns a collection of licenses, typically a series of
// licenses with the most recent one being a subscription's active license.
ListEnterpriseSubscriptionLicenses(context.Context, *ListEnterpriseSubscriptionLicensesRequest) (*ListEnterpriseSubscriptionLicensesResponse, error)
mustEmbedUnimplementedSubscriptionsServiceServer()
}
// UnimplementedSubscriptionsServiceServer must be embedded to have forward compatible implementations.
type UnimplementedSubscriptionsServiceServer struct {
}
func (UnimplementedSubscriptionsServiceServer) GetEnterpriseSubscription(context.Context, *GetEnterpriseSubscriptionRequest) (*GetEnterpriseSubscriptionResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetEnterpriseSubscription not implemented")
}
func (UnimplementedSubscriptionsServiceServer) ListEnterpriseSubscriptions(context.Context, *ListEnterpriseSubscriptionsRequest) (*ListEnterpriseSubscriptionsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListEnterpriseSubscriptions not implemented")
}
func (UnimplementedSubscriptionsServiceServer) ListEnterpriseSubscriptionLicenses(context.Context, *ListEnterpriseSubscriptionLicensesRequest) (*ListEnterpriseSubscriptionLicensesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListEnterpriseSubscriptionLicenses not implemented")
}
func (UnimplementedSubscriptionsServiceServer) mustEmbedUnimplementedSubscriptionsServiceServer() {}
// UnsafeSubscriptionsServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to SubscriptionsServiceServer will
// result in compilation errors.
type UnsafeSubscriptionsServiceServer interface {
mustEmbedUnimplementedSubscriptionsServiceServer()
}
func RegisterSubscriptionsServiceServer(s grpc.ServiceRegistrar, srv SubscriptionsServiceServer) {
s.RegisterService(&SubscriptionsService_ServiceDesc, srv)
}
func _SubscriptionsService_GetEnterpriseSubscription_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetEnterpriseSubscriptionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SubscriptionsServiceServer).GetEnterpriseSubscription(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: SubscriptionsService_GetEnterpriseSubscription_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SubscriptionsServiceServer).GetEnterpriseSubscription(ctx, req.(*GetEnterpriseSubscriptionRequest))
}
return interceptor(ctx, in, info, handler)
}
func _SubscriptionsService_ListEnterpriseSubscriptions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListEnterpriseSubscriptionsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SubscriptionsServiceServer).ListEnterpriseSubscriptions(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: SubscriptionsService_ListEnterpriseSubscriptions_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SubscriptionsServiceServer).ListEnterpriseSubscriptions(ctx, req.(*ListEnterpriseSubscriptionsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _SubscriptionsService_ListEnterpriseSubscriptionLicenses_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListEnterpriseSubscriptionLicensesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(SubscriptionsServiceServer).ListEnterpriseSubscriptionLicenses(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: SubscriptionsService_ListEnterpriseSubscriptionLicenses_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(SubscriptionsServiceServer).ListEnterpriseSubscriptionLicenses(ctx, req.(*ListEnterpriseSubscriptionLicensesRequest))
}
return interceptor(ctx, in, info, handler)
}
// SubscriptionsService_ServiceDesc is the grpc.ServiceDesc for SubscriptionsService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var SubscriptionsService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "enterpriseportal.subscriptions.v1.SubscriptionsService",
HandlerType: (*SubscriptionsServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetEnterpriseSubscription",
Handler: _SubscriptionsService_GetEnterpriseSubscription_Handler,
},
{
MethodName: "ListEnterpriseSubscriptions",
Handler: _SubscriptionsService_ListEnterpriseSubscriptions_Handler,
},
{
MethodName: "ListEnterpriseSubscriptionLicenses",
Handler: _SubscriptionsService_ListEnterpriseSubscriptionLicenses_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "subscriptions.proto",
}

View File

@ -0,0 +1,12 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "v1connect",
srcs = ["subscriptions.connect.go"],
importpath = "github.com/sourcegraph/sourcegraph/lib/enterpriseportal/subscriptions/v1/v1connect",
visibility = ["//visibility:public"],
deps = [
"//lib/enterpriseportal/subscriptions/v1:subscriptions",
"@com_connectrpc_connect//:connect",
],
)

View File

@ -0,0 +1,201 @@
// Code generated by protoc-gen-connect-go. DO NOT EDIT.
//
// Source: subscriptions.proto
package v1connect
import (
connect "connectrpc.com/connect"
context "context"
errors "errors"
v1 "github.com/sourcegraph/sourcegraph/lib/enterpriseportal/subscriptions/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.IsAtLeastVersion1_13_0
const (
// SubscriptionsServiceName is the fully-qualified name of the SubscriptionsService service.
SubscriptionsServiceName = "enterpriseportal.subscriptions.v1.SubscriptionsService"
)
// These constants are the fully-qualified names of the RPCs defined in this package. They're
// exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
//
// Note that these are different from the fully-qualified method names used by
// google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to
// reflection-formatted method names, remove the leading slash and convert the remaining slash to a
// period.
const (
// SubscriptionsServiceGetEnterpriseSubscriptionProcedure is the fully-qualified name of the
// SubscriptionsService's GetEnterpriseSubscription RPC.
SubscriptionsServiceGetEnterpriseSubscriptionProcedure = "/enterpriseportal.subscriptions.v1.SubscriptionsService/GetEnterpriseSubscription"
// SubscriptionsServiceListEnterpriseSubscriptionsProcedure is the fully-qualified name of the
// SubscriptionsService's ListEnterpriseSubscriptions RPC.
SubscriptionsServiceListEnterpriseSubscriptionsProcedure = "/enterpriseportal.subscriptions.v1.SubscriptionsService/ListEnterpriseSubscriptions"
// SubscriptionsServiceListEnterpriseSubscriptionLicensesProcedure is the fully-qualified name of
// the SubscriptionsService's ListEnterpriseSubscriptionLicenses RPC.
SubscriptionsServiceListEnterpriseSubscriptionLicensesProcedure = "/enterpriseportal.subscriptions.v1.SubscriptionsService/ListEnterpriseSubscriptionLicenses"
)
// These variables are the protoreflect.Descriptor objects for the RPCs defined in this package.
var (
subscriptionsServiceServiceDescriptor = v1.File_subscriptions_proto.Services().ByName("SubscriptionsService")
subscriptionsServiceGetEnterpriseSubscriptionMethodDescriptor = subscriptionsServiceServiceDescriptor.Methods().ByName("GetEnterpriseSubscription")
subscriptionsServiceListEnterpriseSubscriptionsMethodDescriptor = subscriptionsServiceServiceDescriptor.Methods().ByName("ListEnterpriseSubscriptions")
subscriptionsServiceListEnterpriseSubscriptionLicensesMethodDescriptor = subscriptionsServiceServiceDescriptor.Methods().ByName("ListEnterpriseSubscriptionLicenses")
)
// SubscriptionsServiceClient is a client for the
// enterpriseportal.subscriptions.v1.SubscriptionsService service.
type SubscriptionsServiceClient interface {
// GetEnterpriseSubscription retrieves an exact match on an Enterprise subscription.
GetEnterpriseSubscription(context.Context, *connect.Request[v1.GetEnterpriseSubscriptionRequest]) (*connect.Response[v1.GetEnterpriseSubscriptionResponse], error)
// ListEnterpriseSubscriptions queries for Enterprise subscriptions.
ListEnterpriseSubscriptions(context.Context, *connect.Request[v1.ListEnterpriseSubscriptionsRequest]) (*connect.Response[v1.ListEnterpriseSubscriptionsResponse], error)
// ListEnterpriseSubscriptionLicenses queries for licenses associated with
// Enterprise subscription licenses, with the ability to list licenses across
// all subscriptions, or just a specific subscription.
//
// Each subscription owns a collection of licenses, typically a series of
// licenses with the most recent one being a subscription's active license.
ListEnterpriseSubscriptionLicenses(context.Context, *connect.Request[v1.ListEnterpriseSubscriptionLicensesRequest]) (*connect.Response[v1.ListEnterpriseSubscriptionLicensesResponse], error)
}
// NewSubscriptionsServiceClient constructs a client for the
// enterpriseportal.subscriptions.v1.SubscriptionsService 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 NewSubscriptionsServiceClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) SubscriptionsServiceClient {
baseURL = strings.TrimRight(baseURL, "/")
return &subscriptionsServiceClient{
getEnterpriseSubscription: connect.NewClient[v1.GetEnterpriseSubscriptionRequest, v1.GetEnterpriseSubscriptionResponse](
httpClient,
baseURL+SubscriptionsServiceGetEnterpriseSubscriptionProcedure,
connect.WithSchema(subscriptionsServiceGetEnterpriseSubscriptionMethodDescriptor),
connect.WithIdempotency(connect.IdempotencyNoSideEffects),
connect.WithClientOptions(opts...),
),
listEnterpriseSubscriptions: connect.NewClient[v1.ListEnterpriseSubscriptionsRequest, v1.ListEnterpriseSubscriptionsResponse](
httpClient,
baseURL+SubscriptionsServiceListEnterpriseSubscriptionsProcedure,
connect.WithSchema(subscriptionsServiceListEnterpriseSubscriptionsMethodDescriptor),
connect.WithIdempotency(connect.IdempotencyNoSideEffects),
connect.WithClientOptions(opts...),
),
listEnterpriseSubscriptionLicenses: connect.NewClient[v1.ListEnterpriseSubscriptionLicensesRequest, v1.ListEnterpriseSubscriptionLicensesResponse](
httpClient,
baseURL+SubscriptionsServiceListEnterpriseSubscriptionLicensesProcedure,
connect.WithSchema(subscriptionsServiceListEnterpriseSubscriptionLicensesMethodDescriptor),
connect.WithIdempotency(connect.IdempotencyNoSideEffects),
connect.WithClientOptions(opts...),
),
}
}
// subscriptionsServiceClient implements SubscriptionsServiceClient.
type subscriptionsServiceClient struct {
getEnterpriseSubscription *connect.Client[v1.GetEnterpriseSubscriptionRequest, v1.GetEnterpriseSubscriptionResponse]
listEnterpriseSubscriptions *connect.Client[v1.ListEnterpriseSubscriptionsRequest, v1.ListEnterpriseSubscriptionsResponse]
listEnterpriseSubscriptionLicenses *connect.Client[v1.ListEnterpriseSubscriptionLicensesRequest, v1.ListEnterpriseSubscriptionLicensesResponse]
}
// GetEnterpriseSubscription calls
// enterpriseportal.subscriptions.v1.SubscriptionsService.GetEnterpriseSubscription.
func (c *subscriptionsServiceClient) GetEnterpriseSubscription(ctx context.Context, req *connect.Request[v1.GetEnterpriseSubscriptionRequest]) (*connect.Response[v1.GetEnterpriseSubscriptionResponse], error) {
return c.getEnterpriseSubscription.CallUnary(ctx, req)
}
// ListEnterpriseSubscriptions calls
// enterpriseportal.subscriptions.v1.SubscriptionsService.ListEnterpriseSubscriptions.
func (c *subscriptionsServiceClient) ListEnterpriseSubscriptions(ctx context.Context, req *connect.Request[v1.ListEnterpriseSubscriptionsRequest]) (*connect.Response[v1.ListEnterpriseSubscriptionsResponse], error) {
return c.listEnterpriseSubscriptions.CallUnary(ctx, req)
}
// ListEnterpriseSubscriptionLicenses calls
// enterpriseportal.subscriptions.v1.SubscriptionsService.ListEnterpriseSubscriptionLicenses.
func (c *subscriptionsServiceClient) ListEnterpriseSubscriptionLicenses(ctx context.Context, req *connect.Request[v1.ListEnterpriseSubscriptionLicensesRequest]) (*connect.Response[v1.ListEnterpriseSubscriptionLicensesResponse], error) {
return c.listEnterpriseSubscriptionLicenses.CallUnary(ctx, req)
}
// SubscriptionsServiceHandler is an implementation of the
// enterpriseportal.subscriptions.v1.SubscriptionsService service.
type SubscriptionsServiceHandler interface {
// GetEnterpriseSubscription retrieves an exact match on an Enterprise subscription.
GetEnterpriseSubscription(context.Context, *connect.Request[v1.GetEnterpriseSubscriptionRequest]) (*connect.Response[v1.GetEnterpriseSubscriptionResponse], error)
// ListEnterpriseSubscriptions queries for Enterprise subscriptions.
ListEnterpriseSubscriptions(context.Context, *connect.Request[v1.ListEnterpriseSubscriptionsRequest]) (*connect.Response[v1.ListEnterpriseSubscriptionsResponse], error)
// ListEnterpriseSubscriptionLicenses queries for licenses associated with
// Enterprise subscription licenses, with the ability to list licenses across
// all subscriptions, or just a specific subscription.
//
// Each subscription owns a collection of licenses, typically a series of
// licenses with the most recent one being a subscription's active license.
ListEnterpriseSubscriptionLicenses(context.Context, *connect.Request[v1.ListEnterpriseSubscriptionLicensesRequest]) (*connect.Response[v1.ListEnterpriseSubscriptionLicensesResponse], error)
}
// NewSubscriptionsServiceHandler 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 NewSubscriptionsServiceHandler(svc SubscriptionsServiceHandler, opts ...connect.HandlerOption) (string, http.Handler) {
subscriptionsServiceGetEnterpriseSubscriptionHandler := connect.NewUnaryHandler(
SubscriptionsServiceGetEnterpriseSubscriptionProcedure,
svc.GetEnterpriseSubscription,
connect.WithSchema(subscriptionsServiceGetEnterpriseSubscriptionMethodDescriptor),
connect.WithIdempotency(connect.IdempotencyNoSideEffects),
connect.WithHandlerOptions(opts...),
)
subscriptionsServiceListEnterpriseSubscriptionsHandler := connect.NewUnaryHandler(
SubscriptionsServiceListEnterpriseSubscriptionsProcedure,
svc.ListEnterpriseSubscriptions,
connect.WithSchema(subscriptionsServiceListEnterpriseSubscriptionsMethodDescriptor),
connect.WithIdempotency(connect.IdempotencyNoSideEffects),
connect.WithHandlerOptions(opts...),
)
subscriptionsServiceListEnterpriseSubscriptionLicensesHandler := connect.NewUnaryHandler(
SubscriptionsServiceListEnterpriseSubscriptionLicensesProcedure,
svc.ListEnterpriseSubscriptionLicenses,
connect.WithSchema(subscriptionsServiceListEnterpriseSubscriptionLicensesMethodDescriptor),
connect.WithIdempotency(connect.IdempotencyNoSideEffects),
connect.WithHandlerOptions(opts...),
)
return "/enterpriseportal.subscriptions.v1.SubscriptionsService/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
switch r.URL.Path {
case SubscriptionsServiceGetEnterpriseSubscriptionProcedure:
subscriptionsServiceGetEnterpriseSubscriptionHandler.ServeHTTP(w, r)
case SubscriptionsServiceListEnterpriseSubscriptionsProcedure:
subscriptionsServiceListEnterpriseSubscriptionsHandler.ServeHTTP(w, r)
case SubscriptionsServiceListEnterpriseSubscriptionLicensesProcedure:
subscriptionsServiceListEnterpriseSubscriptionLicensesHandler.ServeHTTP(w, r)
default:
http.NotFound(w, r)
}
})
}
// UnimplementedSubscriptionsServiceHandler returns CodeUnimplemented from all methods.
type UnimplementedSubscriptionsServiceHandler struct{}
func (UnimplementedSubscriptionsServiceHandler) GetEnterpriseSubscription(context.Context, *connect.Request[v1.GetEnterpriseSubscriptionRequest]) (*connect.Response[v1.GetEnterpriseSubscriptionResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("enterpriseportal.subscriptions.v1.SubscriptionsService.GetEnterpriseSubscription is not implemented"))
}
func (UnimplementedSubscriptionsServiceHandler) ListEnterpriseSubscriptions(context.Context, *connect.Request[v1.ListEnterpriseSubscriptionsRequest]) (*connect.Response[v1.ListEnterpriseSubscriptionsResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("enterpriseportal.subscriptions.v1.SubscriptionsService.ListEnterpriseSubscriptions is not implemented"))
}
func (UnimplementedSubscriptionsServiceHandler) ListEnterpriseSubscriptionLicenses(context.Context, *connect.Request[v1.ListEnterpriseSubscriptionLicensesRequest]) (*connect.Response[v1.ListEnterpriseSubscriptionLicensesResponse], error) {
return nil, connect.NewError(connect.CodeUnimplemented, errors.New("enterpriseportal.subscriptions.v1.SubscriptionsService.ListEnterpriseSubscriptionLicenses is not implemented"))
}

View File

@ -5,6 +5,7 @@ go 1.22
toolchain go1.22.1
require (
connectrpc.com/connect v1.16.1
github.com/Masterminds/semver v1.5.0
github.com/charmbracelet/glamour v0.5.0
github.com/cockroachdb/errors v1.11.1
@ -37,7 +38,7 @@ require (
golang.org/x/sys v0.17.0
golang.org/x/term v0.17.0
google.golang.org/grpc v1.59.0
google.golang.org/protobuf v1.31.0
google.golang.org/protobuf v1.33.0
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
)

View File

@ -1,4 +1,6 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
connectrpc.com/connect v1.16.1 h1:rOdrK/RTI/7TVnn3JsVxt3n028MlTRwmK5Q4heSpjis=
connectrpc.com/connect v1.16.1/go.mod h1:XpZAduBQUySsb4/KO5JffORVkDI4B6/EYPi7N8xpNZw=
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8=
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
@ -528,8 +530,8 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.27.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

View File

@ -120,7 +120,7 @@ require (
google.golang.org/genproto/googleapis/api v0.0.0-20240108191215-35c7eff3a6b1 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240108191215-35c7eff3a6b1 // indirect
google.golang.org/grpc v1.61.1 // indirect
google.golang.org/protobuf v1.32.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
mvdan.cc/gofumpt v0.5.0 // indirect
)

View File

@ -523,8 +523,8 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I=
google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=

View File

@ -83,7 +83,7 @@ require (
golang.org/x/mod v0.15.0 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/tools v0.18.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
mvdan.cc/gofumpt v0.4.0 // indirect
)

View File

@ -692,8 +692,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI=
google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=