account

package
v2.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 14, 2024 License: Apache-2.0 Imports: 0 Imported by: 32

Documentation

Overview

Package account contains definitions for NS1 apikeys/teams/users/etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKey

type APIKey struct {
	// Read-only fields
	ID         string `json:"id,omitempty"`
	Key        string `json:"key,omitempty"`
	LastAccess int    `json:"last_access,omitempty"`

	Name              string         `json:"name"`
	TeamIDs           []string       `json:"teams"`
	Permissions       PermissionsMap `json:"permissions"`
	IPWhitelist       []string       `json:"ip_whitelist"`
	IPWhitelistStrict bool           `json:"ip_whitelist_strict"`
}

APIKey wraps an NS1 /account/apikeys resource

type Address

type Address struct {
	Country string `json:"country,omitempty"`
	Street  string `json:"street,omitempty"`
	State   string `json:"state,omitempty"`
	City    string `json:"city,omitempty"`
	Postal  string `json:"postalcode,omitempty"`
}

Address for Setting struct.

type AuthTag

type AuthTag struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

AuthTag wraps the tags used in "tags_allow" and "tags_deny" in DDI and IPAM permissions in DDI. Tag Names must start with prefix "auth:"

type IDP

type IDP struct {
	UseMetadataURL *bool   `json:"use_metadata_url"`
	MetadataURL    *string `json:"metadata_url"`
	MetadataFile   *string `json:"metadata_file"`
	Provider       *string `json:"provider"`
}

IDP wraps the IDP object in SAML.

type IPWhitelist

type IPWhitelist struct {
	ID     string   `json:"id,omitempty"`
	Name   string   `json:"name"`
	Values []string `json:"values"`
}

IPWhitelist wraps the IP whitelist.

type NotificationSettings

type NotificationSettings struct {
	Billing bool `json:"billing"`
}

NotificationSettings wraps a User's "notify" attribute

type PermissionsAccount

type PermissionsAccount struct {
	ManageUsers           bool `json:"manage_users"`
	ManagePaymentMethods  bool `json:"manage_payment_methods"`
	ManagePlan            bool `json:"manage_plan"`
	ManageTeams           bool `json:"manage_teams"`
	ManageApikeys         bool `json:"manage_apikeys"`
	ManageAccountSettings bool `json:"manage_account_settings"`
	ViewActivityLog       bool `json:"view_activity_log"`
	ViewInvoices          bool `json:"view_invoices"`
	ManageIPWhitelist     bool `json:"manage_ip_whitelist"`
}

PermissionsAccount wraps a User's "permissions.account" attribute

type PermissionsDHCP

type PermissionsDHCP struct {
	ManageDHCP bool `json:"manage_dhcp"`
	ViewDHCP   bool `json:"view_dhcp"`
	// The fields below are only relevant in DDI v2.5+
	TagsAllow *[]AuthTag `json:"tags_allow,omitempty"`
	TagsDeny  *[]AuthTag `json:"tags_deny,omitempty"`
}

PermissionsDHCP wraps a User's "permissions.dhcp" attribute for DDI.

type PermissionsDNS

type PermissionsDNS struct {
	ViewZones           bool                `json:"view_zones"`
	ManageZones         bool                `json:"manage_zones"`
	ZonesAllowByDefault bool                `json:"zones_allow_by_default"`
	ZonesDeny           []string            `json:"zones_deny"`
	ZonesAllow          []string            `json:"zones_allow"`
	RecordsAllow        []PermissionsRecord `json:"records_allow"`
	RecordsDeny         []PermissionsRecord `json:"records_deny"`
}

PermissionsDNS wraps a User's "permissions.dns" attribute

type PermissionsData

type PermissionsData struct {
	PushToDatafeeds   bool `json:"push_to_datafeeds"`
	ManageDatasources bool `json:"manage_datasources"`
	ManageDatafeeds   bool `json:"manage_datafeeds"`
}

PermissionsData wraps a User's "permissions.data" attribute

type PermissionsIPAM

type PermissionsIPAM struct {
	ManageIPAM bool `json:"manage_ipam"`
	ViewIPAM   bool `json:"view_ipam"`
	// The fields below are only relevant in DDI v2.5+
	TagsAllow *[]AuthTag `json:"tags_allow,omitempty"`
	TagsDeny  *[]AuthTag `json:"tags_deny,omitempty"`
}

