Skip to content

Commit cf939c3

Browse files
Merge pull request #268 from SmythOS/fix/core/secret-manager-connector
Fix/core/secret manager connector
2 parents 7044d17 + 42038bd commit cf939c3

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/core/src/helpers/S3Cache.helper.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { GetBucketLifecycleConfigurationCommand } from '@aws-sdk/client-s3';
44
import { S3Client } from '@aws-sdk/client-s3';
55
import { Logger } from '@sre/helpers/Log.helper';
66
const console = Logger('S3Cache');
7+
const lifeCycleRuleNotExistsErrorCode = 'NoSuchLifecycleConfiguration';
78

89
export function generateLifecycleRules() {
910
const rules = [];
@@ -121,7 +122,7 @@ export async function checkAndInstallLifecycleRules(bucketName: string, s3Client
121122
console.log('Lifecycle configuration already exists');
122123
}
123124
} catch (error) {
124-
if (error.code === 'NoSuchLifecycleConfiguration') {
125+
if (error.code === lifeCycleRuleNotExistsErrorCode || error.name === lifeCycleRuleNotExistsErrorCode) {
125126
console.log('No lifecycle configuration found. Creating new configuration...');
126127

127128
const lifecycleRules = generateLifecycleRules();

packages/core/src/subsystems/Security/Vault.service/connectors/SecretsManager.class.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
GetSecretValueCommandOutput,
1414
} from '@aws-sdk/client-secrets-manager';
1515

16+
const defaultPrefix = 'smythos';
1617
const console = Logger('SecretsManager');
1718

1819
export type SecretsManagerConfig = {
@@ -29,7 +30,7 @@ export class SecretsManager extends VaultConnector {
2930
constructor(protected _settings: SecretsManagerConfig) {
3031
super(_settings);
3132
//if (!SmythRuntime.Instance) throw new Error('SRE not initialized');
32-
this.prefix = _settings.prefix || '';
33+
this.prefix = _settings.prefix || defaultPrefix;
3334
this.secretsManager = new SecretsManagerClient({
3435
region: _settings.region,
3536
...(_settings.awsAccessKeyId && _settings.awsSecretAccessKey

0 commit comments

Comments
 (0)