-
Notifications
You must be signed in to change notification settings - Fork 423
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
Use aws_credentials for S3 file system if Access Key ID is missing #2347
Conversation
@josevalim I've refactored things a little bit and pushed to an alternate branch for comparison. I think it's a more elegant solution and solves the two issues above. The new option:
If you agree that it's the better approach I'll merge it into this PR branch. |
PR branch is now up to date with all comments thus far |
lib/livebook/file_system/s3.ex
Outdated
@@ -14,6 +14,12 @@ defmodule Livebook.FileSystem.S3 do | |||
hub_id: String.t() | |||
} | |||
|
|||
@type credentials_t :: %{ |
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.
@type credentials_t :: %{ | |
@type credentials :: %{ |
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.
I originally called the type credentials
, but I wasn't clear on whether a module could contain a type and a function with the same name.
This looks super clean! I think we are almost there. :) |
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!
@josevalim we should update FFS to accept the token and pass it from kino, right? |
Uffizzi Preview |
@jonatanklosko yes, I will ask @philss to work on it :) |
💚 💙 💜 💛 ❤️ |
Resolves #2341. Tested for the following cases:
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
environment variablesI ran into an issue trying to test with the
aws_credentials_file
provider, which uses the canonical AWS profile configuration files (~/.aws/config
and~/.aws/credentials
). The error was coming from theeini
parser, and I couldn't come up with a version of my config file that would satisfy it. Every other ini-file-compatible AWS client seems to work with my configuration just fine, so I'm not sure what can be done besides try to fix it upstream.I also made the Access Key ID and Secret Access Key fields in the FileSystem form optional, but if either one is present, the other has to be as well in order for the changeset to validate.