Skip to content

Commit

Permalink
Fixup keyvault packages
Browse files Browse the repository at this point in the history
  • Loading branch information
xirzec committed Oct 4, 2019
1 parent ecdb1c3 commit 7eaf255
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 53 deletions.
1 change: 1 addition & 0 deletions sdk/keyvault/keyvault-certificates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"@azure/core-arm": "1.0.0-preview.3",
"@azure/core-http": "1.0.0-preview.3",
"@azure/core-paging": "1.0.0-preview.2",
"@azure/core-tracing": "1.0.0-preview.3",
"tslib": "^1.9.3"
},
"devDependencies": {
Expand Down
7 changes: 5 additions & 2 deletions sdk/keyvault/keyvault-certificates/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,13 @@ import {
isNode,
userAgentPolicy,
RequestOptionsBase,
tracingPolicy,
tracingPolicy
} from "@azure/core-http";

import {
getTracer,
Span
} from "@azure/core-http";
} from "@azure/core-tracing";

import {
CertificateAttributes,
Expand Down
1 change: 1 addition & 0 deletions sdk/keyvault/keyvault-keys/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
"@azure/core-http": "1.0.0-preview.3",
"@azure/core-paging": "1.0.0-preview.2",
"@azure/identity": "1.0.0-preview.3",
"@azure/core-tracing": "1.0.0-preview.3",
"tslib": "^1.9.3"
},
"devDependencies": {
Expand Down
108 changes: 73 additions & 35 deletions sdk/keyvault/keyvault-keys/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ import {
isNode,
userAgentPolicy,
RequestOptionsBase,
tracingPolicy,
getTracer,
Span
tracingPolicy
} from "@azure/core-http";

import { getTracer, Span } from "@azure/core-tracing";

import "@azure/core-paging";
import { PageSettings, PagedAsyncIterableIterator } from "@azure/core-paging";

Expand Down Expand Up @@ -295,8 +295,12 @@ export class KeysClient {
let response: CreateKeyResponse;

try {
response = await this.client
.createKey(this.vaultBaseUrl, name, keyType, this.setParentSpan(span, unflattenedOptions));
response = await this.client.createKey(
this.vaultBaseUrl,
name,
keyType,
this.setParentSpan(span, unflattenedOptions)
);
} finally {
span.end();
}
Expand Down Expand Up @@ -345,8 +349,12 @@ export class KeysClient {

let response: CreateKeyResponse;
try {
response = await this.client
.createKey(this.vaultBaseUrl, name, options.hsm ? "EC-HSM" : "EC", this.setParentSpan(span, unflattenedOptions));
response = await this.client.createKey(
this.vaultBaseUrl,
name,
options.hsm ? "EC-HSM" : "EC",
this.setParentSpan(span, unflattenedOptions)
);
} finally {
span.end();
}
Expand Down Expand Up @@ -396,8 +404,12 @@ export class KeysClient {

let response: CreateKeyResponse;
try {
response = await this.client
.createKey(this.vaultBaseUrl, name, options.hsm ? "RSA-HSM" : "RSA", this.setParentSpan(span, unflattenedOptions));
response = await this.client.createKey(
this.vaultBaseUrl,
name,
options.hsm ? "RSA-HSM" : "RSA",
this.setParentSpan(span, unflattenedOptions)
);
} finally {
span.end();
}
Expand Down Expand Up @@ -447,8 +459,12 @@ export class KeysClient {

let response: ImportKeyResponse;
try {
response = await this.client
.importKey(this.vaultBaseUrl, name, key, this.setParentSpan(span, unflattenedOptions));
response = await this.client.importKey(
this.vaultBaseUrl,
name,
key,
this.setParentSpan(span, unflattenedOptions)
);
} finally {
span.end();
}
Expand Down Expand Up @@ -481,8 +497,11 @@ export class KeysClient {

let response: DeleteKeyResponse;
try {
response = await this.client
.deleteKey(this.vaultBaseUrl, name, this.setParentSpan(span, requestOptions));
response = await this.client.deleteKey(
this.vaultBaseUrl,
name,
this.setParentSpan(span, requestOptions)
);
} finally {
span.end();
}
Expand Down Expand Up @@ -534,8 +553,12 @@ export class KeysClient {
let response: UpdateKeyResponse;

try {
response = await this.client
.updateKey(this.vaultBaseUrl, name, keyVersion, this.setParentSpan(span, unflattenedOptions));
response = await this.client.updateKey(
this.vaultBaseUrl,
name,
keyVersion,
this.setParentSpan(span, unflattenedOptions)
);
} finally {
span.end();
}
Expand Down Expand Up @@ -567,13 +590,12 @@ export class KeysClient {

let response: GetKeyResponse;
try {
response = await this.client
.getKey(
this.vaultBaseUrl,
name,
options && options.version ? options.version : "",
this.setParentSpan(span, requestOptions)
);
response = await this.client.getKey(
this.vaultBaseUrl,
name,
options && options.version ? options.version : "",
this.setParentSpan(span, requestOptions)
);
} finally {
span.end();
}
Expand Down Expand Up @@ -601,8 +623,11 @@ export class KeysClient {

let response: GetDeletedKeyResponse;
try {
response = await this.client
.getDeletedKey(this.vaultBaseUrl, name, this.setParentSpan(span, requestOptions));
response = await this.client.getDeletedKey(
this.vaultBaseUrl,
name,
this.setParentSpan(span, requestOptions)
);
} finally {
span.end();
}
Expand Down Expand Up @@ -632,11 +657,14 @@ export class KeysClient {
const span = this.createSpan("purgeDeletedKey", requestOptions);

try {
await this.client.purgeDeletedKey(this.vaultBaseUrl, name, this.setParentSpan(span, requestOptions));
await this.client.purgeDeletedKey(
this.vaultBaseUrl,
name,
this.setParentSpan(span, requestOptions)
);
} finally {
span.end();
}

}

/**
Expand All @@ -661,8 +689,11 @@ export class KeysClient {

let response: RecoverDeletedKeyResponse;
try {
response = await this.client
.recoverDeletedKey(this.vaultBaseUrl, name, this.setParentSpan(span, requestOptions));
response = await this.client.recoverDeletedKey(
this.vaultBaseUrl,
name,
this.setParentSpan(span, requestOptions)
);
} finally {
span.end();
}
Expand Down Expand Up @@ -690,8 +721,11 @@ export class KeysClient {

let response: BackupKeyResponse;
try {
response = await this.client
.backupKey(this.vaultBaseUrl, name, this.setParentSpan(span, requestOptions));
response = await this.client.backupKey(
this.vaultBaseUrl,
name,
this.setParentSpan(span, requestOptions)
);
} finally {
span.end();
}
Expand Down Expand Up @@ -721,8 +755,11 @@ export class KeysClient {

let response: RestoreKeyResponse;
try {
response = await this.client
.restoreKey(this.vaultBaseUrl, backup, this.setParentSpan(span, requestOptions));
response = await this.client.restoreKey(
this.vaultBaseUrl,
backup,
this.setParentSpan(span, requestOptions)
);
} finally {
span.end();
}
Expand Down Expand Up @@ -807,7 +844,8 @@ export class KeysClient {
[Symbol.asyncIterator]() {
return this;
},
byPage: (settings: PageSettings = {}) => this.listKeyVersionsPage(name, settings, updatedOptions)
byPage: (settings: PageSettings = {}) =>
this.listKeyVersionsPage(name, settings, updatedOptions)
};
}

Expand Down Expand Up @@ -1030,9 +1068,9 @@ export class KeysClient {
...options,
spanOptions: {
...options.spanOptions,
parent: span,
parent: span
}
}
};
} else {
return options;
}
Expand Down
1 change: 1 addition & 0 deletions sdk/keyvault/keyvault-secrets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"@azure/core-http": "1.0.0-preview.3",
"@azure/core-paging": "1.0.0-preview.2",
"@azure/identity": "1.0.0-preview.3",
"@azure/core-tracing": "1.0.0-preview.3",
"tslib": "^1.9.3"
},
"devDependencies": {
Expand Down
51 changes: 35 additions & 16 deletions sdk/keyvault/keyvault-secrets/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ import {
getDefaultProxySettings,
isNode,
userAgentPolicy,
tracingPolicy,
getTracer,
Span
tracingPolicy
} from "@azure/core-http";

import { getTracer, Span } from "@azure/core-tracing";

import "@azure/core-paging";
import { PageSettings, PagedAsyncIterableIterator } from "@azure/core-paging";
import {
Expand Down Expand Up @@ -77,11 +77,7 @@ export {
UpdateSecretOptions
};

export {
ProxyOptions,
RetryOptions,
TelemetryOptions
};
export { ProxyOptions, RetryOptions, TelemetryOptions };

/**
* The client to interact with the KeyVault secrets functionality
Expand Down Expand Up @@ -290,7 +286,11 @@ export class SecretsClient {

let response: DeleteSecretResponse;
try {
response = await this.client.deleteSecret(this.vaultBaseUrl, secretName, this.setParentSpan(span, options));
response = await this.client.deleteSecret(
this.vaultBaseUrl,
secretName,
this.setParentSpan(span, options)
);
} finally {
span.end();
}
Expand Down Expand Up @@ -420,7 +420,11 @@ export class SecretsClient {
let response: GetDeletedSecretResponse;

try {
response = await this.client.getDeletedSecret(this.vaultBaseUrl, secretName, this.setParentSpan(span, options));
response = await this.client.getDeletedSecret(
this.vaultBaseUrl,
secretName,
this.setParentSpan(span, options)
);
} finally {
span.end();
}
Expand Down Expand Up @@ -448,7 +452,11 @@ export class SecretsClient {
const span = this.createSpan("purgeDeletedSecret", options);

try {
await this.client.purgeDeletedSecret(this.vaultBaseUrl, secretName, this.setParentSpan(span, options));
await this.client.purgeDeletedSecret(
this.vaultBaseUrl,
secretName,
this.setParentSpan(span, options)
);
} finally {
span.end();
}
Expand Down Expand Up @@ -478,7 +486,11 @@ export class SecretsClient {
let response: RecoverDeletedSecretResponse;

try {
response = await this.client.recoverDeletedSecret(this.vaultBaseUrl, secretName, this.setParentSpan(span, options));
response = await this.client.recoverDeletedSecret(
this.vaultBaseUrl,
secretName,
this.setParentSpan(span, options)
);
} finally {
span.end();
}
Expand All @@ -500,13 +512,20 @@ export class SecretsClient {
* @param [options] The optional parameters
* @returns Promise<Uint8Array | undefined>
*/
public async backupSecret(secretName: string, options?: RequestOptionsBase): Promise<Uint8Array | undefined> {
public async backupSecret(
secretName: string,
options?: RequestOptionsBase
): Promise<Uint8Array | undefined> {
const span = this.createSpan("backupSecret", options);

let response: BackupSecretResponse;

try {
response = await this.client.backupSecret(this.vaultBaseUrl, secretName, this.setParentSpan(span, options));
response = await this.client.backupSecret(
this.vaultBaseUrl,
secretName,
this.setParentSpan(span, options)
);
} finally {
span.end();
}
Expand Down Expand Up @@ -849,9 +868,9 @@ export class SecretsClient {
...options,
spanOptions: {
...options.spanOptions,
parent: span,
parent: span
}
}
};
} else {
return options;
}
Expand Down

0 comments on commit 7eaf255

Please sign in to comment.