Skip to content

Commit e812267

Browse files
committed
fix: dont put env vars in credentials
1 parent f169ec6 commit e812267

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

src/cmap/auth/mongo_credentials.ts

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -134,26 +134,6 @@ export class MongoCredentials {
134134
this.mechanism = options.mechanism || AuthMechanism.MONGODB_DEFAULT;
135135
this.mechanismProperties = options.mechanismProperties || {};
136136

137-
if (this.mechanism.match(/MONGODB-AWS/i)) {
138-
if (!this.username && process.env.AWS_ACCESS_KEY_ID) {
139-
this.username = process.env.AWS_ACCESS_KEY_ID;
140-
}
141-
142-
if (!this.password && process.env.AWS_SECRET_ACCESS_KEY) {
143-
this.password = process.env.AWS_SECRET_ACCESS_KEY;
144-
}
145-
146-
if (
147-
this.mechanismProperties.AWS_SESSION_TOKEN == null &&
148-
process.env.AWS_SESSION_TOKEN != null
149-
) {
150-
this.mechanismProperties = {
151-
...this.mechanismProperties,
152-
AWS_SESSION_TOKEN: process.env.AWS_SESSION_TOKEN
153-
};
154-
}
155-
}
156-
157137
if (this.mechanism === AuthMechanism.MONGODB_OIDC && !this.mechanismProperties.ALLOWED_HOSTS) {
158138
this.mechanismProperties = {
159139
...this.mechanismProperties,

0 commit comments

Comments
 (0)