fix(rpc): map the release:write scope to the contract
- commit
- b8fe0a446e2d7c28fecaf11632dbd33777377dca
- author
- brice · · 2026-10-21 14:54 UTC
- committer
- brice · · 2026-10-21 17:53 UTC
- parent
- f9e6941
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
2 files · +2 -0
M internal/adapters/client/scopes_test.go +1 -0
| @@ -28,6 +28,7 @@ func TestScopeWireNames(t *testing.T) { | |||
| 28 | 28 | ermite.Scope_SCOPE_RUNNER_REGISTER: "runner:register", | |
| 29 | 29 | ermite.Scope_SCOPE_TOKEN_ADMIN: "token:admin", | |
| 30 | 30 | ermite.Scope_SCOPE_ISSUE_WRITE: "issue:write", | |
| 31 | + | ermite.Scope_SCOPE_RELEASE_WRITE: "release:write", | |
| 31 | 32 | } | |
| 32 | 33 | for s, name := range want { | |
| 33 | 34 | assert.Equal(t, name, client.ScopeName(s)) | |
| @@ -28,6 +28,7 @@ func TestScopeWireNames(t *testing.T) { | |||||
| 28 | ermite.Scope_SCOPE_RUNNER_REGISTER: "runner:register", | 28 | ermite.Scope_SCOPE_RUNNER_REGISTER: "runner:register", | ||
| 29 | ermite.Scope_SCOPE_TOKEN_ADMIN: "token:admin", | 29 | ermite.Scope_SCOPE_TOKEN_ADMIN: "token:admin", | ||
| 30 | ermite.Scope_SCOPE_ISSUE_WRITE: "issue:write", | 30 | ermite.Scope_SCOPE_ISSUE_WRITE: "issue:write", | ||
| 31 | + | ermite.Scope_SCOPE_RELEASE_WRITE: "release:write", | |||
| 31 | } | 32 | } | ||
| 32 | for s, name := range want { | 33 | for s, name := range want { | ||
| 33 | assert.Equal(t, name, client.ScopeName(s)) | 34 | assert.Equal(t, name, client.ScopeName(s)) | ||
M internal/adapters/rpc/convert.go +1 -0
| @@ -137,6 +137,7 @@ var scopeToPB = map[domain.Scope]pb.Scope{ | |||
| 137 | 137 | domain.ScopeRunnerRegister: pb.Scope_SCOPE_RUNNER_REGISTER, | |
| 138 | 138 | domain.ScopeTokenAdmin: pb.Scope_SCOPE_TOKEN_ADMIN, | |
| 139 | 139 | domain.ScopeIssueWrite: pb.Scope_SCOPE_ISSUE_WRITE, | |
| 140 | + | domain.ScopeReleaseWrite: pb.Scope_SCOPE_RELEASE_WRITE, | |
| 140 | 141 | } | |
| 141 | 142 | ||
| 142 | 143 | func scopeFromPB(s pb.Scope) (domain.Scope, error) { | |
| @@ -137,6 +137,7 @@ var scopeToPB = map[domain.Scope]pb.Scope{ | |||||
| 137 | domain.ScopeRunnerRegister: pb.Scope_SCOPE_RUNNER_REGISTER, | 137 | domain.ScopeRunnerRegister: pb.Scope_SCOPE_RUNNER_REGISTER, | ||
| 138 | domain.ScopeTokenAdmin: pb.Scope_SCOPE_TOKEN_ADMIN, | 138 | domain.ScopeTokenAdmin: pb.Scope_SCOPE_TOKEN_ADMIN, | ||
| 139 | domain.ScopeIssueWrite: pb.Scope_SCOPE_ISSUE_WRITE, | 139 | domain.ScopeIssueWrite: pb.Scope_SCOPE_ISSUE_WRITE, | ||
| 140 | + | domain.ScopeReleaseWrite: pb.Scope_SCOPE_RELEASE_WRITE, | |||
| 140 | } | 141 | } | ||
| 141 | 142 | ||||
| 142 | func scopeFromPB(s pb.Scope) (domain.Scope, error) { | 143 | func scopeFromPB(s pb.Scope) (domain.Scope, error) { | ||