Skip to content

Commit

Permalink
Fix #147 (#148)
Browse files Browse the repository at this point in the history
* Fix #147 and mop-up update of Public API

* Update Directory.Build.props
  • Loading branch information
jmprieur authored Jan 21, 2025
1 parent 38dbb1d commit 1f352bd
Show file tree
Hide file tree
Showing 11 changed files with 26 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<!-- This should be passed from the VSTS build -->
<MicrosoftIdentityAbstractionsVersion Condition="'$(MicrosoftIdentityAbstractionsVersion)' == ''">7.1.1</MicrosoftIdentityAbstractionsVersion>
<MicrosoftIdentityAbstractionsVersion Condition="'$(MicrosoftIdentityAbstractionsVersion)' == ''">7.2.1</MicrosoftIdentityAbstractionsVersion>
<!-- This will generate AssemblyVersion, AssemblyFileVersion and AssemblyInformationVersion -->
<Version>$(MicrosoftIdentityAbstractionsVersion)</Version>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)\build\35MSSharedLib1024.snk</AssemblyOriginatorKeyFile>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ public string? ReferenceOrValue
CredentialSource.StoreWithDistinguishedName => CertificateDistinguishedName,
CredentialSource.Certificate or CredentialSource.Base64Encoded => Base64EncodedValue,
CredentialSource.SignedAssertionFromManagedIdentity => ManagedIdentityClientId,
CredentialSource.ClientSecret => ClientSecret,
CredentialSource.ClientSecret => "***",
_ => null,
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,3 +248,5 @@ virtual Microsoft.Identity.Abstractions.IdentityApplicationOptions.Authority.get
virtual Microsoft.Identity.Abstractions.IdentityApplicationOptions.Authority.set -> void
Microsoft.Identity.Abstractions.AcquireTokenOptions.ExtraParameters.get -> System.Collections.Generic.IDictionary<string!, object!>?
Microsoft.Identity.Abstractions.AcquireTokenOptions.ExtraParameters.set -> void
Microsoft.Identity.Abstractions.MicrosoftIdentityApplicationOptions.AppHomeTenantId.get -> string?
Microsoft.Identity.Abstractions.MicrosoftIdentityApplicationOptions.AppHomeTenantId.set -> void
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
#nullable enable
Microsoft.Identity.Abstractions.MicrosoftIdentityApplicationOptions.AppHomeTenantId.get -> string?
Microsoft.Identity.Abstractions.MicrosoftIdentityApplicationOptions.AppHomeTenantId.set -> void
Original file line number Diff line number Diff line change
Expand Up @@ -276,4 +276,7 @@ virtual Microsoft.Identity.Abstractions.IdentityApplicationOptions.Authority.get
virtual Microsoft.Identity.Abstractions.IdentityApplicationOptions.Authority.set -> void
Microsoft.Identity.Abstractions.AcquireTokenOptions.ExtraParameters.get -> System.Collections.Generic.IDictionary<string!, object!>?
Microsoft.Identity.Abstractions.AcquireTokenOptions.ExtraParameters.set -> void
Microsoft.Identity.Abstractions.MicrosoftIdentityApplicationOptions.AppHomeTenantId.get -> string?
Microsoft.Identity.Abstractions.MicrosoftIdentityApplicationOptions.AppHomeTenantId.set -> void


Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
#nullable enable
Microsoft.Identity.Abstractions.MicrosoftIdentityApplicationOptions.AppHomeTenantId.get -> string?
Microsoft.Identity.Abstractions.MicrosoftIdentityApplicationOptions.AppHomeTenantId.set -> void
Original file line number Diff line number Diff line change
Expand Up @@ -248,3 +248,5 @@ virtual Microsoft.Identity.Abstractions.IdentityApplicationOptions.Authority.get
virtual Microsoft.Identity.Abstractions.IdentityApplicationOptions.Authority.set -> void
Microsoft.Identity.Abstractions.AcquireTokenOptions.ExtraParameters.get -> System.Collections.Generic.IDictionary<string!, object!>?
Microsoft.Identity.Abstractions.AcquireTokenOptions.ExtraParameters.set -> void
Microsoft.Identity.Abstractions.MicrosoftIdentityApplicationOptions.AppHomeTenantId.get -> string?
Microsoft.Identity.Abstractions.MicrosoftIdentityApplicationOptions.AppHomeTenantId.set -> void
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
#nullable enable
Microsoft.Identity.Abstractions.MicrosoftIdentityApplicationOptions.AppHomeTenantId.get -> string?
Microsoft.Identity.Abstractions.MicrosoftIdentityApplicationOptions.AppHomeTenantId.set -> void
Original file line number Diff line number Diff line change
Expand Up @@ -252,3 +252,5 @@ virtual Microsoft.Identity.Abstractions.IdentityApplicationOptions.Authority.get
virtual Microsoft.Identity.Abstractions.IdentityApplicationOptions.Authority.set -> void
Microsoft.Identity.Abstractions.AcquireTokenOptions.ExtraParameters.get -> System.Collections.Generic.IDictionary<string!, object!>?
Microsoft.Identity.Abstractions.AcquireTokenOptions.ExtraParameters.set -> void
Microsoft.Identity.Abstractions.MicrosoftIdentityApplicationOptions.AppHomeTenantId.get -> string?
Microsoft.Identity.Abstractions.MicrosoftIdentityApplicationOptions.AppHomeTenantId.set -> void
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
#nullable enable
Microsoft.Identity.Abstractions.MicrosoftIdentityApplicationOptions.AppHomeTenantId.get -> string?
Microsoft.Identity.Abstractions.MicrosoftIdentityApplicationOptions.AppHomeTenantId.set -> void
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public void Secret()

Assert.Equal(CredentialType.Secret, credentialDescription.CredentialType);
Assert.Null(credentialDescription.Container);
Assert.Equal(credentialDescription.ClientSecret, credentialDescription.ReferenceOrValue);
Assert.Equal("***", credentialDescription.ReferenceOrValue);
}

[Fact]
Expand Down Expand Up @@ -426,16 +426,25 @@ public void TestContainer(CredentialSource credentialSource)
}

// Ref/Value only
[Theory]
[InlineData(CredentialSource.ClientSecret)]
[InlineData(CredentialSource.SignedAssertionFromManagedIdentity)]
public void TestValueOrReference(CredentialSource credentialSource)
[Fact]
public void TestValueOrReferenceForSignedAssertionManagedIdentity()
{
CredentialDescription credentialDescription = new CredentialDescription { SourceType = credentialSource };
CredentialDescription credentialDescription = new CredentialDescription
{ SourceType = CredentialSource.SignedAssertionFromManagedIdentity };
credentialDescription.ReferenceOrValue = "referenceOrValue";
Assert.Equal("referenceOrValue", credentialDescription.ReferenceOrValue);
}

// Ref/Value only
[Fact]
public void TestValueOrReferenceForClientSecret()
{
CredentialDescription credentialDescription = new CredentialDescription
{ SourceType = CredentialSource.ClientSecret };
credentialDescription.ReferenceOrValue = "referenceOrValue";
Assert.Equal("***", credentialDescription.ReferenceOrValue);
}

[Theory]
[InlineData(CredentialSource.KeyVault, "KeyVaultUrl", "CertificateName")]
[InlineData(CredentialSource.KeyVault, null, "CertificateName")]
Expand Down

0 comments on commit 1f352bd

Please sign in to comment.