Remove more unused APIs (#3537)

* Remove more unused APIs

* prettier

* Fix Test

* Fix tests

* Remove SSO Integreation

* fix tests

* lint
This commit is contained in:
Daniel Valdivia
2025-05-14 15:41:50 -07:00
committed by GitHub
parent e2bbf91e8a
commit 3dc0fdc039
50 changed files with 74 additions and 4337 deletions

View File

@@ -35,8 +35,6 @@ import (
"github.com/minio/console/api/operations"
authApi "github.com/minio/console/api/operations/auth"
"github.com/minio/console/models"
"github.com/minio/console/pkg/auth/idp/oauth2"
"github.com/minio/console/pkg/auth/ldap"
)
type Conditions struct {
@@ -240,7 +238,7 @@ func getSessionResponse(ctx context.Context, session *models.Principal) (*models
envConstants.MaxConcurrentDownloads = getMaxConcurrentDownloadsLimit()
sessionResp := &models.SessionResponse{
Features: getListOfEnabledFeatures(ctx, userAdminClient, session),
Features: getListOfEnabledFeatures(session),
Status: models.SessionResponseStatusOk,
Operator: false,
DistributedMode: erasure,
@@ -254,21 +252,8 @@ func getSessionResponse(ctx context.Context, session *models.Principal) (*models
}
// getListOfEnabledFeatures returns a list of features
func getListOfEnabledFeatures(ctx context.Context, minioClient MinioAdmin, session *models.Principal) []string {
func getListOfEnabledFeatures(session *models.Principal) []string {
features := []string{}
logSearchURL := getLogSearchURL()
oidcEnabled := oauth2.IsIDPEnabled()
ldapEnabled := ldap.GetLDAPEnabled()
if logSearchURL != "" {
features = append(features, "log-search")
}
if oidcEnabled {
features = append(features, "oidc-idp", "external-idp")
}
if ldapEnabled {
features = append(features, "ldap-idp", "external-idp")
}
if session.Hm {
features = append(features, "hide-menu")
@@ -276,12 +261,6 @@ func getListOfEnabledFeatures(ctx context.Context, minioClient MinioAdmin, sessi
if session.Ob {
features = append(features, "object-browser-only")
}
if minioClient != nil {
_, err := minioClient.kmsStatus(ctx)
if err == nil {
features = append(features, "kms")
}
}
return features
}