{"id":15320993,"url":"https://github.com/qingwave/opa-gin-authz","last_synced_at":"2025-04-14T23:34:02.123Z","repository":{"id":112205643,"uuid":"496170970","full_name":"qingwave/opa-gin-authz","owner":"qingwave","description":"Gin http service with OPA authentication in golang.","archived":false,"fork":false,"pushed_at":"2022-05-25T09:56:18.000Z","size":2997,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-28T11:39:28.694Z","etag":null,"topics":["auth","gin","go","golang","http","opa","openpolicyagent"],"latest_commit_sha":null,"homepage":"","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/qingwave.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":"2022-05-25T09:46:44.000Z","updated_at":"2025-02-18T13:48:44.000Z","dependencies_parsed_at":"2023-03-12T13:15:20.657Z","dependency_job_id":null,"html_url":"https://github.com/qingwave/opa-gin-authz","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qingwave%2Fopa-gin-authz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qingwave%2Fopa-gin-authz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qingwave%2Fopa-gin-authz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qingwave%2Fopa-gin-authz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qingwave","download_url":"https://codeload.github.com/qingwave/opa-gin-authz/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248980148,"owners_count":21193110,"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":["auth","gin","go","golang","http","opa","openpolicyagent"],"created_at":"2024-10-01T09:09:33.823Z","updated_at":"2025-04-14T23:34:02.092Z","avatar_url":"https://github.com/qingwave.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OPA Gin Example\n\nThis repository shows how to integrate a http service written in [Gin](https://github.com/gin-gonic/gin) with the OPA to perform API authorization.\n\n## Build\n```\nmake\n```\n\n## Run\n```\nmake run\n```\nor `go run main.go`\n\ntest opa:\n1. None resource request is allowed, `curl http://localhost:8080/`\n2. Unauthenticated user is not allowed for api resource, `curl http://localhost:8080/api/users`\n3. Authenticated user get resource is allowed, `curl http://localhost:8080/api/users?user=bob`\n\n## Authz with OPA\nAuthentication rego config in (authz.rego)[./authz/authz.rego]\n\nGin middleware code in [server.go](./server/opa.go#L14)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqingwave%2Fopa-gin-authz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqingwave%2Fopa-gin-authz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqingwave%2Fopa-gin-authz/lists"}