{"id":25898113,"url":"https://github.com/tesladodger/authngn","last_synced_at":"2025-06-29T13:02:07.372Z","repository":{"id":109479443,"uuid":"609652033","full_name":"tesladodger/authngn","owner":"tesladodger","description":"Simple authorization engine for Go","archived":false,"fork":false,"pushed_at":"2023-03-07T16:03:52.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-03T00:16:54.697Z","etag":null,"topics":["api-rest","authorization","go","golang"],"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/tesladodger.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":"2023-03-04T20:29:46.000Z","updated_at":"2024-09-21T10:44:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"e0474d03-cb28-4120-8d34-bc5830bc481a","html_url":"https://github.com/tesladodger/authngn","commit_stats":{"total_commits":14,"total_committers":1,"mean_commits":14.0,"dds":0.0,"last_synced_commit":"0ec19b9966cfc615053159b5fbff0617c36f44c8"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/tesladodger/authngn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tesladodger%2Fauthngn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tesladodger%2Fauthngn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tesladodger%2Fauthngn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tesladodger%2Fauthngn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tesladodger","download_url":"https://codeload.github.com/tesladodger/authngn/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tesladodger%2Fauthngn/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262598137,"owners_count":23334665,"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":["api-rest","authorization","go","golang"],"created_at":"2025-03-03T00:17:01.231Z","updated_at":"2025-06-29T13:02:07.180Z","avatar_url":"https://github.com/tesladodger.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Authngn\n\nStupidly simple authorization engine.\n\n```\ngo get -u github.com/tesladodger/authngn\n```\n\n## Usage\n\nRegister the rules:\n\n```\nngn := authngn.New()\nngn.Register(User{}, \"read,write,delete\", Resource{}, func(ent, res any) bool {\n    user := ent.(User)\n    res := res.(Resource)\n    return user.id == resource.owner\n})\n```\n\nAssert authorization:\n```\nok := ngn.Authorize(user, \"read\", resource)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftesladodger%2Fauthngn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftesladodger%2Fauthngn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftesladodger%2Fauthngn/lists"}