Documentation
¶
Index ¶
- func BranchFromGitRef(ref string) (string, error)
- func DecodeSignature(s string) ([]byte, error)
- func IsValidBuilderTag(ref string, testing bool) error
- func IsValidJreleaserBuilderTag(ref string) error
- func MergeMaps[K comparable, V any](m1, m2 map[K]V) map[K]V
- func NormalizeGitURI(s string) string
- func ParseBuilderID(id string, needVersion bool) (string, string, error)
- func ParseGitRef(ref string) (string, string)
- func ParseGitURIAndRef(uri string) (string, string, error)
- func PayloadFromEnvelope(env *dsselib.Envelope) ([]byte, error)
- func TagFromGitRef(ref string) (string, error)
- func ValidateGitRef(refType, ref string) (string, error)
- func VerifyVersionedTag(provenanceTag, expectedTag string) error
- type TrustedBuilderID
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BranchFromGitRef ¶ added in v2.4.0
BranchFromGitRef returns the tagname from a tag ref.
func DecodeSignature ¶ added in v2.1.0
func IsValidBuilderTag ¶ added in v2.4.0
IsValidBuilderTag validates if the given ref is a valid builder tag.
func IsValidJreleaserBuilderTag ¶ added in v2.4.0
func MergeMaps ¶ added in v2.4.0
func MergeMaps[K comparable, V any](m1, m2 map[K]V) map[K]V
func NormalizeGitURI ¶ added in v2.4.0
NormalizeGitURI normalizes a git URI to include a git+https:// prefix.
func ParseBuilderID ¶
ParseBuilderID parses the builder ID into the URI and ref parts.
func ParseGitRef ¶ added in v2.4.0
ParseGitRef parses the git ref and returns its type and name.
func ParseGitURIAndRef ¶ added in v2.4.0
ParseGitURIAndRef retrieves the URI and ref from the given URI.
func PayloadFromEnvelope ¶ added in v2.1.0
func TagFromGitRef ¶ added in v2.4.0
TagFromGitRef returns the tagname from a tag ref.
func ValidateGitRef ¶ added in v2.4.0
ValidateGitRef validates that the given git ref is a valid ref of the given type and returns its name.
func VerifyVersionedTag ¶ added in v2.2.0
Types ¶
type TrustedBuilderID ¶
type TrustedBuilderID struct {
// contains filtered or unexported fields
}
TrustedBuilderID represents a builder ID that has been explicitly trusted.
func TrustedBuilderIDNew ¶
func TrustedBuilderIDNew(builderID string, needVersion bool) (*TrustedBuilderID, error)
TrustedBuilderIDNew creates a new BuilderID structure.
func (*TrustedBuilderID) MatchesFull ¶ added in v2.3.0
func (b *TrustedBuilderID) MatchesFull(builderID string, allowRef bool) error
MatchesFull matches the builderID string against the reference builderID. Both the name and versions are always verified.
func (*TrustedBuilderID) MatchesLoose ¶ added in v2.3.0
func (b *TrustedBuilderID) MatchesLoose(builderID string, allowRef bool) error
MatchesLoose matches the builderID string against the reference builderID. If the builderID contains a semver, the full builderID must match. Otherwise, only the name needs to match. `allowRef: true` indicates that the matching need not be an eaxct match. In this case, if the BuilderID version is a GitHub ref `refs/tags/name`, we will consider it equal to user-provided builderID `name`.
func (*TrustedBuilderID) Name ¶
func (b *TrustedBuilderID) Name() string
Name returns the trusted builder's name.
func (*TrustedBuilderID) String ¶
func (b *TrustedBuilderID) String() string
String returns the full trusted builder ID as a string.
func (*TrustedBuilderID) Version ¶
func (b *TrustedBuilderID) Version() string
Version returns the trusted builder's version reference if any.