Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/cli/pkg/action/referrer_discover.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ func NewReferrerDiscoverPublicIndex(cfg *ActionsOpts) *ReferrerDiscoverPublic {
return &ReferrerDiscoverPublic{cfg}
}

// Run calls the deprecated public shared index RPC, kept for backwards compatibility.
//
//nolint:staticcheck // the RPC is deprecated but still supported
func (action *ReferrerDiscoverPublic) Run(ctx context.Context, digest, kind string, p *PaginationOpts) (*ReferrerDiscoverResult, error) {
client := pb.NewReferrerServiceClient(action.cfg.CPConnection)
resp, err := client.DiscoverPublicShared(ctx, &pb.DiscoverPublicSharedRequest{
Expand Down
49 changes: 38 additions & 11 deletions app/controlplane/api/controlplane/v1/referrer.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 20 additions & 0 deletions app/controlplane/api/controlplane/v1/referrer.proto
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ service ReferrerService {
};
}
// DiscoverPublicShared returns the referrer item for a given digest in the public shared index
// Deprecated: the public shared index is being retired.
rpc DiscoverPublicShared(DiscoverPublicSharedRequest) returns (DiscoverPublicSharedResponse) {
option deprecated = true;
option (google.api.http) = {get: "/discover/shared/{digest}"};
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = {
summary: "Discover public shared referrer"
Expand All @@ -60,6 +62,21 @@ message ReferrerServiceDiscoverPrivateRequest {
string kind = 2;
// Pagination options for the references list
CursorPaginationRequest pagination = 3;
// ProjectName optionally scopes the discovery to a project by name.
// Must be set together with project_version.
string project_name = 4;
// ProjectVersion optionally scopes the discovery to a project version (by name, e.g. v1.2.0).
// The referrer and its references are confined to this project version.
// Must be set together with project_name.
string project_version = 5;

// project_name and project_version must be provided together: a version name is unique only
// within a project, and a project name on its own would not scope the discovery.
option (buf.validate.message).cel = {
id: "discover_project_version_dependency"
expression: "(this.project_name == '') == (this.project_version == '')"
message: "project_name and project_version must be set together"
};

option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
json_schema: {
Expand All @@ -70,7 +87,10 @@ message ReferrerServiceDiscoverPrivateRequest {
}

// DiscoverPublicSharedRequest is the request for the DiscoverPublicShared method
// Deprecated: the public shared index is being retired.
message DiscoverPublicSharedRequest {
option deprecated = true;

// Digest is the unique identifier of the referrer to discover
string digest = 1 [(buf.validate.field).string = {min_len: 1}];
// Kind is the optional type of referrer, i.e CONTAINER_IMAGE, GIT_HEAD, ...
Expand Down
5 changes: 5 additions & 0 deletions app/controlplane/api/controlplane/v1/referrer_grpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions app/controlplane/api/controlplane/v1/referrer_http.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 50 additions & 3 deletions app/controlplane/api/gen/frontend/controlplane/v1/referrer.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading