@azure/arm-keyvault 2.1.0-alpha.20221101.1 → 2.1.0-alpha.20221202.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -3
- package/dist/index.js +450 -110
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist-esm/src/index.d.ts +1 -0
- package/dist-esm/src/index.d.ts.map +1 -1
- package/dist-esm/src/index.js +1 -0
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/keyVaultManagementClient.d.ts +2 -0
- package/dist-esm/src/keyVaultManagementClient.d.ts.map +1 -1
- package/dist-esm/src/keyVaultManagementClient.js +49 -18
- package/dist-esm/src/keyVaultManagementClient.js.map +1 -1
- package/dist-esm/src/models/index.d.ts +132 -15
- package/dist-esm/src/models/index.d.ts.map +1 -1
- package/dist-esm/src/models/index.js +107 -0
- package/dist-esm/src/models/index.js.map +1 -1
- package/dist-esm/src/models/mappers.d.ts +1 -0
- package/dist-esm/src/models/mappers.d.ts.map +1 -1
- package/dist-esm/src/models/mappers.js +26 -0
- package/dist-esm/src/models/mappers.js.map +1 -1
- package/dist-esm/src/operations/keys.d.ts.map +1 -1
- package/dist-esm/src/operations/keys.js +37 -14
- package/dist-esm/src/operations/keys.js.map +1 -1
- package/dist-esm/src/operations/managedHsms.d.ts.map +1 -1
- package/dist-esm/src/operations/managedHsms.js +55 -21
- package/dist-esm/src/operations/managedHsms.js.map +1 -1
- package/dist-esm/src/operations/mhsmPrivateEndpointConnections.d.ts.map +1 -1
- package/dist-esm/src/operations/mhsmPrivateEndpointConnections.js +19 -7
- package/dist-esm/src/operations/mhsmPrivateEndpointConnections.js.map +1 -1
- package/dist-esm/src/operations/operations.d.ts.map +1 -1
- package/dist-esm/src/operations/operations.js +19 -7
- package/dist-esm/src/operations/operations.js.map +1 -1
- package/dist-esm/src/operations/privateEndpointConnections.d.ts.map +1 -1
- package/dist-esm/src/operations/privateEndpointConnections.js +19 -7
- package/dist-esm/src/operations/privateEndpointConnections.js.map +1 -1
- package/dist-esm/src/operations/secrets.d.ts.map +1 -1
- package/dist-esm/src/operations/secrets.js +19 -7
- package/dist-esm/src/operations/secrets.js.map +1 -1
- package/dist-esm/src/operations/vaults.d.ts.map +1 -1
- package/dist-esm/src/operations/vaults.js +73 -28
- package/dist-esm/src/operations/vaults.js.map +1 -1
- package/dist-esm/src/pagingHelper.d.ts +13 -0
- package/dist-esm/src/pagingHelper.d.ts.map +1 -0
- package/dist-esm/src/pagingHelper.js +32 -0
- package/dist-esm/src/pagingHelper.js.map +1 -0
- package/dist-esm/test/keyvault_examples.d.ts.map +1 -1
- package/dist-esm/test/keyvault_examples.js +17 -19
- package/dist-esm/test/keyvault_examples.js.map +1 -1
- package/package.json +12 -8
- package/review/arm-keyvault.api.md +30 -123
- package/src/index.ts +1 -0
- package/src/keyVaultManagementClient.ts +60 -20
- package/src/models/index.ts +132 -15
- package/src/models/mappers.ts +27 -0
- package/src/operations/keys.ts +53 -22
- package/src/operations/managedHsms.ts +66 -25
- package/src/operations/mhsmPrivateEndpointConnections.ts +26 -8
- package/src/operations/operations.ts +21 -8
- package/src/operations/privateEndpointConnections.ts +27 -13
- package/src/operations/secrets.ts +27 -9
- package/src/operations/vaults.ts +86 -33
- package/src/pagingHelper.ts +39 -0
- package/types/arm-keyvault.d.ts +144 -15
- package/types/tsdoc-metadata.json +1 -1
|
@@ -131,6 +131,9 @@ export interface ErrorModel {
|
|
|
131
131
|
readonly message?: string;
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
+
// @public
|
|
135
|
+
export function getContinuationToken(page: unknown): string | undefined;
|
|
136
|
+
|
|
134
137
|
// @public
|
|
135
138
|
export type IdentityType = string;
|
|
136
139
|
|
|
@@ -149,17 +152,18 @@ export type JsonWebKeyOperation = string;
|
|
|
149
152
|
export type JsonWebKeyType = string;
|
|
150
153
|
|
|
151
154
|
// @public
|
|
152
|
-
export
|
|
155
|
+
export interface Key extends Resource {
|
|
153
156
|
attributes?: KeyAttributes;
|
|
154
|
-
|
|
157
|
+
curveName?: JsonWebKeyCurveName;
|
|
158
|
+
// (undocumented)
|
|
155
159
|
keyOps?: JsonWebKeyOperation[];
|
|
156
160
|
keySize?: number;
|
|
157
|
-
curveName?: JsonWebKeyCurveName;
|
|
158
161
|
readonly keyUri?: string;
|
|
159
162
|
readonly keyUriWithVersion?: string;
|
|
160
|
-
|
|
163
|
+
kty?: JsonWebKeyType;
|
|
161
164
|
releasePolicy?: KeyReleasePolicy;
|
|
162
|
-
|
|
165
|
+
rotationPolicy?: RotationPolicy;
|
|
166
|
+
}
|
|
163
167
|
|
|
164
168
|
// @public
|
|
165
169
|
export interface KeyAttributes {
|
|
@@ -315,159 +319,96 @@ export interface KeyVaultManagementClientOptionalParams extends coreClient.Servi
|
|
|
315
319
|
|
|
316
320
|
// @public
|
|
317
321
|
export enum KnownActionsRequired {
|
|
318
|
-
// (undocumented)
|
|
319
322
|
None = "None"
|
|
320
323
|
}
|
|
321
324
|
|
|
322
325
|
// @public
|
|
323
326
|
export enum KnownCertificatePermissions {
|
|
324
|
-
// (undocumented)
|
|
325
327
|
All = "all",
|
|
326
|
-
// (undocumented)
|
|
327
328
|
Backup = "backup",
|
|
328
|
-
// (undocumented)
|
|
329
329
|
Create = "create",
|
|
330
|
-
// (undocumented)
|
|
331
330
|
Delete = "delete",
|
|
332
|
-
// (undocumented)
|
|
333
331
|
Deleteissuers = "deleteissuers",
|
|
334
|
-
// (undocumented)
|
|
335
332
|
Get = "get",
|
|
336
|
-
// (undocumented)
|
|
337
333
|
Getissuers = "getissuers",
|
|
338
|
-
// (undocumented)
|
|
339
334
|
Import = "import",
|
|
340
|
-
// (undocumented)
|
|
341
335
|
List = "list",
|
|
342
|
-
// (undocumented)
|
|
343
336
|
Listissuers = "listissuers",
|
|
344
|
-
// (undocumented)
|
|
345
337
|
Managecontacts = "managecontacts",
|
|
346
|
-
// (undocumented)
|
|
347
338
|
Manageissuers = "manageissuers",
|
|
348
|
-
// (undocumented)
|
|
349
339
|
Purge = "purge",
|
|
350
|
-
// (undocumented)
|
|
351
340
|
Recover = "recover",
|
|
352
|
-
// (undocumented)
|
|
353
341
|
Restore = "restore",
|
|
354
|
-
// (undocumented)
|
|
355
342
|
Setissuers = "setissuers",
|
|
356
|
-
// (undocumented)
|
|
357
343
|
Update = "update"
|
|
358
344
|
}
|
|
359
345
|
|
|
360
346
|
// @public
|
|
361
347
|
export enum KnownDeletionRecoveryLevel {
|
|
362
|
-
// (undocumented)
|
|
363
348
|
Purgeable = "Purgeable",
|
|
364
|
-
// (undocumented)
|
|
365
349
|
Recoverable = "Recoverable",
|
|
366
|
-
// (undocumented)
|
|
367
350
|
RecoverableProtectedSubscription = "Recoverable+ProtectedSubscription",
|
|
368
|
-
// (undocumented)
|
|
369
351
|
RecoverablePurgeable = "Recoverable+Purgeable"
|
|
370
352
|
}
|
|
371
353
|
|
|
372
354
|
// @public
|
|
373
355
|
export enum KnownIdentityType {
|
|
374
|
-
// (undocumented)
|
|
375
356
|
Application = "Application",
|
|
376
|
-
// (undocumented)
|
|
377
357
|
Key = "Key",
|
|
378
|
-
// (undocumented)
|
|
379
358
|
ManagedIdentity = "ManagedIdentity",
|
|
380
|
-
// (undocumented)
|
|
381
359
|
User = "User"
|
|
382
360
|
}
|
|
383
361
|
|
|
384
362
|
// @public
|
|
385
363
|
export enum KnownJsonWebKeyCurveName {
|
|
386
|
-
// (undocumented)
|
|
387
364
|
P256 = "P-256",
|
|
388
|
-
// (undocumented)
|
|
389
365
|
P256K = "P-256K",
|
|
390
|
-
// (undocumented)
|
|
391
366
|
P384 = "P-384",
|
|
392
|
-
// (undocumented)
|
|
393
367
|
P521 = "P-521"
|
|
394
368
|
}
|
|
395
369
|
|
|
396
370
|
// @public
|
|
397
371
|
export enum KnownJsonWebKeyOperation {
|
|
398
|
-
// (undocumented)
|
|
399
372
|
Decrypt = "decrypt",
|
|
400
|
-
// (undocumented)
|
|
401
373
|
Encrypt = "encrypt",
|
|
402
|
-
// (undocumented)
|
|
403
374
|
Import = "import",
|
|
404
|
-
// (undocumented)
|
|
405
375
|
Release = "release",
|
|
406
|
-
// (undocumented)
|
|
407
376
|
Sign = "sign",
|
|
408
|
-
// (undocumented)
|
|
409
377
|
UnwrapKey = "unwrapKey",
|
|
410
|
-
// (undocumented)
|
|
411
378
|
Verify = "verify",
|
|
412
|
-
// (undocumented)
|
|
413
379
|
WrapKey = "wrapKey"
|
|
414
380
|
}
|
|
415
381
|
|
|
416
382
|
// @public
|
|
417
383
|
export enum KnownJsonWebKeyType {
|
|
418
|
-
// (undocumented)
|
|
419
384
|
EC = "EC",
|
|
420
|
-
// (undocumented)
|
|
421
385
|
ECHSM = "EC-HSM",
|
|
422
|
-
// (undocumented)
|
|
423
386
|
RSA = "RSA",
|
|
424
|
-
// (undocumented)
|
|
425
387
|
RSAHSM = "RSA-HSM"
|
|
426
388
|
}
|
|
427
389
|
|
|
428
390
|
// @public
|
|
429
391
|
export enum KnownKeyPermissions {
|
|
430
|
-
// (undocumented)
|
|
431
392
|
All = "all",
|
|
432
|
-
// (undocumented)
|
|
433
393
|
Backup = "backup",
|
|
434
|
-
// (undocumented)
|
|
435
394
|
Create = "create",
|
|
436
|
-
// (undocumented)
|
|
437
395
|
Decrypt = "decrypt",
|
|
438
|
-
// (undocumented)
|
|
439
396
|
Delete = "delete",
|
|
440
|
-
// (undocumented)
|
|
441
397
|
Encrypt = "encrypt",
|
|
442
|
-
// (undocumented)
|
|
443
398
|
Get = "get",
|
|
444
|
-
// (undocumented)
|
|
445
399
|
Getrotationpolicy = "getrotationpolicy",
|
|
446
|
-
// (undocumented)
|
|
447
400
|
Import = "import",
|
|
448
|
-
// (undocumented)
|
|
449
401
|
List = "list",
|
|
450
|
-
// (undocumented)
|
|
451
402
|
Purge = "purge",
|
|
452
|
-
// (undocumented)
|
|
453
403
|
Recover = "recover",
|
|
454
|
-
// (undocumented)
|
|
455
404
|
Release = "release",
|
|
456
|
-
// (undocumented)
|
|
457
405
|
Restore = "restore",
|
|
458
|
-
// (undocumented)
|
|
459
406
|
Rotate = "rotate",
|
|
460
|
-
// (undocumented)
|
|
461
407
|
Setrotationpolicy = "setrotationpolicy",
|
|
462
|
-
// (undocumented)
|
|
463
408
|
Sign = "sign",
|
|
464
|
-
// (undocumented)
|
|
465
409
|
UnwrapKey = "unwrapKey",
|
|
466
|
-
// (undocumented)
|
|
467
410
|
Update = "update",
|
|
468
|
-
// (undocumented)
|
|
469
411
|
Verify = "verify",
|
|
470
|
-
// (undocumented)
|
|
471
412
|
WrapKey = "wrapKey"
|
|
472
413
|
}
|
|
473
414
|
|
|
@@ -479,45 +420,31 @@ export enum KnownManagedHsmSkuFamily {
|
|
|
479
420
|
|
|
480
421
|
// @public
|
|
481
422
|
export enum KnownNetworkRuleAction {
|
|
482
|
-
// (undocumented)
|
|
483
423
|
Allow = "Allow",
|
|
484
|
-
// (undocumented)
|
|
485
424
|
Deny = "Deny"
|
|
486
425
|
}
|
|
487
426
|
|
|
488
427
|
// @public
|
|
489
428
|
export enum KnownNetworkRuleBypassOptions {
|
|
490
|
-
// (undocumented)
|
|
491
429
|
AzureServices = "AzureServices",
|
|
492
|
-
// (undocumented)
|
|
493
430
|
None = "None"
|
|
494
431
|
}
|
|
495
432
|
|
|
496
433
|
// @public
|
|
497
434
|
export enum KnownPrivateEndpointConnectionProvisioningState {
|
|
498
|
-
// (undocumented)
|
|
499
435
|
Creating = "Creating",
|
|
500
|
-
// (undocumented)
|
|
501
436
|
Deleting = "Deleting",
|
|
502
|
-
// (undocumented)
|
|
503
437
|
Disconnected = "Disconnected",
|
|
504
|
-
// (undocumented)
|
|
505
438
|
Failed = "Failed",
|
|
506
|
-
// (undocumented)
|
|
507
439
|
Succeeded = "Succeeded",
|
|
508
|
-
// (undocumented)
|
|
509
440
|
Updating = "Updating"
|
|
510
441
|
}
|
|
511
442
|
|
|
512
443
|
// @public
|
|
513
444
|
export enum KnownPrivateEndpointServiceConnectionStatus {
|
|
514
|
-
// (undocumented)
|
|
515
445
|
Approved = "Approved",
|
|
516
|
-
// (undocumented)
|
|
517
446
|
Disconnected = "Disconnected",
|
|
518
|
-
// (undocumented)
|
|
519
447
|
Pending = "Pending",
|
|
520
|
-
// (undocumented)
|
|
521
448
|
Rejected = "Rejected"
|
|
522
449
|
}
|
|
523
450
|
|
|
@@ -535,31 +462,20 @@ export enum KnownProvisioningState {
|
|
|
535
462
|
|
|
536
463
|
// @public
|
|
537
464
|
export enum KnownPublicNetworkAccess {
|
|
538
|
-
// (undocumented)
|
|
539
465
|
Disabled = "Disabled",
|
|
540
|
-
// (undocumented)
|
|
541
466
|
Enabled = "Enabled"
|
|
542
467
|
}
|
|
543
468
|
|
|
544
469
|
// @public
|
|
545
470
|
export enum KnownSecretPermissions {
|
|
546
|
-
// (undocumented)
|
|
547
471
|
All = "all",
|
|
548
|
-
// (undocumented)
|
|
549
472
|
Backup = "backup",
|
|
550
|
-
// (undocumented)
|
|
551
473
|
Delete = "delete",
|
|
552
|
-
// (undocumented)
|
|
553
474
|
Get = "get",
|
|
554
|
-
// (undocumented)
|
|
555
475
|
List = "list",
|
|
556
|
-
// (undocumented)
|
|
557
476
|
Purge = "purge",
|
|
558
|
-
// (undocumented)
|
|
559
477
|
Recover = "recover",
|
|
560
|
-
// (undocumented)
|
|
561
478
|
Restore = "restore",
|
|
562
|
-
// (undocumented)
|
|
563
479
|
Set = "set"
|
|
564
480
|
}
|
|
565
481
|
|
|
@@ -571,43 +487,26 @@ export enum KnownSkuFamily {
|
|
|
571
487
|
|
|
572
488
|
// @public
|
|
573
489
|
export enum KnownStoragePermissions {
|
|
574
|
-
// (undocumented)
|
|
575
490
|
All = "all",
|
|
576
|
-
// (undocumented)
|
|
577
491
|
Backup = "backup",
|
|
578
|
-
// (undocumented)
|
|
579
492
|
Delete = "delete",
|
|
580
|
-
// (undocumented)
|
|
581
493
|
Deletesas = "deletesas",
|
|
582
|
-
// (undocumented)
|
|
583
494
|
Get = "get",
|
|
584
|
-
// (undocumented)
|
|
585
495
|
Getsas = "getsas",
|
|
586
|
-
// (undocumented)
|
|
587
496
|
List = "list",
|
|
588
|
-
// (undocumented)
|
|
589
497
|
Listsas = "listsas",
|
|
590
|
-
// (undocumented)
|
|
591
498
|
Purge = "purge",
|
|
592
|
-
// (undocumented)
|
|
593
499
|
Recover = "recover",
|
|
594
|
-
// (undocumented)
|
|
595
500
|
Regeneratekey = "regeneratekey",
|
|
596
|
-
// (undocumented)
|
|
597
501
|
Restore = "restore",
|
|
598
|
-
// (undocumented)
|
|
599
502
|
Set = "set",
|
|
600
|
-
// (undocumented)
|
|
601
503
|
Setsas = "setsas",
|
|
602
|
-
// (undocumented)
|
|
603
504
|
Update = "update"
|
|
604
505
|
}
|
|
605
506
|
|
|
606
507
|
// @public
|
|
607
508
|
export enum KnownVaultProvisioningState {
|
|
608
|
-
// (undocumented)
|
|
609
509
|
RegisteringDns = "RegisteringDns",
|
|
610
|
-
// (undocumented)
|
|
611
510
|
Succeeded = "Succeeded"
|
|
612
511
|
}
|
|
613
512
|
|
|
@@ -625,9 +524,9 @@ export interface LogSpecification {
|
|
|
625
524
|
}
|
|
626
525
|
|
|
627
526
|
// @public
|
|
628
|
-
export
|
|
527
|
+
export interface ManagedHsm extends ManagedHsmResource {
|
|
629
528
|
properties?: ManagedHsmProperties;
|
|
630
|
-
}
|
|
529
|
+
}
|
|
631
530
|
|
|
632
531
|
// @public
|
|
633
532
|
export interface ManagedHsmError {
|
|
@@ -780,6 +679,11 @@ export interface ManagedHsmsPurgeDeletedOptionalParams extends coreClient.Operat
|
|
|
780
679
|
updateIntervalInMs?: number;
|
|
781
680
|
}
|
|
782
681
|
|
|
682
|
+
// @public
|
|
683
|
+
export interface ManagedHsmsUpdateHeaders {
|
|
684
|
+
location?: string;
|
|
685
|
+
}
|
|
686
|
+
|
|
783
687
|
// @public
|
|
784
688
|
export interface ManagedHsmsUpdateOptionalParams extends coreClient.OperationOptions {
|
|
785
689
|
resumeFrom?: string;
|
|
@@ -823,15 +727,17 @@ export interface MhsmPrivateEndpoint {
|
|
|
823
727
|
}
|
|
824
728
|
|
|
825
729
|
// @public
|
|
826
|
-
export
|
|
730
|
+
export interface MhsmPrivateEndpointConnection extends ManagedHsmResource {
|
|
827
731
|
etag?: string;
|
|
828
732
|
privateEndpoint?: MhsmPrivateEndpoint;
|
|
829
733
|
privateLinkServiceConnectionState?: MhsmPrivateLinkServiceConnectionState;
|
|
830
734
|
provisioningState?: PrivateEndpointConnectionProvisioningState;
|
|
831
|
-
}
|
|
735
|
+
}
|
|
832
736
|
|
|
833
737
|
// @public
|
|
834
738
|
export interface MhsmPrivateEndpointConnectionItem {
|
|
739
|
+
etag?: string;
|
|
740
|
+
id?: string;
|
|
835
741
|
privateEndpoint?: MhsmPrivateEndpoint;
|
|
836
742
|
privateLinkServiceConnectionState?: MhsmPrivateLinkServiceConnectionState;
|
|
837
743
|
provisioningState?: PrivateEndpointConnectionProvisioningState;
|
|
@@ -902,11 +808,11 @@ export interface MhsmPrivateEndpointConnectionsPutOptionalParams extends coreCli
|
|
|
902
808
|
export type MhsmPrivateEndpointConnectionsPutResponse = MhsmPrivateEndpointConnectionsPutHeaders & MhsmPrivateEndpointConnection;
|
|
903
809
|
|
|
904
810
|
// @public
|
|
905
|
-
export
|
|
811
|
+
export interface MhsmPrivateLinkResource extends ManagedHsmResource {
|
|
906
812
|
readonly groupId?: string;
|
|
907
813
|
readonly requiredMembers?: string[];
|
|
908
814
|
requiredZoneNames?: string[];
|
|
909
|
-
}
|
|
815
|
+
}
|
|
910
816
|
|
|
911
817
|
// @public
|
|
912
818
|
export interface MhsmPrivateLinkResourceListResult {
|
|
@@ -1008,12 +914,12 @@ export interface PrivateEndpoint {
|
|
|
1008
914
|
}
|
|
1009
915
|
|
|
1010
916
|
// @public
|
|
1011
|
-
export
|
|
917
|
+
export interface PrivateEndpointConnection extends Resource {
|
|
1012
918
|
etag?: string;
|
|
1013
919
|
privateEndpoint?: PrivateEndpoint;
|
|
1014
920
|
privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState;
|
|
1015
921
|
provisioningState?: PrivateEndpointConnectionProvisioningState;
|
|
1016
|
-
}
|
|
922
|
+
}
|
|
1017
923
|
|
|
1018
924
|
// @public
|
|
1019
925
|
export interface PrivateEndpointConnectionItem {
|
|
@@ -1095,11 +1001,11 @@ export type PrivateEndpointConnectionsPutResponse = PrivateEndpointConnectionsPu
|
|
|
1095
1001
|
export type PrivateEndpointServiceConnectionStatus = string;
|
|
1096
1002
|
|
|
1097
1003
|
// @public
|
|
1098
|
-
export
|
|
1004
|
+
export interface PrivateLinkResource extends Resource {
|
|
1099
1005
|
readonly groupId?: string;
|
|
1100
1006
|
readonly requiredMembers?: string[];
|
|
1101
1007
|
requiredZoneNames?: string[];
|
|
1102
|
-
}
|
|
1008
|
+
}
|
|
1103
1009
|
|
|
1104
1010
|
// @public
|
|
1105
1011
|
export interface PrivateLinkResourceListResult {
|
|
@@ -1158,12 +1064,13 @@ export interface RotationPolicy {
|
|
|
1158
1064
|
}
|
|
1159
1065
|
|
|
1160
1066
|
// @public
|
|
1161
|
-
export
|
|
1067
|
+
export interface Secret extends Resource {
|
|
1162
1068
|
properties: SecretProperties;
|
|
1163
|
-
}
|
|
1069
|
+
}
|
|
1164
1070
|
|
|
1165
1071
|
// @public
|
|
1166
|
-
export
|
|
1072
|
+
export interface SecretAttributes extends Attributes {
|
|
1073
|
+
}
|
|
1167
1074
|
|
|
1168
1075
|
// @public
|
|
1169
1076
|
export interface SecretCreateOrUpdateParameters {
|
package/src/index.ts
CHANGED
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
|
|
9
9
|
import * as coreClient from "@azure/core-client";
|
|
10
10
|
import * as coreRestPipeline from "@azure/core-rest-pipeline";
|
|
11
|
+
import {
|
|
12
|
+
PipelineRequest,
|
|
13
|
+
PipelineResponse,
|
|
14
|
+
SendRequest
|
|
15
|
+
} from "@azure/core-rest-pipeline";
|
|
11
16
|
import * as coreAuth from "@azure/core-auth";
|
|
12
17
|
import {
|
|
13
18
|
KeysImpl,
|
|
@@ -66,47 +71,53 @@ export class KeyVaultManagementClient extends coreClient.ServiceClient {
|
|
|
66
71
|
credential: credentials
|
|
67
72
|
};
|
|
68
73
|
|
|
69
|
-
const packageDetails = `azsdk-js-arm-keyvault/2.1.0-beta.
|
|
74
|
+
const packageDetails = `azsdk-js-arm-keyvault/2.1.0-beta.2`;
|
|
70
75
|
const userAgentPrefix =
|
|
71
76
|
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
72
77
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
73
78
|
: `${packageDetails}`;
|
|
74
79
|
|
|
75
|
-
if (!options.credentialScopes) {
|
|
76
|
-
options.credentialScopes = ["https://management.azure.com/.default"];
|
|
77
|
-
}
|
|
78
80
|
const optionsWithDefaults = {
|
|
79
81
|
...defaults,
|
|
80
82
|
...options,
|
|
81
83
|
userAgentOptions: {
|
|
82
84
|
userAgentPrefix
|
|
83
85
|
},
|
|
84
|
-
|
|
86
|
+
endpoint:
|
|
85
87
|
options.endpoint ?? options.baseUri ?? "https://management.azure.com"
|
|
86
88
|
};
|
|
87
89
|
super(optionsWithDefaults);
|
|
88
90
|
|
|
91
|
+
let bearerTokenAuthenticationPolicyFound: boolean = false;
|
|
89
92
|
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
|
|
90
93
|
const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
|
|
91
|
-
|
|
94
|
+
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
|
|
92
95
|
(pipelinePolicy) =>
|
|
93
96
|
pipelinePolicy.name ===
|
|
94
97
|
coreRestPipeline.bearerTokenAuthenticationPolicyName
|
|
95
98
|
);
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
99
|
+
}
|
|
100
|
+
if (
|
|
101
|
+
!options ||
|
|
102
|
+
!options.pipeline ||
|
|
103
|
+
options.pipeline.getOrderedPolicies().length == 0 ||
|
|
104
|
+
!bearerTokenAuthenticationPolicyFound
|
|
105
|
+
) {
|
|
106
|
+
this.pipeline.removePolicy({
|
|
107
|
+
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
|
|
108
|
+
});
|
|
109
|
+
this.pipeline.addPolicy(
|
|
110
|
+
coreRestPipeline.bearerTokenAuthenticationPolicy({
|
|
111
|
+
credential: credentials,
|
|
112
|
+
scopes:
|
|
113
|
+
optionsWithDefaults.credentialScopes ??
|
|
114
|
+
`${optionsWithDefaults.endpoint}/.default`,
|
|
115
|
+
challengeCallbacks: {
|
|
116
|
+
authorizeRequestOnChallenge:
|
|
117
|
+
coreClient.authorizeRequestOnClaimChallenge
|
|
118
|
+
}
|
|
119
|
+
})
|
|
120
|
+
);
|
|
110
121
|
}
|
|
111
122
|
// Parameter assignments
|
|
112
123
|
this.subscriptionId = subscriptionId;
|
|
@@ -125,6 +136,35 @@ export class KeyVaultManagementClient extends coreClient.ServiceClient {
|
|
|
125
136
|
this.mhsmPrivateLinkResources = new MhsmPrivateLinkResourcesImpl(this);
|
|
126
137
|
this.operations = new OperationsImpl(this);
|
|
127
138
|
this.secrets = new SecretsImpl(this);
|
|
139
|
+
this.addCustomApiVersionPolicy(options.apiVersion);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
|
|
143
|
+
private addCustomApiVersionPolicy(apiVersion?: string) {
|
|
144
|
+
if (!apiVersion) {
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
const apiVersionPolicy = {
|
|
148
|
+
name: "CustomApiVersionPolicy",
|
|
149
|
+
async sendRequest(
|
|
150
|
+
request: PipelineRequest,
|
|
151
|
+
next: SendRequest
|
|
152
|
+
): Promise<PipelineResponse> {
|
|
153
|
+
const param = request.url.split("?");
|
|
154
|
+
if (param.length > 1) {
|
|
155
|
+
const newParams = param[1].split("&").map((item) => {
|
|
156
|
+
if (item.indexOf("api-version") > -1) {
|
|
157
|
+
return "api-version=" + apiVersion;
|
|
158
|
+
} else {
|
|
159
|
+
return item;
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
request.url = param[0] + "?" + newParams.join("&");
|
|
163
|
+
}
|
|
164
|
+
return next(request);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
this.pipeline.addPolicy(apiVersionPolicy);
|
|
128
168
|
}
|
|
129
169
|
|
|
130
170
|
keys: Keys;
|