config/config.go
config package removed, it belongs to the authorization package and it doesn't provides functionality on his own. Moved to authorization.go
Removed these package variables:
var (
PublicKeyStr string
AdminGroup string
IgnoreExpiration bool
)
I see 2 bugs:
An authorization handler is initialized from a config and these values should be specific for the own handler, and not shared between multiple handler instances
AdminGroup is used in the getObject func (aux function for the permission table) and its only initialized by calling to Authorization, this doesn't permit to use the PermissionTable without a handler and its confusing.
Those var shouldn't be unexported for the package (solved since they are removed)
permissions.go
NewPermissionTable can do a build, Build func removed and done in the constructor.
permission as a type to clarification
Unused struct CheckPermission removed
constants.go
moved the constant to the preparePermissions func (where it is used) and changed it to unexported,
file deleted
also, I have some suggestions to do that we can talk in person :)
config/config.go config package removed, it belongs to the authorization package and it doesn't provides functionality on his own. Moved to authorization.go
Removed these package variables:
I see 2 bugs:
Those var shouldn't be unexported for the package (solved since they are removed)
permissions.go NewPermissionTable can do a build, Build func removed and done in the constructor. permission as a type to clarification
Unused struct CheckPermission removed
constants.go moved the constant to the preparePermissions func (where it is used) and changed it to unexported, file deleted
also, I have some suggestions to do that we can talk in person :)