{"id":19420139,"url":"https://github.com/einride/iam-go","last_synced_at":"2025-09-16T17:38:50.683Z","repository":{"id":37534849,"uuid":"353359235","full_name":"einride/iam-go","owner":"einride","description":"An opinionated Open Source implementation of the google.iam APIs on top of Cloud Spanner.","archived":false,"fork":false,"pushed_at":"2025-09-09T11:01:30.000Z","size":1343,"stargazers_count":32,"open_issues_count":4,"forks_count":3,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-09-09T13:46:25.661Z","etag":null,"topics":["cloud-spanner","go","golang","grpc","iam","iam-policy","protobuf"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/go.einride.tech/iam","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/einride.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-03-31T13:03:29.000Z","updated_at":"2025-09-09T10:59:35.000Z","dependencies_parsed_at":"2024-04-15T06:52:20.087Z","dependency_job_id":"8fb69dd5-926b-419b-98cc-74c80bde6f1e","html_url":"https://github.com/einride/iam-go","commit_stats":null,"previous_names":[],"tags_count":76,"template":false,"template_full_name":null,"purl":"pkg:github/einride/iam-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/einride%2Fiam-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/einride%2Fiam-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/einride%2Fiam-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/einride%2Fiam-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/einride","download_url":"https://codeload.github.com/einride/iam-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/einride%2Fiam-go/sbom","scorecard":{"id":370071,"data":{"date":"2025-08-11","repo":{"name":"github.com/einride/iam-go","commit":"e05436f0efa1958ddef5cd98ed421fe1630938b1"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.2,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: topLevel permissions set to 'write-all': .github/workflows/release.yml:7"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":10,"reason":"all changesets reviewed","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":2,"reason":"3 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: SECURITY.md:1","Info: Found linked content: SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1","Info: Found text in security policy: SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/einride/iam-go/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/release.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/einride/iam-go/release.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/stale.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/einride/iam-go/stale.yml/master?enable=pin","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.56.1 not signed: https://api.github.com/repos/einride/iam-go/releases/208100716","Warn: release artifact v0.56.0 not signed: https://api.github.com/repos/einride/iam-go/releases/180387530","Warn: release artifact v0.56.1 does not have provenance: https://api.github.com/repos/einride/iam-go/releases/208100716","Warn: release artifact v0.56.0 does not have provenance: https://api.github.com/repos/einride/iam-go/releases/180387530"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":5,"reason":"branch protection is not maximal on development and all release branches","details":["Info: 'allow deletion' disabled on branch 'master'","Info: 'force pushes' disabled on branch 'master'","Info: 'branch protection settings apply to administrators' is required to merge on branch 'master'","Warn: 'stale review dismissal' is disabled on branch 'master'","Warn: required approving review count is 1 on branch 'master'","Info: codeowner review is required on branch 'master'","Warn: 'last push approval' is disabled on branch 'master'","Info: status check found to merge onto on branch 'master'","Info: PRs are required in order to make changes on branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":7,"reason":"3 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2025-3487 / GHSA-hcg3-q754-cr77","Warn: Project is vulnerable to: GO-2025-3503 / GHSA-qxp5-gwg8-xv66","Warn: Project is vulnerable to: GO-2025-3595 / GHSA-vvgc-356p-c3xw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":-1,"reason":"internal error: internal error: Client.Checks.ListCheckRunsForRef: error during graphqlHandler.setupCheckRuns: non-200 OK status code: 502 Bad Gateway body: \"\u003chtml\u003e\\r\\n\u003chead\u003e\u003ctitle\u003e502 Bad Gateway\u003c/title\u003e\u003c/head\u003e\\r\\n\u003cbody\u003e\\r\\n\u003ccenter\u003e\u003ch1\u003e502 Bad Gateway\u003c/h1\u003e\u003c/center\u003e\\r\\n\u003chr\u003e\u003ccenter\u003enginx\u003c/center\u003e\\r\\n\u003c/body\u003e\\r\\n\u003c/html\u003e\\r\\n\"","details":null,"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T12:44:35.440Z","repository_id":37534849,"created_at":"2025-08-18T12:44:35.440Z","updated_at":"2025-08-18T12:44:35.440Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275457687,"owners_count":25468239,"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","status":"online","status_checked_at":"2025-09-16T02:00:10.229Z","response_time":65,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cloud-spanner","go","golang","grpc","iam","iam-policy","protobuf"],"created_at":"2024-11-10T13:21:21.339Z","updated_at":"2025-09-16T17:38:50.662Z","avatar_url":"https://github.com/einride.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IAM Go\n\nAn opinionated Open Source implementation of the\n[google.iam.v1.IAMPolicy](https://github.com/googleapis/googleapis/blob/master/google/iam/v1/iam_policy.proto)\nservice API, using [Cloud Spanner](https://cloud.google.com/spanner) for\nstorage.\n\n## Usage\n\n### 1) Install\n\n```bash\n$ go get go.einride.tech/iam\n```\n\n### 2) Include the IAMPolicy mixin in your gRPC service\n\nSee\n[google.iam.v1.IAMPolicy](https://github.com/googleapis/googleapis/blob/master/google/iam/v1/iam_policy.proto).\n\n```proto\npackage your.pkg;\n\nimport \"google/iam/v1/iam_policy.proto\";\nimport \"google/iam/v1/policy.proto\";\n\nservice YourService {\n  /* ... */\n\n  rpc SetIamPolicy(google.iam.v1.SetIamPolicyRequest) returns (google.iam.v1.Policy);\n  rpc GetIamPolicy(google.iam.v1.GetIamPolicyRequest) returns (google.iam.v1.Policy);\n  rpc TestIamPermissions(google.iam.v1.TestIamPermissionsRequest) returns (google.iam.v1.TestIamPermissionsResponse);\n}\n```\n\n### 3) Embed the IAMServer implementation in your server\n\nSee [iamspanner.IAMServer](./iamspanner/server.go).\n\n```go\n// Server implements your gRPC API.\ntype Server struct {\n\t*iamspanner.IAMServer\n\t// ...\n}\n\n// Server now also implements the iam.IAMPolicyServer mixin.\nvar _ iam.IAMPolicyServer = \u0026Server{}\n```\n\n### 4) Include the IAM policy bindings table in your Spanner SQL schema\n\nSee [schema.sql](./iamspanner/schema.sql).\n\n### 5) Annotate your gRPC methods\n\nBuf annotations for rpc method authorization are described in\n[annotations.proto](../proto/einride/iam/v1/annotations.proto)\n\n```proto\npackage your.pkg;\n\nimport \"einride/iam/v1/annotations.proto\";\n\nservice YourService {\n  rpc YourMethod(YourMethodRequest) returns YourMethodResponse {\n      option (einride.iam.v1.method_authorization) = {\n        permission: \"namespace.entity.method\"\n        before: {\n          expression: \"test(caller, request.entity)\" // iamcel expression\n          description: \"The caller must have method permission against the entity\"\n        }\n      };\n    };\n}\n\nmessage YourMethodRequest {\n  string entity = 1 [\n    (google.api.resource_reference) = {\n      type: \"example.com/Entity\"\n    }\n  ];\n};\n```\n\n```proto\npackage your.pkg;\n\nimport \"einride/iam/v1/annotations.proto\";\n\nservice YourService {\n  rpc YourMethod(YourMethodRequest) returns YourMethodResponse {\n      option (einride.iam.v1.method_authorization) = {\n        resource_permissions {\n          resource_permission {\n            resource: {\n              type: \"example.com/Entity1\"\n            }\n            permission: \"namespace.entity1.method\"\n          }\n          resource_permission {\n            resource: {\n              type: \"example.com/Entity2\"\n            }\n            permission: \"namespace.entity2.method\"\n          }\n        }\n        after: {\n          expression: \"test_all(caller, response.entities)\" // iamcel expression\n          description: \"The caller must have method permission against all entities\"\n        }\n      };\n    };\n}\n\nmessage YourMethodResponse {\n  // Elements in this list are either Entity1 or Entity2 references\n  repeated string entities = 1;\n};\n```\n\nExpresssions in the `method_authorization` annotation use\n[cel-go](https://github.com/google/cel-go) with [iamcel](./iamcel) extensions.\nThe `iamcel` extensions provide the following cel functions.\n\n#### [`test(caller Caller, resource string) bool`](./iamcel/test.go)\n\nTests `caller`s permissions against `resource`.\n\n#### [`test_all(caller Caller, resources []string) bool`](./iamcel/testall.go)\n\nTests `caller`s permissions against all `resources`. This test asserts that the\ncaller has the permission against all resources.\n\n#### [`test_any(caller Caller, resources []string) bool`](./iamcel/testany.go)\n\nTests `caller`s permissions against any `resources`. This test asserts that the\ncaller has the permission against at least one resource.\n\n#### [`ancestor(resource string, pattern string) string`](./iamcel/ancestor.go)\n\nResolves an ancestor of `resource` using `pattern`. An input of\n`ancestor(\"foo/1/bar/2\", \"foo/{foo}\")` will yield the result `\"foo/1\"`.\n\n#### [`join(parent string, resource string) string`](./iamcel/join.go)\n\nJoins a `resource` name with a `parent` resource name. An input of\n`join(\"foo/1\", \"bar/2\")` will yield the result `\"foo/1/bar/2\"`.\n\n#### [`caller.member(kind string) string`](./iamcel/member.go)\n\nReturns the first IAM member value from the caller's member list which matches\nthe member kind, or fails if there are no such kind.\n\n### 6) Generate authorization middleware\n\nComing soon.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feinride%2Fiam-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feinride%2Fiam-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feinride%2Fiam-go/lists"}