fix(webui): resolve a selected org's workspaces as the caller, wire selection into gateway and harness, and let a member start tasks in the org they selected

This commit is contained in:
sam committed 2026-10-27 11:06:18 +11:00
1 parent c3d49cbc6c
commit 4bb473c0b0
12 files changed
+101 -21

No files matched your search

+3 -1
View File
@@ -19,6 +19,7 @@ import (
"github.com/samcharles93/archie-core/internal/container"
daemonpb "github.com/samcharles93/archie-core/internal/contracts/daemon/v1"
pb "github.com/samcharles93/archie-core/internal/contracts/harness/v1"
"github.com/samcharles93/archie-core/internal/domain/access"
"github.com/samcharles93/archie-core/internal/domain/org"
"github.com/samcharles93/archie-core/internal/domain/presence"
"github.com/samcharles93/archie-core/internal/infrastructure/harnesssession"
@@ -207,7 +208,8 @@ func (b *boot) setupDaemonRPC(ctx context.Context) {
b.log.WarnContext(ctx, "harness sessions disabled: listen", "err", err)
return
}
callers := rpcidentity.Callers{Principals: b.d.Principals}
workspaces, _ := b.stateStore.(access.WorkspaceLister)
callers := rpcidentity.Callers{Principals: b.d.Principals, Workspaces: workspaces}
srv := grpc.NewServer(append(servicekit.ServerLimits(), creds, grpc.ChainUnaryInterceptor(callers.Unary()), grpc.ChainStreamInterceptor(callers.Stream()))...)
daemonpb.RegisterDaemonServiceServer(srv, &repositoryServer{boot: b})
// Terminal sessions still require certificates and a container launcher.
+2 -2
View File
@@ -87,12 +87,12 @@ const inboundMessageHeadroomBytes = 1 << 20
// request carries a channel attachment's bytes: the channel frontend
// downloads the file, and this process -- which runs the turn -- holds no
// platform credential to fetch it again.
func gatewayServerOpts(listen string, id *rpctls.Identity, principals access.PrincipalSource) ([]grpc.ServerOption, error) {
func gatewayServerOpts(listen string, id *rpctls.Identity, principals access.PrincipalSource, workspaces access.WorkspaceLister) ([]grpc.ServerOption, error) {
creds, err := id.ServerOption(listen, false)
if err != nil {
return nil, fmt.Errorf("gateway: %w", err)
}
callers := rpcidentity.Callers{Principals: principals}
callers := rpcidentity.Callers{Principals: principals, Workspaces: workspaces}
return []grpc.ServerOption{
creds,
grpc.MaxRecvMsgSize(messaging.MaxInboundAttachmentBytes + inboundMessageHeadroomBytes),
+1 -1
View File
@@ -128,7 +128,7 @@ func Run(ctx context.Context, options Options) error {
if err != nil {
return err
}
opts, err := gatewayServerOpts(listen, b.id, b.stateStore)
opts, err := gatewayServerOpts(listen, b.id, b.stateStore, b.stateStore)
if err != nil {
return err
}