You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 15, 2024. It is now read-only.
As an example, here is how the Config.DisabledUsersFile() method is defined:
// DisabledUsersFile returns the user-provided path to the EZproxy include// file where this application should write disabled user accounts or the// default value if not provided. CLI flag values take precedence if provided.func (cConfig) DisabledUsersFile() string {
switch {
casec.cliConfig.DisabledUsers.File!=nil:
return*c.cliConfig.DisabledUsers.Filecasec.fileConfig.DisabledUsers.File!=nil:
return*c.fileConfig.DisabledUsers.Filedefault:
// FIXME: During development the default is set to a fixed/temporary// path. Before MVP deployment the defaults should be changed to empty// strings?returndefaultDisabledUsersFile
}
}
and here is how the defaultDisabledUsersFile constant is defined (spacing tweaked):
and here is how it is checked inside of Config.validate():
ifc.DisabledUsersFile() =="" {
returnfmt.Errorf("path to disabled users file not provided")
}
If the sysadmin provides no value for the configuration setting they will end up with /var/cache/brick/users.brick-disabled.txt as the default value, otherwise if they specify something that will be the value returned by the Getter method. Lastly, if they supply a blank response they'll either get "caught" by the flag or config-file handling packages or the Config.validate() method will catch it and complain.
Is this the desired behavior? If so, what about other defaultXYZ constants which supply values when omitted by the sysadmin?
As an example, here is how the
Config.DisabledUsersFile()
method is defined:and here is how the
defaultDisabledUsersFile
constant is defined (spacing tweaked):and here is how it is checked inside of
Config.validate()
:If the sysadmin provides no value for the configuration setting they will end up with
/var/cache/brick/users.brick-disabled.txt
as the default value, otherwise if they specify something that will be the value returned by the Getter method. Lastly, if they supply a blank response they'll either get "caught" by the flag or config-file handling packages or theConfig.validate()
method will catch it and complain.Is this the desired behavior? If so, what about other
defaultXYZ
constants which supply values when omitted by the sysadmin?Worth emphasizing: this is already the documented behavior as of v0.1.1 (https://github.com/atc0005/brick/blob/v0.1.1/docs/configure.md).
The text was updated successfully, but these errors were encountered: