feat: add CoreServiceBindings interface to ServiceDeps

This commit is contained in:
Alex Dunmow 2026-05-02 11:02:08 +08:00
parent d270bc8582
commit a174eb943d
2 changed files with 16 additions and 0 deletions

13
plugin/community.go Normal file
View File

@ -0,0 +1,13 @@
package plugin
import (
"git.dev.alexdunmow.com/block/core/rbac"
)
// CoreServiceBindings provides pre-built CMS service bindings that plugins
// can include in their ServiceRegistration with custom RBAC role mappings.
// The CMS constructs the actual service handlers — plugins just specify which
// services to mount and what roles apply.
type CoreServiceBindings interface {
Bind(serviceName string, methodRoles map[string]rbac.Role) (ConnectServiceBinding, error)
}

View File

@ -46,6 +46,9 @@ type ServiceDeps struct {
// Plugin interop
Bridge PluginBridge
// Core RPC services — pre-built bindings for CMS-provided services
CoreServiceBindings CoreServiceBindings
// Extension points — typed as narrow interfaces where possible
JobRunner JobRunner
EmbeddingService EmbeddingService