Documentation ¶
Overview ¶
Package validation contains code to validate the configs used by auth service.
Index ¶
- Constants
- func GetRealmsCfgPath(ctx context.Context) string
- func GetSubnets(allowlists []*configspb.IPAllowlistConfig_IPAllowlist) (map[string][]string, error)
- func NewRealmsValidator(db *permissions.PermissionsDB, allowInternal bool) *realmsValidator
- func RegisterRealmsCfgValidation(ctx context.Context)
Constants ¶
View Source
const ( // The AppID of the deployed development environment, so the correct realms // config path will be used. DevAppID = "chrome-infra-auth-dev" // Paths to use within a project or service's folder when looking // for realms configs. RealmsProdCfgPath = "realms.cfg" RealmsDevCfgPath = "realms-dev.cfg" )
Variables ¶
This section is empty.
Functions ¶
func GetRealmsCfgPath ¶
GetRealmsCfgPath returns the appropriate realms config path, depending on whether the environment is for development or production.
func GetSubnets ¶
func GetSubnets(allowlists []*configspb.IPAllowlistConfig_IPAllowlist) (map[string][]string, error)
GetSubnets validates the includes of all allowlists and generates a map {allowlistName: []subnets}.
func NewRealmsValidator ¶
func NewRealmsValidator(db *permissions.PermissionsDB, allowInternal bool) *realmsValidator
NewRealmsValidator returns a realms validator using the given permissions DB and flag for whether internal permissions and roles references are allowed.
func RegisterRealmsCfgValidation ¶
RegisterRealmsCfgValidation adds realms config file validation based on the environment (i.e. development vs production).
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.