Skip to content
Merged
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
48 changes: 37 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.

19 changes: 19 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,20 @@ message ReferrerServiceDiscoverPrivateRequest {
string kind = 2;
// Pagination options for the references list
CursorPaginationRequest pagination = 3;
// ProjectName optionally scopes the discovery to a project by name. Can be set on its own
// (project-wide filter) or together with project_version (project + version filter).
string project_name = 4;
// ProjectVersion optionally scopes the discovery to a project version (by name, e.g. v1.2.0).
// Requires project_name, since a version name is unique only within a project.
string project_version = 5;

// project_version requires project_name (a version name is unique only within a project);
// project_name on its own is allowed.
option (buf.validate.message).cel = {
id: "discover_project_version_requires_project_name"
expression: "!(this.project_version != '' && this.project_name == '')"
message: "project_name must be set when project_version is set"
};

option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = {
json_schema: {
Expand All @@ -70,7 +86,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.

52 changes: 49 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