Skip to content

Commit

Permalink
fix: adds TUF URI for customMetadata.
Browse files Browse the repository at this point in the history
Signed-off-by: ianhundere <138915+ianhundere@users.noreply.github.com>
  • Loading branch information
ianhundere committed Feb 27, 2024
1 parent 0bfcc5b commit 7519c2c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/tuf/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ type TargetFile struct {
type customMetadata struct {
Usage UsageKind `json:"usage"`
Status StatusKind `json:"status"`
URI string `json:"uri"`
}

type sigstoreCustomMetadata struct {
Expand Down
4 changes: 4 additions & 0 deletions pkg/tuf/usage_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ const (
Fulcio
Rekor
CTFE
TSA
)

var toUsageString = map[UsageKind]string{
UnknownUsage: "Unknown",
Fulcio: "Fulcio",
Rekor: "Rekor",
CTFE: "CTFE",
TSA: "TSA",
}

func (u UsageKind) String() string {
Expand All @@ -57,6 +59,8 @@ func (u *UsageKind) UnmarshalText(text []byte) error {
*u = Rekor
case "ctfe":
*u = CTFE
case "tsa":
*u = TSA
default:
return fmt.Errorf("error while unmarshalling, UsageKind=%v not valid", string(text))
}
Expand Down

0 comments on commit 7519c2c

Please sign in to comment.