Conversation
WalkthroughRemoved Sentry error reporting, JWT-based authentication & authorization middleware, and the OCM client and related config/flags; corresponding imports, mocks, middleware applications, and test JWT utilities were deleted across server, config, client, middleware, and tests. Changes
Sequence Diagram(s)mermaid Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 🧹 Recent nitpick comments
Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
cmd/maestro/server/api_server.go (1)
41-54:⚠️ Potential issue | 🔴 CriticalRestore the CORS allowed origins configuration.
The
AllowedOriginswas changed to an empty slice[]string{}, which blocks all cross-origin requests. The previous configuration allowed specific origins includinghttps://console.redhat.com,https://cloud.redhat.com,https://qa.console.redhat.com,https://api.openshift.com, and others. An empty slice will break CORS for all UI applications that depend on this API.Restore the list of allowed origins or remove the
AllowedOriginsoption entirely if all origins should be permitted.
🧹 Nitpick comments (1)
test/integration/consumers_test.go (1)
53-79: Remove JWT-derived Authorization header now that contexts are unauthenticated.Line 74 and Line 133 pull
openapi.ContextAccessTokenfromcontext.Background(), which is nil;fmt.Sprintf("Bearer %s", nil)produces a bogus header value and makes the invalid-JSON check depend on a meaningless token. Drop the header (or inject a fixed dummy token) so the test focuses solely on request validation.Proposed cleanup
- jwtToken := ctx.Value(openapi.ContextAccessToken) restyResp, err := resty.R(). SetHeader("Content-Type", "application/json"). - SetHeader("Authorization", fmt.Sprintf("Bearer %s", jwtToken)). SetBody(`{ this is invalid }`). Post(h.RestURL("/consumers"))- jwtToken := ctx.Value(openapi.ContextAccessToken) restyResp, _ := resty.R(). SetHeader("Content-Type", "application/json"). - SetHeader("Authorization", fmt.Sprintf("Bearer %s", jwtToken)). SetBody(`{ this is invalid }`). Patch(h.RestURL("/consumers/foo"))Also applies to: 102-138
Signed-off-by: clyang82 <chuyang@redhat.com>
74bdad2 to
95f97a8
Compare
Remove the following flags and related code: