Skip to content

Commit

Permalink
fix(dbaas): redis access control properties to pointers
Browse files Browse the repository at this point in the history
  • Loading branch information
villevsv-upcloud committed Jan 25, 2024
1 parent 59b0f32 commit 94c7b0a
Show file tree
Hide file tree
Showing 10 changed files with 421 additions and 235 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ See updating [Changelog example here](https://keepachangelog.com/en/1.0.0/)

## [Unreleased]

### Changed
- **Breaking**, Managed Database: `ManagedDatabaseUserRedisAccessControl` `[]string` properties changed to `*[]string`

### Removed
- **Breaking**, Managed Database: connection related methods in favor of session

Expand Down
8 changes: 4 additions & 4 deletions upcloud/managed_database.go
Original file line number Diff line number Diff line change
Expand Up @@ -622,10 +622,10 @@ type ManagedDatabaseUserPGAccessControl struct {
}

type ManagedDatabaseUserRedisAccessControl struct {
Categories []string `json:"categories,omitempty"`
Channels []string `json:"channels,omitempty"`
Commands []string `json:"commands,omitempty"`
Keys []string `json:"keys,omitempty"`
Categories *[]string `json:"categories,omitempty"`
Channels *[]string `json:"channels,omitempty"`
Commands *[]string `json:"commands,omitempty"`
Keys *[]string `json:"keys,omitempty"`
}

type ManagedDatabaseUserOpenSearchAccessControl struct {
Expand Down
8 changes: 4 additions & 4 deletions upcloud/managed_database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -779,10 +779,10 @@ func TestManagedDatabaseUser(t *testing.T) {
AllowReplication: false,
},
RedisAccessControl: &ManagedDatabaseUserRedisAccessControl{
Categories: []string{"+@set"},
Channels: []string{"*"},
Commands: []string{"+set"},
Keys: []string{"key_*"},
Categories: &[]string{"+@set"},
Channels: &[]string{"*"},
Commands: &[]string{"+set"},
Keys: &[]string{"key_*"},
},
}
assert.Equal(t, want, got)
Expand Down
16 changes: 8 additions & 8 deletions upcloud/request/managed_database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,10 +432,10 @@ func TestCreateManagedDatabaseUserRequest(t *testing.T) {
AllowReplication: true,
},
RedisAccessControl: &upcloud.ManagedDatabaseUserRedisAccessControl{
Categories: []string{"+@set"},
Channels: []string{"*"},
Commands: []string{"+set"},
Keys: []string{"key_*"},
Categories: &[]string{"+@set"},
Channels: &[]string{"*"},
Commands: &[]string{"+set"},
Keys: &[]string{"key_*"},
},
}
got, err := json.Marshal(&r)
Expand Down Expand Up @@ -478,10 +478,10 @@ func TestModifyManagedDatabaseUserAccessControlRequest(t *testing.T) {
AllowReplication: true,
},
RedisAccessControl: &upcloud.ManagedDatabaseUserRedisAccessControl{
Categories: []string{"+@set"},
Channels: []string{"*"},
Commands: []string{"+set"},
Keys: []string{"key_*"},
Categories: &[]string{"+@set"},
Channels: &[]string{"*"},
Commands: &[]string{"+set"},
Keys: &[]string{"key_*"},
},
}
got, err := json.Marshal(&r)
Expand Down
107 changes: 0 additions & 107 deletions upcloud/service/fixtures/modifymanageddatabaseuseraccesscontrol.yaml

This file was deleted.

109 changes: 0 additions & 109 deletions upcloud/service/fixtures/modifymanageddatabaseuseraccesscontrolos.yaml

This file was deleted.

Loading

0 comments on commit 94c7b0a

Please sign in to comment.