Remove Operator mode references in Console mode (#884)
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
This commit is contained in:
@@ -30,7 +30,6 @@ import (
|
||||
|
||||
"github.com/minio/console/models"
|
||||
"github.com/minio/console/pkg"
|
||||
"github.com/minio/console/pkg/acl"
|
||||
"github.com/minio/console/pkg/auth"
|
||||
"github.com/minio/console/pkg/auth/ldap"
|
||||
xjwt "github.com/minio/console/pkg/auth/token"
|
||||
@@ -309,15 +308,6 @@ func (s consoleSTSAssumeRole) IsExpired() bool {
|
||||
func NewConsoleCredentials(accessKey, secretKey, location string) (*credentials.Credentials, error) {
|
||||
// Future authentication methods can be added under this switch statement
|
||||
switch {
|
||||
// authentication for Operator Console
|
||||
case acl.GetOperatorMode():
|
||||
{
|
||||
creds, err := auth.GetConsoleCredentialsForOperator(secretKey)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return creds, nil
|
||||
}
|
||||
// LDAP authentication for Console
|
||||
case ldap.GetLDAPEnabled():
|
||||
{
|
||||
|
||||
@@ -19,14 +19,13 @@ package restapi
|
||||
// list of all console environment constants
|
||||
const (
|
||||
// Constants for common configuration
|
||||
ConsoleMinIOServer = "CONSOLE_MINIO_SERVER"
|
||||
ConsoleMinIORegion = "CONSOLE_MINIO_REGION"
|
||||
ConsoleProductionMode = "CONSOLE_PRODUCTION_MODE"
|
||||
ConsoleHostname = "CONSOLE_HOSTNAME"
|
||||
ConsolePort = "CONSOLE_PORT"
|
||||
ConsoleTLSHostname = "CONSOLE_TLS_HOSTNAME"
|
||||
ConsoleTLSPort = "CONSOLE_TLS_PORT"
|
||||
ConsoleSubnetLicense = "CONSOLE_SUBNET_LICENSE"
|
||||
ConsoleMinIOServer = "CONSOLE_MINIO_SERVER"
|
||||
ConsoleMinIORegion = "CONSOLE_MINIO_REGION"
|
||||
ConsoleHostname = "CONSOLE_HOSTNAME"
|
||||
ConsolePort = "CONSOLE_PORT"
|
||||
ConsoleTLSHostname = "CONSOLE_TLS_HOSTNAME"
|
||||
ConsoleTLSPort = "CONSOLE_TLS_PORT"
|
||||
ConsoleSubnetLicense = "CONSOLE_SUBNET_LICENSE"
|
||||
|
||||
// Constants for Secure middleware
|
||||
ConsoleSecureAllowedHosts = "CONSOLE_SECURE_ALLOWED_HOSTS"
|
||||
@@ -48,21 +47,9 @@ const (
|
||||
ConsoleSecureReferrerPolicy = "CONSOLE_SECURE_REFERRER_POLICY"
|
||||
ConsoleSecureFeaturePolicy = "CONSOLE_SECURE_FEATURE_POLICY"
|
||||
ConsoleSecureExpectCTHeader = "CONSOLE_SECURE_EXPECT_CT_HEADER"
|
||||
ConsoleOperatorConsoleImage = "CONSOLE_OPERATOR_CONSOLE_IMAGE"
|
||||
PrometheusURL = "CONSOLE_PROMETHEUS_URL"
|
||||
PrometheusJobID = "CONSOLE_PROMETHEUS_JOB_ID"
|
||||
ConsoleLogQueryURL = "CONSOLE_LOG_QUERY_URL"
|
||||
ConsoleLogQueryAuthToken = "CONSOLE_LOG_QUERY_AUTH_TOKEN"
|
||||
LogSearchQueryAuthToken = "LOGSEARCH_QUERY_AUTH_TOKEN"
|
||||
)
|
||||
|
||||
// Image versions
|
||||
const (
|
||||
ConsoleImageDefaultVersion = "minio/console:v0.7.5"
|
||||
)
|
||||
|
||||
// K8s
|
||||
|
||||
const (
|
||||
OperatorSubnetLicenseSecretName = "subnet-license"
|
||||
)
|
||||
|
||||
@@ -193,8 +193,6 @@ func getLoginDetailsResponse() (*models.LoginDetails, *models.Error) {
|
||||
// Validate user against IDP
|
||||
identityProvider := &auth.IdentityProvider{Client: oauth2Client}
|
||||
redirectURL = identityProvider.GenerateLoginURL()
|
||||
} else if acl.GetOperatorMode() {
|
||||
loginStrategy = models.LoginDetailsLoginStrategyServiceDashAccount
|
||||
}
|
||||
|
||||
loginDetails := &models.LoginDetails{
|
||||
|
||||
@@ -40,9 +40,10 @@ func validateDistributedMode(session *models.Principal) bool {
|
||||
|
||||
info, err := client.AccountInfo(ctx)
|
||||
|
||||
// We couldn't retrieve admin information
|
||||
// We couldn't retrieve admin information, default to true for legacy reasons
|
||||
// TODO: Revert to false after August 15th 2021
|
||||
if err != nil {
|
||||
return false
|
||||
return true
|
||||
}
|
||||
|
||||
backendInfo := info.Server
|
||||
@@ -72,7 +73,7 @@ func getSessionResponse(session *models.Principal) (*models.SessionResponse, *mo
|
||||
Pages: acl.GetAuthorizedEndpoints(session.Actions),
|
||||
Features: getListOfEnabledFeatures(),
|
||||
Status: models.SessionResponseStatusOk,
|
||||
Operator: acl.GetOperatorMode(),
|
||||
Operator: false,
|
||||
DistributedMode: validateDistributedMode(session),
|
||||
}
|
||||
return sessionResp, nil
|
||||
|
||||
Reference in New Issue
Block a user