Added configurable CORS origins to VCVerifier#92
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Operators can now specify allowedOrigins per service in configRepo.services to control which origins are permitted for cross-origin requests.