Skip to content

Commit 80b52d3

Browse files
Merge pull request #16 from Infisical/daniel/expand-refs-default-true
fix: default expandSecretReferences to true
2 parents 737a3a4 + b75e0a9 commit 80b52d3

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/custom/secrets.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ export type DeleteSecretResult = ApiV3SecretsRawSecretNamePost200Response;
5454

5555
const convertBool = (value?: boolean) => (value ? "true" : "false");
5656

57+
const defaultBoolean = (value?: boolean, defaultValue: boolean = false) => {
58+
if (value === undefined) {
59+
return defaultValue;
60+
}
61+
return value;
62+
};
63+
5764
export default class SecretsClient {
5865
#apiInstance: InfisicalApi;
5966
#requestOptions: RawAxiosRequestConfig | undefined;
@@ -68,7 +75,7 @@ export default class SecretsClient {
6875
{
6976
environment: options.environment,
7077
workspaceId: options.projectId,
71-
expandSecretReferences: convertBool(options.expandSecretReferences),
78+
expandSecretReferences: convertBool(defaultBoolean(options.expandSecretReferences, true)),
7279
includeImports: convertBool(options.includeImports),
7380
recursive: convertBool(options.recursive),
7481
secretPath: options.secretPath,
@@ -125,7 +132,7 @@ export default class SecretsClient {
125132
environment: options.environment,
126133
secretName: options.secretName,
127134
workspaceId: options.projectId,
128-
expandSecretReferences: convertBool(options.expandSecretReferences),
135+
expandSecretReferences: convertBool(defaultBoolean(options.expandSecretReferences, true)),
129136
includeImports: convertBool(options.includeImports),
130137
secretPath: options.secretPath,
131138
type: options.type,

0 commit comments

Comments
 (0)