Skip to content
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

Merge credentials into proper location #10

Closed
wants to merge 5 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions client/derive_config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ export function deriveConfig(conf: ClientConfig = {}): Doc {
const got: Doc = get({ profile: _conf.profile || "default" });

if (typeof _conf.credentials !== "function") {
_conf.credentials = { ...got.credentials, ..._conf.credentials };
_conf.credentials = {
...got.credentials,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we purposely strip the accessKeyId and secretAccessKey off of this before spreading? It's polluting the object right now.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as you correctly said b4 got just doesn't have credentials

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

..._conf.credentials,
accessKeyId: got.accessKeyId,
secretAccessKey: got.secretAccessKey
};
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe we also need the SessionToken here too, agreed?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, session token should be passed

}

_conf.region = got.region;
Expand All @@ -39,7 +44,7 @@ export function deriveConfig(conf: ClientConfig = {}): Doc {

const endpoint: string = `http${
_conf.region === "local" ? "" : "s"
}://${host}:${_conf.port || 80}/`;
}://${host}:${_conf.port || 443}/`;

return {
..._conf,
Expand Down