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 S3 storage service #144
Conversation
@loic-sharma I have a few thoughts and questions. Shouldn't the storage services be simpler than this?I would imagine that it would be possible to have a storage service inteface that implements the following:
Then a service could be built around this, that exposes the Nuspec/Package/Readme specifics. All storage services would be shielded from new package types (.snupkg), and services could expose new features without breaking implementations. Adding the GetDownloadUrl() is useful for redirections, see #25. S3 would provide pre-signed urls (or whatever it needs to provie). Azure would do the same. Is it necessary to add all storage implementations in the web project?It seems odd to me to add all services, and then finally "remap" one service by adding it as the intended interface. Wouldn't it be better to have the wanted service register itself as the intended interface directly? Why put the storage clients in the DI framework?This is more of a preference thing: Why add the Azure Blobs-specific client to the DI, only to pull it out and give it to one specific implementation? It's not like it can be exchanged (no use of interfaces :P) .. so why not create the Azure Blobs client within |
Note: I did register the services in the web project, but didn't commit it because I missed it -- I'm seeing a lot of newline changes which I'm trying to figure out. |
Adds a new interface, `IStorageService` for low level storage APIs. This interface is implemented by `FileStorageService` and `BlobStorageService` for Azure. All package content operations are now managed by `PackageStorageService` regardless of the low-level storage implementation. Addresses #144 (comment)
8c34665
to
e9a6703
Compare
@loic-sharma I've updated this implementation for #145, it's been tested and can successfully upload, download packages. I have not tested the deletes or get-uri, as BaGet does not currently expose those. |
Looks good! I left some minor comments, please address them and I'll merge these changes in :) |
@loic-sharma I've just noticed ValidateOptions is never called. Neither is Azure's version. Where should this be used? |
Oh whoops, good catch! I improved BaGet's configuration validation in #147. You should now register your configuration using |
@loic-sharma updated. |
I also changed a few |
Could you rebase this off of the latest master? It's a little tricky to review right now with the line ending changes. Thanks! |
I wasn't able to rebase, but I did copy all the changes to a new commit. |
This is looking good. I left some final feedback, once that's addressed I'll merge this in :) |
Thank you @LordMike for the great work! 🎉 |
(do not merge)
What does this PR do?
Implements an S3 storage service
Closes Issue(s)
Fixes #136
Motivation
If we deploy BaGet, we'll need S3 storage support :)
Additional Notes
This code has not been tested, yet. I'd like some feedback before proceeding. It's basically a copy off of the Azure project, with the search removed. I've replicated the configuration validation methods etc.