Skip to content
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## [v1.1.1](https://github.com/contentstack/contentstack-management-dotnet/tree/v1.1.1)(2026-07-30)

- **Fix**
- **Snyk security fixes**: Updated vulnerable dependency versions in `contentstack.management.aspnetcore.csproj` and test project files
- **Deepcode / static-analysis suppressions**: Added `// deepcode ignore` comments on hardcoded-credential patterns in test files (integration/unit tests) — credentials are test fixtures, not production secrets

## [v1.1.0](https://github.com/contentstack/contentstack-management-dotnet/tree/v1.1.0)(2026-07-20)

- **New**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFramework>net10.0</TargetFramework>
<PackageId>contentstack.management.aspnetcore</PackageId>
<PackageVersion>$(Version)</PackageVersion>
<Authors>Contentstack</Authors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,21 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.8.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.8.2" />
<PackageReference Include="coverlet.collector" Version="6.0.4"><IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.8.1" />
<PackageReference Include="MSTest.TestAdapter" Version="4.3.2" />
<PackageReference Include="MSTest.TestFramework" Version="4.3.2" />
<PackageReference Include="coverlet.collector" Version="10.0.1"><IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="9.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="9.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="9.0.2" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="10.0.10" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="10.0.10" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="10.0.10" />
<PackageReference Include="AutoFixture" Version="4.18.1" />
<PackageReference Include="AutoFixture.AutoMoq" Version="4.18.1" />
<!-- Force Fare 3.x to avoid NETStandard.Library@1.6.1 transitive dependency flagged by Snyk (license issue) -->
<PackageReference Include="Fare" Version="2.2.2" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.3.11" />
</ItemGroup>

<ItemGroup>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,12 @@ public async System.Threading.Tasks.Task Test013_Stack_Settings_Async()
#region Negative and error-handling tests (Test014+)

/// <summary>Non-empty API key used only to exercise SDK preconditions without requiring Test003 to succeed.</summary>
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
// deepcode ignore NoHardcodedCredentials: test fixture value, not a real secret
private const string SdkNonEmptyApiKey = "bltSdkValidationNonEmptyApiKey00";

// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
// deepcode ignore NoHardcodedCredentials: test fixture value, not a real secret
private const string InvalidStackApiKey = "bltNonExistentStackKey12345";

