validation

package
v0.0.0-...-d3da680 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package validation contains code to validate the configs used by auth service.

Index

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

func GetRealmsCfgPath(ctx context.Context) string

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

func RegisterRealmsCfgValidation(ctx context.Context)

RegisterRealmsCfgValidation adds realms config file validation based on the environment (i.e. development vs production).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL