start pulling in the github api client wrapper
Signed-off-by: Meredith Lancaster <malancas@github.com>
This commit is contained in:
parent
97c10f4c04
commit
5462df5e7b
3 changed files with 52 additions and 3 deletions
33
pkg/cmd/attestation/github/attestation.go
Normal file
33
pkg/cmd/attestation/github/attestation.go
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
package github
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/sigstore/sigstore-go/pkg/bundle"
|
||||
)
|
||||
|
||||
const (
|
||||
GetAttestationByRepoAndSubjectDigestPath = "repos/%s/attestations/%s"
|
||||
GetAttestationByOwnerAndSubjectDigestPath = "orgs/%s/attestations/%s"
|
||||
)
|
||||
|
||||
type ErrNoAttestations struct {
|
||||
name string
|
||||
digest string
|
||||
}
|
||||
|
||||
func (e ErrNoAttestations) Error() string {
|
||||
return fmt.Sprintf("no attestations found for digest %s in %s", e.name, e.digest)
|
||||
}
|
||||
|
||||
func newErrNoAttestations(name, digest string) ErrNoAttestations {
|
||||
return ErrNoAttestations{name, digest}
|
||||
}
|
||||
|
||||
type Attestation struct {
|
||||
Bundle *bundle.ProtobufBundle `json:"bundle"`
|
||||
}
|
||||
|
||||
type AttestationsResponse struct {
|
||||
Attestations []*Attestation `json:"attestations"`
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue