// newIdentityWhitelistMap takes a slice of policies and creates a hashmap of identity
// authorizations per-route for each allowed group, domain, and email.
newIdentityWhitelistMap takes a slice of policies and creates a hashmap of identity
authorizations per-route for each allowed group, domain, and email.
// newIdentityWhitelistMap takes a slice of policies and creates a hashmap of identity // authorizations per - route for each allowed group domain and email .
func newIdentityWhitelistMap(policies []policy.Policy) *identityWhitelist {
	var im identityWhitelist
	im.m = make(map[string]bool, len(policies)*3)
	for _, p := range policies {
		for _, group := range p.AllowedGroups {
			log.Debug().Str("route", p.From).Str("group", group).Msg("add group")
			im.PutGroup(p.From, group)
		}
		for _, domain := range p.AllowedDomains {
			im.PutDomain(p.From, domain)
			log.Debug().Str("route", p.From).Str("group", domain).Msg("add domain")
		}
		for _, email := range p.AllowedEmails {
			im.PutEmail(p.From, email)
			log.Debug().Str("route", p.From).Str("group", email).Msg("add email")
		}
	}
	return &im
}
func newIdentityWhitelistMap ( policies [ ] policy . Policy ) * identityWhitelist { var im identityWhitelist im . m = make ( map [ string ] bool , len ( policies ) * 3 ) for _ , p := range policies { for _ , group := range p . AllowedGroups { log . Debug ( ) . Str ( " " , p . From ) . Str ( " " , group ) . Msg ( " " ) im . PutGroup ( p . From , group ) } for _ , domain := range p . AllowedDomains { im . PutDomain ( p . From , domain ) log . Debug ( ) . Str ( " " , p . From ) . Str ( " " , domain ) . Msg ( " " ) } for _ , email := range p . AllowedEmails { im . PutEmail ( p . From , email ) log . Debug ( ) . Str ( " " , p . From ) . Str ( " " , email ) . Msg ( " " ) } } return & im }
newIdentityWhitelistMap takes a slice of policies and creates a hashmap of identity
authorizations per-route for each allowed group, domain, and email.
newIdentityWhitelistMap takes a slice of policies and creates a hashmap of identity authorizations per - route for each allowed group domain and email .