Skip to content

[proxy] Handle both gRPC and HTTP requests against public-api #13582

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 5, 2022

Conversation

easyCZ
Copy link
Member

@easyCZ easyCZ commented Oct 4, 2022

Description

Related Issue(s)

How to test

Ensure that gRPC traffic is still routed to the gRPC server

gpctl api workspaces get 123 --address api.mp-caddy-r9ed2436f9c.preview.gitpod-dev.com:443 --token foo
FATA[0000] failed to retrieve workspace (ID: 123)        error="rpc error: code = PermissionDenied desc = insufficient permission to access workspace"

Permission denied is expected, we're supplying a dummy token. But we got an application level response - this means it works.

Test that HTTP routing works to the HTTP server

curl https://api.mp-caddy-r9ed2436f9c.preview.gitpod-dev.com/test
test

Release Notes

NONE

Documentation

Werft options:

  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-integration-tests=all
    Valid options are all, workspace, webapp, ide

@werft-gitpod-dev-com
Copy link

started the job as gitpod-build-mp-caddy-route-http-1-to-api.1 because the annotations in the pull request description changed
(with .werft/ from main)

@@ -62,6 +62,9 @@ func Start(logger *logrus.Entry, version string, cfg *config.Configuration) erro
log.Info("No stripe webhook secret is configured, endpoints will return NotImplemented")
}

srv.HTTPMux().Handle("/test", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(`test`))
Copy link
Member Author

Choose a reason for hiding this comment

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

We'll remove this once we've got actual endpoints implemented, for now this acts as a quick check the server is reachable.

@easyCZ easyCZ force-pushed the mp/caddy-route-http-1-to-api branch from ae505c4 to ea5f5c4 Compare October 4, 2022 17:16
@easyCZ easyCZ changed the title [proxy] Route HTTP 1.x requests to public-api-server [proxy] Handle both gRPC and HTTP requests against public-api Oct 4, 2022
@easyCZ easyCZ marked this pull request as ready for review October 4, 2022 17:17
@easyCZ easyCZ requested a review from a team October 4, 2022 17:17
@github-actions github-actions bot added the team: webapp Issue belongs to the WebApp team label Oct 4, 2022
@roboquat roboquat merged commit 31f2732 into main Oct 5, 2022
@roboquat roboquat deleted the mp/caddy-route-http-1-to-api branch October 5, 2022 05:56
@roboquat roboquat added deployed: webapp Meta team change is running in production deployed Change is completely running in production labels Oct 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deployed: webapp Meta team change is running in production deployed Change is completely running in production release-note-none size/S team: webapp Issue belongs to the WebApp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants