codeartifact

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 27 Imported by: 0

README

CodeArtifact

Parity grade: A · SDK aws-sdk-go-v2/service/codeartifact@v1.38.19 · last audited 2026-07-23 (TBD-fill-in-after-commit)

Coverage

Metric Value
Operations audited 48 (41 ok, 7 partial)
Feature families 3 (3 ok)
Known gaps 6
Deferred items 3
Resource leaks clean
Known gaps
  • Package-group 'weak match' (case-folding, dash/dot/underscore-equivalence, confusable-character normalization used for dependency-confusion protection) is not implemented — only the 'strong' (exact) half of AWS's matching algorithm is (see package_group_pattern_matching family note). Every match this backend reports is therefore always associationType STRONG; real AWS's WEAK association type (and its 'block the package even though a broader group would allow it' side effect) never occurs here.
  • This backend does not auto-create the implicit root package group ('/*') that real AWS attaches to every domain and forbids deleting. Adding it would change GetAssociatedPackageGroup/ListPackageGroups behavior on a domain with zero explicitly-created groups (several existing tests assert 'no groups yet' -> empty list / no match), so it was deliberately left out this pass rather than rewriting that test surface; flagged for a future pass.
  • DescribePackage / DescribePackageVersion auto-create a stub record when the resource doesn't exist, instead of returning ResourceNotFoundException like real AWS. This is pre-existing, intentionally-documented behavior, reconfirmed this pass to be extremely load-bearing test-seeding infrastructure (60+ call sites across handler_package_versions_test.go, handler_package_versions_assets_test.go, persistence_test.go, handler_packages_test.go use GET as a seed operation), so ripping it out remains a large, independently-scoped migration — not touched this pass either. Real behavioral divergence from AWS.
  • GetPackageVersionReadme / ListPackageVersionDependencies now parse real content from a published package.json asset (npm convention — see the ops table), but still return empty for any format/publish that doesn't include a standalone package.json asset (e.g. a real npm tarball, a Maven POM, or any non-npm format) — this backend's single-asset-per-call publish model doesn't unpack archives.
  • GetAuthorizationToken returns a fabricated token string rather than any real credential material; acceptable since nothing validates it downstream, but flagged in case a future op starts checking it.
  • domain-owner / cross-account query param is accepted by real AWS on nearly every op (for cross-account domain access) but is not read anywhere in this backend; single-account-only is assumed throughout.
Deferred
  • Package-group 'weak match' dependency-confusion-protection semantics (see gaps above)
  • Root package-group auto-creation (see gaps above)
  • store_setup.go was read but not modified — no bugs found, not exhaustively re-audited

More

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotFound is returned when a requested resource does not exist.
	ErrNotFound = awserr.New("ResourceNotFoundException", awserr.ErrNotFound)
	// ErrAlreadyExists is returned when a resource already exists.
	ErrAlreadyExists = awserr.New("ConflictException", awserr.ErrConflict)
	// ErrValidation is returned when input validation fails.
	ErrValidation = awserr.New("ValidationException", awserr.ErrInvalidParameter)
)
View Source
var ErrNilAppContext = errors.New("nil app context")

ErrNilAppContext is returned when Init is called with a nil AppContext.

Functions

This section is empty.

Types

type AllowedRepoOp added in v1.2.0

type AllowedRepoOp struct {
	OriginRestrictionType string
	RepositoryName        string
}

AllowedRepoOp is one entry of UpdatePackageGroupOriginConfiguration's addAllowedRepositories/removeAllowedRepositories request lists (mirrors aws-sdk-go-v2 types.PackageGroupAllowedRepository).

type AssetInfo

type AssetInfo struct {
	Name    string `json:"name"`
	SHA256  string `json:"sha256"`
	Content []byte `json:"content,omitempty"`
	Size    int64  `json:"size"`
}

