Infisical secret references now resolve to their value instead of the raw reference
This commit is contained in:
1 file changed
+7
-2
@@ -68,7 +68,9 @@ function multiScopeHint(statusCode: number, config: InfisicalConfig): string {
|
|||||||
/**
|
/**
|
||||||
* Builds the /api/v3/secrets/raw URL. The secret path defaults to `/` (Infisical's
|
* Builds the /api/v3/secrets/raw URL. The secret path defaults to `/` (Infisical's
|
||||||
* root). workspaceId/environment are omitted when empty so a service token can infer
|
* root). workspaceId/environment are omitted when empty so a service token can infer
|
||||||
* them from its own scope.
|
* them from its own scope. `expandSecretReferences=true` makes Infisical resolve
|
||||||
|
* native secret references (a value like `${OTHER}`) to their final value server-side;
|
||||||
|
* this endpoint leaves them raw by default, which would inject the literal reference.
|
||||||
*/
|
*/
|
||||||
function rawSecretsUrl(
|
function rawSecretsUrl(
|
||||||
host: string,
|
host: string,
|
||||||
@@ -76,7 +78,10 @@ function rawSecretsUrl(
|
|||||||
environment: string | undefined,
|
environment: string | undefined,
|
||||||
secretPath: string
|
secretPath: string
|
||||||
): string {
|
): string {
|
||||||
const params = new URLSearchParams({ secretPath: secretPath || '/' });
|
const params = new URLSearchParams({
|
||||||
|
secretPath: secretPath || '/',
|
||||||
|
expandSecretReferences: 'true'
|
||||||
|
});
|
||||||
if (workspaceId) params.set('workspaceId', workspaceId);
|
if (workspaceId) params.set('workspaceId', workspaceId);
|
||||||
if (environment) params.set('environment', environment);
|
if (environment) params.set('environment', environment);
|
||||||
return `${baseUrl(host)}/api/v3/secrets/raw?${params.toString()}`;
|
return `${baseUrl(host)}/api/v3/secrets/raw?${params.toString()}`;
|
||||||
|
|||||||
Reference in new issue
Block a user