{"id":23807121,"url":"https://github.com/brettbuddin/pass","last_synced_at":"2026-04-27T00:30:20.075Z","repository":{"id":57561369,"uuid":"328413210","full_name":"brettbuddin/pass","owner":"brettbuddin","description":"A library for creating configurable reverse-proxies.","archived":false,"fork":false,"pushed_at":"2021-02-21T19:56:35.000Z","size":62,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-01T23:30:12.700Z","etag":null,"topics":["go","golang","http","library","reverse-proxy"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brettbuddin.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":null,"security":null,"support":null}},"created_at":"2021-01-10T15:19:44.000Z","updated_at":"2022-01-19T23:04:45.000Z","dependencies_parsed_at":"2022-09-10T06:13:38.885Z","dependency_job_id":null,"html_url":"https://github.com/brettbuddin/pass","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brettbuddin%2Fpass","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brettbuddin%2Fpass/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brettbuddin%2Fpass/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brettbuddin%2Fpass/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brettbuddin","download_url":"https://codeload.github.com/brettbuddin/pass/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240061735,"owners_count":19742085,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["go","golang","http","library","reverse-proxy"],"created_at":"2025-01-01T23:27:48.359Z","updated_at":"2026-04-27T00:30:19.997Z","avatar_url":"https://github.com/brettbuddin.png","language":"Go","readme":"# pass\n\n[![Go\nReference](https://pkg.go.dev/badge/github.com/brettbuddin/pass.svg)](https://pkg.go.dev/github.com/brettbuddin/pass)\n\nPass is a library for building reverse-proxies. It wraps\n[`httputil.ReverseProxy`](https://golang.org/pkg/net/http/httputil/#ReverseProxy),\nand specifies routing via configuration files.\n\n## Configuration\n\nRouting in Pass is configured via HCL. This enables proxy routing to be\nconfigured outside of your binary's code—such as Kubernetes `ConfigMap`\ndefinitions.\n\n```hcl\n// Base prefix for all upstream routes. (optional)\nprefix_path = \"/api/v2\"\n\n// Annotations for this Manifest that can be used by other libraries once\n// this Manifest is parsed. Similar to Kubernetes Annotations, they enable other\n// libraries and tooling to apply meaning to the Manifest. These values are\n// arbitrary to the pass library.\nannotations = {\n    \"company/version\": 2\n}\n\n// Define an upstream service called \"widgets\". The identifier here is just a\n// human readable string to refer to this service. For instance, you could use\n// this identifier when tagging metrics.\nupstream \"widgets\" {\n    // Annotations for this upstream destination.\n    annotations = {\n        \"company/middleware\": \"jwt,tracing\"\n    }\n\n    // Location in the form of \"scheme://hostname\" to send the traffic.\n    destination = \"http://widgets.local\" \n\n    // Team identifier to help keep track of who's the point of contact for a\n    // particular upstream service. (optional)\n    owner = \"Team A \u003cteam-a@company.com\u003e\"\n\n    // Inform the reverse-proxy to flush the response body every second. If this\n    // is omitted, no flushing will be peformed. A negative value will flush\n    // immediately after each write to the client. (optional)\n    flush_interval_ms = 1000\n\n    // Add an additional prefix segment (added to the root level `prefix_path`)\n    // that should be stripped from outgoing requests. (optional)\n    prefix_path = \"/private\"\n\n    // GET `/api/v2/private/widgets` -\u003e GET `http://widgets.local/widgets`\n    // POST `/api/v2/private/widgets` -\u003e POST `http://widgets.local/widgets`\n    route {\n        methods = [\"GET\", \"POST\"]\n        path = \"/widgets\"\n    }\n\n    // GET `/api/v2/private/widgets/123` -\u003e GET `http://widgets.local/widgets/123`\n    // PUT `/api/v2/private/widgets/123` -\u003e PUT `http://widgets.local/widgets/123`\n    // DELETE `/api/v2/private/widgets/123` -\u003e DELETE `http://widgets.local/widgets/123`\n    route {\n        methods = [\"GET\", \"PUT\", \"DELETE\"]\n        path = \"/widgets/{[0-9]+}\"\n    }\n}\n\nupstream \"gears\" {\n    destination = \"http://gears.local\" \n    owner = \"Team B \u003cteam-b@company.com\u003e\"\n    prefix_path = \"/gears\"\n\n    // ANY METHOD /api/v2/gears/anything -\u003e http://gears.local/api/v2/gears/anything\n    route {\n        methods = [\"DELETE\", \"GET\", \"HEAD\", \"OPTIONS\", \"PATCH\", \"POST\", \"PUT\"]\n        path = \"/*\"\n    }\n\n    // ANY METHOD /api/v2/gears -\u003e http://gears.local/api/v2/gears\n    route {\n        methods = [\"DELETE\", \"GET\", \"HEAD\", \"OPTIONS\", \"PATCH\", \"POST\", \"PUT\"]\n        path = \"/\"\n    }\n}\n```\n\nParsing the file and mounting it in your application:\n\n```go\nm, err := pass.LoadManifest(\"./manifest.hcl\", nil)\nif err != nil {\n\treturn err\n}\n\n// Register the manifest's routes with a router.\nproxy, err := pass.New(m)\nif err != nil {\n\treturn err\n}\n```\n\nYou can pass an optional `hcl.EvalContext` to specify variables and functions as\npart of the HCL parsing.\n\n```go\nectx := \u0026hcl.EvalContext{\n\tVariables: map[string]cty.Value{\n\t\t\"namespace\": cty.StringVal(\"example\"),\n\t},\n}\n\n// The variable \"namespace\" will be available in this configuration file.\nm, err := pass.LoadManifest(\"./manifest.hcl\", ectx)\nif err != nil {\n\treturn err\n}\n```\n\n## Examples\n\nCheck out the [example/](example) directory for usage examples in code.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrettbuddin%2Fpass","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrettbuddin%2Fpass","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrettbuddin%2Fpass/lists"}