Skip to content

Commit

Permalink
Merge pull request #189 from ember-cli-deploy/revert-to-4.0.1
Browse files Browse the repository at this point in the history
Revert to 4.0.1 to back out of breaking AWS SDK upgrade
  • Loading branch information
lukemelia committed Mar 28, 2024
2 parents c721054 + 272f2d8 commit 5c77cd1
Show file tree
Hide file tree
Showing 4 changed files with 183 additions and 1,224 deletions.
23 changes: 0 additions & 23 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,7 @@
# Changelog

## 4.0.3 (2024-03-26)

#### :bug: Bug Fix
* [#187](https://github.com/ember-cli-deploy/ember-cli-deploy-s3/pull/187) Fix setting of credentials via plugin config ([@owen-c](https://github.com/owen-c))

#### Committers: 1
- Owen Cummings ([@owen-c](https://github.com/owen-c))

## 4.0.2 (2024-03-23)

#### :house: Internal
* [#186](https://github.com/ember-cli-deploy/ember-cli-deploy-s3/pull/186) Update aws-sdk to v3 ([@gorner](https://github.com/gorner))

#### Committers: 1
- Joshua Gorner ([@gorner](https://github.com/gorner))

## 4.0.1 (2023-08-01)

* Merge pull request #182 from ember-cli-deploy/dependabot/npm_and_yarn/word-wrap-1.2.5 (874872b)
* Merge pull request #178 from ember-cli-deploy/dependabot/npm_and_yarn/semver-5.7.2 (641b9a8)
* Bump word-wrap from 1.2.3 to 1.2.5 (0bf1938)
* Merge pull request #181 from gorner/update-proxy-agent (6d756b6)
* Update proxy-agent to v6.3.0 to remove vm2 dep (fba8777)
* Bump semver from 5.3.0 to 5.7.2 (dcfebf6)

## 4.0.0 (2023-06-04)

#### :boom: Breaking Change
Expand Down
22 changes: 6 additions & 16 deletions lib/s3.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,7 @@ var _ = require('lodash');
module.exports = CoreObject.extend({
init: function(options) {
this._super(options);

const {
fromIni
} = require('@aws-sdk/credential-providers');

const {
S3
} = require('@aws-sdk/client-s3');

var AWS = require('aws-sdk');
var s3Options = {
region: this.plugin.readConfig('region')
};
Expand Down Expand Up @@ -46,10 +38,8 @@ module.exports = CoreObject.extend({

if (accessKeyId && secretAccessKey) {
this.plugin.log('Using AWS access key id and secret access key from config', { verbose: true });
s3Options.credentials = {
accessKeyId: accessKeyId,
secretAccessKey: secretAccessKey,
};
s3Options.accessKeyId = accessKeyId;
s3Options.secretAccessKey = secretAccessKey;
}

if (signatureVersion) {
Expand All @@ -64,15 +54,15 @@ module.exports = CoreObject.extend({

if (profile && !this.plugin.readConfig('s3Client')) {
this.plugin.log('Using AWS profile from config', { verbose: true });
s3Options.credentials = fromIni({ profile: profile });
AWS.config.credentials = new AWS.SharedIniFileCredentials({ profile: profile });
}

if (endpoint) {
this.plugin.log('Using endpoint from config', { verbose: true });
s3Options.endpoint = endpoint;
s3Options.endpoint = new AWS.Endpoint(endpoint);
}

this._client = this.plugin.readConfig('s3Client') || new S3(s3Options);
this._client = this.plugin.readConfig('s3Client') || new AWS.S3(s3Options);
},

upload: function(options) {
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ember-cli-deploy-s3",
"version": "4.0.3",
"version": "4.0.1",
"description": "An ember-cli-deploy plugin to upload to s3",
"keywords": [
"ember-addon",
Expand All @@ -18,8 +18,7 @@
"test": "node tests/runner.js && ./node_modules/.bin/eslint index.js lib/* tests/**/*-test.js"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.525.0",
"@aws-sdk/credential-providers": "^3.525.0",
"aws-sdk": "^2.1354.0",
"chalk": "^4.1.0",
"core-object": "^3.1.5",
"ember-cli-deploy-plugin": "^0.2.9",
Expand Down
Loading

0 comments on commit 5c77cd1

Please sign in to comment.