Skip to content

Commit d76bddf

Browse files
authored
Merge pull request #41 from contentstack/next
Next
2 parents b559c90 + 108f699 commit d76bddf

File tree

23 files changed

+112
-45
lines changed

23 files changed

+112
-45
lines changed

.github/workflows/sca-scan.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@ jobs:
66
security-sca:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@master
9+
- name: Checkout repository
10+
uses: actions/checkout@master
11+
- name: Run Dotnet Restore
12+
run: |
13+
dotnet restore
1014
- name: Run Snyk to check for vulnerabilities
1115
uses: snyk/actions/dotnet@master
1216
env:
1317
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
1418
with:
15-
args: --fail-on=all
19+
args: --file=Contentstack.Management.Core/obj/project.assets.json --fail-on=all

.talismanrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ threshold: medium
22
fileignoreconfig:
33
- filename: Contentstack.Management.Core.Tests/Mock/customUpload.html
44
checksum: 854eb83dcacd62d3bf233c82e5cfd0c69dd20478fa0e7c6af9028f6c6386749d
5+
- filename: Contentstack.Management.Core/Attributes/CSMJsonConverterAttribute.cs
6+
checksum: 774bc2a4cf7f62fb890ba39ba1319769f0ff4e13d94781d394fcac2adf14381e
57
version: ""

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
# Changelog
22

3-
## [v0.1.7](https://github.com/contentstack/contentstack-management-dotnet/tree/v0.1.5) (2024-02-11)
3+
## [v0.1.8](https://github.com/contentstack/contentstack-management-dotnet/tree/v0.1.8)
4+
- Fix
5+
- Strong named assemblies
6+
7+
## [v0.1.7](https://github.com/contentstack/contentstack-management-dotnet/tree/v0.1.7) (2024-02-11)
48
- Feature
59
- Parameter support in References and ReferencesAsync methods
610

7-
## [v0.1.6](https://github.com/contentstack/contentstack-management-dotnet/tree/v0.1.5) (2024-02-11)
11+
## [v0.1.6](https://github.com/contentstack/contentstack-management-dotnet/tree/v0.1.6) (2024-02-11)
812
- Fix
913
- TextNode Deserializer
1014

CSManagementSDK.snk

596 Bytes
Binary file not shown.

Contentstack.Management.ASPNETCore/contentstack.management.aspnetcore.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<TargetFramework>netstandard2.1</TargetFramework>
55
<PackageId>contentstack.management.aspnetcore</PackageId>
6-
<PackageVersion>0.1.7</PackageVersion>
6+
<PackageVersion>$(Version)</PackageVersion>
77
<Authors>Contentstack</Authors>
88
<Copyright>Copyright © 2012-2024 Contentstack. All Rights Reserved</Copyright>
99
<Owners>Contentstack </Owners>
@@ -14,8 +14,8 @@
1414
<Title>Contentstack Management</Title>
1515
<Description>.NET SDK for the Contentstack Content Management API.</Description>
1616
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
17-
<PackageTags>v0.1.7</PackageTags>
18-
<ReleaseVersion>0.1.7</ReleaseVersion>
17+
<PackageTags>v$(Version)</PackageTags>
18+
<ReleaseVersion>$(Version)</ReleaseVersion>
1919
<RootNamespace>Contentstack.Management.ASPNETCore</RootNamespace>
2020
</PropertyGroup>
2121

Contentstack.Management.Core.Tests/Contentstack.Management.Core.Tests.csproj

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55

66
<IsPackable>false</IsPackable>
77
<ReleaseVersion>0.1.3</ReleaseVersion>
8+
9+
<SignAssembly>true</SignAssembly>
10+
<AssemblyOriginatorKeyFile>../CSManagementSDK.snk</AssemblyOriginatorKeyFile>
811
</PropertyGroup>
912

1013
<ItemGroup>

