testDBAuthzRole returns a context with a subject that has a role with permissions required for test setup.
(ctx context.Context)
| 935 | // testDBAuthzRole returns a context with a subject that has a role |
| 936 | // with permissions required for test setup. |
| 937 | func testDBAuthzRole(ctx context.Context) context.Context { |
| 938 | return dbauthz.As(ctx, rbac.Subject{ |
| 939 | ID: uuid.Nil.String(), |
| 940 | Roles: rbac.Roles([]rbac.Role{ |
| 941 | { |
| 942 | Identifier: rbac.RoleIdentifier{Name: "testing"}, |
| 943 | DisplayName: "Unit Tests", |
| 944 | Site: rbac.Permissions(map[string][]policy.Action{ |
| 945 | rbac.ResourceWildcard.Type: {policy.WildcardSymbol}, |
| 946 | }), |
| 947 | User: []rbac.Permission{}, |
| 948 | ByOrgID: map[string]rbac.OrgPermissions{}, |
| 949 | }, |
| 950 | }), |
| 951 | Scope: rbac.ScopeAll, |
| 952 | }) |
| 953 | } |
| 954 | |
| 955 | // restartableListener is a TCP listener that can have all of it's connections |
| 956 | // severed on demand. |
no test coverage detected