AssetInfo represents an asset (file) uploaded to a package version via PublishPackageVersion. Content holds the raw bytes so GetPackageVersionAsset can serve back exactly what was published, instead of always returning an empty stub.

type Domain

type Domain struct {
	CreatedTime    time.Time  `json:"createdTime"`
	Tags           *tags.Tags `json:"tags,omitempty"`
	Name           string     `json:"name"`
	ARN            string     `json:"arn"`
	EncryptionKey  string     `json:"encryptionKey,omitempty"`
	Owner          string     `json:"owner"`
	Region         string     `json:"region"`
	Status         string     `json:"status"`
	S3BucketARN    string     `json:"s3BucketArn,omitempty"`
	AssetSizeBytes int64      `json:"assetSizeBytes"`
}

Domain represents an AWS CodeArtifact domain.

The Tags field is backend-owned. Callers must treat the returned pointer as read-only; mutate tags only via TagResource / CreateDomain.

type DomainPermissionsPolicy

type DomainPermissionsPolicy struct {
	Document    string `json:"document"`
	Revision    string `json:"revision"`
	ResourceARN string `json:"resourceArn"`
	// contains filtered or unexported fields
}

DomainPermissionsPolicy represents a permissions policy attached to a domain.

type EffectiveRestriction added in v1.2.0

type EffectiveRestriction struct {
	InheritedFrom     *PackageGroup
	Mode              string
	EffectiveMode     string
	RepositoriesCount int
}

EffectiveRestriction is a package group's resolved origin-restriction state for one restriction type, mirroring aws-sdk-go-v2 types.PackageGroupOriginRestriction.

type ExternalConnection

type ExternalConnection struct {
	ExternalConnectionName string `json:"externalConnectionName"`
	PackageFormat          string `json:"packageFormat"`
	Status                 string `json:"status"`
}

ExternalConnection represents a connection of a repository to an external package source.

type Handler

