Skip to content

Commit

Permalink
FW-5588: Add hostname and ASN lists
Browse files Browse the repository at this point in the history
  • Loading branch information
Paschal Obba committed May 22, 2023
1 parent 870f6bd commit 656b03b
Show file tree
Hide file tree
Showing 3 changed files with 381 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .changelog/1288.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:enhancement
lists: add support for hostname and ASN lists.
```
12 changes: 12 additions & 0 deletions list.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ const (
ListTypeIP = "ip"
// ListTypeRedirect specifies a list containing redirects.
ListTypeRedirect = "redirect"
// ListTypeHostname specifies a list containing hostnames.
ListTypeHostname = "hostname"
// ListTypeHostname specifies a list containing autonomous system numbers (ASNs).
ListTypeASN = "asn"
)

// ListBulkOperation contains information about a Bulk Operation.
Expand Down Expand Up @@ -47,11 +51,17 @@ type Redirect struct {
PreservePathSuffix *bool `json:"preserve_path_suffix,omitempty"`
}

type Hostname struct {
UrlHostname string `json:"url_hostname"`
}

// ListItem contains information about a single List Item.
type ListItem struct {
ID string `json:"id"`
IP *string `json:"ip,omitempty"`
Redirect *Redirect `json:"redirect,omitempty"`
Hostname *Hostname `json:"hostname,omitempty"`
ASN *uint32 `json:"asn,omitempty"`
Comment string `json:"comment"`
CreatedOn *time.Time `json:"created_on"`
ModifiedOn *time.Time `json:"modified_on"`
Expand All @@ -68,6 +78,8 @@ type ListCreateRequest struct {
type ListItemCreateRequest struct {
IP *string `json:"ip,omitempty"`
Redirect *Redirect `json:"redirect,omitempty"`
Hostname *Hostname `json:"hostname,omitempty"`
ASN *uint32 `json:"asn,omitempty"`
Comment string `json:"comment"`
}

Expand Down

0 comments on commit 656b03b

Please sign in to comment.