Skip to content

Commit

Permalink
Address PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyb3r-Jak3 committed Apr 17, 2023
1 parent cf6ed3d commit 83bd66f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
6 changes: 3 additions & 3 deletions turnstile.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type TurnstileWidget struct {
Mode string `json:"mode,omitempty"`
BotFightMode bool `json:"bot_fight_mode,omitempty"`
Region string `json:"region,omitempty"`
OffLabel bool `json:"off_label,omitempty"`
OffLabel bool `json:"offlabel,omitempty"`
}

type CreateTurnstileWidgetRequest struct {
Expand All @@ -30,7 +30,7 @@ type CreateTurnstileWidgetRequest struct {
Mode string `json:"mode,omitempty"`
BotFightMode bool `json:"bot_fight_mode,omitempty"`
Region string `json:"region,omitempty"`
OffLabel bool `json:"off_label,omitempty"`
OffLabel bool `json:"offlabel,omitempty"`
}

type TurnstileWidgetResponse struct {
Expand Down Expand Up @@ -88,7 +88,7 @@ func (api *API) ListTurnstileWidgets(ctx context.Context, rc *ResourceContainer,
}

if params.PerPage < 1 {
params.PerPage = 50
params.PerPage = 25
}

if params.Page < 1 {
Expand Down
22 changes: 15 additions & 7 deletions turnstile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ var (
Mode: "invisible",
BotFightMode: true,
Region: "world",
OffLabel: false,
}
)

Expand Down Expand Up @@ -57,7 +58,8 @@ func TestTurnstileWidget_Create(t *testing.T) {
],
"mode": "invisible",
"bot_fight_mode": true,
"region": "world"
"region": "world",
"offlabel": false
}
}`)
})
Expand All @@ -77,7 +79,8 @@ func TestTurnstileWidget_Create(t *testing.T) {
"cloudflare.com",
"blog.example.com",
},
Region: "world",
Region: "world",
OffLabel: false,
})
if assert.NoError(t, err) {
assert.Equal(t, expectedTurnstileWidget, out, "create challenge_widgets structs not equal")
Expand Down Expand Up @@ -111,7 +114,8 @@ func TestTurnstileWidget_List(t *testing.T) {
],
"mode": "invisible",
"bot_fight_mode": true,
"region": "world"
"region": "world",
"offlabel": false
}
],
"result_info": {
Expand Down Expand Up @@ -163,7 +167,8 @@ func TestTurnstileWidget_Get(t *testing.T) {
],
"mode": "invisible",
"bot_fight_mode": true,
"region": "world"
"region": "world",
"offlabel": false
}
}`)
})
Expand Down Expand Up @@ -210,7 +215,8 @@ func TestTurnstileWidgets_Update(t *testing.T) {
],
"mode": "invisible",
"bot_fight_mode": true,
"region": "world"
"region": "world",
"offlabel": false
}
}`)
})
Expand Down Expand Up @@ -258,7 +264,8 @@ func TestTurnstileWidgets_RotateSecret(t *testing.T) {
],
"mode": "invisible",
"bot_fight_mode": true,
"region": "world"
"region": "world",
"offlabel": false
}
}`)
})
Expand Down Expand Up @@ -305,7 +312,8 @@ func TestTurnstileWidgets_Delete(t *testing.T) {
],
"mode": "invisible",
"bot_fight_mode": true,
"region": "world"
"region": "world",
"offlabel": false
}
}`)
})
Expand Down

0 comments on commit 83bd66f

Please sign in to comment.