mirror of
https://github.com/argoproj/argo-cd
synced 2026-05-24 01:38:43 +00:00
fix: Support argocd app diff --local and argocd app sync --local with custom plugins (#3733)
* settingsMgr returns plugins list When login successful or When API server DisableAuth
This commit is contained in:
parent
4032e8efd7
commit
10dc082404
2 changed files with 5 additions and 4 deletions
|
|
@ -512,7 +512,7 @@ func (a *ArgoCDServer) newGRPCServer() *grpc.Server {
|
|||
projectLock := util.NewKeyLock()
|
||||
applicationService := application.NewServer(a.Namespace, a.KubeClientset, a.AppClientset, a.appLister, a.RepoClientset, a.Cache, kubectl, db, a.enf, projectLock, a.settingsMgr)
|
||||
projectService := project.NewServer(a.Namespace, a.KubeClientset, a.AppClientset, a.enf, projectLock, a.sessionMgr, a.policyEnforcer)
|
||||
settingsService := settings.NewServer(a.settingsMgr, a)
|
||||
settingsService := settings.NewServer(a.settingsMgr, a, a.DisableAuth)
|
||||
accountService := account.NewServer(a.sessionMgr, a.settingsMgr, a.enf)
|
||||
certificateService := certificate.NewServer(a.RepoClientset, db, a.enf)
|
||||
versionpkg.RegisterVersionServiceServer(grpcS, &version.Server{})
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import (
|
|||
type Server struct {
|
||||
mgr *settings.SettingsManager
|
||||
authenticator Authenticator
|
||||
disableAuth bool
|
||||
}
|
||||
|
||||
type Authenticator interface {
|
||||
|
|
@ -22,8 +23,8 @@ type Authenticator interface {
|
|||
}
|
||||
|
||||
// NewServer returns a new instance of the Settings service
|
||||
func NewServer(mgr *settings.SettingsManager, authenticator Authenticator) *Server {
|
||||
return &Server{mgr: mgr, authenticator: authenticator}
|
||||
func NewServer(mgr *settings.SettingsManager, authenticator Authenticator, disableAuth bool) *Server {
|
||||
return &Server{mgr: mgr, authenticator: authenticator, disableAuth: disableAuth}
|
||||
}
|
||||
|
||||
// Get returns Argo CD settings
|
||||
|
|
@ -99,7 +100,7 @@ func (s *Server) Get(ctx context.Context, q *settingspkg.SettingsQuery) (*settin
|
|||
KustomizeVersions: kustomizeVersions,
|
||||
}
|
||||
|
||||
if sessionmgr.LoggedIn(ctx) {
|
||||
if sessionmgr.LoggedIn(ctx) || s.disableAuth {
|
||||
configManagementPlugins, err := s.mgr.GetConfigManagementPlugins()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
Loading…
Reference in a new issue