Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed Obsolete attribute from ClientToken and added to AAD properties #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using FluentAssertions;
using NUnit.Framework;
using SFA.DAS.Notifications.Api.Client.Configuration;

namespace SFA.DAS.Notifications.Api.Client.UnitTests.NotificationsApiClientConfigurationTests
{
[TestFixture]
public class AttributeTests
{
[Test]
public void ClientTokenDoesNotHaveAnObsoleteAttribute()
{
typeof(NotificationsApiClientConfiguration).GetProperty("ClientToken").Should().NotBeDecoratedWith<ObsoleteAttribute>();
}


[TestCase("ClientId")]
[TestCase("ClientSecret")]
[TestCase("IdentifierUri")]
[TestCase("Tenant")]
public void AADPropertyHasObsoleteAttribute(string propertyName)
{
typeof(NotificationsApiClientConfiguration).GetProperty(propertyName).Should().BeDecoratedWith<ObsoleteAttribute>();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
<HintPath>..\packages\Castle.Core.3.3.3\lib\net45\Castle.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="FluentAssertions, Version=5.6.0.0, Culture=neutral, PublicKeyToken=33f2691a05b67b6a">
<HintPath>..\packages\FluentAssertions.5.6.0\lib\net45\FluentAssertions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.ApplicationInsights, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.ApplicationInsights.2.2.0\lib\net45\Microsoft.ApplicationInsights.dll</HintPath>
</Reference>
Expand All @@ -60,6 +64,10 @@
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51">
<HintPath>..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
Expand All @@ -71,6 +79,7 @@
<Compile Include="FakeResponseHandler.cs" />
<Compile Include="NotificationApiClientTests\WhenISendAnSms.cs" />
<Compile Include="NotificationApiClientTests\WhenISendAnEmail.cs" />
<Compile Include="NotificationsApiClientConfigurationTests\AttributeTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Castle.Core" version="3.3.3" targetFramework="net45" />
<package id="FluentAssertions" version="5.6.0" targetFramework="net452" />
<package id="Microsoft.ApplicationInsights" version="2.2.0" targetFramework="net452" />
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="3.13.8" targetFramework="net45" />
<package id="Moq" version="4.5.28" targetFramework="net45" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net452" />
<package id="NUnit" version="3.5.0" targetFramework="net45" />
<package id="SFA.DAS.Http" version="1.2.112" targetFramework="net45" />
<package id="System.ValueTuple" version="4.4.0" targetFramework="net452" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ namespace SFA.DAS.Notifications.Api.Client.Configuration
public class NotificationsApiClientConfiguration : INotificationsApiClientConfiguration
{
public string ApiBaseUrl { get; set; }

[Obsolete("Azure AD authentication is obsolete. Use JWT authentication.")]
public string ClientId { get; set; }
[Obsolete("Azure AD authentication is obsolete. Use JWT authentication.")]
public string ClientSecret { get; set; }
[Obsolete("Azure AD authentication is obsolete. Use JWT authentication.")]
public string IdentifierUri { get; set; }
[Obsolete("Azure AD authentication is obsolete. Use JWT authentication.")]
public string Tenant { get; set; }

[Obsolete("Jwt token usage is obsolete. Use Azure AD authentication.")]

public string ClientToken { get; set; }
}
}