PermissionsIPAM wraps a User's "permissions.ipam" attribute for DDI.

type PermissionsMap

type PermissionsMap struct {
	DNS        PermissionsDNS        `json:"dns"`
	Data       PermissionsData       `json:"data"`
	Account    PermissionsAccount    `json:"account"`
	Monitoring PermissionsMonitoring `json:"monitoring"`
	Security   *PermissionsSecurity  `json:"security,omitempty"`

	// DHCP and IPAM are only relevant for DDI and should not be provided in managed.
	DHCP *PermissionsDHCP `json:"dhcp,omitempty"`
	IPAM *PermissionsIPAM `json:"ipam,omitempty"`
}

PermissionsMap wraps a User's "permissions" attribute

type PermissionsMonitoring

type PermissionsMonitoring struct {
	ManageLists bool `json:"manage_lists"`
	ManageJobs  bool `json:"manage_jobs"`
	ViewJobs    bool `json:"view_jobs"`
}

PermissionsMonitoring wraps a User's "permissions.monitoring" attribute Only relevant for the managed product.

type PermissionsRecord

type PermissionsRecord struct {
	Domain     string `json:"domain"`
	Subdomains bool   `json:"include_subdomains"`
	Zone       string `json:"zone"`
	RecordType string `json:"type"`
}

PermissionsRecord wraps a User's "permissions.record" attribute

type PermissionsSecurity

type PermissionsSecurity struct {
	ManageGlobal2FA bool `json:"manage_global_2fa"`

	// This field is only relevant for DDI and should not be set to true for managed.
	ManageActiveDirectory bool `json:"manage_active_directory,omitempty"`
}

PermissionsSecurity wraps a User's "permissions.security" attribute.

type SAML

type SAML struct {
	SSO bool `json:"sso"`
	IDP `json:"idp"`
}

SAML wraps the SAML object in SharedAuth.

type Setting

type Setting struct {
	CustomerID int     `json:"customerid,omitempty"`
	FirstName  string  `json:"firstname,omitempty"`
	LastName   string  `json:"lastname,omitempty"`
	Company    string  `json:"company,omitempty"`
	Phone      string  `json:"phone,omitempty"`
	Email      string  `json:"email,omitempty"`
	Address    Address `json:"address,omitempty"`
}

Setting represents an accounts' contact info.

type SharedAuth

type SharedAuth struct {
	SAML `json:"saml"`
}

SharedAuth wraps the shared auth object on a User.

type Team

type Team struct {
	ID          string         `json:"id,omitempty"`
	Name        string         `json:"name"`
	Permissions PermissionsMap `json:"permissions"`
	IPWhitelist []IPWhitelist  `json:"ip_whitelist"`
}

Team wraps an NS1 /accounts/teams resource

type UsageWarning

type UsageWarning struct {
	Records Warning `json:"records"`
	Queries Warning `json:"queries"`
}

UsageWarning wraps an NS1 /account/usagewarnings resource

type User

type User struct {
	// Read-only fields
	LastAccess float64 `json:"last_access"`
	Created    float64 `json:"created"`

	Name                 string               `json:"name"`
	Username             string               `json:"username"`
	Email                string               `json:"email"`
	TeamIDs              []string             `json:"teams"`
	Notify               NotificationSettings `json:"notify"`
	Permissions          PermissionsMap       `json:"permissions"`
	IPWhitelist          []string             `json:"ip_whitelist"`
	IPWhitelistStrict    bool                 `json:"ip_whitelist_strict"`
	TwoFactorAuthEnabled bool                 `json:"2fa_enabled"`
	InviteToken          string               `json:"invite_token,omitempty"`
	SharedAuth           `json:"shared_auth"`
}

User wraps an NS1 /account/users resource

type Warning

type Warning struct {
	Send bool `json:"send_warnings"`

	First  int `json:"warning_1"`
	Second int `json:"warning_2"`
}

Warning contains alerting toggles and thresholds for overage warning alert messages. First thresholds must be smaller than Second ones and all thresholds must be percentages between 0 and 100.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL