Skip to content

Commit 40cc92b

Browse files
committed
Add N64 runtime projection and DKR cheat support
1 parent 7534826 commit 40cc92b

20 files changed

Lines changed: 3488 additions & 297 deletions

backend/cmd/server/app_password_policy_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ func TestHelperPolicyEnforcedForUploadLatestAndDownload(t *testing.T) {
176176
"system": "n64",
177177
"device_type": "linux-x86",
178178
"fingerprint": "deck-policy",
179+
"n64Profile": n64ProfileMister,
179180
}, "policy-n64.eep", buildTestN64Payload("eep", "n64-before-policy"))
180181
blockedBeforePolicyID := mustString(t, mustObject(t, blockedBeforePolicy["save"], "save")["id"], "save.id")
181182

@@ -191,6 +192,7 @@ func TestHelperPolicyEnforcedForUploadLatestAndDownload(t *testing.T) {
191192
"system": "n64",
192193
"device_type": "linux-x86",
193194
"fingerprint": "deck-policy",
195+
"n64Profile": n64ProfileMister,
194196
}, "file", "policy-n64-2.eep", buildTestN64Payload("eep", "n64-after-policy"))
195197
assertStatus(t, blockedUpload, http.StatusForbidden)
196198

@@ -204,7 +206,7 @@ func TestHelperPolicyEnforcedForUploadLatestAndDownload(t *testing.T) {
204206
}, "policy-snes.srm", []byte("snes-after-policy"))
205207
allowedID := mustString(t, mustObject(t, allowedUpload["save"], "save")["id"], "save.id")
206208

207-
latestBlocked := helperGET(t, h, "/save/latest?romSha1=policy-n64-rom&slotName=default&device_type=linux-x86&fingerprint=deck-policy", helperKey)
209+
latestBlocked := helperGET(t, h, "/save/latest?romSha1=policy-n64-rom&slotName=default&device_type=linux-x86&fingerprint=deck-policy&n64Profile="+n64ProfileMister, helperKey)
208210
assertStatus(t, latestBlocked, http.StatusOK)
209211
latestBlockedBody := decodeJSONMap(t, latestBlocked.Body)
210212
if mustBool(t, latestBlockedBody["exists"], "exists") {
@@ -218,7 +220,7 @@ func TestHelperPolicyEnforcedForUploadLatestAndDownload(t *testing.T) {
218220
t.Fatalf("expected allowed latest lookup to succeed: %s", prettyJSON(latestAllowedBody))
219221
}
220222

221-
blockedDownload := helperGET(t, h, "/saves/download?id="+blockedBeforePolicyID+"&device_type=linux-x86&fingerprint=deck-policy", helperKey)
223+
blockedDownload := helperGET(t, h, "/saves/download?id="+blockedBeforePolicyID+"&device_type=linux-x86&fingerprint=deck-policy&n64Profile="+n64ProfileMister, helperKey)
222224
assertStatus(t, blockedDownload, http.StatusForbidden)
223225

224226
allowedDownload := helperGET(t, h, "/saves/download?id="+allowedID+"&device_type=linux-x86&fingerprint=deck-policy", helperKey)

0 commit comments

Comments
 (0)