fix(archied): extract accessDeps to bring stateStoreDeps under the complexity limit
The equivalent fix was made in the crew/qc8p worktree but never committed there before the merge, so the merge silently carried the pre-fix version through despite a clean, no-conflict merge. Re-applied directly on main; task check clean.
This commit is contained in:
1 file changed
+17
-13
@@ -338,19 +338,7 @@ func (b *boot) stateStoreDeps(grants *staterpc.TaskGrants) staterpc.Deps {
|
||||
if wc, ok := b.st.(storecontract.WorkflowCaller); ok {
|
||||
deps.WorkflowCalls = wc
|
||||
}
|
||||
// The policy chain and its denial records are served from the same store
|
||||
// (docs/prds/orgs-and-access.md). A store without them -- one that owns
|
||||
// no tenant boundary yet -- degrades the access RPCs rather than failing
|
||||
// the boot, the same pattern the other optional surfaces use.
|
||||
if ps, ok := b.st.(access.PrincipalSource); ok {
|
||||
deps.Principals = ps
|
||||
}
|
||||
if ps, ok := b.st.(access.PolicyStore); ok {
|
||||
deps.Policies = ps
|
||||
}
|
||||
if ds, ok := b.st.(access.DenialStore); ok {
|
||||
deps.Denials = ds
|
||||
}
|
||||
b.accessDeps(&deps)
|
||||
if css, ok := b.st.(storecontract.ConfigSnapshotStore); ok {
|
||||
deps.ConfigSnapshots = css
|
||||
}
|
||||
@@ -363,6 +351,22 @@ func (b *boot) stateStoreDeps(grants *staterpc.TaskGrants) staterpc.Deps {
|
||||
return deps
|
||||
}
|
||||
|
||||
// accessDeps wires the policy chain and its denial records from the same
|
||||
// store (docs/prds/orgs-and-access.md). A store without them -- one that owns
|
||||
// no tenant boundary yet -- degrades the access RPCs rather than failing the
|
||||
// boot, the same pattern the other optional surfaces use.
|
||||
func (b *boot) accessDeps(deps *staterpc.Deps) {
|
||||
if ps, ok := b.st.(access.PrincipalSource); ok {
|
||||
deps.Principals = ps
|
||||
}
|
||||
if ps, ok := b.st.(access.PolicyStore); ok {
|
||||
deps.Policies = ps
|
||||
}
|
||||
if ds, ok := b.st.(access.DenialStore); ok {
|
||||
deps.Denials = ds
|
||||
}
|
||||
}
|
||||
|
||||
// serveStateStore registers the StateStore gRPC service and serves it until
|
||||
// ctx ends, draining in-flight calls before returning (mirroring serveGateway
|
||||
// in gateway.go, minus the gateway's session-store argument).
|
||||
|
||||
Reference in new issue
Block a user