// SetWhitelist sets the Whitelist field's value.
489609
func (s *DescribeOriginEndpointOutput) SetWhitelist(v []*string) *DescribeOriginEndpointOutput {
	s.Whitelist = v
	return s
}
803916
func (s *CreateOriginEndpointOutput) SetWhitelist(v []*string) *CreateOriginEndpointOutput {
	s.Whitelist = v
	return s
}
353895
func (db ErroringDB) IsInWhitelist(c context.Context, ip net.IP, whitelist string) (bool, error) {
	logging.Errorf(c, "%s", db.Error)
	return false, db.Error
}
455125
func (r *Resource) SetPayload(args interface{}) io.Reader {
	var b []byte
	b, _ = json.Marshal(args)
	r.SetHeader("Content-Type", "application/json")
	return bytes.NewBuffer(b)
}
280872
func (b *backend) pathTidyIdentityWhitelistUpdate(ctx context.Context, req *logical.Request, data *framework.FieldData) (*logical.Response, error) {
	return b.tidyWhitelistIdentity(ctx, req, data.Get("safety_buffer").(int))
}
957670
func NewWhiteList(regex string) *WhiteList {
	cregexp, err := regexp.Compile(regex)
	if err != nil {
		panic(err)
	}
	return &WhiteList{
		rawRegex:      regex,
		compiledRegex: cregexp,
	}
}
211842
func (s *SetSourceRequest) SetWhitelistCidr(v string) *SetSourceRequest {
	s.WhitelistCidr = &v
	return s
}
1079645
func AreLabelsInWhiteList(labels, whitelist Set) bool {
	if len(whitelist) == 0 {
		return true
	}

	for k, v := range labels {
		value, ok := whitelist[k]
		if !ok {
			return false
		}
		if value != v {
			return false
		}
	}
	return true
}
877156
func (b *backend) pathIdentityWhitelistRead(ctx context.Context, req *logical.Request, data *framework.FieldData) (*logical.Response, error) {
	instanceID := data.Get("instance_id").(string)
	if instanceID == "" {
		return logical.ErrorResponse("missing instance_id"), nil
	}

	entry, err := whitelistIdentityEntry(ctx, req.Storage, instanceID)
	if err != nil {
		return nil, err
	}
	if entry == nil {
		return nil, nil
	}

	return &logical.Response{
		Data: map[string]interface{}{
			"role":                      entry.Role,
			"client_nonce":              entry.ClientNonce,
			"creation_time":             entry.CreationTime.Format(time.RFC3339Nano),
			"disallow_reauthentication": entry.DisallowReauthentication,
			"pending_time":              entry.PendingTime,
			"expiration_time":           entry.ExpirationTime.Format(time.RFC3339Nano),
			"last_updated_time":         entry.LastUpdatedTime.Format(time.RFC3339Nano),
		},
	}, nil
}
279784
func SetLogLevel(logLevel string) {
	level, err := log.ParseLevel(logLevel)
	errors.CheckError(err)
	log.SetLevel(level)
	if os.Getenv("FORCE_LOG_COLORS") == "1" {
		log.SetFormatter(&log.TextFormatter{ForceColors: true})
	}
}
316639
func CheckIPWhitelist(remoteAddr string, ipRange string) (bool, error) {
	// Extract IP address from remote address.

	ip := remoteAddr

	if strings.LastIndex(remoteAddr, ":") != -1 {
		ip = remoteAddr[0:strings.LastIndex(remoteAddr, ":")]
	}

	ip = strings.TrimSpace(ip)

	// IPv6 addresses will likely be surrounded by [], so don't forget to remove those.

	if strings.HasPrefix(ip, "[") && strings.HasSuffix(ip, "]") {
		ip = ip[1 : len(ip)-1]
	}

	parsedIP := net.ParseIP(strings.TrimSpace(ip))

	if parsedIP == nil {
		return false, fmt.Errorf("invalid IP address found in remote address '%s'", remoteAddr)
	}

	// Extract IP range in CIDR form.  If a single IP address is provided, turn it into CIDR form.

	ipRange = strings.TrimSpace(ipRange)

	if !strings.Contains(ipRange, "/") {
		ipRange = ipRange + "/32"
	}

	_, cidr, err := net.ParseCIDR(ipRange)

	if err != nil {
		return false, err
	}

	return cidr.Contains(parsedIP), nil
}
58224
func (a Arg) SetTLSEnabled(tlsEnabled bool) Arg {
	a.TLSEnabled = tlsEnabled
	return a
}
413922
func (v *Validator) SetJWTID(jti string) {
	v.expect()
	v.Expected.Set("jti", jti)
}
496703
func parseWhitelistFile(whitelistFile string) (*vulnerabilitiesWhitelist, error) {
	whitelistYAML := vulnerabilitiesWhitelistYAML{}
	whitelist := vulnerabilitiesWhitelist{}

	//read the whitelist file
	whitelistBytes, err := ioutil.ReadFile(whitelistFile)
	if err != nil {
		return nil, fmt.Errorf("could not read file %v", err)
	}
	if err = yaml.Unmarshal(whitelistBytes, &whitelistYAML); err != nil {
		return nil, fmt.Errorf("could not unmarshal %v", err)
	}

	//Initialize the whitelist maps
	whitelist.General = make(map[string]bool)
	whitelist.Images = make(map[string]map[string]bool)

	//Populate the maps
	for _, cve := range whitelistYAML.General {
		whitelist.General[cve] = true
	}

	for image, cveList := range whitelistYAML.Images {
		whitelist.Images[image] = make(map[string]bool)
		for _, cve := range cveList {
			whitelist.Images[image][cve] = true
		}
	}

	return &whitelist, nil
}
105154
func (c *Client) SetFirewallRule(service string, whiteListCidrs []string) error {
	serviceValue := params.KnownServiceValue(service)
	if err := serviceValue.Validate(); err != nil {
		return errors.Trace(err)
	}

	args := params.FirewallRuleArgs{
		Args: []params.FirewallRule{
			{
				KnownService:   serviceValue,
				WhitelistCIDRS: whiteListCidrs,
			}},
	}
	var results params.ErrorResults
	if err := c.facade.FacadeCall("SetFirewallRules", args, &results); err != nil {
		return errors.Trace(err)
	}
	return results.OneError()
}
1197640
func (s *UpdateOriginEndpointInput) SetWhitelist(v []*string) *UpdateOriginEndpointInput {
	s.Whitelist = v
	return s
}
773497
func WhitelistAllRegistries() RegistryWhitelister {
	return &registryWhitelister{
		whitelist: []allowedHostPortGlobs{{host: "*", port: "*"}},
		pullSpecs: sets.NewString(),
	}
}