Big update
This commit is contained in:
parent
8b607dd700
commit
2e6afc460b
474 changed files with 934 additions and 86159 deletions
|
|
@ -20,8 +20,6 @@ func newDefaultAuthManager() *sdkAuth.Manager {
|
|||
return sdkAuth.NewManager(
|
||||
sdkAuth.GetTokenStore(),
|
||||
sdkAuth.NewCodexAuthenticator(),
|
||||
sdkAuth.NewClaudeAuthenticator(),
|
||||
sdkAuth.NewXAIAuthenticator(),
|
||||
)
|
||||
}
|
||||
|
||||
|
|
@ -112,6 +110,9 @@ func (s *Service) handleAuthUpdates(ctx context.Context, updates []watcher.AuthU
|
|||
if update.Auth == nil || update.Auth.ID == "" {
|
||||
continue
|
||||
}
|
||||
if !strings.EqualFold(strings.TrimSpace(update.Auth.Provider), "codex") || update.Auth.AuthKind() != "oauth" {
|
||||
continue
|
||||
}
|
||||
auth := s.prepareCoreAuthForModelRegistration(registrationCtx, update.Auth)
|
||||
if auth == nil {
|
||||
continue
|
||||
|
|
|
|||
|
|
@ -199,18 +199,7 @@ func (s *Service) registerAvailableExecutors(ctx context.Context, opts executorR
|
|||
}
|
||||
|
||||
func baselineExecutorAuths() []*coreauth.Auth {
|
||||
providers := []string{
|
||||
"codex",
|
||||
"claude",
|
||||
constant.Gemini,
|
||||
constant.GeminiInteractions,
|
||||
"vertex",
|
||||
"aistudio",
|
||||
"antigravity",
|
||||
"kimi",
|
||||
"xai",
|
||||
"openai-compatibility",
|
||||
}
|
||||
providers := []string{"codex"}
|
||||
auths := make([]*coreauth.Auth, 0, len(providers))
|
||||
for _, provider := range providers {
|
||||
auth := &coreauth.Auth{
|
||||
|
|
|
|||
|
|
@ -130,26 +130,6 @@ func (s *Service) Run(ctx context.Context) error {
|
|||
s.startHomeSubscriber(ctx)
|
||||
}
|
||||
|
||||
if s.server != nil && s.wsGateway != nil {
|
||||
s.server.AttachWebsocketRoute(s.wsGateway.Path(), s.wsGateway.Handler())
|
||||
s.server.SetWebsocketAuthChangeHandler(func(oldEnabled, newEnabled bool) {
|
||||
if oldEnabled == newEnabled {
|
||||
return
|
||||
}
|
||||
if !oldEnabled && newEnabled {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer cancel()
|
||||
if errStop := s.wsGateway.Stop(ctx); errStop != nil {
|
||||
log.Warnf("failed to reset websocket connections after ws-auth change %t -> %t: %v", oldEnabled, newEnabled, errStop)
|
||||
return
|
||||
}
|
||||
log.Debugf("ws-auth enabled; existing websocket sessions terminated to enforce authentication")
|
||||
return
|
||||
}
|
||||
log.Debugf("ws-auth disabled; existing websocket sessions remain connected")
|
||||
})
|
||||
}
|
||||
|
||||
if s.hooks.OnBeforeStart != nil {
|
||||
s.hooks.OnBeforeStart(s.cfg)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue