Skip to content

proxy로 swagger 테스트 가능하도록 변경#4

Merged
hellices merged 2 commits into
mainfrom
feature/proxy-architecture
Jun 4, 2025
Merged

proxy로 swagger 테스트 가능하도록 변경#4
hellices merged 2 commits into
mainfrom
feature/proxy-architecture

Conversation

@hellices

@hellices hellices commented Jun 4, 2025

Copy link
Copy Markdown
Owner

No description provided.

@hellices hellices requested a review from Copilot June 4, 2025 04:19

This comment was marked as outdated.

@hellices hellices requested a review from Copilot June 4, 2025 04:33

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enables proxy-based requests in the Swagger UI by intercepting and forwarding all API calls through the aggregator server, and updates versioning, samples, and documentation to support the new feature.

  • Bumps operator version from 0.1.0 to 0.2.0 across configs
  • Adds a requestInterceptor in the Swagger UI and implements proxyRequest handling in server.go
  • Updates sample manifests and README to include the new allowed-methods annotation and proxy flow

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
versions.txt Updated operator version to 0.2.0
pkg/swagger/swagger-ui/index.html Added requestInterceptor to reroute API calls through /proxy/
pkg/swagger/server.go Implemented proxyRequest endpoint and spec server-info updates
internal/controller/openapiaggregator_controller.go Ensured API path always begins with /
install.yaml Added allowedMethodsAnnotation property and bumped version
config/samples/test-service.yaml Updated example allowed-methods value in sample service
config/manager/kustomization.yaml Updated controller image tag to 0.2.0
README.md Documented allowed-methods annotation and proxy flow
Comments suppressed due to low confidence (3)

config/samples/test-service.yaml:11

  • [nitpick] The inline comment still states "get만 허용" (only GET allowed) but the example value allows both GET and POST. Please update the comment to accurately reflect the allowed methods.
    openapi.aggregator.io/allowed-methods: "get,post"  # get만 허용, 'get,post'처럼 쉼표로 구분하여 여러 메서드 허용 가능

pkg/swagger/server.go:11

  • Missing imports for fmt and encoding/json. The new code uses fmt.Sprintf, json.NewDecoder, and json.NewEncoder but these packages are not imported, causing compilation errors.
    "net/url"

pkg/swagger/server.go:262

  • proxyRequest sets reqBody to nil for all requests, so POST/PUT bodies are dropped. You should initialize reqBody from r.Body (e.g., reqBody = r.Body) to forward payloads correctly.
    reqBody = nil

@hellices hellices merged commit 9bf027b into main Jun 4, 2025
2 checks passed
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