-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
feat: allow providing session token in config #362
Conversation
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.
LGTM thanks @satyamkondle
could you attach some AWS doc info regarding the session you are adding? |
@satyamkondle regarding the tests, I think you should be fine, since S3 is mocked in the actual test. If you really want to add something though, you could do a bit of mocking check with something like this:
where |
@@ -56,6 +56,7 @@ store: | |||
s3ForcePathStyle: false # optional, will use path style URLs for S3 objects | |||
accessKeyId: your-access-key-id # optional, aws accessKeyId for private S3 bucket | |||
secretAccessKey: your-secret-access-key # optional, aws secretAccessKey for private S3 bucket | |||
sessionToken: your-session-token # optional, aws sessionToken for private S3 bucket |
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.
quick question here: aren't sessionTokens temporary? are there any Docs on their TTL? if they are expired say after one day, does not make sense to put them in config no?
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.
Right, sessionTokens are temporary. I think it is okay to have them in the config and users can provide an environment variable instead of hard coding and changing that again, right?
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.
well depends on the TTL, would be nice to know in what kind of circumstance they would expire. If it happens too frequently, it would not be a good choice, it would mean, the devOps people have to keep manually update it
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.
In our use case, we are not using verdaccio as a long running service. We just start it, connect to it and download packages during build processes and exit. During the build process we use aws roles so this is not a problem.
However, when we want to push packages from local machines, we only have temporary credentials (token) that expire every day. So, for us to publish packages to S3 using verdaccio from local machines, we need this (unless I am missing something). I believe there will be people who would run into the same. This is not for DevOps, this is for developers essentially.
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.
oh interesting use case. We went a different way, having verdaccio as a running service on an aws instance. In any case, it is maybe worth mentioning that in the Docs? @juanpicado I wonder if there is specific Docs, on best practices when it comes to verdaccio (as long running service, or one-off Dev as mentioned).
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.
First time I heard that his plugin is being used for merely development purposes, which is cool :) .
As @tetrohed suggests, I'd update the readme, unfortunately, we do not have docs in our website regarding specific plugins, the main reason is (at least me) don't have much domain of AWS itself so I guess users will come to read the README (it's what I'd do).
Perhaps the future website might have more info about each plugin (https://github.com/verdaccio/website_2.0) like GatsbyJS does for instance, but not the case at this moment.
@stackdumper feel free to update the README (add a new section) and tell more about your use case and the new property you are adding, I guess others will find your experience really interesting.
Sounds good. I do want to check the environment variable following @tetrohed comment. Will update. Thank you! |
@tetrohed Added a test. Can you please take a relook? |
@juanpicado : Thank you and here is the aws doc about temporary credentials: https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_use-resources.html |
Codecov Report
@@ Coverage Diff @@
## 9.x #362 +/- ##
==========================================
+ Coverage 68.16% 77.97% +9.81%
==========================================
Files 29 6 -23
Lines 1401 386 -1015
Branches 203 61 -142
==========================================
- Hits 955 301 -654
+ Misses 406 47 -359
+ Partials 40 38 -2
Continue to review full report at Codecov.
|
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.
LGTM thanks ! Please, would be great a new PR updating the README adding a use case for this feature.
Type:Feature
Scope:aws-s3-storage
The following has been addressed in the PR:
Ability to provide session token when connecting to private s3 bucket.
No.
No, looked at the existing unit tests. This is only adding a value to the config and I don't see any tests checking each config value. Please advice if I need to add tests.
Description:
Sometimes session tokens are required to be able to connect. Adding the ability to add session token to config.