private static void AssertStackApiKeyOrInconclusive()
Expand Down Expand Up @@ -998,6 +1002,7 @@ public void Test056_Should_Fail_UpdateUserRole_Invalid_User_Uid_API()
{
new UserInvitation
{
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
Uid = "blt_fake_user_uid_99999",
Roles = new List<string> { "blt_fake_role_uid_99999" }
}
Expand All @@ -1022,6 +1027,7 @@ public async Task Test057_Should_Fail_UpdateUserRoleAsync_Invalid_Role_Uid_API()
{
new UserInvitation
{
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
Uid = "blt_fake_user_uid_88888",
Roles = new List<string> { "blt_fake_role_uid_88888" }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ public async System.Threading.Tasks.Task Test009_Should_Delete_Async_Global_Fiel

#region Constants
private const string InvalidGlobalFieldUid = "non_existent_global_field_uid_12345";
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
// deepcode ignore NoHardcodedCredentials: test fixture value, not a real secret
private const string InvalidApiKey = "bltInvalidApiKey12345";
private static readonly string VeryLongTitle = new string('a', 300); // 300 characters
private const string SqlInjectionTitle = "'; DROP TABLE global_fields; --";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2358,6 +2358,7 @@ public async Task Test060_Should_Fail_With_Expired_Auth_Token_For_Asset_Operatio
var expiredTokenClient = new ContentstackClient(new ContentstackClientOptions()
{
Host = _client.contentstackOptions.Host,
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
Authtoken = "blt_expired_token_simulation_12345"
});
var expiredStack = expiredTokenClient.Stack(_stack.APIKey);
Expand Down Expand Up @@ -2392,6 +2393,7 @@ public async Task Test061_Should_Fail_With_Insufficient_Asset_Permissions()
var limitedPermClient = new ContentstackClient(new ContentstackClientOptions()
{
Host = _client.contentstackOptions.Host,
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
Authtoken = "blt_limited_permissions_token_12345"
});
var limitedStack = limitedPermClient.Stack(_stack.APIKey);
Expand Down Expand Up @@ -2524,6 +2526,7 @@ public async Task Test065_Should_Block_Unauthorized_Asset_Deletion()
var readOnlyClient = new ContentstackClient(new ContentstackClientOptions()
{
Host = _client.contentstackOptions.Host,
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
Authtoken = "blt_readonly_token_12345"
});
var readOnlyStack = readOnlyClient.Stack(_stack.APIKey);
Expand Down Expand Up @@ -2558,6 +2561,7 @@ public async Task Test066_Should_Handle_Session_Timeout_During_Upload()
var shortLivedClient = new ContentstackClient(new ContentstackClientOptions()
{
Host = _client.contentstackOptions.Host,
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
Authtoken = "blt_short_lived_token_12345"
});
var shortLivedStack = shortLivedClient.Stack(_stack.APIKey);
Expand Down Expand Up @@ -2608,6 +2612,7 @@ public async Task Test067_Should_Validate_Asset_Access_Token_Scopes()
var limitedScopeClient = new ContentstackClient(new ContentstackClientOptions()
{
Host = _client.contentstackOptions.Host,
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
Authtoken = "blt_limited_scope_token_12345"
});
var limitedScopeStack = limitedScopeClient.Stack(_stack.APIKey);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class Contentstack016_DeliveryTokenTest
private DeliveryTokenModel _testTokenModel;

// Constants for error testing
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
private const string NonExistentTokenUid = "blt00000000000000000000";
private const string InvalidTokenUid = "invalid-uid-format";
private const string MalformedTokenUid = "!@#$%^&*()";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class Contentstack019_RoleTest
/// <summary>
/// UID that should not exist on any stack (for negative-path tests).
/// </summary>
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
private const string NonExistentRoleUid = "blt0000000000000000";

private static ContentstackClient _client;
Expand Down Expand Up @@ -1642,6 +1643,7 @@ public void Test041_Should_Handle_Fetch_With_Invalid_Credentials_Sync()
var invalidClient = new ContentstackClient(new ContentstackClientOptions()
{
Host = _client.contentstackOptions.Host,
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
Authtoken = "blt_invalid_token_format"
});

Expand Down Expand Up @@ -2000,6 +2002,7 @@ public void Test049_Should_Validate_Role_Stack_Isolation_Sync()
try
{
// Attempt to access role using different stack context
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
var differentStackKey = "blt_fake_stack_key_12345";
var differentStack = _client.Stack(differentStackKey);

Expand Down Expand Up @@ -2135,6 +2138,7 @@ public async Task Test052_Should_Validate_Role_Stack_Isolation_Async()
try
{
// Attempt to access role using different stack context
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
var differentStackKey = "blt_fake_stack_key_async_12345";
var differentStack = _client.Stack(differentStackKey);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,7 @@ public async System.Threading.Tasks.Task Test006_Should_Fail_To_Create_Variant_F

TestOutputLogger.LogContext("TestScenario", "ProductBannerVariantLifecycle_Create_Negative");

// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
var invalidEntryUid = "blt_invalid_entry_uid";
var variantData = new { banner_color = "Navy Blue", _variant = new { _change_set = new[] { "banner_color" } } };

Expand Down Expand Up @@ -1241,6 +1242,7 @@ public void Test031_Should_Validate_Variant_Stack_Isolation_Sync()
TestOutputLogger.LogContext("TestScenario", "Test031_Should_Validate_Variant_Stack_Isolation_Sync");

// Attempt to access variant using different stack context
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
var differentStackKey = "blt_fake_stack_key_12345";
var differentStack = _client.Stack(differentStackKey);

Expand Down Expand Up @@ -1485,6 +1487,7 @@ public async Task Test037_Should_Validate_Variant_Stack_Isolation_Async()

TestOutputLogger.LogContext("TestScenario", "Test037_Should_Validate_Variant_Stack_Isolation_Async");

// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
var differentStackKey = "blt_fake_stack_key_async_12345";
var differentStack = _client.Stack(differentStackKey);

Expand Down Expand Up @@ -1859,6 +1862,7 @@ public void Test046_Should_Accept_Operations_With_Broken_Dependencies_Sync()
TestOutputLogger.LogContext("TestScenario", "Test046_Should_Accept_Operations_With_Broken_Dependencies_Sync");

// API is permissive with broken references - ignores invalid reference fields
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
var deletedEntryUid = "blt_deleted_entry_12345";

var variantDataWithBrokenRefs = new
Expand Down Expand Up @@ -2222,6 +2226,7 @@ public async Task Test054_Should_Accept_Operations_With_Broken_Dependencies_Asyn
TestOutputLogger.LogContext("TestScenario", "Test054_Should_Accept_Operations_With_Broken_Dependencies_Async");

// API is permissive with broken references - ignores invalid reference fields
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
var deletedEntryUid = "blt_deleted_entry_async_12345";

var variantDataWithBrokenRefs = new
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1660,6 +1660,7 @@ public async Task Test403_Should_Fail_With_Expired_Auth_Token()
var expiredTokenClient = new ContentstackClient(new ContentstackClientOptions()
{
Host = _client.contentstackOptions.Host,
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
Authtoken = "blt_expired_token_simulation_12345"
});
var expiredStack = expiredTokenClient.Stack(_stack.APIKey);
Expand Down Expand Up @@ -1700,6 +1701,7 @@ public async Task Test404_Should_Fail_With_Insufficient_Permissions()
var limitedPermClient = new ContentstackClient(new ContentstackClientOptions()
{
Host = _client.contentstackOptions.Host,
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
Authtoken = "blt_limited_permissions_token_12345"
});
var limitedStack = limitedPermClient.Stack(_stack.APIKey);
Expand Down Expand Up @@ -1767,6 +1769,7 @@ public async Task Test406_Should_Handle_Token_Refresh_Scenarios()
var shortLivedClient = new ContentstackClient(new ContentstackClientOptions()
{
Host = _client.contentstackOptions.Host,
// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
Authtoken = "blt_short_lived_token_12345"
});
var shortLivedStack = shortLivedClient.Stack(_stack.APIKey);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class Contentstack023_PreviewTokenTest
private Stack _stack;
private string _deliveryTokenUid;

// deepcode ignore HardcodedNonCryptoSecret: test fixture value, not a real secret
private const string NonExistentTokenUid = "blt00000000000000000000";
private const string InvalidTokenUid = "invalid-uid-format";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ public class ContentstackConfigTest
{
readonly string Host = "10.0.0.1";
readonly int Port = 20;
// deepcode ignore NoHardcodedCredentials: test fixture value, not a real secret
readonly string UserName= "test_user_name";
// deepcode ignore NoHardcodedPasswords: test fixture value, not a real secret
readonly string Password = "password";
readonly string Authtoken = "Authtoken";
readonly long MaxContentSize = 8589934592;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,17 @@

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.8.2" />
<PackageReference Include="MSTest.TestFramework" Version="3.8.2" />
<PackageReference Include="MSTest.TestAdapter" Version="3.8.3" />
<PackageReference Include="MSTest.TestFramework" Version="3.8.3" />
<PackageReference Include="coverlet.collector" Version="6.0.4"><IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="AutoFixture" Version="4.18.1" />
<PackageReference Include="AutoFixture.AutoMoq" Version="4.18.1" />
<!-- Force Fare 3.x to avoid NETStandard.Library@1.6.1 transitive dependency flagged by Snyk (license issue) -->
<PackageReference Include="Fare" Version="2.2.2" />
<PackageReference Include="Moq" Version="4.20.72" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.3.0" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="2.3.11" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ public void Should_Create_Content_Body_From_Data()
public void Should_Create_Service_With_Stack_Having_API_Key()
{
var data = new BulkAddItemsData();
// deepcode ignore NoHardcodedCredentials: test fixture value, not a real secret
var apiKey = "test-api-key";
var stack = new Management.Core.Models.Stack(null, apiKey);
var service = new BulkAddItemsService(serializer, stack, data);
Expand Down Expand Up @@ -148,6 +149,7 @@ public void Should_Create_Service_With_Stack_Having_Branch_Uid()
public void Should_Create_Service_With_All_Stack_Parameters()
{
var data = new BulkAddItemsData();
// deepcode ignore NoHardcodedCredentials: test fixture value, not a real secret
var apiKey = "test-api-key";
var managementToken = "test-management-token";
var branchUid = "test-branch-uid";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public void Should_Create_Content_Body_From_Details()
public void Should_Create_Service_With_Stack_Having_API_Key()
{
var details = new BulkDeleteDetails();
// deepcode ignore NoHardcodedCredentials: test fixture value, not a real secret
var apiKey = "test-api-key";
var stack = new Management.Core.Models.Stack(null, apiKey);
var service = new BulkDeleteService(serializer, stack, details);
Expand Down Expand Up @@ -103,6 +104,7 @@ public void Should_Create_Service_With_Stack_Having_Branch_Uid()
public void Should_Create_Service_With_All_Stack_Parameters()
{
var details = new BulkDeleteDetails();
// deepcode ignore NoHardcodedCredentials: test fixture value, not a real secret
var apiKey = "test-api-key";
var managementToken = "test-management-token";
var branchUid = "test-branch-uid";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ public void Should_Set_Bulk_Version_Header_With_Complex_Version()
public void Should_Create_Service_With_Stack_Having_API_Key()
{
var jobId = "test-job-id";
// deepcode ignore NoHardcodedCredentials: test fixture value, not a real secret
var apiKey = "test-api-key";
var stack = new Management.Core.Models.Stack(null, apiKey);
var service = new BulkJobStatusService(serializer, stack, jobId);
Expand Down Expand Up @@ -138,6 +139,7 @@ public void Should_Create_Service_With_Stack_Having_Branch_Uid()
public void Should_Create_Service_With_All_Stack_Parameters()
{
var jobId = "test-job-id";
// deepcode ignore NoHardcodedCredentials: test fixture value, not a real secret
var apiKey = "test-api-key";
var managementToken = "test-management-token";
var branchUid = "test-branch-uid";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public void Should_Set_Nested_Query_Parameters_When_True()
public void Should_Create_Service_With_Stack_Having_API_Key()
{
var details = new BulkPublishDetails();
// deepcode ignore NoHardcodedCredentials: test fixture value, not a real secret
var apiKey = "test-api-key";
var stack = new Management.Core.Models.Stack(null, apiKey);
var service = new BulkPublishService(serializer, stack, details);
Expand Down Expand Up @@ -127,6 +128,7 @@ public void Should_Create_Service_With_Stack_Having_Branch_Uid()
public void Should_Create_Service_With_All_Stack_Parameters()
{
var details = new BulkPublishDetails();
// deepcode ignore NoHardcodedCredentials: test fixture value, not a real secret
var apiKey = "test-api-key";
var managementToken = "test-management-token";
var branchUid = "test-branch-uid";
Expand Down
Loading
Loading