Add ansible Galaxy remote type #137
Reference in New Issue
Block a user
Delete Branch "benvin/remote-ansible"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
ansible-galaxy installs pull collections straight from galaxy.ansible.com because artifactapi has no Galaxy remote type.
ansiblepackage type proxying the Galaxy v3 API (discovery, collection versions, artifact downloads)limit(capped at 100) andoffseton metadata paths, canonicalised; tarball paths forward no queryhref,download_urlandlinks.*to root-relative remote paths so tarballs flow through artifactapiartifacts/*.tar.gzas immutable and JSON metadata as mutablerequires unkin/artifactapi#146
indexes/<remote>/<path>?<q>) and is sent upstream verbatim: any?x=<random>mints unlimited cache entries/objects and upstream requests, and param order/encoding variants split keys → forward only an allowlist (limit,offset; add others only if needed), re-encode viaurl.Values.Encode()(sorted), cap value length/digits, drop everything else.isArtifactruns on path+query, so.../versions/?x=.tar.gzis classified Immutable (cached forever, never rewritten) and content-typed gzip → strip the query (path, _, _ = strings.Cut(path, "?")) before the suffix check; also require the artifacts path segment, not just.tar.gz.?n=1..Non one tarball creates N artifact rows/aliases for the same bytes → only forward the query on non-artifact (metadata) paths.ReplaceAllof"/api/rewrites any JSON string value starting with/api/(descriptions, readme fields) and hardcodes the/api/v1/remote/mount; remote.Name is spliced into the body unescaped → unmarshal and rewrite onlyhref,download_url, andlinks.*, or at minimum JSON-escape the prefix.TestForwardsQueryonly asserts the marker interface; nothing tests the proxy.go change (query appended, no query = unchanged path, non-forwarder providers unchanged) or the cache key → add a handler-level test with a forwarder and a non-forwarder, and a test that unknown params are dropped..tar.gzfinding) and rewrite has no case for a body with other/api/strings or odd remote names → add them.versions/?limit=&offset=+ rewritten links) the PR exists for has no e2e → add a case followinglinks.nextthrough the proxy.provider.QueryForwarder+ proxy.go + allowlist + tests, (2) ansible provider/model/server registration, (3) UI + README + e2e (or fold into 2).No findings.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.