-
Notifications
You must be signed in to change notification settings - Fork 38
feat(referrers): shared index API #441
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(referrers): shared index API #441
Conversation
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez Trivino <miguel@chainloop.dev>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Looking forward to it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks good to me.
just 1 comment about nomenclature but it's not a blocker, I can approve it
|
||
func NewReferrerDiscover(cfg *ActionsOpts) *ReferrerDiscover { | ||
func NewReferrerDiscoverPrivate(cfg *ActionsOpts) *ReferrerDiscover { | ||
return &ReferrerDiscover{cfg} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe here we have some nomenclature inconsistency?
xyzPrivate vs. xyzPublic everywhere, except here: the public has the "Public" suffix, the private it simply doesn't have suffix
indexConfig *conf.ReferrerSharedIndex | ||
} | ||
|
||
func NewReferrerUseCase(repo ReferrerRepo, wfRepo WorkflowRepo, mRepo MembershipRepo, indexCfg *conf.ReferrerSharedIndex, l log.Logger) (*ReferrerUseCase, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[very nit]
Maybe when the decl is this long, it could be done vertical?
func NewReferrerUseCase(
repo ReferrerRepo,
wfRepo WorkflowRepo,
mRepo MembershipRepo,
indexCfg *conf.ReferrerSharedIndex,
l log.Logger,
) (
*ReferrerUseCase,
error,
) {
...
}
Not a big deal thogh.
Never mind, it's merged already |
Exposes a discovery API that returns the referrers from public workflows of allowed organizations.
In practice, an organization that has been added to the allowList can mark a workflow as public, and its referrers will be exposed through a shared public, index.
Configuration
The list of organizations that can opt to publish referrers in the shared index is defined via a static configuration sntry. This acts as a trusted publisher mechanism.
API changes
This public index is available both via gRPC and HTTP and DOES NOT require authentication
Behavior
For example, let's say we have an artifact associated with five attestations.
By calling the discover endpoint, you'll get all the attestations regardless of whether they belong to a private or a public workflow. They belong to one of your organizations.
But there is a way to only get public referrers added to the shared index, by passing the
--public
flag.This one includes only the public attestations for this org.
HTTP endpoint
The HTTP endpoint is
/discover/sha256:...
$ curl -s "http://localhost:8000/discover/sha256:4b83ebba199499a1cbbd58517f5818d8e3fd56cb5cc244c26f4dd0729e2fccb2"
Other implementation changes
Refs #435