Skip to content

Commit

Permalink
fix(api)!: function is not mandatory for all challenges, only dynamic…
Browse files Browse the repository at this point in the history
… ones
  • Loading branch information
pandatix committed Dec 12, 2024
1 parent 30badf7 commit 7a93844
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions api/challenges.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type PostChallengesParams struct {
Category string `json:"category"`
Description string `json:"description"`
Attribution *string `json:"attribution,omitempty"`
Function string `json:"function"`
Function *string `json:"function,omitempty"`
ConnectionInfo *string `json:"connection_info,omitempty"`
Value int `json:"value"`
Initial *int `json:"initial,omitempty"`
Expand Down Expand Up @@ -83,7 +83,7 @@ type PatchChallengeParams struct {
Category string `json:"category"`
Description string `json:"description"`
Attribution *string `json:"attribution,omitempty"`
Function string `json:"function"`
Function *string `json:"function,omitempty"`
ConnectionInfo *string `json:"connection_info,omitempty"`
Value *int `json:"value,omitempty"`
Initial *int `json:"initial,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion api/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type (
Attribution *string `json:"attribution"`
ConnectionInfo *string `json:"connection_info,omitempty"`
MaxAttempts *int `json:"max_attempts,omitempty"`
Function string `json:"function"`
Function *string `json:"function,omitempty"`
Value int `json:"value"`
Initial *int `json:"initial,omitempty"`
Decay *int `json:"decay,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion api/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func Test_F_CTF(t *testing.T) {
Name: "Stealing data",
Category: "network",
Description: "The network administrator just sent you the info that some strange packets where going out of a server.\nAt first glance, it is an internal one.\nCan you tell us what it is ?",
Function: "logarithmic",
Function: ptr("logarithmic"),
ConnectionInfo: ptr("ssh -l [email protected]"),
MaxAttempts: ptr(3),
Initial: ptr(500),
Expand Down
2 changes: 1 addition & 1 deletion api/setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ func Test_F_Setup(t *testing.T) {
Name: "Stealing data",
Category: "network",
Description: "The network administrator just sent you the info that some strange packets where going out of a server.\nAt first glance, it is an internal one.\nCan you tell us what it is ?",
Function: "logarithmic",
Function: ptr("logarithmic"),
ConnectionInfo: ptr("ssh -l [email protected]"),
MaxAttempts: ptr(3),
Initial: ptr(500),
Expand Down
2 changes: 1 addition & 1 deletion examples/setup/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func main() {
Category: "crypto",
Description: "...",
Attribution: ptr("pandatix"),
Function: "logarithmic",
Function: ptr("logarithmic"),
ConnectionInfo: ptr("ssh -l [email protected]"),
MaxAttempts: ptr(3),
Initial: ptr(500),
Expand Down

0 comments on commit 7a93844

Please sign in to comment.