Skip to content

starknet_transaction_prover: add CORS and config validation tests#13136

Closed
avi-starkware wants to merge 1 commit intoavi/privacy/error-enum-and-mapping-testsfrom
avi/privacy/cors-and-config-tests
Closed

starknet_transaction_prover: add CORS and config validation tests#13136
avi-starkware wants to merge 1 commit intoavi/privacy/error-enum-and-mapping-testsfrom
avi/privacy/cors-and-config-tests

Conversation

@avi-starkware
Copy link
Copy Markdown
Collaborator

@avi-starkware avi-starkware commented Mar 10, 2026

Summary

  • Add 8 CORS tests: layer construction for empty/wildcard/allowlist, mode label correctness, origin normalization edge cases (ftp scheme, missing host, userinfo, default port stripping)
  • Add 10 config validation tests: missing rpc_url, zero max_concurrent/max_connections, CORS mutual exclusivity, fee validation toggle, config file loading/merging, CLI override precedence, non-HTTP CORS scheme rejection

Test plan

  • SEED=0 cargo test -p starknet_transaction_prover -- cors_test — 13 tests pass
  • SEED=0 cargo test -p starknet_transaction_prover -- config_test — 33 tests pass (includes pre-existing)

🤖 Generated with Claude Code


Note

Low Risk
Test-only changes plus a #[cfg(test)] module include; no runtime logic changes beyond exercising existing validation paths, so risk is low.

Overview
Adds new unit tests for ServiceConfig::from_args covering required-field enforcement, numeric argument validation, --no-cors/--cors-allow-origin exclusivity, fee validation toggling, and config-file vs CLI precedence.

Introduces a dedicated cors_test.rs (wired via #[cfg(test)] in cors.rs) to validate CORS layer construction, mode labeling, and origin normalization edge cases (schemes/host/userinfo/default-port handling).

Written by Cursor Bugbot for commit 1b5cafe. This will update automatically on new commits. Configure here.

@reviewable-StarkWare
Copy link
Copy Markdown

This change is Reviewable

@avi-starkware avi-starkware force-pushed the avi/privacy/error-enum-and-mapping-tests branch from e9cdab3 to e8b043d Compare March 10, 2026 14:27
@avi-starkware avi-starkware force-pushed the avi/privacy/cors-and-config-tests branch from cf88612 to 1091461 Compare March 10, 2026 14:27
@avi-starkware avi-starkware force-pushed the avi/privacy/error-enum-and-mapping-tests branch from e8b043d to fe98fe5 Compare March 10, 2026 14:36
@avi-starkware avi-starkware force-pushed the avi/privacy/cors-and-config-tests branch 2 times, most recently from 6235e80 to 6a944e0 Compare March 10, 2026 14:55
@avi-starkware avi-starkware force-pushed the avi/privacy/error-enum-and-mapping-tests branch 2 times, most recently from 5f41e20 to b8f14c6 Compare March 10, 2026 15:07
@avi-starkware avi-starkware force-pushed the avi/privacy/cors-and-config-tests branch 2 times, most recently from 1eade72 to 662669a Compare March 10, 2026 16:39
@avi-starkware avi-starkware force-pushed the avi/privacy/error-enum-and-mapping-tests branch 2 times, most recently from 01f846e to 76aa26a Compare March 10, 2026 17:16
@avi-starkware avi-starkware force-pushed the avi/privacy/cors-and-config-tests branch 2 times, most recently from 783e4ce to a8827f8 Compare March 10, 2026 18:01
@avi-starkware avi-starkware force-pushed the avi/privacy/error-enum-and-mapping-tests branch from 25f6f3b to a6246c2 Compare March 10, 2026 19:58
@avi-starkware avi-starkware force-pushed the avi/privacy/cors-and-config-tests branch from a8827f8 to 49a3322 Compare March 10, 2026 19:58
@avi-starkware avi-starkware force-pushed the avi/privacy/error-enum-and-mapping-tests branch from a6246c2 to c905302 Compare March 11, 2026 05:58
@avi-starkware avi-starkware force-pushed the avi/privacy/cors-and-config-tests branch from 49a3322 to f479105 Compare March 11, 2026 05:58
@avi-starkware avi-starkware force-pushed the avi/privacy/error-enum-and-mapping-tests branch from c905302 to c3e9ded Compare March 11, 2026 07:18
@avi-starkware avi-starkware force-pushed the avi/privacy/cors-and-config-tests branch 2 times, most recently from cf86175 to ce8a83d Compare March 11, 2026 08:01
@avi-starkware avi-starkware force-pushed the avi/privacy/cors-and-config-tests branch from ce8a83d to 8453086 Compare March 11, 2026 08:38
@avi-starkware avi-starkware force-pushed the avi/privacy/error-enum-and-mapping-tests branch from 084d115 to 05724db Compare March 11, 2026 08:38
@avi-starkware avi-starkware force-pushed the avi/privacy/cors-and-config-tests branch from 8453086 to 8517456 Compare March 11, 2026 12:23
@avi-starkware avi-starkware force-pushed the avi/privacy/error-enum-and-mapping-tests branch 2 times, most recently from 3991130 to 347e5ff Compare March 11, 2026 13:33
@avi-starkware avi-starkware force-pushed the avi/privacy/cors-and-config-tests branch from 8517456 to 8155738 Compare March 11, 2026 13:33
@avi-starkware avi-starkware force-pushed the avi/privacy/error-enum-and-mapping-tests branch from 347e5ff to d63c018 Compare March 12, 2026 14:21
@avi-starkware avi-starkware force-pushed the avi/privacy/cors-and-config-tests branch 2 times, most recently from 4505c57 to dbed0f9 Compare March 18, 2026 11:05
@avi-starkware avi-starkware force-pushed the avi/privacy/error-enum-and-mapping-tests branch from d63c018 to c4d0f33 Compare March 18, 2026 11:05
Add 8 CORS tests (layer construction, mode labels, origin normalization
edge cases) and 10 config validation tests (missing rpc_url, zero
max_concurrent/max_connections, CORS conflicts, config file merging,
CLI override precedence).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@avi-starkware avi-starkware force-pushed the avi/privacy/cors-and-config-tests branch from dbed0f9 to 1b5cafe Compare March 18, 2026 12:53
@avi-starkware avi-starkware force-pushed the avi/privacy/error-enum-and-mapping-tests branch from c4d0f33 to 3a65b2e Compare March 18, 2026 12:53
@avi-starkware avi-starkware deleted the branch avi/privacy/error-enum-and-mapping-tests March 19, 2026 13:36
@github-actions github-actions bot locked and limited conversation to collaborators Mar 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants