luci: go.chromium.org/luci/server/auth/authdb/internal/ipaddr Index | Files

package ipaddr

import "go.chromium.org/luci/server/auth/authdb/internal/ipaddr"

Package ipaddr implements IP whitelist check.

Index

Package Files

ipaddr.go

type Whitelist Uses

type Whitelist struct {
    // contains filtered or unexported fields
}

Whitelist holds all named IP whitelists and the whitelist assignment map.

func NewWhitelist Uses

func NewWhitelist(wl []*protocol.AuthIPWhitelist, as []*protocol.AuthIPWhitelistAssignment) (Whitelist, error)

NewWhitelist creates new populated IP whitelist.

func (Whitelist) GetWhitelistForIdentity Uses

func (wl Whitelist) GetWhitelistForIdentity(ident identity.Identity) string

GetWhitelistForIdentity returns name of the IP whitelist to use to check IP of requests from given `ident`.

Returns an empty string if the identity is not IP-restricted.

func (Whitelist) IsInWhitelist Uses

func (wl Whitelist) IsInWhitelist(ip net.IP, whitelist string) bool

IsInWhitelist returns true if IP address belongs to given named IP whitelist.

Package ipaddr imports 4 packages (graph) and is imported by 2 packages. Updated 2019-10-22. Refresh now. Tools for package owners.