Documentation
¶
Index ¶
- Constants
- Variables
- func FetchIP2ASNDatabase(ctx context.Context, client *http.Client, url string) (*ip2asnStream, error)
- type AmazonAWSIPRanges
- type AtlassianIPRanges
- type AzureIPRanges
- type GitHubMeta
- type Record
- func RecordsFromAmazonAWSIPRanges(in *AmazonAWSIPRanges) []Record
- func RecordsFromAppleDomainVerificationIPAddresses(in []string) []Record
- func RecordsFromAtlassianIPRanges(in *AtlassianIPRanges) []Record
- func RecordsFromAzureIPRanges(in *AzureIPRanges) []Record
- func RecordsFromGitHubMeta(in *GitHubMeta) []Record
- func RecordsFromIP2ASNRecord(in *ip2asnRecord) []Record
- func RecordsFromStripeIPRanges(in *StripeIPRanges) []Record
- type Server
- type ServerOption
- type StripeIPRanges
Constants ¶
const ( AmazonASNumber = "16509" AmazonCountryCode = "US" AmazonASName = "AMAZON-02" )
const ( // AppleASNumber is the Apple ASNumber. AppleASNumber = "714" AppleCountryCode = "US" AppleASName = "APPLE-ENGINEERING" )
const ( AtlassianASNumber = "133530" AtlassianCountryCode = "AU" AtlassianASName = "ATLASSIAN PTY LTD" )
const ( MicrosoftASNumber = "8075" MicrosoftCountryCode = "US" MicrosoftASName = "MICROSOFT-CORP-MSN-AS-BLOCK" )
const ( GitHubASNumber = "36459" GitHubCountryCode = "US" GitHubASName = "GITHUB" )
const ( StripeASNumber = "5091" StripeCountryCode = "US" StripeASName = "STRIPE" )
Variables ¶
var AppleDomainVerificationIPAddresses = []string{
"17.32.139.128/27",
"17.32.139.160/27",
"17.140.126.0/27",
"17.140.126.32/27",
"17.179.144.128/27",
"17.179.144.160/27",
"17.179.144.192/27",
"17.179.144.224/27",
"17.253.0.0/16",
}
AppleDomainVerificationIPAddresses are the domain verification ip addresses for Apple. https://developer.apple.com/documentation/apple_pay_on_the_web/setting_up_your_server#3179116
var DefaultAmazonAWSIPRangesURL = "https://ip-ranges.amazonaws.com/ip-ranges.json"
DefaultAmazonAWSIPRangesURL is the default amazon aws ip ranges url.
var DefaultAtlassianIPRangesURL = "https://ip-ranges.atlassian.com/"
DefaultAtlassianIPRangesURL is the default Atlassian IP Ranges url.
var DefaultGitHubMetaURL = "https://api.github.com/meta"
var DefaultIP2ASNURL = "https://iptoasn.com/data/ip2asn-v4.tsv.gz"
var DefaultStripeIPRangesURL = "https://stripe.com/files/ips/ips_webhooks.json"
The DefaultStripeIPRangesURL is the default stripe ip ranges url.
Functions ¶
Types ¶
type AmazonAWSIPRanges ¶
type AmazonAWSIPRanges struct { Prefixes []struct { IPPrefix string `json:"ip_prefix"` Region string `json:"region"` Service string `json:"service"` NetworkBorderGroup string `json:"network_border_group"` } `json:"prefixes"` }
func FetchAmazonAWSIPRanges ¶
func FetchAmazonAWSIPRanges( ctx context.Context, client *http.Client, url string, ) (*AmazonAWSIPRanges, error)
FetchAmazonAWSIPRanges fetches the Amazon AWS IP Ranges.
type AtlassianIPRanges ¶
type AtlassianIPRanges struct { Items []struct { CIDR string `json:"cidr"` Product []string `json:"product"` } `json:"items"` }
AtlassianIPRanges are the Atlassian IP ranges.
func FetchAtlassianIPRanges ¶
func FetchAtlassianIPRanges( ctx context.Context, client *http.Client, url string, ) (*AtlassianIPRanges, error)
FetchAtlassianIPRanges fetches the Atlassian IP Ranges.
type AzureIPRanges ¶
type AzureIPRanges struct { Values []struct { Name string `json:"name"` ID string `json:"id"` Properties struct { SystemService string `json:"systemService"` AddressPrefixes []string `json:"addressPrefixes"` } `json:"properties"` } `json:"values"` }
AzureIPRanges are the definitions of the ip ranges for services in Azure.
func FetchAzureIPRanges ¶
func FetchAzureIPRanges( ctx context.Context, ) (*AzureIPRanges, error)
FetchAzureIPRanges fetches the Azure IP Ranges for all Azure services.
type GitHubMeta ¶
type GitHubMeta struct { Hooks []string `json:"hooks"` Web []string `json:"web"` API []string `json:"api"` Git []string `json:"git"` Packages []string `json:"packages"` Pages []string `json:"pages"` Importer []string `json:"importer"` Actions []string `json:"actions"` Dependabot []string `json:"dependabot"` }
GitHubMeta is the GitHub metadata.
func FetchGitHubMeta ¶
FetchGitHubMeta fetches the GitHub metadata.
type Record ¶
A Record is a Well-Known IP Record.
func RecordsFromAmazonAWSIPRanges ¶
func RecordsFromAmazonAWSIPRanges(in *AmazonAWSIPRanges) []Record
RecordsFromAmazonAWSIPRanges converts AmazonAWSIPRanges records to Well-Known IP Records.
func RecordsFromAppleDomainVerificationIPAddresses ¶
RecordsFromAppleDomainVerificationIPAddresses converts AppleDomainVerificationIPAddresses into records.
func RecordsFromAtlassianIPRanges ¶
func RecordsFromAtlassianIPRanges(in *AtlassianIPRanges) []Record
RecordsFromAtlassianIPRanges converts AtlassianIPRanges into records.
func RecordsFromAzureIPRanges ¶
func RecordsFromAzureIPRanges(in *AzureIPRanges) []Record
RecordsFromAzureIPRanges converts AzureIPRanges into records.
func RecordsFromGitHubMeta ¶
func RecordsFromGitHubMeta(in *GitHubMeta) []Record
RecordsFromGitHubMeta converts GitHubMeta into records.
func RecordsFromIP2ASNRecord ¶
func RecordsFromIP2ASNRecord(in *ip2asnRecord) []Record
RecordsFromIP2ASNRecord converts IP2ASN records to Well-Known IP Records.
func RecordsFromStripeIPRanges ¶
func RecordsFromStripeIPRanges(in *StripeIPRanges) []Record
RecordsFromStripeIPRanges converts StripeIPRanges into records.
func (Record) MarshalJSON ¶
MarshalJSON marshals the Well-Known IP Record as a JSON object.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server serves well-known-ip records
type ServerOption ¶
type ServerOption func(*serverConfig)
A ServerOption customizes the server config.
func WithIP2ASNURL ¶
func WithIP2ASNURL(url string) ServerOption
WithIP2ASNURL sets the ip2asn url in the config.
type StripeIPRanges ¶
type StripeIPRanges struct {
WebHooks []string `json:"WEBHOOKS"`
}
StripeIPRanges are the stripe IP ranges.
func FetchStripeIPRanges ¶
func FetchStripeIPRanges( ctx context.Context, client *http.Client, url string, ) (*StripeIPRanges, error)
FetchStripeIPRanges fetches the stripe ip ranges.