mirror of
https://github.com/project-zot/zot.git
synced 2026-06-17 12:58:02 +08:00
Remove AllowReadOnly and ReadOnly
Signed-off-by: Nicol Draghici <idraghic@cisco.com> Remove check and set header every time Signed-off-by: Nicol Draghici <idraghic@cisco.com>
This commit is contained in:
committed by
Ramkumar Chinchani
parent
a5ed99178e
commit
a702a2377e
@@ -68,8 +68,6 @@ type HTTPConfig struct {
|
||||
Auth *AuthConfig
|
||||
RawAccessControl map[string]interface{} `mapstructure:"accessControl,omitempty"`
|
||||
Realm string
|
||||
AllowReadAccess bool `mapstructure:",omitempty"`
|
||||
ReadOnly bool `mapstructure:",omitempty"`
|
||||
Ratelimit *RatelimitConfig `mapstructure:",omitempty"`
|
||||
}
|
||||
|
||||
@@ -112,8 +110,9 @@ type AccessControlConfig struct {
|
||||
type Repositories map[string]PolicyGroup
|
||||
|
||||
type PolicyGroup struct {
|
||||
Policies []Policy
|
||||
DefaultPolicy []string
|
||||
Policies []Policy
|
||||
DefaultPolicy []string
|
||||
AnonymousPolicy []string
|
||||
}
|
||||
|
||||
type Policy struct {
|
||||
@@ -193,8 +192,11 @@ func (c *Config) LoadAccessControlConfig(viperInstance *viper.Viper) error {
|
||||
}
|
||||
|
||||
defaultPolicy := viperInstance.GetStringSlice(fmt.Sprintf("http::accessControl::%s::defaultPolicy", policy))
|
||||
policyGroup.Policies = policies
|
||||
policyGroup.DefaultPolicy = defaultPolicy
|
||||
|
||||
anonymousPolicy := viperInstance.GetStringSlice(fmt.Sprintf("http::accessControl::%s::anonymousPolicy", policy))
|
||||
policyGroup.Policies = policies
|
||||
policyGroup.AnonymousPolicy = anonymousPolicy
|
||||
c.AccessControl.Repositories[policy] = policyGroup
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user