You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: src/Arcus.Security.Providers.AzureKeyVault/Extensions/SecretStoreBuilderExtensions.cs
+108
Original file line number
Diff line number
Diff line change
@@ -372,6 +372,27 @@ public static SecretStoreBuilder AddAzureKeyVaultWithManagedServiceIdentityWithO
372
372
configureOptions);
373
373
}
374
374
375
+
/// <summary>
376
+
/// Adds Azure Key Vault as a secret source which uses Managed Identity authentication.
377
+
/// </summary>
378
+
/// <param name="builder">The builder to create the secret store.</param>
379
+
/// <param name="rawVaultUri">The Uri of the Azure Key Vault you want to connect to.</param>
380
+
/// The optional client id to authenticate for a user assigned managed identity.
381
+
/// More information on user assigned managed identities can be found here: https://docs.microsoft.com/en-us/azure/active-directory/managed-identities-azure-resources/overview#how-a-user-assigned-managed-identity-works-with-an-azure-vm</param>
382
+
/// <param name="allowCaching">The flag to indicate whether to include caching during secret retrieval in Azure key vault.</param>
383
+
/// <exception cref="ArgumentNullException">Thrown when the <paramref name="builder"/> is <c>null</c>.</exception>
384
+
/// <exception cref="ArgumentException">Thrown when the <paramref name="rawVaultUri"/> is blank.</exception>
Guard.NotNull(builder,nameof(builder),"Requires a secret store builder to add the Azure Key Vault secret provider");
391
+
Guard.NotNullOrWhitespace(rawVaultUri,nameof(rawVaultUri),"Requires a non-blank URI of the Azure Key Vault instance to add the secret provider to the secret store");
Guard.NotNull(builder,nameof(builder),"Requires a secret store builder to add the Azure Key Vault secret provider");
446
+
Guard.NotNullOrWhitespace(rawVaultUri,nameof(rawVaultUri),"Requires a non-blank URI of the Azure Key Vault instance to add the secret provider to the secret store");
447
+
448
+
returnAddAzureKeyVaultWithManagedIdentity(
449
+
builder,
450
+
rawVaultUri,
451
+
clientId:null,
452
+
configureOptions:configureOptions,
453
+
name:name,
454
+
mutateSecretName:mutateSecretName,
455
+
allowCaching:allowCaching);
456
+
}
457
+
405
458
/// <summary>
406
459
/// Adds Azure Key Vault as a secret source which uses Managed Identity authentication.
407
460
/// </summary>
@@ -500,6 +553,29 @@ public static SecretStoreBuilder AddAzureKeyVaultWithManagedServiceIdentityWithO
500
553
configureOptions);
501
554
}
502
555
556
+
/// <summary>
557
+
/// Adds Azure Key Vault as a secret source which uses Managed Identity authentication.
558
+
/// </summary>
559
+
/// <param name="builder">The builder to create the secret store.</param>
560
+
/// <param name="rawVaultUri">The Uri of the Azure Key Vault you want to connect to.</param>
561
+
/// <param name="cacheConfiguration">The configuration to control how the caching will be done.</param>
562
+
/// <exception cref="ArgumentNullException">Thrown when the <paramref name="builder"/> is <c>null</c>.</exception>
563
+
/// <exception cref="ArgumentException">Thrown when the <paramref name="rawVaultUri"/> is blank.</exception>
Guard.NotNull(builder,nameof(builder),"Requires a secret store builder to add the Azure Key Vault secret provider");
570
+
Guard.NotNullOrWhitespace(rawVaultUri,nameof(rawVaultUri),"Requires a non-blank URI of the Azure Key Vault instance to add the secret provider to the secret store");
571
+
572
+
returnAddAzureKeyVaultWithManagedIdentity(
573
+
builder,
574
+
rawVaultUri,
575
+
cacheConfiguration,
576
+
clientId:null);
577
+
}
578
+
503
579
/// <summary>
504
580
/// Adds Azure Key Vault as a secret source which uses Managed Identity authentication.
505
581
/// </summary>
@@ -529,6 +605,38 @@ public static SecretStoreBuilder AddAzureKeyVaultWithManagedIdentity(
529
605
name:null,
530
606
mutateSecretName:null);
531
607
}
608
+
609
+
/// <summary>
610
+
/// Adds Azure Key Vault as a secret source which uses Managed Identity authentication.
611
+
/// </summary>
612
+
/// <param name="builder">The builder to create the secret store.</param>
613
+
/// <param name="rawVaultUri">The Uri of the Azure Key Vault you want to connect to.</param>
614
+
/// <param name="cacheConfiguration">The configuration to control how the caching will be done.</param>
615
+
/// <param name="configureOptions">The optional additional options to configure the Azure Key Vault secret source.</param>
616
+
/// <param name="name">The unique name to register this Azure Key Vault provider in the secret store.</param>
617
+
/// <param name="mutateSecretName">The optional function to mutate the secret name before looking it up.</param>
618
+
/// <exception cref="ArgumentNullException">Thrown when the <paramref name="builder"/> is <c>null</c>.</exception>
619
+
/// <exception cref="ArgumentException">Thrown when the <paramref name="rawVaultUri"/> is blank.</exception>
Guard.NotNull(builder,nameof(builder),"Requires a secret store builder to add the Azure Key Vault secret provider");
629
+
Guard.NotNullOrWhitespace(rawVaultUri,nameof(rawVaultUri),"Requires a non-blank URI of the Azure Key Vault instance to add the secret provider to the secret store");
630
+
631
+
returnAddAzureKeyVaultWithManagedIdentity(
632
+
builder,
633
+
rawVaultUri,
634
+
cacheConfiguration,
635
+
clientId:null,
636
+
configureOptions:configureOptions,
637
+
name:name,
638
+
mutateSecretName:mutateSecretName);
639
+
}
532
640
533
641
/// <summary>
534
642
/// Adds Azure Key Vault as a secret source which uses Managed Identity authentication.
0 commit comments