From 522761e6dcb147d266cf0f42fb72b3111da56f3d Mon Sep 17 00:00:00 2001 From: Matthew Long Date: Mon, 10 Nov 2025 16:11:36 +0000 Subject: [PATCH 1/3] feat: support for GET deletionGracePeriod and persistentStorageEncryptionType for CMK --- service/subscriptions/model.go | 2 ++ subscription_test.go | 26 ++++++++++++++++---------- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/service/subscriptions/model.go b/service/subscriptions/model.go index f5e172e..cf5878a 100644 --- a/service/subscriptions/model.go +++ b/service/subscriptions/model.go @@ -136,6 +136,8 @@ type Subscription struct { StorageEncryption *bool `json:"storageEncryption,omitempty"` NumberOfDatabases *int `json:"numberOfDatabases,omitempty"` CloudDetails []*CloudDetail `json:"cloudDetails,omitempty"` + PersistentStorageEncryptionType *string `json:"persistentStorageEncryptionType,omitempty"` + DeletionGracePeriod *string `json:"deletionGracePeriod,omitempty"` CustomerManagedKeyAccessDetails *CustomerManagedKeyAccessDetails `json:"customerManagedKeyAccessDetails,omitempty"` PublicEndpointAccess *bool `json:"publicEndpointAccess,omitempty"` } diff --git a/subscription_test.go b/subscription_test.go index e1c6697..e12bc35 100644 --- a/subscription_test.go +++ b/subscription_test.go @@ -647,7 +647,9 @@ func TestSubscription_Get(t *testing.T) { }, actual) } -func TestSubscription_Get_PublicEndpointAccess(t *testing.T) { +// TestSubscription_Get_OptionalFields tests that optional fields like publicEndpointAccess, +// persistentStorageEncryptionType, and deletionGracePeriod are properly unmarshaled from the API response +func TestSubscription_Get_OptionalFields(t *testing.T) { s := httptest.NewServer(testServer("apiKey", "secret", getRequest(t, "/subscriptions/98766", `{ "id": 2, "name": "Get-test-public-endpoint", @@ -657,6 +659,8 @@ func TestSubscription_Get_PublicEndpointAccess(t *testing.T) { "memoryStorage": "ram", "storageEncryption": false, "publicEndpointAccess": false, + "persistentStorageEncryptionType": "customer-managed-key", + "deletionGracePeriod": "15-minutes", "numberOfDatabases": 1, "cloudDetails": [ { @@ -696,15 +700,17 @@ func TestSubscription_Get_PublicEndpointAccess(t *testing.T) { require.NoError(t, err) assert.Equal(t, &subscriptions.Subscription{ - ID: redis.Int(2), - Name: redis.String("Get-test-public-endpoint"), - Status: redis.String("active"), - PaymentMethod: redis.String("credit-card"), - PaymentMethodID: redis.Int(2), - MemoryStorage: redis.String("ram"), - StorageEncryption: redis.Bool(false), - PublicEndpointAccess: redis.Bool(false), - NumberOfDatabases: redis.Int(1), + ID: redis.Int(2), + Name: redis.String("Get-test-public-endpoint"), + Status: redis.String("active"), + PaymentMethod: redis.String("credit-card"), + PaymentMethodID: redis.Int(2), + MemoryStorage: redis.String("ram"), + StorageEncryption: redis.Bool(false), + PublicEndpointAccess: redis.Bool(false), + PersistentStorageEncryptionType: redis.String("customer-managed-key"), + DeletionGracePeriod: redis.String("15-minutes"), + NumberOfDatabases: redis.Int(1), CloudDetails: []*subscriptions.CloudDetail{ { Provider: redis.String("AWS"), From 4cd64706b8993ff846e3bdf5f81b624f59bd4f86 Mon Sep 17 00:00:00 2001 From: Matthew Long Date: Mon, 10 Nov 2025 16:12:20 +0000 Subject: [PATCH 2/3] docs: changelog --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3955f53..7ce3f65 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. See updating [Changelog example here](https://keepachangelog.com/en/1.0.0/). +## Unreleased + +### Added: +* Added `PersistentStorageEncryptionType` and `DeletionGracePeriod` fields to `Subscription` model for customer-managed key support + ## 0.42.0 (10th November 2025) ### Added: From d6ee5a340553b56677cd958d373a9c9f93804d58 Mon Sep 17 00:00:00 2001 From: Matthew Long Date: Tue, 11 Nov 2025 13:25:02 +0000 Subject: [PATCH 3/3] docs: changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ce3f65..c7c26f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file. See updating [Changelog example here](https://keepachangelog.com/en/1.0.0/). -## Unreleased +## 0.43.0 (11th November 2025) ### Added: * Added `PersistentStorageEncryptionType` and `DeletionGracePeriod` fields to `Subscription` model for customer-managed key support