Skip to content

starknet_transaction_prover: add CORS validation unit tests - #14048

Open
avi-starkware wants to merge 1 commit into
main-v0.14.4from
avi/privacy/cors-tests-v2
Open

starknet_transaction_prover: add CORS validation unit tests#14048
avi-starkware wants to merge 1 commit into
main-v0.14.4from
avi/privacy/cors-tests-v2

Conversation

@avi-starkware

@avi-starkware avi-starkware commented May 17, 2026

Copy link
Copy Markdown
Collaborator

Covers build_cors_layer (empty/wildcard/allowlist branches), cors_mode
labelling, and normalize_cors_allow_origins (scheme/host/userinfo/path/query
rejection, default-port handling, deduplication of equivalent origins, and
wildcard collapsing the rest of the list).

Includes a port_80_retained_on_https case: url normalizes away a
scheme-default port at parse time, so https://host:80 is the input that tells a
correctly-scoped default-port rule apart from one that strips any :80. Nothing
covered that before.

@reviewable-StarkWare

Copy link
Copy Markdown

This change is Reviewable

@cursor

cursor Bot commented May 17, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Test-only change with no runtime or configuration behavior modifications.

Overview
Adds cors_test and registers it from server.rs under #[cfg(test)]. No production CORS behavior changes.

The new suite exercises build_cors_layer (disabled when the origin list is empty, allowlist echo vs omit, wildcard *, OPTIONS preflight allowing POST), cors_mode labels (disabled / wildcard / allowlist), and normalize_cors_allow_origins (rejecting bad schemes, missing host, userinfo, path/query/fragment, and unparseable strings; canonicalizing default ports on http/https; keeping non-default ports; deduping equivalent origins; wildcard collapsing or ignoring invalid siblings while preserving order for distinct origins). Includes port_80_retained_on_https so default-port stripping is not over-applied to https://…:80.

Reviewed by Cursor Bugbot for commit c9610b9. Bugbot is set up for automated code reviews on this repo. Configure here.

@avi-starkware
avi-starkware force-pushed the avi/privacy/prover-input-validation-tests-v2 branch from 62bd425 to e7ccb94 Compare May 17, 2026 17:39
@avi-starkware
avi-starkware force-pushed the avi/privacy/cors-tests-v2 branch 2 times, most recently from b5dba94 to 9636c86 Compare May 17, 2026 19:07
@avi-starkware
avi-starkware force-pushed the avi/privacy/prover-input-validation-tests-v2 branch from e7ccb94 to 0523284 Compare May 17, 2026 19:07
@avi-starkware
avi-starkware force-pushed the avi/privacy/cors-tests-v2 branch from 9636c86 to 20c98e9 Compare May 20, 2026 08:33
@avi-starkware
avi-starkware force-pushed the avi/privacy/prover-input-validation-tests-v2 branch from 0523284 to 3275e20 Compare May 20, 2026 08:33
@avi-starkware
avi-starkware force-pushed the avi/privacy/prover-input-validation-tests-v2 branch from 3275e20 to 63d5c0b Compare May 31, 2026 10:39
@avi-starkware
avi-starkware force-pushed the avi/privacy/cors-tests-v2 branch from 20c98e9 to d437078 Compare May 31, 2026 10:39
@avi-starkware
avi-starkware force-pushed the avi/privacy/cors-tests-v2 branch from d437078 to 8342ce5 Compare June 7, 2026 11:46
@avi-starkware
avi-starkware force-pushed the avi/privacy/prover-input-validation-tests-v2 branch from 63d5c0b to 6141678 Compare June 7, 2026 11:46
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

There hasn't been any activity on this pull request recently, and in order to prioritize active work, it has been marked as stale.
This PR will be closed and locked in 7 days if no further activity occurs.
Thank you for your contributions!

@avi-starkware
avi-starkware force-pushed the avi/privacy/cors-tests-v2 branch from 44f2584 to f05b07f Compare July 9, 2026 13:03
@avi-starkware
avi-starkware force-pushed the avi/privacy/prover-input-validation-tests-v2 branch from 266b559 to c572793 Compare July 9, 2026 13:03
@avi-starkware
avi-starkware force-pushed the avi/privacy/cors-tests-v2 branch from f05b07f to 44eccac Compare July 9, 2026 13:57
@avi-starkware
avi-starkware force-pushed the avi/privacy/prover-input-validation-tests-v2 branch from c572793 to 1709b33 Compare July 9, 2026 13:57
@github-actions github-actions Bot removed the stale label Jul 10, 2026
@avi-starkware
avi-starkware changed the base branch from avi/privacy/prover-input-validation-tests-v2 to graphite-base/14048 July 12, 2026 10:09
@avi-starkware
avi-starkware force-pushed the avi/privacy/cors-tests-v2 branch from 44eccac to 31f18eb Compare July 12, 2026 10:09
@avi-starkware
avi-starkware changed the base branch from graphite-base/14048 to main-v0.14.3 July 12, 2026 10:09
@avi-starkware
avi-starkware force-pushed the avi/privacy/cors-tests-v2 branch from 31f18eb to bef2115 Compare July 12, 2026 12:39
@avi-starkware
avi-starkware force-pushed the avi/privacy/cors-tests-v2 branch from bef2115 to b5aa7f0 Compare July 19, 2026 13:25
@avi-starkware
avi-starkware changed the base branch from main-v0.14.3 to graphite-base/14048 August 25, 2026 19:33
@avi-starkware
avi-starkware force-pushed the avi/privacy/cors-tests-v2 branch from b5aa7f0 to c86b17e Compare August 25, 2026 19:33
@avi-starkware
avi-starkware changed the base branch from graphite-base/14048 to main-v0.14.4 August 25, 2026 19:34
Covers build_cors_layer (empty/wildcard/allowlist branches), cors_mode
labelling, and normalize_cors_allow_origins (scheme/host/userinfo/path/
query rejection, default-port stripping, deduplication of equivalent
origins, and wildcard collapsing the rest of the list).
@avi-starkware
avi-starkware force-pushed the avi/privacy/cors-tests-v2 branch from c86b17e to c9610b9 Compare August 25, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants