{"id":44905756,"url":"https://github.com/iwarapter/gostack","last_synced_at":"2026-02-17T22:33:45.507Z","repository":{"id":137358610,"uuid":"610513740","full_name":"iwarapter/gostack","owner":"iwarapter","description":null,"archived":false,"fork":false,"pushed_at":"2023-07-27T15:06:57.000Z","size":121,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-20T08:19:40.013Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/iwarapter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-03-06T23:25:55.000Z","updated_at":"2024-02-14T19:47:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"6310cc4a-2950-43b5-9519-4fe1184eb659","html_url":"https://github.com/iwarapter/gostack","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iwarapter/gostack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwarapter%2Fgostack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwarapter%2Fgostack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwarapter%2Fgostack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwarapter%2Fgostack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iwarapter","download_url":"https://codeload.github.com/iwarapter/gostack/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iwarapter%2Fgostack/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29560920,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T21:50:49.831Z","status":"ssl_error","status_checked_at":"2026-02-17T21:46:15.313Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":"2026-02-17T22:33:44.839Z","updated_at":"2026-02-17T22:33:45.498Z","avatar_url":"https://github.com/iwarapter.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GoStack\n\nQuick and dirty testing util to spin up lambda processes and invoke them as API GW targets (with authorizers) and also an ALB.\n\n## Usage\n\n```bash\n$ gostack --help\nUsage:\n  main [OPTIONS]\n\nApplication Options:\n  -c, --config= Path to the configuration file (default: gostack.yml)\n  -p, --port=   Listener port (default: 8080)\n\nHelp Options:\n  -h, --help    Show this help message\n```\n\nSee below for quick example:\n\n`gostack.yml`\n```yaml\nlambdas:\n  - name: example\n    zip: example.zip\n    timeout: 5\n    environment:\n      FOO: BAR\n      API_KEY: ${API_KEY}\napigateways:\n  - id: example\n    openapi-spec: swagger.json\nalbs:\n  - id: default\n    default-introspection: '{\"active\": true,\"scope\": \"openid email\"}'\n    default-userinfo: '{\"foo\":\"bar\"}'\n    rules:\n    - path: /config\n      oidc: true\n      methods:\n        - GET\n      fixed-response:\n        body: '{\"foo\":\"bar\"}'\n        content-type: application/json\n    - path: /foo\n      headers:\n        accept: application/json\n      methods:\n        - POST\n      oidc: true\n      target: arn:aws:lambda:us-east-1:123456789012:function:one\n    - path: /\n      oidc: true\n      files:\n        path: dist/\n        index: index.html\n\nmock-data:\n  \"my-example-token\":\n    userinfo:\n      scope: foo\n      other: bar\n    introspection:\n      active: true\n      scope: \"openid email example\"\n```\n\n## Lambdas\n\nLambdas should be compiled for `local` OS/ARCH (i.e: `go build -o bootstrap`).\n\nEnvironment variables are passed to the lambda configuration as `FOO=BAR` and the `bootstrap` process is invoked with the `FOO=BAR` environment variables.\n\nVariables defined with `${}` will be replaced with the value of the environment variable.\nExample:\n```yaml\nenvironment:\n  FOO: BAR\n  API_KEY: ${API_KEY}\n```\n\n## API Gateways\n\nAPI Gateways will import from OpenAPI spec, AWS tags for authorizer/lambda integration are honoured.\n\n### Lambda Integrations\n\nLambda integrations are defined in the OpenAPI spec, the `x-amazon-apigateway-integration` tag is used to define the lambda integration.\n\nExample:\n```yaml\npaths:\n  /foo:\n    get:\n      x-amazon-apigateway-integration:\n        uri: arn:aws:lambda:us-east-1:123456789012:function:one\n        passthroughBehavior: when_no_match\n        httpMethod: POST\n        type: aws_proxy\n```\n\n### Authorizers\n\nAuthorizers are defined in the OpenAPI spec, the `x-amazon-apigateway-authtype` tag is used to define the type of authorizer.\n\nExample:\n```yaml\npaths:\n  /foo:\n    get:\n      security:\n        - authorizer: []\n      x-amazon-apigateway-integration:\n        uri: arn:aws:lambda:us-east-1:123456789012:function:one\n        passthroughBehavior: when_no_match\n        httpMethod: POST\n        type: aws_proxy\ncomponents:\n  securitySchemes:\n    authorizer:\n      type: apiKey\n      name: Authorization\n      in: header\n      x-amazon-apigateway-authtype: custom\n      x-amazon-apigateway-authorizer:\n        authorizerUri: arn:aws:lambda:us-east-1:123456789012:function:auth\n        authorizerResultTtlInSeconds: 300\n        type: request\n        identitySource : method.request.header.Authorization\n```\n\nBoth `request` and `token` authorizers are supported.\n\n## Application Load Balancers\n\nALB - Configuration rules, `fixed-response`, `target` or files (served like an SPA).\n\n### Fixed Response\n\nThe `fixed-response` rule will return a fixed response with the provided body and content-type.\n\nExample:\n```yaml\nalbs:\n  - rules:\n    - path: /config\n      oidc: true\n      methods:\n        - GET\n      fixed-response:\n        body: '{\"foo\":\"bar\"}'\n        content-type: application/json\n```\n\n### Target\n\nThe `target` rule will invoke the lambda function with the provided ARN.\n\nExample:\n```yaml\nalbs:\n  - rules:\n    - path: /foo\n      methods:\n        - POST\n      oidc: true\n      target: arn:aws:lambda:us-east-1:123456789012:function:one\n```\n\n### Files\n\nThe `files` rule will serve files from the provided path, the `index` file will be served for the root path.\n\nExample:\n```yaml\nalbs:\n  - rules:\n    - path: /\n      oidc: true\n      files:\n        path: dist/\n        index: index.html\n        response-headers:\n          X-Custom-Header: foo\n```\n\n### Proxy\n\nThe `proxy` rule will proxy the request to the provided URL.\n\nExample:\n```yaml\nalbs:\n  - rules:\n    - path: /proxy\n      oidc: true\n      proxy:\n        target: https://www.google.com\n```\n\n### Headers\n\nThe `headers` rule will match on the provided headers. Headers are key/value pairs.\n\nExample:\n```yaml\nalbs:\n  - rules:\n    - path: /foo\n      headers:\n        accept: application/json\n      methods:\n        - POST\n      oidc: true\n      target: arn:aws:lambda:us-east-1:123456789012:function:one\n```\n\n### OIDC\n\nThe `oidc` rule will require the user to be authenticated via OIDC.\n\n### ALB Auth\n\nALB - Auth, the ALB has a very hacky thrown together oauth flow, the login page simply takes all the relevant information\nand then presents it. For easy testing of different user/configuration scenarios.\n\nThe auth domain is `auth.127.0.0.1.nip.io:8080` and the login page is `auth.127.0.0.1.nip.io:8080/login`.\n\nThe auth also signs the JWT with a static key, so the JWT can be decoded to see the contents. The JWT is signed according to the AWS ALB spec, which is non-standard (yay).\n\nIt supports settings the OIDC subject, the introspection response and the userinfo response. The cookie lifetime is also configurable.\n\n## Mock-Data\n\nThe mock-data section is used to provide mock data for the OIDC flow. The key is the token that will be used to identify the user.\n\nThe `userinfo` section is used to provide the user information that will be returned by the userinfo endpoint.\n\nThe `introspection` section is used to provide the introspection information that will be returned by the introspection endpoint.\n\nAll claims for the `userinfo` and `introspection` sections are optional. If a claim is not provided, it will not be returned. All data is marshalled to JSON, so the values should be valid JSON values.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiwarapter%2Fgostack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiwarapter%2Fgostack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiwarapter%2Fgostack/lists"}