Skip to content

Commit

Permalink
[FSSDK-8663] chore: General clean up before ticket work (#367)
Browse files Browse the repository at this point in the history
* Fix Rider-identified problems

* Fix invalid AssemblyFileVersion as noted by GitHub

* Remove unused field

* Remove App_Data from proj

* Upgrade Newtonsoft.Json for vulnerability in Demo & Test projs

Now matching other projs at 13.0.2

* Code review changes
  • Loading branch information
mikechu-optimizely authored Aug 16, 2023
1 parent f3a21d5 commit bfe4e64
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 48 deletions.
6 changes: 1 addition & 5 deletions OptimizelySDK.DemoApp/OptimizelySDK.DemoApp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@
<Private>True</Private>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
<Private>True</Private>
<HintPath>..\packages\Newtonsoft.Json.13.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
Expand Down Expand Up @@ -249,9 +248,6 @@
<Content Include="Scripts\popper-utils.min.js.map" />
<Content Include="Scripts\popper-utils.js.map" />
</ItemGroup>
<ItemGroup>
<Folder Include="App_Data\" />
</ItemGroup>
<ItemGroup>
<Content Include="packages.config" />
</ItemGroup>
Expand Down
8 changes: 4 additions & 4 deletions OptimizelySDK.DemoApp/Views/Shared/_Layout.cshtml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
@{
/*
* Copyright 2017-2018, Optimizely
* Copyright 2017-2018, 2023 Optimizely
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -17,7 +17,7 @@
}

<!DOCTYPE html>
<html>
<html lang="">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
Expand All @@ -37,7 +37,7 @@
@Html.ActionLink("Home", "Index", "Home", new { area = "" }, new { @class = "nav-link" })
</li>
<li class="nav-item">
@Html.ActionLink("Demo", "Index", "Demo/Config", new { area = "" }, new { @class = "nav-link" })
@Html.ActionLink("Demo", "Config", "Demo", new { area = "" }, new { @class = "nav-link" })
</li>
</ul>
</div>
Expand Down
2 changes: 1 addition & 1 deletion OptimizelySDK.DemoApp/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<package id="Microsoft.Web.Infrastructure" version="1.0.0.0" targetFramework="net45" />
<package id="Modernizr" version="2.6.2" targetFramework="net45" />
<package id="murmurhash-signed" version="1.0.2" targetFramework="net45" />
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net45" />
<package id="Newtonsoft.Json" version="13.0.2" targetFramework="net45" />
<package id="NJsonSchema" version="10.8.0" targetFramework="net45" />
<package id="Optimizely.SDK" version="3.2.0" targetFramework="net45" />
<package id="popper.js" version="1.12.9" targetFramework="net45" />
Expand Down
2 changes: 1 addition & 1 deletion OptimizelySDK.Net35/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("4.0.0.0-beta")]
[assembly: AssemblyFileVersion("4.0.0.0")]
[assembly: AssemblyInformationalVersion("4.0.0-beta")] // Used by Nuget.
2 changes: 1 addition & 1 deletion OptimizelySDK.Net40/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("4.0.0.0-beta")]
[assembly: AssemblyFileVersion("4.0.0.0")]
[assembly: AssemblyInformationalVersion("4.0.0-beta")] // Used by Nuget.
2 changes: 1 addition & 1 deletion OptimizelySDK.NetStandard16/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("4.0.0")]
[assembly: AssemblyFileVersion("4.0.0.0-beta")]
[assembly: AssemblyFileVersion("4.0.0.0")]
[assembly: AssemblyInformationalVersion("4.0.0-beta")] // Used by Nuget.
2 changes: 1 addition & 1 deletion OptimizelySDK.NetStandard20/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("4.0.0.0-beta")]
[assembly: AssemblyFileVersion("4.0.0.0")]
[assembly: AssemblyInformationalVersion("4.0.0-beta")] // Used by Nuget.
27 changes: 8 additions & 19 deletions OptimizelySDK.Tests/App.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,15 @@
<configuration>

<configSections>
<section name="optlySDKConfigSection"
type="OptimizelySDK.OptimizelySDKConfigSection, OptimizelySDK"/>
<section name="optlySDKConfigSection" type="OptimizelySDK.OptimizelySDKConfigSection, OptimizelySDK" />
</configSections>

<optlySDKConfigSection>

<HttpProjectConfig sdkKey="43214321"
url="www.testurl.com"
format="https://cdn.optimizely.com/data/{0}.json"
pollingInterval="2000"
blockingTimeOutPeriod="10000"
datafileAccessToken="testingtoken123"
autoUpdate="true"
defaultStart="true">
<HttpProjectConfig sdkKey="43214321" url="www.testurl.com" format="https://cdn.optimizely.com/data/{0}.json" pollingInterval="2000" blockingTimeOutPeriod="10000" datafileAccessToken="testingtoken123" autoUpdate="true" defaultStart="true">
</HttpProjectConfig>

<BatchEventProcessor batchSize="10"
flushInterval="2000"
timeoutInterval="10000"
defaultStart="true">
<BatchEventProcessor batchSize="10" flushInterval="2000" timeoutInterval="10000" defaultStart="true">
</BatchEventProcessor>

</optlySDKConfigSection>
Expand All @@ -36,16 +25,16 @@
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234"/>
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0"/>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
2 changes: 1 addition & 1 deletion OptimizelySDK.Tests/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// You can specify all the values or you can default the Revision and Build Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("4.0.0.0-beta")]
[assembly: AssemblyFileVersion("4.0.0.0")]
[assembly: AssemblyInformationalVersion("4.0.0-beta")] // Used by Nuget.
14 changes: 7 additions & 7 deletions OptimizelySDK.Tests/packages.config
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Castle.Core" version="4.0.0" targetFramework="net45"/>
<package id="Moq" version="4.7.1" targetFramework="net45"/>
<package id="Newtonsoft.Json" version="9.0.1" targetFramework="net45"/>
<package id="NUnit" version="2.6.4" targetFramework="net45"/>
<package id="NUnitTestAdapter" version="2.1.1" targetFramework="net45"/>
<package id="OpenCover" version="4.6.519" targetFramework="net45"/>
<package id="ReportGenerator" version="2.5.6" targetFramework="net45"/>
<package id="Castle.Core" version="4.0.0" targetFramework="net45" />
<package id="Moq" version="4.7.1" targetFramework="net45" />
<package id="Newtonsoft.Json" version="13.0.2" targetFramework="net45" />
<package id="NUnit" version="2.6.4" targetFramework="net45" />
<package id="NUnitTestAdapter" version="2.1.1" targetFramework="net45" />
<package id="OpenCover" version="4.6.519" targetFramework="net45" />
<package id="ReportGenerator" version="2.5.6" targetFramework="net45" />
</packages>
3 changes: 0 additions & 3 deletions OptimizelySDK.sln
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
ProjectSection(SolutionItems) = preProject
CHANGELOG.MD = CHANGELOG.MD
CONTRIBUTING.md = CONTRIBUTING.md
OptimizelySDK.Package\OptimizelySDK.nuspec = OptimizelySDK.Package\OptimizelySDK.nuspec
OptimizelySDK.Package\pack.ps1 = OptimizelySDK.Package\pack.ps1
README.md = README.md
OptimizelySDK.Package\verifysn.ps1 = OptimizelySDK.Package\verifysn.ps1
keypair.snk = keypair.snk
EndProjectSection
EndProject
Expand Down
4 changes: 2 additions & 2 deletions OptimizelySDK/Config/HttpProjectConfigManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#endif

using System;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using OptimizelySDK.ErrorHandler;
Expand Down Expand Up @@ -179,7 +180,7 @@ private string GetRemoteDatafileResponse()
}

var lastModified = result.Headers.GetValues("Last-Modified");
if (!string.IsNullOrEmpty(lastModified.First()))
if (!string.IsNullOrEmpty(lastModified?.First()))
{
LastModifiedSince = lastModified.First();
}
Expand Down Expand Up @@ -234,7 +235,6 @@ public class Builder
private bool StartByDefault = true;
private NotificationCenter NotificationCenter;


private bool IsBlockingTimeoutProvided = false;
private bool IsPollingIntervalProvided = false;

Expand Down
1 change: 0 additions & 1 deletion OptimizelySDK/OptimizelyDecisionContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ public class OptimizelyDecisionContext

private string flagKey;
private string ruleKey;
private string decisionKey;

/// <summary>
/// Represents the object is valid or not.
Expand Down
2 changes: 1 addition & 1 deletion OptimizelySDK/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("4.0.0.0")]
[assembly: AssemblyFileVersion("4.0.0.0-beta")]
[assembly: AssemblyFileVersion("4.0.0.0")]
[assembly: AssemblyInformationalVersion("4.0.0-beta")] // Used by Nuget.

0 comments on commit bfe4e64

Please sign in to comment.