Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public async getDeletedSecret(
secretName: string,
options: GetDeletedSecretOptions = {}
): Promise {
const requestOptions = operationOptionsToRequestOptionsBase(options);
const span = this.createSpan("getDeletedSecret", requestOptions);
let response: GetDeletedSecretResponse;
try {
response = await this.client.getDeletedSecret(
this.vaultUrl,
secretName,
this.setParentSpan(span, requestOptions)
);
} finally {
span.end();
}
return this.getSecretFromSecretBundle(response);
}
public async signData(
algorithm: SignatureAlgorithm,
data: Uint8Array,
options: SignOptions = {}
): Promise {
const requestOptions = operationOptionsToRequestOptionsBase(options);
const span = this.createSpan("signData", requestOptions);
let digest;
switch (algorithm) {
case "ES256":
case "ES256K":
case "PS256":
case "RS256":
{
digest = await createHash("sha256", data);
}
break;
case "ES384":
case "PS384":
case "RS384":
{
private async recoverDeletedKey(
name: string,
options: RecoverDeletedKeyOptions = {}
): Promise {
const requestOptions = operationOptionsToRequestOptionsBase(options);
const span = this.createSpan("recoverDeletedKey", requestOptions);
let response: RecoverDeletedKeyResponse;
try {
response = await this.client.recoverDeletedKey(
this.vaultUrl,
name,
this.setParentSpan(span, requestOptions)
);
} finally {
span.end();
}
return this.getKeyFromKeyBundle(response);
}
private async *listRevisionsByPage(
options: ListRevisionsOptions = {}
): AsyncIterableIterator {
const opts = operationOptionsToRequestOptionsBase(options);
let currentResponse = await this.spanner.trace("listRevisions", opts, (newOptions) => {
return this.client.getRevisions({
...newOptions,
...formatAcceptDateTime(options),
...formatWildcards(newOptions)
});
});
yield {
...currentResponse,
items: currentResponse.items != null ? currentResponse.items.map(transformKeyValue) : []
};
while (currentResponse.nextLink) {
currentResponse = await this.spanner.trace("listRevisions", opts, (newOptions) => {
return this.client.getRevisions({
public async createRsaKey(name: string, options?: CreateRsaKeyOptions): Promise {
if (options) {
const requestOptions = operationOptionsToRequestOptionsBase(options);
const { enabled, notBefore, expiresOn: expires, ...remainingOptions } = requestOptions;
const unflattenedOptions = {
...remainingOptions,
keyAttributes: {
enabled,
notBefore,
expires
}
};
const span = this.createSpan("createRsaKey", unflattenedOptions);
let response: CreateKeyResponse;
try {
response = await this.client.createKey(
this.vaultUrl,
deleteConfigurationSetting(
id: ConfigurationSettingId,
options: DeleteConfigurationSettingOptions = {}
): Promise {
const opts = operationOptionsToRequestOptionsBase(options);
return this.spanner.trace("deleteConfigurationSetting", opts, async (newOptions) => {
const originalResponse = await this.client.deleteKeyValue(id.key, {
label: id.label,
...newOptions,
...checkAndFormatIfAndIfNoneMatch(id, options)
});
return transformKeyValueResponseWithStatusCode(originalResponse);
});
}
private async *listConfigurationSettingsByPage(
options: ListConfigurationSettingsOptions = {}
): AsyncIterableIterator {
const opts = operationOptionsToRequestOptionsBase(options);
let currentResponse = await this.spanner.trace(
"listConfigurationSettings",
opts,
(newOptions) => {
return this.client.getKeyValues({
...newOptions,
...formatAcceptDateTime(options),
...formatWildcards(newOptions)
});
}
);
yield* this.createListConfigurationPageFromResponse(currentResponse);
while (currentResponse.nextLink) {
currentResponse = await this.spanner.trace(
public listDeletedSecrets(
options: ListDeletedSecretsOptions = {}
): PagedAsyncIterableIterator {
const requestOptions = operationOptionsToRequestOptionsBase(options);
const span = this.createSpan("listDeletedSecrets", requestOptions);
const updatedOptions: ListDeletedSecretsOptions = {
...requestOptions,
...this.setParentSpan(span, requestOptions)
};
const iter = this.listDeletedSecretsAll(updatedOptions);
span.end();
return {
next() {
return iter.next();
},
[Symbol.asyncIterator]() {
return this;
},