Skip to content

Commit 39546fb

Browse files
authored
Evil allow_list pointer (#256)
1 parent d8df3d8 commit 39546fb

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

mongo.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ type MongoCreateOptions struct {
9292
// MongoUpdateOptions fields are used when altering the existing Mongo Database
9393
type MongoUpdateOptions struct {
9494
Label string `json:"label,omitempty"`
95-
AllowList []string `json:"allow_list,omitempty"`
95+
AllowList *[]string `json:"allow_list,omitempty"`
9696
Updates *DatabaseMaintenanceWindow `json:"updates,omitempty"`
9797
}
9898

mysql.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ type MySQLCreateOptions struct {
7575
// MySQLUpdateOptions fields are used when altering the existing MySQL Database
7676
type MySQLUpdateOptions struct {
7777
Label string `json:"label,omitempty"`
78-
AllowList []string `json:"allow_list,omitempty"`
78+
AllowList *[]string `json:"allow_list,omitempty"`
7979
Updates *DatabaseMaintenanceWindow `json:"updates,omitempty"`
8080
}
8181

test/integration/mongo_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,10 @@ func TestDatabase_Mongo_Suite(t *testing.T) {
7070
WeekOfMonth: &week,
7171
}
7272

73+
allowList := []string{"128.173.205.21", "123.177.200.20"}
74+
7375
opts := linodego.MongoUpdateOptions{
74-
AllowList: []string{"128.173.205.21", "123.177.200.20"},
76+
AllowList: &allowList,
7577
Label: fmt.Sprintf("%s-updated", database.Label),
7678
Updates: &updatedWindow,
7779
}

test/integration/mysql_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,10 @@ func TestDatabase_MySQL_Suite(t *testing.T) {
7171
WeekOfMonth: &week,
7272
}
7373

74+
allowList := []string{"128.173.205.21", "123.177.200.20"}
75+
7476
opts := linodego.MySQLUpdateOptions{
75-
AllowList: []string{"128.173.205.21", "123.177.200.20"},
77+
AllowList: &allowList,
7678
Label: fmt.Sprintf("%s-updated", database.Label),
7779
Updates: &updatedWindow,
7880
}

0 commit comments

Comments
 (0)