Skip to content
This repository was archived by the owner on Jul 26, 2022. It is now read-only.

Commit fa747dc

Browse files
authored
fix: reverts assumeRole to use pod role instead of web identity (#453)
1 parent d722e1a commit fa747dc

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

config/aws-config.js

-16
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@
44
const AWS = require('aws-sdk')
55
const clonedeep = require('lodash.clonedeep')
66
const merge = require('lodash.merge')
7-
const fs = require('fs')
87

98
const localstack = process.env.LOCALSTACK || 0
10-
const webIdentity = process.env.AWS_WEB_IDENTITY_TOKEN_FILE || 0
119

1210
let secretsManagerConfig = {}
1311
let systemManagerConfig = {}
@@ -31,10 +29,6 @@ if (localstack) {
3129
}
3230
}
3331

34-
function loadServiceToken () {
35-
return fs.readFileSync(webIdentity, 'utf8')
36-
}
37-
3832
module.exports = {
3933
secretsManagerFactory: (opts = {}) => {
4034
if (localstack) {
@@ -50,16 +44,6 @@ module.exports = {
5044
},
5145
assumeRole: (assumeRoleOpts) => {
5246
const sts = new AWS.STS(stsConfig)
53-
if (webIdentity) {
54-
return new Promise((resolve, reject) => {
55-
sts.assumeRoleWithWebIdentity(merge(assumeRoleOpts, { WebIdentityToken: loadServiceToken() }), (err, res) => {
56-
if (err) {
57-
return reject(err)
58-
}
59-
resolve(res)
60-
})
61-
})
62-
}
6347

6448
return new Promise((resolve, reject) => {
6549
sts.assumeRole(assumeRoleOpts, (err, res) => {

0 commit comments

Comments
 (0)