{"id":26216113,"url":"https://github.com/getyourguide/extproc-go","last_synced_at":"2026-04-22T15:35:46.036Z","repository":{"id":266505677,"uuid":"893499647","full_name":"getyourguide/extproc-go","owner":"getyourguide","description":null,"archived":false,"fork":false,"pushed_at":"2026-03-31T12:35:46.000Z","size":185,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":29,"default_branch":"main","last_synced_at":"2026-03-31T14:39:09.714Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/getyourguide.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-11-24T15:54:37.000Z","updated_at":"2026-03-31T12:35:49.000Z","dependencies_parsed_at":"2025-12-09T05:00:20.761Z","dependency_job_id":null,"html_url":"https://github.com/getyourguide/extproc-go","commit_stats":null,"previous_names":["getyourguide/extproc-go"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/getyourguide/extproc-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getyourguide%2Fextproc-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getyourguide%2Fextproc-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getyourguide%2Fextproc-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getyourguide%2Fextproc-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/getyourguide","download_url":"https://codeload.github.com/getyourguide/extproc-go/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/getyourguide%2Fextproc-go/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32143657,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T15:33:03.595Z","status":"ssl_error","status_checked_at":"2026-04-22T15:30:42.712Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-12T11:19:43.257Z","updated_at":"2026-04-22T15:35:46.007Z","avatar_url":"https://github.com/getyourguide.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# extproc-go\n\nA Go library for building [Envoy External Processor](https://www.envoyproxy.io/docs/envoy/latest/configuration/http/http_filters/ext_proc_filter).\n\n\u003e [!NOTE]\n\u003e This code is used in large scale production but is a work in progress and the API is subject to change.\n\n## Example Usage\n\nThe following is an example of a filter that sets the SameSite attribute to Lax on all cookies set in the response headers. The filter is implemented as a Go struct that implements the `ResponseHeaders` method of the [filter.Filter](filter/filter.go) interface. The `ResponseHeaders` method is called by the extproc-go library when the filter is invoked by Envoy.\n\n- [SameSiteLaxMode](./examples/filters/setcookie.go)\n\n```go\ntype SameSiteLaxMode struct {\n\tfilter.NoOpFilter\n}\n\nfunc (f *SameSiteLaxMode) ResponseHeaders(ctx context.Context, crw *filter.CommonResponseWriter, req *filter.RequestContext) (*extproc.ProcessingResponse_ImmediateResponse, error) {\n\tfor i, cookie := range req.SetCookies() {\n\t\tcookie.SameSite = http.SameSiteLaxMode\n\t\tcookie.HttpOnly = true\n\t\t// The first set-cookie we overwrite the header, the others we append\n\t\tif i == 0 {\n\t\t\tcrw.SetHeader(\"set-cookie\", cookie.String())\n\t\t\tcontinue\n\t\t}\n\t\tcrw.AppendHeader(\"set-cookie\", cookie.String())\n\t}\n\treturn nil, nil\n}\n```\n\nThe filter is then registered with the extproc-go library and the server is started to listen for incoming requests from Envoy.\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\n\t\"github.com/getyourguide/extproc-go/examples/filters\"\n\t\"github.com/getyourguide/extproc-go/server\"\n)\n\nfunc main() {\n\terr := server.New(context.Background(),\n\t\tserver.WithFilters(\u0026filters.SameSiteLaxMode{}),\n\t\tserver.WithEcho(),\n\t).Serve()\n\n\t// handle error ...\n}\n```\n\n## Filter API\n\nA server is composed of one of more filters. Requests and responses are proxied by Envoy to the external processor server,\nand then each filter in turn receives request information. The current implementation supports implementing the following\nmethods:\n\n- `RequestHeaders`: request headers is run on a request being made to the server\n- `ResponseHeaders`: response headers is run on a response being returned from the downstream\n\nThe order of processing is determined by the order of filters passed to the server. On request, filters process the request\nfrom first to last, while on response, filters process the request from last to first. This matches the [envoy implementation](https://www.envoyproxy.io/docs/envoy/latest/intro/arch_overview/http/http_filters#filter-ordering)\nof filters.\n\n## Stream API\n\nFilters can also be run on changes to the stream by implementing the `Stream` interface. Currently, the stream interface\nsupports `OnStreamComplete`, which runs when a stream completes for any reason (e.g an `ImmediateResponse` is returned,\nor extproc returns an `EOF`). `OnStreamComplete` allows adding a final async processing step, for instance emitting custom\nmetrics.\n\n## Testing Filters\n\nWe provide a simple way to write and run integration tests against filters built with extproc-go. An example test case would look like the following:\n\n```yaml\nname: it should set set-cookie headers with SameSite=Lax and HttpOnly\ninput:\n  headers:\n    - name: path\n      value: /response-headers?set-cookie=session=my-session\u0026set-cookie=auth=d2h5IHNvIGN1cmlvdXM/Cg==\nexpect:\n  responseHeaders:\n    - name: set-cookie\n      exact: session=my-session; HttpOnly; SameSite=Lax\n      matchAction: ANY\n    - name: set-cookie\n      exact: auth=d2h5IHNvIGN1cmlvdXM/Cg==; HttpOnly; SameSite=Lax\n      matchAction: ANY\n```\n\nThe integration test requires [Envoy](examples/envoy.yml) and [extproc server](examples/main.go) running with the echo handlers loaded, the full setup is available in the [compose.yml](./examples/compose.yaml) file. To run the tests add the following to your test file:\n\n```go\nfunc TestSameSiteLax(t *testing.T) {\n\t// ...\n\ttc := extproctest.Load(t, \"testdata/setcookie.yml\")\n\ttc.Run(t)\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetyourguide%2Fextproc-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgetyourguide%2Fextproc-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgetyourguide%2Fextproc-go/lists"}