From cd2b91d6c99fdfdb77cedc0b09ebd5eaedd19590 Mon Sep 17 00:00:00 2001 From: Piper McCorkle Date: Fri, 27 Dec 2024 12:50:23 -0600 Subject: [PATCH] feat: add waiting room turnstile integration fields WR-1796 --- .changelog/3764.txt | 3 +++ waiting_room.go | 4 ++++ waiting_room_test.go | 12 ++++++++++-- 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 .changelog/3764.txt diff --git a/.changelog/3764.txt b/.changelog/3764.txt new file mode 100644 index 00000000000..a61bbf8bc92 --- /dev/null +++ b/.changelog/3764.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +waiting_room: add waiting room turnstile integration fields +``` \ No newline at end of file diff --git a/waiting_room.go b/waiting_room.go index c765bd057e7..48e8338fd41 100644 --- a/waiting_room.go +++ b/waiting_room.go @@ -41,6 +41,8 @@ type WaitingRoom struct { QueueingStatusCode int `json:"queueing_status_code"` EnabledOriginCommands []string `json:"enabled_origin_commands,omitempty"` CookieAttributes *WaitingRoomCookieAttributes `json:"cookie_attributes,omitempty"` + TurnstileMode string `json:"turnstile_mode,omitempty"` + TurnstileAction string `json:"turnstile_action,omitempty"` } // WaitingRoomStatus describes the status of a waiting room. @@ -70,6 +72,8 @@ type WaitingRoomEvent struct { DisableSessionRenewal *bool `json:"disable_session_renewal,omitempty"` Suspended bool `json:"suspended"` ShuffleAtEventStart bool `json:"shuffle_at_event_start"` + TurnstileMode string `json:"turnstile_mode,omitempty"` + TurnstileAction string `json:"turnstile_action,omitempty"` } type WaitingRoomRule struct { diff --git a/waiting_room_test.go b/waiting_room_test.go index 26f729af70b..3e3717d474a 100644 --- a/waiting_room_test.go +++ b/waiting_room_test.go @@ -43,7 +43,9 @@ var waitingRoomJSON = fmt.Sprintf(` "cookie_suffix": "example_shop", "additional_routes": [{"host": "shop2.example.com", "path": "/shop/checkout"}], "queueing_status_code": 200, - "enabled_origin_commands": ["revoke"] + "enabled_origin_commands": ["revoke"], + "turnstile_mode": "invisible", + "turnstile_action": "log" } `, waitingRoomID, testTimestampWaitingRoom.Format(time.RFC3339Nano), testTimestampWaitingRoom.Format(time.RFC3339Nano), testTimestampWaitingRoomEventStart.Format(time.RFC3339Nano)) @@ -65,7 +67,9 @@ var waitingRoomEventJSON = fmt.Sprintf(` "session_duration": null, "disable_session_renewal": null, "queueing_method": "random", - "custom_page_html": "{{#waitTimeKnown}} {{waitTime}} mins {{/waitTimeKnown}} {{^waitTimeKnown}} Event is prequeueing / Queue all enabled {{/waitTimeKnown}}" + "custom_page_html": "{{#waitTimeKnown}} {{waitTime}} mins {{/waitTimeKnown}} {{^waitTimeKnown}} Event is prequeueing / Queue all enabled {{/waitTimeKnown}}", + "turnstile_mode": "invisible", + "turnstile_action": "log" } `, waitingRoomEventID, testTimestampWaitingRoomEvent.Format(time.RFC3339Nano), testTimestampWaitingRoomEvent.Format(time.RFC3339Nano), @@ -131,6 +135,8 @@ var waitingRoom = WaitingRoom{ AdditionalRoutes: []*WaitingRoomRoute{{Host: "shop2.example.com", Path: "/shop/checkout"}}, QueueingStatusCode: 200, EnabledOriginCommands: []string{"revoke"}, + TurnstileMode: "invisible", + TurnstileAction: "log", } var waitingRoomEvent = WaitingRoomEvent{ @@ -150,6 +156,8 @@ var waitingRoomEvent = WaitingRoomEvent{ DisableSessionRenewal: nil, QueueingMethod: "random", CustomPageHTML: "{{#waitTimeKnown}} {{waitTime}} mins {{/waitTimeKnown}} {{^waitTimeKnown}} Event is prequeueing / Queue all enabled {{/waitTimeKnown}}", + TurnstileMode: "invisible", + TurnstileAction: "log", } var waitingRoomStatus = WaitingRoomStatus{