| 169 | } |
| 170 | |
| 171 | func (s *Service) syncPluginRuntimeConfig(ctx context.Context) bool { |
| 172 | if s == nil { |
| 173 | sdkAuth.RegisterPluginAuthParser(nil) |
| 174 | return false |
| 175 | } |
| 176 | if ctx == nil { |
| 177 | ctx = context.Background() |
| 178 | } |
| 179 | |
| 180 | s.cfgMu.RLock() |
| 181 | cfg := s.cfg |
| 182 | s.cfgMu.RUnlock() |
| 183 | |
| 184 | if s.pluginHost != nil { |
| 185 | s.pluginHost.ApplyConfig(ctx, cfg) |
| 186 | } |
| 187 | if s.coreManager != nil { |
| 188 | s.coreManager.SetPluginScheduler(s.pluginHost) |
| 189 | } |
| 190 | s.registerPluginAuthParser() |
| 191 | if s.pluginHost == nil { |
| 192 | return false |
| 193 | } |
| 194 | s.pluginHost.RegisterFrontendAuthProviders() |
| 195 | if s.accessManager != nil { |
| 196 | s.accessManager.SetProviders(sdkaccess.RegisteredProviders()) |
| 197 | } |
| 198 | s.pluginHost.RegisterUsagePlugins() |
| 199 | sdktranslator.SetPluginHooks(s.pluginHost) |
| 200 | if s.server != nil { |
| 201 | s.server.RefreshPluginManagementRoutes() |
| 202 | } |
| 203 | return true |
| 204 | } |
| 205 | |
| 206 | func (s *Service) syncPluginModelRuntime(ctx context.Context) { |
| 207 | if s == nil || s.pluginHost == nil || s.coreManager == nil { |