type Handler struct {
	Backend *InMemoryBackend
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(backend *InMemoryBackend) *Handler

func (*Handler) ChaosOperations

func (h *Handler) ChaosOperations() []string

func (*Handler) ChaosRegions

func (h *Handler) ChaosRegions() []string

func (*Handler) ChaosServiceName

func (h *Handler) ChaosServiceName() string

func (*Handler) ExtractOperation

func (h *Handler) ExtractOperation(c *echo.Context) string

func (*Handler) ExtractResource

func (h *Handler) ExtractResource(c *echo.Context) string

func (*Handler) GetSupportedOperations

func (h *Handler) GetSupportedOperations() []string

func (*Handler) Handler

func (h *Handler) Handler() echo.HandlerFunc

func (*Handler) MatchPriority

func (h *Handler) MatchPriority() int

func (*Handler) Name

func (h *Handler) Name() string

func (*Handler) Reset

func (h *Handler) Reset()

func (*Handler) Restore

func (h *Handler) Restore(ctx context.Context, data []byte) error

Restore implements persistence.Persistable by delegating to the backend.

func (*Handler) RouteMatcher

func (h *Handler) RouteMatcher() service.Matcher

func (*Handler) Snapshot

func (h *Handler) Snapshot(ctx context.Context) []byte

Snapshot implements persistence.Persistable by delegating to the backend.

type InMemoryBackend

type InMemoryBackend struct {
	// contains filtered or unexported fields
}

InMemoryBackend is the in-memory store for CodeArtifact resources.

domains and repositories already carry a real, wire-visible Region field, so each registers directly on b.registry as a flat *store.Table keyed by the composite "region|id" string (see regionKey), with a companion *store.Index grouping entries by region for the per-region scans the old region-nested maps used to answer directly -- the region-qualified-table pattern services/emr uses.

packageGroups, packages, and packageVersions have no wire-visible region field, so each gained an unexported region field purely for this composite key; they are "dirty" tables (store.New only, NOT store.Register-ed onto b.registry -- see store_setup.go) round-tripped through a DTO wrapper in persistence.go. repositoryPolicies and domainPolicies are also "dirty" for the same reason (region, plus domainName/repoName -- neither type carries any parent-identity field at all).

externalConnections is deliberately NOT converted: its value, []ExternalConnection, is a slice of plain structs with no identity of its own, so there is nothing for store.Table to key on. It remains a plain region-nested map, unchanged by this refactor.

func NewInMemoryBackend

func NewInMemoryBackend(accountID, region string) *InMemoryBackend

NewInMemoryBackend creates a new in-memory CodeArtifact backend.

func (*InMemoryBackend) AssociateExternalConnection

func (b *InMemoryBackend) AssociateExternalConnection(
	ctx context.Context,
	domainName, repoName, connectionName string,
) (*Repository, error)

AssociateExternalConnection associates an external connection with a repository.

func (*InMemoryBackend) CopyPackageVersions

func (b *InMemoryBackend) CopyPackageVersions(
	ctx context.Context,
	domainName, srcRepo, dstRepo, format, namespace, name string,
	versions []string,
) (map[string]string, error)

CopyPackageVersions copies specified package versions from a source repository to a destination repository in the same domain.

func (*InMemoryBackend) CountRepositoriesInDomain

func (b *InMemoryBackend) CountRepositoriesInDomain(ctx context.Context, domainName string) int

CountRepositoriesInDomain returns the number of repositories in a domain.

func (*InMemoryBackend) CreateDomain

func (b *InMemoryBackend) CreateDomain(
	ctx context.Context, name, encryptionKey string, kv map[string]string,
) (*Domain, error)

CreateDomain creates a new CodeArtifact domain.

func (*InMemoryBackend) CreatePackageGroup

func (b *InMemoryBackend) CreatePackageGroup(
	ctx context.Context,
	domainName, pattern, description, contactInfo string,
	kv map[string]string,
) (*PackageGroup, error)

CreatePackageGroup creates a new CodeArtifact package group.

func (*InMemoryBackend) CreateRepository

func (b *InMemoryBackend) CreateRepository(
	ctx context.Context,
	domainName, repoName, description string,
	kv map[string]string,
	upstreams []string,
) (*Repository, error)

CreateRepository creates a new CodeArtifact repository.

func (*InMemoryBackend) DeleteDomain

func (b *InMemoryBackend) DeleteDomain(ctx context.Context, name string) (*Domain, error)

DeleteDomain deletes a domain by name, cascade-deleting all its repositories, packages, package versions, package groups, external connections, policies, and Tags.

func (*InMemoryBackend) DeleteDomainPermissionsPolicy

func (b *InMemoryBackend) DeleteDomainPermissionsPolicy(
	ctx context.Context, domainName string,
) (*DomainPermissionsPolicy, error)

DeleteDomainPermissionsPolicy removes the permissions policy from a domain. Returns ErrNotFound if the domain does not exist or if no policy has been set.

func (*InMemoryBackend) DeletePackage

func (b *InMemoryBackend) DeletePackage(
	ctx context.Context, domainName, repoName, format, namespace, name string,
) (*Package, error)

DeletePackage deletes a package and all its versions from a repository.

func (*InMemoryBackend) DeletePackageGroup

func (b *InMemoryBackend) DeletePackageGroup(ctx context.Context, domainName, pattern string) (*PackageGroup, error)

DeletePackageGroup deletes a package group by domain and pattern.

func (*InMemoryBackend) DeletePackageVersions

func (b *InMemoryBackend) DeletePackageVersions(
	ctx context.Context,
	domainName, repoName, format, namespace, name string,
	versions []string,
) (map[string]string, error)

DeletePackageVersions deletes specified versions of a package and returns a map of version→errorCode for any versions that could not be deleted.

func (*InMemoryBackend) DeleteRepository

func (b *InMemoryBackend) DeleteRepository(ctx context.Context, domainName, repoName string) (*Repository, error)

DeleteRepository deletes a repository by domain and name, cascade-deleting all its packages, package versions, external connections, permissions policy, and Tags.

func (*InMemoryBackend) DeleteRepositoryPermissionsPolicy

func (b *InMemoryBackend) DeleteRepositoryPermissionsPolicy(
	ctx context.Context,
	domainName, repoName string,
) (*RepositoryPermissionsPolicy, error)

DeleteRepositoryPermissionsPolicy removes the permissions policy from a repository.

func (*InMemoryBackend) DescribeDomain

func (b *InMemoryBackend) DescribeDomain(ctx context.Context, name string) (*Domain, error)

DescribeDomain returns a domain by name.

func (*InMemoryBackend) DescribeOriginInfo added in v1.2.0

func (b *InMemoryBackend) DescribeOriginInfo(
	ctx context.Context, domainName string, pg *PackageGroup,
) (*PackageGroupOriginInfo, error)

DescribeOriginInfo computes pg's PackageGroupOriginInfo. Callers pass a group already fetched from this backend (e.g. via DescribePackageGroup); domainName scopes the hierarchy search to sibling groups in the same domain.

func (*InMemoryBackend) DescribePackage

func (b *InMemoryBackend) DescribePackage(
	ctx context.Context, domainName, repoName, format, namespace, name string,
) (*Package, error)

DescribePackage returns a package by domain, repository, format, namespace, and name. If the package does not already exist in the store, a stub entry is created on the fly so that callers (e.g. Terraform providers) can always retrieve metadata about packages that were published directly to the repository.

func (*InMemoryBackend) DescribePackageGroup

func (b *InMemoryBackend) DescribePackageGroup(ctx context.Context, domainName, pattern string) (*PackageGroup, error)

DescribePackageGroup returns a package group by domain and pattern.

func (*InMemoryBackend) DescribePackageVersion

func (b *InMemoryBackend) DescribePackageVersion(
	ctx context.Context,
	domainName, repoName, format, namespace, name, version string,
) (*PackageVersion, error)

DescribePackageVersion returns a specific version of a package. As with DescribePackage, stub entries are created on demand.

func (*InMemoryBackend) DescribeRepository

func (b *InMemoryBackend) DescribeRepository(ctx context.Context, domainName, repoName string) (*Repository, error)

DescribeRepository returns a repository by domain and name.

func (*InMemoryBackend) DisassociateExternalConnection

func (b *InMemoryBackend) DisassociateExternalConnection(
	ctx context.Context,
	domainName, repoName, connectionName string,
) (*Repository, error)

DisassociateExternalConnection removes an external connection from a repository.

func (*InMemoryBackend) DisposePackageVersions

func (b *InMemoryBackend) DisposePackageVersions(
	ctx context.Context,
	domainName, repoName, format, namespace, name string,
	versions []string,
) (map[string]string, error)

DisposePackageVersions moves specified versions of a package to the Disposed status.

func (*InMemoryBackend) GetAssociatedPackageGroup

func (b *InMemoryBackend) GetAssociatedPackageGroup(
	ctx context.Context,
	domainName, format, namespace, name string,
) (*PackageGroup, error)

GetAssociatedPackageGroup returns the most specific package group whose pattern matches the given package coordinate, per AWS's pattern specificity algorithm (see package_group_pattern.go). Returns (nil, nil) if no group in the domain matches -- not an error per the real API.

Scope note: this backend does not auto-create the implicit root group ("/*") that real AWS attaches to every domain, so an empty domain (or one whose groups don't cover the package) returns no match here where real AWS would always find at least the root group -- see PARITY.md's gaps.

func (*InMemoryBackend) GetDomainPermissionsPolicy

func (b *InMemoryBackend) GetDomainPermissionsPolicy(
	ctx context.Context, domainName string,
) (*DomainPermissionsPolicy, error)

GetDomainPermissionsPolicy retrieves the permissions policy for a domain. Returns ErrNotFound if the domain does not exist or if no policy has been set.

func (*InMemoryBackend) GetExternalConnections

func (b *InMemoryBackend) GetExternalConnections(
	ctx context.Context, domainName, repoName string,
) []ExternalConnection

GetExternalConnections returns a copy of the external connections for a repository.

func (*InMemoryBackend) GetPackageVersionAsset

func (b *InMemoryBackend) GetPackageVersionAsset(
	ctx context.Context,
	domainName, repoName, format, namespace, name, version, asset string,
) ([]byte, error)

GetPackageVersionAsset returns the content of an asset previously uploaded via PublishPackageVersion.

func (*InMemoryBackend) GetPackageVersionReadme

func (b *InMemoryBackend) GetPackageVersionReadme(
	ctx context.Context,
	domainName, repoName, format, namespace, name, version string,
) (string, *PackageVersion, error)

GetPackageVersionReadme returns the "readme" field parsed from a published "package.json" asset (npm convention), if one exists -- see npmPackageJSON's doc comment for scope. Otherwise returns "", same as real AWS would for a package version whose metadata carries no readme. The returned PackageVersion lets callers build the full GetPackageVersionReadmeOutput wire shape (format/namespace/package/ version/versionRevision) without a second lookup.

func (*InMemoryBackend) GetRepositoryPermissionsPolicy

func (b *InMemoryBackend) GetRepositoryPermissionsPolicy(
	ctx context.Context,
	domainName, repoName string,
) (*RepositoryPermissionsPolicy, error)

GetRepositoryPermissionsPolicy retrieves the permissions policy for a repository.

func (*InMemoryBackend) ListAllowedRepositoriesForGroup

func (b *InMemoryBackend) ListAllowedRepositoriesForGroup(
	ctx context.Context,
	domainName, pattern, restrictionType string,
) ([]string, error)

ListAllowedRepositoriesForGroup returns the allowed-repository list for the given package group and origin restriction type.

func (*InMemoryBackend) ListAssociatedPackages

func (b *InMemoryBackend) ListAssociatedPackages(ctx context.Context, domainName, pattern string) ([]*Package, error)

ListAssociatedPackages returns the packages in the domain whose most-specific matching package group (see bestMatchingGroup) is exactly the group identified by pattern. Packages are deduplicated by (format, namespace, name) across every repository in the domain, mirroring how ListPackages dedupes within a single repository.

func (*InMemoryBackend) ListDomains

func (b *InMemoryBackend) ListDomains(ctx context.Context) []*Domain

ListDomains returns all domains sorted by name.

func (*InMemoryBackend) ListPackageGroups

func (b *InMemoryBackend) ListPackageGroups(ctx context.Context, domainName, prefix string) ([]*PackageGroup, error)

ListPackageGroups returns all package groups in a domain, optionally filtered by prefix.

func (*InMemoryBackend) ListPackageVersionAssets

func (b *InMemoryBackend) ListPackageVersionAssets(
	ctx context.Context,
	domainName, repoName, format, namespace, name, version string,
) ([]AssetInfo, error)

ListPackageVersionAssets lists the assets actually uploaded to a package version via PublishPackageVersion.

func (*InMemoryBackend) ListPackageVersionDependencies

func (b *InMemoryBackend) ListPackageVersionDependencies(
	ctx context.Context,
	domainName, repoName, format, namespace, name, version string,
) ([]PackageDependencyInfo, error)

ListPackageVersionDependencies returns dependencies parsed from a published "package.json" asset (npm convention), if one exists -- see npmPackageJSON's doc comment for scope. Otherwise returns an empty list, same as real AWS would for a package version whose metadata carries no dependencies.

func (*InMemoryBackend) ListPackageVersions

func (b *InMemoryBackend) ListPackageVersions(
	ctx context.Context,
	domainName, repoName, format, namespace, name string,
) ([]*PackageVersion, error)

ListPackageVersions lists all versions of a package in a repository.

func (*InMemoryBackend) ListPackages

func (b *InMemoryBackend) ListPackages(
	ctx context.Context, domainName, repoName, format, namespace string,
) ([]*Package, error)

ListPackages lists packages in a repository.

func (*InMemoryBackend) ListRepositories

func (b *InMemoryBackend) ListRepositories(ctx context.Context) []*Repository

ListRepositories returns all repositories across all domains, sorted by name.

func (*InMemoryBackend) ListRepositoriesInDomain

func (b *InMemoryBackend) ListRepositoriesInDomain(ctx context.Context, domainName string) ([]*Repository, error)

ListRepositoriesInDomain returns all repositories in a domain, sorted by name. Returns ErrNotFound if the domain does not exist.

func (*InMemoryBackend) ListSubPackageGroups

func (b *InMemoryBackend) ListSubPackageGroups(
	ctx context.Context,
	domainName, pattern string,
) ([]*PackageGroup, error)

ListSubPackageGroups returns the direct children of the given package group pattern in the pattern hierarchy (see package_group_pattern.go's isProperSubsetPattern): every OTHER group in the domain whose immediate parent (the most specific proper-superset pattern) is exactly this one. Real AWS returns direct children only, not the full descendant subtree (verified against the ListSubPackageGroups API reference).

func (*InMemoryBackend) ListTagsForResource

func (b *InMemoryBackend) ListTagsForResource(ctx context.Context, resourceARN string) (map[string]string, error)

ListTagsForResource returns tags for a resource by ARN.

func (*InMemoryBackend) PublishPackageVersion

func (b *InMemoryBackend) PublishPackageVersion(
	ctx context.Context,
	domainName, repoName, format, namespace, name, version string,
	asset AssetInfo,
) (*PackageVersion, error)

PublishPackageVersion creates or updates a package version in the backend and upserts the uploaded asset (by name) into its Assets list. Unlike DescribePackageVersion's auto-create fallback, this is the real entry point AWS clients use to create a version, so it validates the repository exists first.

func (*InMemoryBackend) PutDomainPermissionsPolicy

func (b *InMemoryBackend) PutDomainPermissionsPolicy(
	ctx context.Context, domainName, document string,
) (*DomainPermissionsPolicy, error)

PutDomainPermissionsPolicy stores a permissions policy for a domain.

func (*InMemoryBackend) PutPackageOriginConfiguration

func (b *InMemoryBackend) PutPackageOriginConfiguration(
	ctx context.Context,
	domainName, repoName, format, namespace, name, publish, upstream string,
) (*Package, error)

PutPackageOriginConfiguration sets a package's publish/upstream origin restrictions and persists the (possibly newly created) package record. publish/upstream default to "ALLOW" when the caller passes an empty string, matching an unconfigured package.

func (*InMemoryBackend) PutRepositoryPermissionsPolicy

func (b *InMemoryBackend) PutRepositoryPermissionsPolicy(
	ctx context.Context,
	domainName, repoName, document string,
) (*RepositoryPermissionsPolicy, error)

PutRepositoryPermissionsPolicy stores a permissions policy for a repository.

func (*InMemoryBackend) Region

func (b *InMemoryBackend) Region() string

Region returns the AWS region this backend is configured for.

func (*InMemoryBackend) Reset

func (b *InMemoryBackend) Reset()

Reset clears all stored resources, closing Tags on each domain, repository, and package group.

func (*InMemoryBackend) Restore

func (b *InMemoryBackend) Restore(ctx context.Context, data []byte) error

Restore loads backend state from a JSON snapshot. It implements persistence.Persistable.

func (*InMemoryBackend) Snapshot

func (b *InMemoryBackend) Snapshot(ctx context.Context) []byte

Snapshot serialises the backend state to JSON. It implements persistence.Persistable.

func (*InMemoryBackend) TagResource

func (b *InMemoryBackend) TagResource(ctx context.Context, resourceARN string, kv map[string]string) error

TagResource adds or replaces tags on a resource by ARN.

func (*InMemoryBackend) UntagResource

func (b *InMemoryBackend) UntagResource(ctx context.Context, resourceARN string, tagKeys []string) error

UntagResource removes tags from a resource by ARN.

func (*InMemoryBackend) UpdatePackageGroup

func (b *InMemoryBackend) UpdatePackageGroup(
	ctx context.Context,
	domainName, pattern, description, contactInfo string,
) (*PackageGroup, error)

UpdatePackageGroup updates description or contact info of a package group.

func (*InMemoryBackend) UpdatePackageGroupOriginConfiguration

func (b *InMemoryBackend) UpdatePackageGroupOriginConfiguration(
	ctx context.Context,
	domainName, pattern string,
	restrictions map[string]string,
	addRepos, removeRepos []AllowedRepoOp,
) (*PackageGroup, map[string]map[string][]string, error)

UpdatePackageGroupOriginConfiguration updates a package group's per-type restriction mode and/or allowed-repository list. Returns the updated group plus a restrictionType -> {"ADDED"|"REMOVED": [repoNames]} map describing exactly what changed, mirroring the real UpdatePackageGroupOriginConfigurationOutput.AllowedRepositoryUpdates shape (verified against aws-sdk-go-v2 deserializers.go).

func (*InMemoryBackend) UpdatePackageVersionsStatus

func (b *InMemoryBackend) UpdatePackageVersionsStatus(
	ctx context.Context,
	domainName, repoName, format, namespace, name, targetStatus string,
	versions []string,
) (map[string]string, error)

UpdatePackageVersionsStatus updates the status of specified package versions.

func (*InMemoryBackend) UpdateRepository

func (b *InMemoryBackend) UpdateRepository(
	ctx context.Context, domainName, repoName, description string, upstreams []string,
) (*Repository, error)

UpdateRepository updates repository description or upstreams.

type Package

type Package struct {
	DomainName  string `json:"domainName"`
	DomainOwner string `json:"domainOwner"`
	Repository  string `json:"repository"`
	Format      string `json:"format"`
	Namespace   string `json:"namespace,omitempty"`
	Name        string `json:"name"`
	// OriginConfigPublish and OriginConfigUpstream mirror
	// PackageOriginRestrictions.Publish/Upstream ("ALLOW" or "BLOCK"), set via
	// PutPackageOriginConfiguration. Both default to "ALLOW", matching a package
	// that has never had its origin configuration explicitly set.
	OriginConfigPublish  string `json:"originConfigPublish,omitempty"`
	OriginConfigUpstream string `json:"originConfigUpstream,omitempty"`
	// contains filtered or unexported fields
}

Package represents an AWS CodeArtifact package (without versions).

type PackageDependencyInfo added in v1.2.0

type PackageDependencyInfo struct {
	DependencyType     string
	Namespace          string
	PackageName        string
	VersionRequirement string
}

PackageDependencyInfo is a single dependency extracted from a package version's published metadata, mirroring aws-sdk-go-v2 types.PackageDependency.

type PackageGroup

type PackageGroup struct {
	CreatedTime time.Time  `json:"createdTime"`
	Tags        *tags.Tags `json:"tags,omitempty"`
	// Restrictions holds the explicitly-set origin-control mode/allowed-repo
	// list for each restriction type ("PUBLISH", "INTERNAL_UPSTREAM",
	// "EXTERNAL_UPSTREAM"), set via UpdatePackageGroupOriginConfiguration. A
	// missing key means "INHERIT" (AWS's default for a newly created,
	// non-root group) -- see resolveEffectiveRestriction in
	// package_groups.go for how the effective mode is resolved by walking
	// the pattern-hierarchy chain (package_group_pattern.go) up to the
	// nearest non-INHERIT ancestor, defaulting to ALLOW if none is found.
	Restrictions map[string]*PackageGroupRestriction `json:"restrictions,omitempty"`
	ARN          string                              `json:"arn"`
	DomainName   string                              `json:"domainName"`
	DomainOwner  string                              `json:"domainOwner"`
	Pattern      string                              `json:"pattern"`
	Description  string                              `json:"description,omitempty"`
	ContactInfo  string                              `json:"contactInfo,omitempty"`
	// contains filtered or unexported fields
}

PackageGroup represents an AWS CodeArtifact package group.

type PackageGroupOriginInfo added in v1.2.0

type PackageGroupOriginInfo struct {
	Parent       *PackageGroup
	Restrictions map[string]EffectiveRestriction
}

PackageGroupOriginInfo bundles a package group's computed origin-control wire data: the resolved EffectiveRestriction for each of the three restriction types, plus its immediate parent in the pattern hierarchy. Handlers use this to build the real PackageGroupDescription/ PackageGroupSummary "originConfiguration"/"parent" wire fields.

type PackageGroupRestriction added in v1.2.0

type PackageGroupRestriction struct {
	// Mode is one of ALLOW, ALLOW_SPECIFIC_REPOSITORIES, BLOCK, or INHERIT.
	Mode string `json:"mode"`
	// AllowedRepositories is only meaningful when Mode is
	// ALLOW_SPECIFIC_REPOSITORIES, but is tracked regardless (AWS allows
	// populating it before switching to that mode).
	AllowedRepositories []string `json:"allowedRepositories,omitempty"`
}

PackageGroupRestriction is the per-origin-type restriction state of a package group -- mirrors the explicitly-configured half of aws-sdk-go-v2's types.PackageGroupOriginRestriction (Mode) plus the allowed-repository list managed by AddAllowedRepositories/ RemoveAllowedRepositories on UpdatePackageGroupOriginConfiguration.

type PackageVersion

type PackageVersion struct {
	PublishedAt time.Time `json:"publishedAt"`
	DomainName  string    `json:"domainName"`
	Repository  string    `json:"repository"`
	Format      string    `json:"format"`
	Namespace   string    `json:"namespace,omitempty"`
	PackageName string    `json:"packageName"`
	Version     string    `json:"version"`
	Status      string    `json:"status"`
	Revision    string    `json:"revision"`

	Assets []AssetInfo `json:"assets,omitempty"`
	// contains filtered or unexported fields
}

PackageVersion represents a single version of an AWS CodeArtifact package.

type Provider

type Provider struct{}

Provider implements service.Provider for AWS CodeArtifact.

func (*Provider) Init

Init initializes the CodeArtifact service backend and handler.

func (*Provider) Name

func (p *Provider) Name() string

Name returns the provider name.

type Repository

type Repository struct {
	CreatedTime          time.Time  `json:"createdTime"`
	Tags                 *tags.Tags `json:"tags,omitempty"`
	Name                 string     `json:"name"`
	ARN                  string     `json:"arn"`
	DomainName           string     `json:"domainName"`
	DomainOwner          string     `json:"domainOwner"`
	Description          string     `json:"description,omitempty"`
	AdministratorAccount string     `json:"administratorAccount"`
	Region               string     `json:"region"`
	UpstreamRepositories []string   `json:"upstreamRepositories,omitempty"`
}

Repository represents an AWS CodeArtifact repository.

The Tags field is backend-owned. Callers must treat the returned pointer as read-only; mutate tags only via TagResource / CreateRepository.

type RepositoryPermissionsPolicy

type RepositoryPermissionsPolicy struct {
	Document    string `json:"document"`
	Revision    string `json:"revision"`
	ResourceARN string `json:"resourceArn"`
	// contains filtered or unexported fields
}

RepositoryPermissionsPolicy represents a permissions policy attached to a repository.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL