fix: Upgrade axios to address CVE-2023-45857 (#7713)

[GH Advisory](https://github.com/advisories/GHSA-wf5p-g6vw-rhxx)
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-12-19 16:17:01 +01:00
committed by GitHub
parent 8e6b951a76
commit 64eb9bbc36
11 changed files with 104 additions and 69 deletions

View File

@@ -251,19 +251,15 @@ export class VaultProvider extends SecretsProvider {
this.#http = axios.create({ baseURL: baseURL.toString() });
if (this.settings.namespace) {
this.#http.interceptors.request.use((config) => {
return {
...config,
// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-unsafe-assignment
headers: { ...config.headers, 'X-Vault-Namespace': this.settings.namespace },
};
config.headers['X-Vault-Namespace'] = this.settings.namespace;
return config;
});
}
this.#http.interceptors.request.use((config) => {
if (!this.#currentToken) {
return config;
if (this.#currentToken) {
config.headers['X-Vault-Token'] = this.#currentToken;
}
// eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-unsafe-assignment
return { ...config, headers: { ...config.headers, 'X-Vault-Token': this.#currentToken } };
return config;
});
}

View File

@@ -324,9 +324,15 @@ export class MessageEventBusDestinationWebhook
password: httpBasicAuth.password as string,
};
} else if (httpHeaderAuth) {
this.axiosRequestOptions.headers[httpHeaderAuth.name as string] = httpHeaderAuth.value;
this.axiosRequestOptions.headers = {
...this.axiosRequestOptions.headers,
[httpHeaderAuth.name as string]: httpHeaderAuth.value as string,
};
} else if (httpQueryAuth) {
this.axiosRequestOptions.params[httpQueryAuth.name as string] = httpQueryAuth.value;
this.axiosRequestOptions.params = {
...this.axiosRequestOptions.params,
[httpQueryAuth.name as string]: httpQueryAuth.value as string,
};
} else if (httpDigestAuth) {
this.axiosRequestOptions.auth = {
username: httpDigestAuth.user as string,