Skip to content

Added configurable CORS origins to VCVerifier#92

Merged
wistefan merged 12 commits intomainfrom
ticket-33/work
Apr 30, 2026
Merged

Added configurable CORS origins to VCVerifier#92
wistefan merged 12 commits intomainfrom
ticket-33/work

Conversation

@wistefan
Copy link
Copy Markdown
Collaborator

Operators can now specify allowedOrigins per service in configRepo.services to control which origins are permitted for cross-origin requests.

  • New config field: allowedOrigins on ConfiguredService — accepts a list of origin strings (e.g., ["https://app.example.com"]) or ["*"] for wildcard.
  • Backward compatible: When no allowedOrigins are configured on any service, the verifier defaults to allowing all origins (*), matching the previous hardcoded behavior.
  • Multi-service merge: Origins from all configured services are collected into a single deduplicated list. If any service includes "*", the wildcard takes precedence.
  • Documented: server.yaml includes a commented-out example showing how to configure allowedOrigins.

general-agent-2 and others added 11 commits April 29, 2026 11:18
4-step plan to make CORS allowed-origins configurable per service
in ConfiguredService, replacing the hardcoded wildcard in main.go.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…t-33/plan into ticket-33/work

Reviewed-on: http://localhost:3001/general-agent-2/VCVerifier/pulls/11
Reviewed-by: wistefan <wistefan@dev-env.local>
Add an optional AllowedOrigins []string field to the ConfiguredService
struct, enabling per-service CORS origin configuration. The field uses
json and mapstructure tags with omitempty so existing configs are
unaffected. When absent, the slice defaults to nil, signaling that no
service-specific restriction is set.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…onfigure cors headers' (#12) from ticket-33/step-1 into ticket-33/work

Reviewed-on: http://localhost:3001/general-agent-2/VCVerifier/pulls/12
Reviewed-by: wistefan <wistefan@dev-env.local>
Replace hardcoded CORS wildcard origin with ResolveAllowedOrigins
helper that aggregates AllowedOrigins from all ConfiguredServices.
Falls back to wildcard ["*"] when no origins are configured, preserving
backward compatibility.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Implemented step 2 of 4: Wire CORS middleware to use configured origins from all services
…onfigure cors headers' (#13) from ticket-33/step-2 into ticket-33/work

Reviewed-on: http://localhost:3001/general-agent-2/VCVerifier/pulls/13
Reviewed-by: wistefan <wistefan@dev-env.local>
Update config_test.yaml with allowedOrigins field for the test service,
update provider_test.go expected struct to match, and add main_test.go
with 11 parameterized table-driven tests covering all edge cases of
ResolveAllowedOrigins (nil/empty services, wildcard precedence,
deduplication, mixed configured/unconfigured services).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… unit tests' (#14) from ticket-33/step-3 into ticket-33/work

Reviewed-on: http://localhost:3001/general-agent-2/VCVerifier/pulls/14
Reviewed-by: wistefan <wistefan@dev-env.local>
Document the new CORS allowedOrigins configuration option in the
example server.yaml so operators can discover and configure it.
Includes inline comments explaining the merge behavior across
services and the wildcard default.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… and documentation' (#15) from ticket-33/step-4 into ticket-33/work

Reviewed-on: http://localhost:3001/general-agent-2/VCVerifier/pulls/15
Reviewed-by: wistefan <wistefan@dev-env.local>
@wistefan wistefan added the patch Should be applied for dependency updates and small bugfixes. label Apr 29, 2026
@wistefan wistefan merged commit d5eae8e into main Apr 30, 2026
14 of 15 checks passed
@wistefan wistefan deleted the ticket-33/work branch April 30, 2026 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

patch Should be applied for dependency updates and small bugfixes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant