{"id":22261385,"url":"https://github.com/adaptant-labs/openfaas-function-auth-opa","last_synced_at":"2025-07-28T08:32:53.233Z","repository":{"id":66208375,"uuid":"215249107","full_name":"adaptant-labs/openfaas-function-auth-opa","owner":"adaptant-labs","description":"Open Policy Agent-backed authentication in OpenFaaS Serverless functions","archived":false,"fork":false,"pushed_at":"2019-10-15T08:40:12.000Z","size":3,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-04-10T02:55:28.221Z","etag":null,"topics":["authz","faas","opa","openfaas","openpolicyagent","serverless"],"latest_commit_sha":null,"homepage":null,"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/adaptant-labs.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-15T08:39:13.000Z","updated_at":"2024-06-19T10:05:45.845Z","dependencies_parsed_at":"2023-05-30T00:45:26.049Z","dependency_job_id":null,"html_url":"https://github.com/adaptant-labs/openfaas-function-auth-opa","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adaptant-labs%2Fopenfaas-function-auth-opa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adaptant-labs%2Fopenfaas-function-auth-opa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adaptant-labs%2Fopenfaas-function-auth-opa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adaptant-labs%2Fopenfaas-function-auth-opa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adaptant-labs","download_url":"https://codeload.github.com/adaptant-labs/openfaas-function-auth-opa/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227886300,"owners_count":17834992,"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":["authz","faas","opa","openfaas","openpolicyagent","serverless"],"created_at":"2024-12-03T09:12:37.587Z","updated_at":"2024-12-03T09:12:38.320Z","avatar_url":"https://github.com/adaptant-labs.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# openfaas-function-auth-opa\n\nThis repository provides an example of [Open Policy Agent](https://www.openpolicyagent.org/)\\-backed authentication in OpenFaaS Serverless functions.\n\n## Quick Start\n\nTo try it out, you will need to have an OPA server in your OpenFaaS stack. A version implementing this by default can\nbe found [here](https://github.com/adaptant-labs/faas/tree/opa-integration). Once this is up and running, fetch the\n[golang-http-gomod](https://github.com/adaptant-labs/openfaas-golang-http-gomod-template) template and deploy as normal:\n\n```\n$ faas-cli template pull https://github.com/adaptant-labs/openfaas-golang-http-gomod-template.git\n$ faas-cli up --skip-push\n```\n## Example Policy\n\nA simple example rego policy is provided in order to get started. This policy\nprohibits access by default, allowing access to the named function only for a\nspecified user:\n\n```\npackage openfaas.authz\n\ndefault allow = false\n\nallow {\n  input.function == \"opa-auth\"\n  input.user == \"alice\"\n}\n```\n\n## Function Invocation\n\nInvocation of the function is prohibited by default by the example policy:\n\n```\n$ curl -X POST http://127.0.0.1:8080/function/opa-auth\nUnauthorized.\n```\n\nRetrying the request with the permitted named user succeeds:\n\n```\n$ curl -H 'Authorization: alice' -X POST http://127.0.0.1:8080/function/opa-auth\nAuthorization OK\n```\n\n## Licensing\n\nReleased under the terms of the [MIT](LICENSE) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadaptant-labs%2Fopenfaas-function-auth-opa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadaptant-labs%2Fopenfaas-function-auth-opa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadaptant-labs%2Fopenfaas-function-auth-opa/lists"}