Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
a1dc0bd
fix(plugins): deliver only catalog events to plugins, in their public…
Quick104 Nov 4, 2026
9a32f45
feat(plugins): tell plugins about media request lifecycle events
Quick104 Nov 4, 2026
06f65c3
feat(plugins): approve plugin permissions and issue scoped host API keys
Quick104 Nov 4, 2026
7efa15b
fix(plugins): drop events whose payload doesn't fit the catalog, and …
Quick104 Nov 5, 2026
4d7277b
fix(plugins): name the requester on the request.fulfilled plugin event
Quick104 Nov 5, 2026
5cf5f1e
Merge remote-tracking branch 'origin/main' into pr3547-babysit
Quick104 Nov 5, 2026
066035f
fix(plugins): audit the host API key deletion when a plugin is uninst…
Quick104 Nov 5, 2026
037771a
fix(plugins): record the host API scopes of installations from before…
Quick104 Nov 5, 2026
2863269
Merge remote-tracking branch 'origin/feat/plugin-event-catalog' into …
Quick104 Nov 5, 2026
6ddf7a7
chore(deps): pin silo-plugin-sdk to the reviewed notification plugin …
Quick104 Nov 5, 2026
b0f5e14
fix(notifications): publish request events for plugins in order
Quick104 Nov 5, 2026
ae9c848
Merge remote-tracking branch 'origin/feat/plugin-event-catalog' into …
Quick104 Nov 5, 2026
9a5e4a1
fix(backup): carry plugin permission grants with their host API keys
Quick104 Nov 5, 2026
cbdf5fb
Merge origin/main into feat/plugin-event-catalog
Quick104 Nov 5, 2026
5d21cb3
Merge origin/feat/plugin-event-catalog into feat/plugin-permissions
Quick104 Nov 5, 2026
6af3e6c
Merge origin/main into feat/plugin-event-catalog
Quick104 Nov 6, 2026
8b840a2
fix(plugins): string IDs in catalog events, drop request events, keep…
Quick104 Nov 6, 2026
f52970c
Merge feat/plugin-event-catalog into feat/plugin-permissions
Quick104 Nov 6, 2026
6ff587b
fix(plugins): revoke a wider host API key on a narrowing upgrade, dro…
Quick104 Nov 6, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 20 additions & 7 deletions cmd/silo/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -1156,9 +1156,7 @@ func main() {
}()
}

// The plugin event dispatcher observes what this process publishes, so
// each event reaches plugins once however many nodes receive it.
eventBus := cache.NewObservedEventBus(cache.NewEventBus(cfg.Redis))
eventBus := cache.NewEventBus(cfg.Redis)
if err := eventBus.Subscribe(appCtx, cache.ChannelCatalog, func(event cache.Event) {
switch event.Type {
case cache.EventScanComplete:
Expand Down Expand Up @@ -1888,6 +1886,11 @@ func main() {
installer := plugins.NewInstaller(installationStore, plugins.InstallerOptions{
BaseDir: pluginCacheDir,
})
// Approvals rebuild every API server's event subscriber index through
// the lifecycle path; pluginService is assigned below.
pluginPermissions := plugins.NewPermissionService(installationStore, deps.SecretCipher,
auth.PluginHostAPIKeys{Keys: auth.NewAPIKeyRepository(deps.DB)},
func(ctx context.Context) { pluginService.OnLifecycleChange(ctx) })

libSource := pluginLibrarySource{groups: accessGroupStore}
if deps.FolderRepo != nil {
Expand Down Expand Up @@ -1961,9 +1964,10 @@ func main() {
return runtimeConfigStore.PutGlobalConfig(ctx, installationID, key, value)
},
),
HostInfo: hostInfo,
InstanceState: instanceStateStore,
NetworkAccess: networkAccess,
HostInfo: hostInfo,
InstanceState: instanceStateStore,
NetworkAccess: networkAccess,
HostAPICredentials: pluginPermissions,
Logger: hclog.New(&hclog.LoggerOptions{
Name: "plugin-host",
Level: hclog.Info,
Expand All @@ -1978,6 +1982,7 @@ func main() {
installer,
plugins.NewHostAdapter(pluginHost),
)
pluginService.SetPermissions(pluginPermissions)
// Crashes of resident plugins (network access providers) reach the
// supervisor through the host's exit watcher so they restart with
// backoff instead of waiting for the next lazy RPC.
Expand Down Expand Up @@ -2070,6 +2075,15 @@ func main() {
}
}
}
// Installations from before permission grants keep the event access
// they had. This runs before the catalog auto-update below, so an
// update never meets an installation without a grant to hold back
// what it newly asks for.
if granted, err := installationStore.EnsurePermissionGrants(appCtx); err != nil {
log.Fatalf("record plugin permission grants: %v", err)
} else if granted > 0 {
slog.Info("recorded plugin permission grants for existing installations", "component", "plugins", "installations", granted)
}
if err := pluginService.PreloadEnabled(appCtx); err != nil {
log.Fatalf("preload enabled plugins: %v", err)
}
Expand Down Expand Up @@ -2137,7 +2151,6 @@ func main() {
if err := dispatcher.Start(appCtx); err != nil {
log.Fatalf("plugin event dispatcher: %v", err)
}
eventBus.ObservePublishes(dispatcher.ObservePublish)
defer dispatcher.Stop()
// Rerun the lifecycle hooks registered so far. PreloadEnabled ran them
// before PublishLifecycleChanges was registered, so this call is the
Expand Down
Loading
Loading