Repository navigation
feat(coana): download the Coana CLI through SOCKET_COANA_MIRROR_URL - #1825
Draft
Oskar Haarklou Veileborg (BarrensZeppelin) wants to merge 1 commit into
Draft
Oskar Haarklou Veileborg (BarrensZeppelin) wants to merge 1 commit into
Oskar Haarklou Veileborg (BarrensZeppelin) wants to merge 1 commit into
Conversation
Machines that can't reach storage.googleapis.com can mirror Coana's bucket, for example with an Artifactory remote repository, and set SOCKET_COANA_MIRROR_URL to it. Each signed URL for the cli component then has its https://storage.googleapis.com/socket-coana-cli/ prefix replaced with the mirror's URL, keeping the signature, including the URL requested anew after a 4xx. Coana, which inherits the variable, follows the same rule for its own components. A signed URL outside the bucket is refused rather than fetched from GCS. A mirror URL that isn't https, or that has a query or fragment, is refused before the API is asked, without echoing the value. socket-cli downloads over https only, so unlike Coana it doesn't accept an http mirror.
Contributor
|
Love it Oskar Haarklou Veileborg (@BarrensZeppelin) ❤️ ! |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
socket-cli's side of mirror support that Coana is also gaining for its own downloads.
Machines that can't reach
storage.googleapis.comcan mirror Coana's bucket, for example with an Artifactory generic remote repository with "Propagate Query Params" turned on, and setSOCKET_COANA_MIRROR_URLto it. socket-cli then downloads theclicomponent from the mirror:https://storage.googleapis.com/socket-coana-cli/of the signed URL is replaced with the mirror's URL, with a/appended when it lacks one. The query string, which holds the signature, is kept.requestArtifacts, so the URL requested anew after a 4xx is rewritten too...or%2e%2e. The error leaves out the signature.Coana inherits the variable through the user's environment and applies the same rule to its own
analyzersandfactsdownloads, once the pinned Coana supports the variable.Depends on a Coana version bump that supports the inherited
SOCKET_COANA_MIRROR_URL.Tests
New cases in
src/utils/coana-release.test.mtsmock the API and the download, and use an empty cache per test with the real cache script:All 13 fail against the previous implementation.
Expected reviewer effort: High-level design decisions