Documentation
¶
Index ¶
- Constants
- func BuildApplicationVersionRepoKey(project string) string
- func BuildBuildInfoRepoKey(project string) string
- func BuildGraphQLEntityHasSubjectWith(subject model.EntitySubject) string
- func BuildQuery(template, nodeFields string) string
- func BuildReleaseBundleRepoKey(project string) string
- func GetEnvVariable(envVarName string) (string, error)
- func IsAttachmentsFieldNotFound(err error) bool
- func IsFeatureSupported(feature EvidenceFeature, version string) bool
- func IsFlagPositiveNumber(flag string) bool
- func IsHttpStatusSuccessful(statusCode int) bool
- func IsNonReleaseEvidenceVersion(version string) bool
- func IsRunningUnderGitHubAction() bool
- func IsSonarIntegration(integration string) bool
- func MinVersionForFeature(feature EvidenceFeature) string
- func ParseIsoTimestamp(isoTimestamp string) (time.Time, error)
- func ResolveApplicationEntityProjectKey(serverDetails *config.ServerDetails, subject *model.EntitySubject) error
- func ResolveApplicationProjectKey(serverDetails *config.ServerDetails, applicationKey string) (string, error)
- func ValidateIntegration(integration string) error
- type AqlResult
- type EvidenceFeature
- type NodeFieldsBuilder
Constants ¶
const ( NodeFieldsPlaceholder = "{{NODE_FIELDS}}" // Shared GraphQL node field fragments. FieldDownloadPath = "downloadPath" FieldPredicateType = "predicateType" FieldPredicateSlug = "predicateSlug" FieldPredicate = "predicate" FieldVerified = "verified" FieldCreatedBy = "createdBy" FieldCreatedAt = "createdAt" FieldSubjectSha256 = "subject { sha256 }" // FieldSubjectWithPath includes Artifactory subject location fields used by entity cleanup // and callers that need the stored subject path in addition to the checksum. FieldSubjectWithPath = "subject { sha256 fullPath repositoryKey path name }" FieldSigningKeyAlias = "signingKey { alias }" FieldSigningKeyWithPublicKey = "signingKey {alias, publicKey}" // Optional GraphQL fragments. AttachmentsFragment = "attachments { name sha256 type downloadPath }" )
const DefaultProject = "default"
const IsoDateTimeLayout = "2006-01-02T15:04:05.000-0700"
const SonarIntegration = "sonar"
Variables ¶
This section is empty.
Functions ¶
func BuildApplicationVersionRepoKey ¶ added in v0.8.1
func BuildBuildInfoRepoKey ¶
func BuildGraphQLEntityHasSubjectWith ¶ added in v0.10.0
func BuildGraphQLEntityHasSubjectWith(subject model.EntitySubject) string
BuildGraphQLEntityHasSubjectWith builds the GraphQL hasSubjectWith fields for an entity subject. Exactly one of EntityRepo, ProjectKey, and ApplicationKey may be set (or none).
func BuildQuery ¶ added in v0.9.0
BuildQuery replaces every occurrence of NodeFieldsPlaceholder in template with the provided nodeFields string.
func GetEnvVariable ¶
func IsAttachmentsFieldNotFound ¶ added in v0.9.0
func IsFeatureSupported ¶ added in v0.10.0
func IsFeatureSupported(feature EvidenceFeature, version string) bool
IsFeatureSupported reports whether the given Evidence service version supports feature. Non-release / development version strings are treated as supported so local and snapshot builds are not blocked. Unknown features are not supported.
func IsFlagPositiveNumber ¶
func IsHttpStatusSuccessful ¶ added in v0.9.0
func IsNonReleaseEvidenceVersion ¶ added in v0.10.0
IsNonReleaseEvidenceVersion reports whether version is anything other than a pure major.minor.patch release string (e.g. "7.1285.0"). Production Evidence returns that form only; every other string (dev, SNAPSHOT, empty, suffixes) is treated as development and should not fail feature checks.
func IsRunningUnderGitHubAction ¶
func IsRunningUnderGitHubAction() bool
func IsSonarIntegration ¶
func MinVersionForFeature ¶ added in v0.10.0
func MinVersionForFeature(feature EvidenceFeature) string
MinVersionForFeature returns the minimum Evidence release that supports feature, or an empty string when the feature is unknown.
func ResolveApplicationEntityProjectKey ¶ added in v0.10.0
func ResolveApplicationEntityProjectKey(serverDetails *config.ServerDetails, subject *model.EntitySubject) error
ResolveApplicationEntityProjectKey resolves project scope for bare application-entity subjects (entity-type=application with no --project/--entity-repo/--application-key scope already set). When resolution is not needed, subject is left unchanged.
func ResolveApplicationProjectKey ¶ added in v0.10.0
func ResolveApplicationProjectKey(serverDetails *config.ServerDetails, applicationKey string) (string, error)
ResolveApplicationProjectKey looks up an application in AppTrust and returns its project key.
func ValidateIntegration ¶
Types ¶
type AqlResult ¶
type AqlResult struct {
Results []*servicesUtils.ResultItem `json:"results,omitempty"`
}
func ExecuteAqlQuery ¶
func ExecuteAqlQuery(query string, client *artifactory.ArtifactoryServicesManager) (*AqlResult, error)
ExecuteAqlQuery executes an AQL query and returns the result.
type EvidenceFeature ¶ added in v0.10.0
type EvidenceFeature string
EvidenceFeature identifies an Evidence service capability gated by a minimum version.
const ( // FeatureEntityAPI is the Evidence /entity create, get, and verify APIs. FeatureEntityAPI EvidenceFeature = "entityAPI" )
type NodeFieldsBuilder ¶ added in v0.9.0
type NodeFieldsBuilder struct {
// contains filtered or unexported fields
}
NodeFieldsBuilder composes GraphQL node field lists dynamically, avoiding combinatorial explosion of query constants when optional fields (attachments, predicate, publicKey, etc.) are involved.
func NewNodeFieldsBuilder ¶ added in v0.9.0
func NewNodeFieldsBuilder(baseFields ...string) *NodeFieldsBuilder
NewNodeFieldsBuilder creates a builder pre-populated with the given base fields.
func (*NodeFieldsBuilder) Build ¶ added in v0.9.0
func (b *NodeFieldsBuilder) Build() string
Build returns the space-joined field list ready for insertion into a query template.
func (*NodeFieldsBuilder) WithIf ¶ added in v0.9.0
func (b *NodeFieldsBuilder) WithIf(condition bool, field string) *NodeFieldsBuilder
WithIf appends field to the list only when condition is true.