Contentstack.Management.Core.Unit.Tests/Contentstack.Management.Core.Unit.Tests.csproj

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
<TargetFramework>net7.0</TargetFramework>
55

66
<IsPackable>false</IsPackable>
7-
<ReleaseVersion>0.1.7</ReleaseVersion>
7+
<ReleaseVersion>$(Version)</ReleaseVersion>
8+
<SignAssembly>true</SignAssembly>
9+
<AssemblyOriginatorKeyFile>../CSManagementSDK.snk</AssemblyOriginatorKeyFile>
810
</PropertyGroup>
911

1012
<ItemGroup>

Contentstack.Management.Core.Unit.Tests/Models/RoleTest.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,5 +142,23 @@ public async System.Threading.Tasks.Task Should_Delete_Role_Async()
142142
Assert.AreEqual(_contentstackResponse.OpenResponse(), response.OpenResponse());
143143
Assert.AreEqual(_contentstackResponse.OpenJObjectResponse().ToString(), response.OpenJObjectResponse().ToString());
144144
}
145+
146+
[TestMethod]
147+
public void Should_Create_Role_With_Taxonomy_Permissions()
148+
{
149+
ContentstackResponse response = _stack.Role().Create(_fixture.Create<RoleModel>());
150+
151+
Assert.AreEqual(_contentstackResponse.OpenResponse(), response.OpenResponse());
152+
Assert.AreEqual(_contentstackResponse.OpenJObjectResponse().ToString(), response.OpenJObjectResponse().ToString());
153+
}
154+
155+
[TestMethod]
156+
public void Should_Update_Role_With_Taxonomy_Permissions()
157+
{
158+
ContentstackResponse response = _stack.Role(_fixture.Create<string>()).Update(_fixture.Create<RoleModel>());
159+
160+
Assert.AreEqual(_contentstackResponse.OpenResponse(), response.OpenResponse());
161+
Assert.AreEqual(_contentstackResponse.OpenJObjectResponse().ToString(), response.OpenJObjectResponse().ToString());
162+
}
145163
}
146164
}

Contentstack.Management.Core.Unit.Tests/Mokes/MockHttpHandler.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ namespace Contentstack.Management.Core.Unit.Tests.Mokes
99
{
1010
public class MockRetryHadler : PipelineHandler
1111
{
12-
public override Task<T> InvokeAsync<T>(IExecutionContext executionContext)
12+
public override Task<T> InvokeAsync<T>(IExecutionContext executionContext, bool addAcceptMediaHeader = false)
1313
{
14-
return base.InvokeAsync<T>(executionContext);
14+
return base.InvokeAsync<T>(executionContext, addAcceptMediaHeader);
1515
}
1616

1717
public override void InvokeSync(IExecutionContext executionContext)
@@ -32,7 +32,7 @@ public MockHttpHandler(ContentstackResponse response)
3232
public ILogManager LogManager { get; set; }
3333
public IPipelineHandler InnerHandler { get; set; }
3434

35-
public async Task<T> InvokeAsync<T>(IExecutionContext executionContext)
35+
public async Task<T> InvokeAsync<T>(IExecutionContext executionContext, bool addAcceptMediaHeader = false)
3636
{
3737
executionContext.ResponseContext.httpResponse = _response;
3838

Contentstack.Management.Core.Unit.Tests/Mokes/MockService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public bool HasRequestBody()
174174
return HttpMethod == "POST" || HttpMethod == "PUT" || HttpMethod == "PATCH";
175175
}
176176

177-
public virtual IHttpRequest CreateHttpRequest(HttpClient httpClient, ContentstackClientOptions config)
177+
public virtual IHttpRequest CreateHttpRequest(HttpClient httpClient, ContentstackClientOptions config, bool addAcceptMediaHeader = false)
178178
{
179179
var contentstackHttpRequest = new ContentstackHttpRequest(httpClient, _serializer);
180180
contentstackHttpRequest.Method = new HttpMethod(HttpMethod);

0 commit comments

Comments
 (0)