-
Notifications
You must be signed in to change notification settings - Fork 503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add artifactory storage backend #1671
base: main
Are you sure you want to change the base?
Conversation
Seems like the test failure is unrelated to the PR |
@bored-engineer yea, I think that's a flake. I restarted it. One question though - would it not be better to just use Artifactory as an upstream? iirc you can use it as a Go module server as well |
Yes, that would absolutely make sense if that's an available in your environment. JFrog offers a Go Registry that should be the first option to use. In our environment that was not an option but using Artifactory as a storage backend was a business requirement (due to in-built compliance/security controls). |
@bored-engineer makes sense. Ok I will review this right now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bored-engineer this looks very well done, thanks for submitting it. The only thing left would be to write some tests.
What is the problem I am trying to address?
Add the option to use Artifactory as a storage backend for athens.
The implementation it is very similar to the existing
external
provider with a few tweaks specific to the Artifactory REST API and specific configuration options added for usability.Note: This client uses artifactory as a generic object storage backend, it may or may not be compatible with the folder structure created by official Artifactory Go Registry plugin.
How is the fix applied?
Implements a new
storage.Backend
which uses the Artifactory REST API to read/write objects.The upload action is accomplished by writing a zip file (generated on the fly) and using the
X-Explode-Archive: true
andX-Explode-Archive-Atomic: true
so the objects are extracted atomically into a folder by artifactory.Lister functionality is accomplished by the FolderInfo API call.
What GitHub issue(s) does this PR fix or close?
Fixes #1130 (which was already closed/abandoned but is the closest match)