mirror of https://github.com/minio/minio.git
Compare commits
5 Commits
401005096d
...
50f2ba2925
| Author | SHA1 | Date |
|---|---|---|
|
|
50f2ba2925 | |
|
|
de234b888c | |
|
|
e0182b85e0 | |
|
|
9611aa9b15 | |
|
|
bebf04e2b6 |
|
|
@ -1827,17 +1827,19 @@ func (a adminAPIHandlers) SetPolicyForUserOrGroup(w http.ResponseWriter, r *http
|
||||||
iamLogIf(ctx, err)
|
iamLogIf(ctx, err)
|
||||||
} else if foundGroupDN == nil || !underBaseDN {
|
} else if foundGroupDN == nil || !underBaseDN {
|
||||||
err = errNoSuchGroup
|
err = errNoSuchGroup
|
||||||
}
|
} else {
|
||||||
entityName = foundGroupDN.NormDN
|
entityName = foundGroupDN.NormDN
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
var foundUserDN *xldap.DNSearchResult
|
var foundUserDN *xldap.DNSearchResult
|
||||||
if foundUserDN, err = globalIAMSys.LDAPConfig.GetValidatedDNForUsername(entityName); err != nil {
|
if foundUserDN, err = globalIAMSys.LDAPConfig.GetValidatedDNForUsername(entityName); err != nil {
|
||||||
iamLogIf(ctx, err)
|
iamLogIf(ctx, err)
|
||||||
} else if foundUserDN == nil {
|
} else if foundUserDN == nil {
|
||||||
err = errNoSuchUser
|
err = errNoSuchUser
|
||||||
}
|
} else {
|
||||||
entityName = foundUserDN.NormDN
|
entityName = foundUserDN.NormDN
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL)
|
writeErrorResponseJSON(ctx, w, toAdminAPIErr(ctx, err), r.URL)
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -524,6 +524,7 @@ func lookupConfigs(s config.Config, objAPI ObjectLayer) {
|
||||||
configLogIf(ctx, fmt.Errorf("Invalid site configuration: %w", err))
|
configLogIf(ctx, fmt.Errorf("Invalid site configuration: %w", err))
|
||||||
}
|
}
|
||||||
globalSite.Update(siteCfg)
|
globalSite.Update(siteCfg)
|
||||||
|
xhttp.SetSiteName(globalSite.Name())
|
||||||
|
|
||||||
globalAutoEncryption = crypto.LookupAutoEncryption() // Enable auto-encryption if enabled
|
globalAutoEncryption = crypto.LookupAutoEncryption() // Enable auto-encryption if enabled
|
||||||
if globalAutoEncryption && GlobalKMS == nil {
|
if globalAutoEncryption && GlobalKMS == nil {
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,9 @@ var (
|
||||||
|
|
||||||
// GlobalDeploymentID - is sent in the header to all http targets
|
// GlobalDeploymentID - is sent in the header to all http targets
|
||||||
GlobalDeploymentID string
|
GlobalDeploymentID string
|
||||||
|
|
||||||
|
// GlobalSiteName - is sent in the header to all http targets
|
||||||
|
GlobalSiteName string
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
@ -236,3 +239,8 @@ func SetMinIOVersion(version string) {
|
||||||
func SetDeploymentID(deploymentID string) {
|
func SetDeploymentID(deploymentID string) {
|
||||||
GlobalDeploymentID = deploymentID
|
GlobalDeploymentID = deploymentID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SetSiteName -- user defined site from environment variable `MINIO_SITE_NAME` or from configuration `site.name`
|
||||||
|
func SetSiteName(siteName string) {
|
||||||
|
GlobalSiteName = siteName
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,6 +52,7 @@ func GetAuditEntry(ctx context.Context) *audit.Entry {
|
||||||
r = &audit.Entry{
|
r = &audit.Entry{
|
||||||
Version: internalAudit.Version,
|
Version: internalAudit.Version,
|
||||||
DeploymentID: xhttp.GlobalDeploymentID,
|
DeploymentID: xhttp.GlobalDeploymentID,
|
||||||
|
SiteName: xhttp.GlobalSiteName,
|
||||||
Time: time.Now().UTC(),
|
Time: time.Now().UTC(),
|
||||||
}
|
}
|
||||||
return r
|
return r
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,7 @@ func NewEntry(deploymentID string) audit.Entry {
|
||||||
return audit.Entry{
|
return audit.Entry{
|
||||||
Version: Version,
|
Version: Version,
|
||||||
DeploymentID: deploymentID,
|
DeploymentID: deploymentID,
|
||||||
|
SiteName: xhttp.GlobalSiteName,
|
||||||
Time: time.Now().UTC(),
|
Time: time.Now().UTC(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue