diff --git a/Makefile b/Makefile index 460dd0802..1296b5776 100644 --- a/Makefile +++ b/Makefile @@ -77,7 +77,7 @@ run_fixtures: LINODE_API_VERSION="v4beta" \ LINODE_URL="$(LINODE_URL)" \ GO111MODULE="on" \ - go test -timeout=$(TEST_TIMEOUT) -v $(ARGS) + go test --tags $(TEST_TAGS) -timeout=$(TEST_TIMEOUT) -v $(ARGS) sanitize: @echo "* Sanitizing fixtures" diff --git a/account.go b/account.go index 03d3297fd..4ff0a478d 100644 --- a/account.go +++ b/account.go @@ -1,6 +1,12 @@ package linodego -import "context" +import ( + "context" + "encoding/json" + "time" + + "github.com/linode/linodego/internal/parseabletime" +) // Account associated with the token in use. type Account struct { @@ -20,6 +26,29 @@ type Account struct { Phone string `json:"phone"` CreditCard *CreditCard `json:"credit_card"` EUUID string `json:"euuid"` + BillingSource string `json:"billing_source"` + Capabilities []string `json:"capabilities"` + ActiveSince *time.Time `json:"-"` +} + +// UnmarshalJSON implements the json.Unmarshaler interface +func (account *Account) UnmarshalJSON(b []byte) error { + type Mask Account + + p := struct { + *Mask + ActiveSince *parseabletime.ParseableTime `json:"active_since"` + }{ + Mask: (*Mask)(account), + } + + if err := json.Unmarshal(b, &p); err != nil { + return err + } + + account.ActiveSince = (*time.Time)(p.ActiveSince) + + return nil } // CreditCard information associated with the Account. diff --git a/account_child.go b/account_child.go new file mode 100644 index 000000000..ce45321c0 --- /dev/null +++ b/account_child.go @@ -0,0 +1,44 @@ +package linodego + +import ( + "context" +) + +// ChildAccount represents an account under the current account. +// NOTE: This is an alias to prevent any future breaking changes. +type ChildAccount = Account + +// ChildAccountToken represents a short-lived token created using +// the CreateChildAccountToken(...) function. +// NOTE: This is an alias to prevent any future breaking changes. +type ChildAccountToken = Token + +// ListChildAccounts lists child accounts under the current account. +func (c *Client) ListChildAccounts(ctx context.Context, opts *ListOptions) ([]ChildAccount, error) { + return getPaginatedResults[ChildAccount]( + ctx, + c, + "account/child-accounts", + opts, + ) +} + +// GetChildAccount gets a single child accounts under the current account. +func (c *Client) GetChildAccount(ctx context.Context, euuid string) (*ChildAccount, error) { + return doGETRequest[ChildAccount]( + ctx, + c, + formatAPIPath("account/child-accounts/%s", euuid), + ) +} + +// CreateChildAccountToken creates a short-lived token that can be used to +// access the Linode API under a child account. +// The attributes of this token are not currently configurable. +func (c *Client) CreateChildAccountToken(ctx context.Context, euuid string) (*ChildAccountToken, error) { + return doPOSTRequest[ChildAccountToken, any]( + ctx, + c, + formatAPIPath("account/child-accounts/%s/token", euuid), + ) +} diff --git a/account_users.go b/account_users.go index d9633d881..5906c462e 100644 --- a/account_users.go +++ b/account_users.go @@ -11,10 +11,20 @@ import ( "github.com/linode/linodego/internal/parseabletime" ) +type UserType string + +const ( + UserTypeProxy UserType = "proxy" + UserTypeParent UserType = "parent" + UserTypeChild UserType = "child" + UserTypeDefault UserType = "default" +) + // User represents a User object type User struct { Username string `json:"username"` Email string `json:"email"` + UserType UserType `json:"user_type"` Restricted bool `json:"restricted"` TFAEnabled bool `json:"tfa_enabled"` SSHKeys []string `json:"ssh_keys"` diff --git a/go.work.sum b/go.work.sum index 295c2d24a..aa05c24d1 100644 --- a/go.work.sum +++ b/go.work.sum @@ -1,277 +1,3 @@ -cloud.google.com/go v0.81.0 h1:at8Tk2zUz63cLPR0JPWm5vp77pEZmzxEQBEfRKn1VV8= -cloud.google.com/go v0.110.2 h1:sdFPBr6xG9/wkBbfhmUz/JmZC7X6LavQgcrVINrKiVA= -cloud.google.com/go v0.110.2/go.mod h1:k04UEeEtb6ZBRTv3dZz4CeJC3jKGxyhl0sAiVVquxiw= -cloud.google.com/go/bigquery v1.8.0 h1:PQcPefKFdaIzjQFbiyOgAqyx8q5djaE7x9Sqe712DPA= -cloud.google.com/go/compute v1.20.1 h1:6aKEtlUiwEpJzM001l0yFkpXmUVXaN8W+fbkb2AZNbg= -cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= -cloud.google.com/go/compute/metadata v0.2.0 h1:nBbNSZyDpkNlo3DepaaLKVuO7ClyifSAmNloSCZrHnQ= -cloud.google.com/go/compute/metadata v0.2.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= -cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= -cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= -cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc= -cloud.google.com/go/compute/metadata v0.3.0/go.mod h1:zFmK7XCadkQkj6TtorcaGlCW1hT1fIilQDwofLpJ20k= -cloud.google.com/go/datastore v1.1.0 h1:/May9ojXjRkPBNVrq+oWLqmWCkr4OU5uRY29bu0mRyQ= -cloud.google.com/go/pubsub v1.3.1 h1:ukjixP1wl0LpnZ6LWtZJ0mX5tBmjp1f8Sqer8Z2OMUU= -cloud.google.com/go/storage v1.10.0 h1:STgFzyU5/8miMl0//zKh2aQeTyeaUH3WN9bSUiJ09bA= -dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9 h1:VpgP7xuJadIUuKccphEpTJnWhS2jkQyMt6Y7pJCD7fY= -github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= -github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest v0.11.18 h1:90Y4srNYrwOtAgVo3ndrQkTYn6kf1Eg/AjTFJ8Is2aM= -github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= -github.com/Azure/go-autorest/autorest/adal v0.9.13 h1:Mp5hbtOePIzM8pJVRa3YLrWWmZtoxRXqUEzCfJt3+/Q= -github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= -github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw= -github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.4.1 h1:K0laFcLE6VLTOwNgSxaGbUcLPuGXlNkbVvq4cW4nIHk= -github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= -github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg= -github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= -github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= -github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= -github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802 h1:1BDTz0u9nC3//pOCMdNH+CiXJVYJh5UQNCOBG7jbELc= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46 h1:lsxEuwrXEAokXB9qhlbKWPpo3KMLZQ5WB5WLQRW1uq0= -github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= -github.com/PuerkitoBio/purell v1.0.0/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= -github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI= -github.com/PuerkitoBio/urlesc v0.0.0-20160726150825-5bd2802263f2/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= -github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5 h1:0CwZNZbxp69SHPdPJAN/hZIm0C4OItdklCFmMRWYpio= -github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a h1:idn718Q4B6AGu/h5Sxe66HYVdqdGu2l9Iebqhi/AEoA= -github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= -github.com/census-instrumentation/opencensus-proto v0.2.1 h1:glEXhBS5PSLLv4IXzLA5yPRVX4bilULVyxxbrfOtDAk= -github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= -github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= -github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= -github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/client9/misspell v0.3.4 h1:ta993UF76GwbvJcIo3Y68y/M3WxlpEHPWIGDkJYwzJI= -github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403 h1:cqQfy1jclcSy/FwLjemeg3SR1yaINm74aQyupQ0Bl8M= -github.com/creack/pty v1.1.9 h1:uDmaGzcdjhF4i/plgjmEsriH11Y0o7RKapEf/LDaM3w= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dnaeon/go-vcr v1.0.1/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= -github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= -github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ= -github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153 h1:yUdfgN0XgIJw7foRItutHYUIhlcKzcSf5vDpdhQAKTc= -github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633 h1:H2pdYOb3KQ1/YsqVWoWNLQO+fusocsw354rqGTZtAgw= -github.com/emicklei/go-restful/v3 v3.8.0/go.mod h1:6n3XBCmQQb25CM2LCACGz8ukIrRry+4bhvbpWn3mrbc= -github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad h1:EmNYJhPYy0pOFjCx2PrgtaBXmee0iUX9hLlxE1xHOJE= -github.com/envoyproxy/protoc-gen-validate v0.1.0 h1:EQciDnbrYxy13PgWoY8AqoxGiPrpgBZ1R8UNe3ddc+A= -github.com/evanphx/json-patch v4.2.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84= -github.com/evanphx/json-patch v4.12.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U= -github.com/evanphx/json-patch v5.6.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= -github.com/form3tech-oss/jwt-go v3.2.3+incompatible h1:7ZaBxOI7TMoYBfyA3cQHErNNyAWIKUMIwqxEtgHOs5c= -github.com/getkin/kin-openapi v0.76.0 h1:j77zg3Ec+k+r+GA3d8hBoXpAc6KX9TbBPrwQGBIy2sY= -github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= -github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1 h1:QbL/5oDUmRBzO9/Z7Seo6zf912W/a6Sr4Eu0G/3Jho0= -github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4 h1:WtGNWLvXpe6ZudgnXrq0barxBImvnnJoMEhXAzcbM0I= -github.com/go-logr/logr v0.1.0/go.mod h1:ixOQHD9gLJUVQQ2ZOR7zLEifBX6tGkNJF4QyIY7sIas= -github.com/go-logr/logr v0.2.0/go.mod h1:z6/tIYblkpsD+a4lm/fGIIU9mZ+XfAiaFtq7xTgseGU= -github.com/go-openapi/jsonpointer v0.0.0-20160704185906-46af16f9f7b1/go.mod h1:+35s3my2LFTysnkMfxsJBAMHj/DoqoB9knIWoYG/Vk0= -github.com/go-openapi/jsonpointer v0.19.5 h1:gZr+CIYByUqjcgeLXnQu2gHYQC9o73G2XUeOFYEICuY= -github.com/go-openapi/jsonreference v0.0.0-20160704190145-13c6e3589ad9/go.mod h1:W3Z9FmVs9qj+KR4zFKmDPGiLdk1D9Rlm7cyMvf57TTg= -github.com/go-openapi/jsonreference v0.19.3 h1:5cxNfTy0UVC3X8JL5ymxzyoUZmo8iZb+jeTWn7tUa8o= -github.com/go-openapi/jsonreference v0.20.1/go.mod h1:Bl1zwGIM8/wsvqjsOQLJ/SH+En5Ap4rVB5KVcIDZG2k= -github.com/go-openapi/spec v0.0.0-20160808142527-6aced65f8501/go.mod h1:J8+jY1nAiCcj+friV/PDoE1/3eeccG9LYBs0tYvLOWc= -github.com/go-openapi/swag v0.0.0-20160704191624-1d0bd113de87/go.mod h1:DXUve3Dpr1UfpPtxFw+EFuQ41HhCWZfha5jSVRG7C7I= -github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY= -github.com/go-resty/resty/v2 v2.13.1 h1:x+LHXBI2nMB1vqndymf26quycC4aggYJ7DECYbiz03g= -github.com/go-resty/resty/v2 v2.13.1/go.mod h1:GznXlLxkq6Nh4sU59rPmUw3VtgpO3aS96ORAI6Q7d+0= -github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= -github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= -github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/mock v1.5.0 h1:jlYHihg//f7RRwuPfptm04yp4s7O6Kw8EZiVYIGcH0g= -github.com/golang/protobuf v0.0.0-20161109072736-4bd1920723d7/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= -github.com/google/btree v1.0.1/go.mod h1:xXMiIv4Fb/0kKde4SpL7qlzvu5cMJDRkFDxJfI9uaxA= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= -github.com/google/martian/v3 v3.1.0 h1:wCKgOCHuUEVfsaQLpPSJb7VdYCdTVZQAuOdYm1yc/60= -github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5 h1:zIaiqGYDQwa4HVx5wGRTXbx38Pqxjemn4BP98wpzpXo= -github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= -github.com/google/renameio v0.1.0 h1:GOZbcHa3HfsPKPlmyPyN2KEohoMXOhdMbHrvbpl2QaA= -github.com/google/s2a-go v0.1.4 h1:1kZ/sQM3srePvKs3tXAvQzo66XfcReoqFpIpIccE7Oc= -github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/googleapis/enterprise-certificate-proxy v0.2.3 h1:yk9/cqRKtT9wXZSsRH9aurXEpJX+U6FLtpYTdC3R06k= -github.com/googleapis/enterprise-certificate-proxy v0.2.3/go.mod h1:AwSRAtLfXpU5Nm3pW+v7rGDHp09LsPtGY9MduiEsR9k= -github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= -github.com/googleapis/gax-go/v2 v2.11.0 h1:9V9PWXEsWnPpQhu/PeQIkS4eGzMlTLGgt80cUUI8Ki4= -github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI= -github.com/googleapis/gnostic v0.0.0-20170729233727-0c5108395e2d/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/googleapis/gnostic v0.1.0/go.mod h1:sJBsCZ4ayReDTBIg8b9dl28c5xFWyhBTVRp3pOg5EKY= -github.com/gophercloud/gophercloud v0.1.0/go.mod h1:vxM41WHh5uqHVBMZHzuwNOHh8XEoIEcSTewFxm1c5g8= -github.com/gorilla/mux v1.8.0 h1:i40aqfkR1h2SlN9hojwV5ZA91wcXFOvkdNIeFDP5koI= -github.com/gorilla/websocket v1.4.2 h1:+/TMaTYc4QFitKJxsQ7Yye35DkWvkdLcvGKqM+x0Ufc= -github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc= -github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM= -github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= -github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= -github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639 h1:mV02weKRL81bEnm8A0HT1/CAelMQDBuQIfLw8n+d6xI= -github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= -github.com/json-iterator/go v1.1.8/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= -github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= -github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= -github.com/kisielk/errcheck v1.5.0 h1:e8esj/e4R+SAOwFwN+n3zr0nYeCyeweozKfO23MvHzY= -github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= -github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= -github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pty v1.1.1 h1:VkoXIwSboBpnk99O/KFauAEILuNHv5DVFKZMBN/gUgw= -github.com/linode/linodego v0.20.1 h1:Kw5Qes0E0wlKVx5EbITI+F/ambO6G+PQyK0Yi7i4EyQ= -github.com/linode/linodego v0.20.1/go.mod h1:XOWXRHjqeU2uPS84tKLgfWIfTlv3TYzCS0io4GOQzEI= -github.com/mailru/easyjson v0.0.0-20160728113105-d5b7844b561a/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc= -github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8= -github.com/maxatome/go-testdeep v1.11.0/go.mod h1:011SgQ6efzZYAen6fDn4BqQ+lUR72ysdyKe7Dyogw70= -github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= -github.com/moby/spdystream v0.2.0 h1:cjW1zVyyoiM0T7b6UoySUFqzXMoqRckQtXwGPiBhOM8= -github.com/moby/spdystream v0.2.0/go.mod h1:f7i0iNDQJ059oMTcWxx8MA/zKFIuD/lY+0GqbN2Wy8c= -github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5 h1:8Q0qkMVC/MmWkpIdlvZgcv2o2jrlF6zqVOh7W5YHdMA= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d h1:7PxY7LVfSZm7PEeBTyK1rj1gABdCO2mbri6GKO1cMDs= -github.com/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f h1:y5//uYreIhSUg3J1GEMiLbxo1LJaP8RfCpH6pymGZus= -github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= -github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= -github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= -github.com/onsi/ginkgo/v2 v2.1.4/go.mod h1:um6tUpWM/cxCK3/FK8BXqEiUMUwRgSM4JXG47RKZmLU= -github.com/onsi/ginkgo/v2 v2.9.1/go.mod h1:FEcmzVcCHl+4o9bQZVab+4dC9+j+91t2FHSzmGAPfuo= -github.com/onsi/ginkgo/v2 v2.9.2/go.mod h1:WHcJJG2dIlcCqVfBAwUCrJxSPFb6v4azBwgxeMeDuts= -github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= -github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= -github.com/onsi/gomega v1.27.3/go.mod h1:5vG284IBtfDAmDyrK+eGyZmUgUlmi+Wngqo557cZ6Gw= -github.com/onsi/gomega v1.27.4/go.mod h1:riYq/GJKh8hhoM01HN6Vmuy93AarCXCBGpvFDK3q3fQ= -github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= -github.com/peterbourgon/diskv v2.0.1+incompatible h1:UBdAOUP5p4RWqPBg048CAvpKN+vxiaj6gdUUzhl4XmI= -github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e h1:aoZm08cpOy4WuID//EZDgcC4zIxODThtZNPirFr42+A= -github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4 h1:gQz4mCbXsO+nc9n1hCxHcGA3Zx3Eo+UHZoInFGUIXNM= -github.com/rogpeppe/go-internal v1.3.0 h1:RR9dF3JtopPvtkroDZuVD7qquD0bnHlKSqaQhgwt8yk= -github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= -github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= -github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= -github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= -github.com/stoewer/go-strcase v1.2.0 h1:Z2iHWqGXH00XYgqDmNgQbIBxf3wrNq0F3feEy0ainaU= -github.com/stretchr/objx v0.1.0 h1:4G4v2dO3VZwixGIRoQ5Lfboy6nUhCyYzaqnIAPPhYs4= -github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c= -github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= -github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= -github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= -github.com/yuin/goldmark v1.2.1 h1:ruQGxdhGHe7FWOJPT0mKs5+pD2Xs1Bm/kdGlHO04FmM= -github.com/yuin/goldmark v1.3.5 h1:dPmz1Snjq0kmkz159iL7S6WzdahUTHnHB5M56WFVifs= -github.com/yuin/goldmark v1.4.13 h1:fVcFKWvrslecOb/tg+Cc05dkeYx540o0FuFt3nUVDoE= -go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= -go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= -go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= -golang.org/x/crypto v0.0.0-20190211182817-74369b46fc67/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.10.0 h1:LKqV2xt9+kDzSTfOhx4FrkEBcMrAgHSYgzywV9zcGmM= -golang.org/x/crypto v0.10.0/go.mod h1:o4eNf7Ede1fv+hwOwZsTHl9EsPFO6q6ZvYR8vYfY45I= -golang.org/x/crypto v0.11.0/go.mod h1:xgJhtzW8F9jGdVFWZESrid1U1bjeNy4zgy5cRr/CIio= -golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk= -golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw= -golang.org/x/crypto v0.13.0 h1:mvySKfSWJ+UKUii46M40LOvyWfN0s2U+46/jDd0e6Ck= -golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= -golang.org/x/crypto v0.15.0/go.mod h1:4ChreQoLWfG3xLDer1WdlH5NdlQ3+mwnQq1YTKY+72g= -golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -golang.org/x/crypto v0.18.0/go.mod h1:R0j02AL6hcrfOiy9T4ZYp/rcWeMxM3L6QYxlOuEG1mg= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= -golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= -golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= -golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6 h1:QE6XYQK6naiK1EPAe1g/ILLxN5RBoH5xkJk3CqlMI/Y= -golang.org/x/image v0.0.0-20190802002840-cff245a6509b h1:+qEpEAPhDZ1o0x3tHzZTQDArnOixOzGD9HUJfcg0mb4= -golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 h1:2M3HP5CCK1Si9FQhwnzYhXdG6DXeebvUHFpre8QvbyI= -golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028 h1:4+4C/Iv2U4fMZBiMCc98MG1In4gJY5YRhtpDNeDeHWs= -golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= -golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.10.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/net v0.0.0-20170114055629-f2499483f923/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= -golang.org/x/net v0.0.0-20191004110552-13f9640d40b9/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b h1:PxfKdU9lEEDYjdIzOtC4qFWgkU2rGHdKlKowJSMN9h0= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= -golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns= -golang.org/x/net v0.13.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA= -golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= -golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= -golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9 h1:SQFwaSi55rU7vdNs9Yr0Z324VNlrF+0wMqRXT4St8ck= -golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190209173611-3b5209105503/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20191022100944-742c48ecaeb7/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -golang.org/x/time v0.3.0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20200505023115-26f46d2f7ef8/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.4.0/go.mod h1:UE5sM2OK9E/d67R0ANs2xJizIymRP5gJU295PvKXxjQ= -golang.org/x/tools v0.8.0/go.mod h1:JxBZ99ISMI5ViVkT1tr6tdNmXeTrcpVSD3vZ1RsRdN4= -golang.org/x/tools v0.12.0/go.mod h1:Sc0INKfu04TlqNoRA1hgpFZbhYXHPr4V5DzpSBTPqQM= -golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= -golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -google.golang.org/api v0.126.0 h1:q4GJq+cAdMAC7XP7njvQ4tvohGLiSlytuL4BQxbIZ+o= -google.golang.org/api v0.126.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= -google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= -google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= -google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc h1:8DyZCyvI8mE1IdLy/60bS+52xfymkE72wv1asokgtao= -google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= -google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc h1:kVKPf/IiYSBWEWtkIn6wZXwWGCnLKcC8oWfZvXjsGnM= -google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA= -google.golang.org/grpc v1.55.0 h1:3Oj82/tFSCeUrRTg/5E/7d/W5A1tj6Ky1ABAuZuv5ag= -google.golang.org/grpc v1.55.0/go.mod h1:iYEXKGkEBhg1PjZQvoYEVPTDkHo1/bjTnfwTeGONTY8= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c h1:GohjlNKauSai7gN4wsJkeZ3WAJx4Sh+oT/b5IYn5suA= -k8s.io/gengo v0.0.0-20210813121822-485abfe95c7c/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01 h1:pWEwq4Asjm4vjW7vcsmijwBhOr1/shsbSYiWXmNGlks= -k8s.io/gengo v0.0.0-20230829151522-9cce18d56c01/go.mod h1:FiNAH4ZV3gBg2Kwh89tzAEV2be7d5xI0vBa/VySYy3E= -k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= -k8s.io/klog/v2 v2.2.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= -k8s.io/klog/v2 v2.80.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= -k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA= -sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= +github.com/dnaeon/go-vcr v1.2.0 h1:zHCHvJYTMh1N7xnV7zf1m1GPBF9Ad0Jk/whtQ1663qI= +github.com/dnaeon/go-vcr v1.2.0/go.mod h1:R4UdLID7HZT3taECzJs4YgbbH6PIGXB6W/sc5OLb6RQ= +github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= diff --git a/test/Makefile b/test/Makefile index 0f1e1552f..2c1832fdb 100644 --- a/test/Makefile +++ b/test/Makefile @@ -19,4 +19,9 @@ smoketest: LINODE_TOKEN="awesometokenawesometokenawesometoken" \ LINODE_API_VERSION="v4beta" \ GO111MODULE="on" \ - go test -v -run smoke ./integration/... \ No newline at end of file + go test -v -run smoke ./integration/... + + +.PHONY: unit-test +unit-test: + go test -v ./unit $(ARGS) \ No newline at end of file diff --git a/test/integration/account_child_test.go b/test/integration/account_child_test.go new file mode 100644 index 000000000..7102ef0d7 --- /dev/null +++ b/test/integration/account_child_test.go @@ -0,0 +1,40 @@ +//go:build parent_child + +package integration + +import ( + "context" + "reflect" + "testing" + + "github.com/google/go-cmp/cmp" + "github.com/stretchr/testify/require" +) + +// NOTE: These fixtures are expected to be run under a parent account. +func TestAccountChild_basic(t *testing.T) { + client, teardown := createTestClient(t, "fixtures/TestAccountChild_basic") + defer teardown() + + childAccounts, err := client.ListChildAccounts(context.Background(), nil) + require.NoError(t, err) + require.Greater( + t, + len(childAccounts), + 0, + "number of child accounts should be > 0", + ) + + childAccount, err := client.GetChildAccount(context.Background(), childAccounts[0].EUUID) + require.NoError(t, err) + require.True( + t, + reflect.DeepEqual(*childAccount, childAccounts[0]), + "child accounts should be equal", + cmp.Diff(*childAccount, childAccounts[0]), + ) + + token, err := client.CreateChildAccountToken(context.Background(), childAccount.EUUID) + require.NoError(t, err) + require.Greater(t, len(token.Token), 0) +} diff --git a/test/integration/account_users_test.go b/test/integration/account_users_test.go index 0d421de8e..18204e930 100644 --- a/test/integration/account_users_test.go +++ b/test/integration/account_users_test.go @@ -67,6 +67,9 @@ func TestUser_Get_smoke(t *testing.T) { if user.VerifiedPhoneNumber != nil { t.Error("expected phone number is not set") } + if user.UserType == "" { + t.Errorf("expected user type, got none") + } } func TestUser_Update(t *testing.T) { @@ -150,6 +153,9 @@ func TestUsers_List(t *testing.T) { if newUser.VerifiedPhoneNumber != nil { t.Error("expected phone number is not set") } + if newUser.UserType == "" { + t.Errorf("expected user type, got none") + } } func createUser(t *testing.T, client *linodego.Client, userModifiers ...userModifier) (*User, func()) { diff --git a/test/integration/fixtures/ExampleGetAccount.yaml b/test/integration/fixtures/ExampleGetAccount.yaml index 3fa04a656..fefce1c2b 100644 --- a/test/integration/fixtures/ExampleGetAccount.yaml +++ b/test/integration/fixtures/ExampleGetAccount.yaml @@ -14,14 +14,14 @@ interactions: url: https://api.linode.com/v4beta/account method: GET response: - body: '{"company": "Linode", "email": "lgarber@linode.com", "first_name": "Lena", - "last_name": "Garber", "address_1": "2228 Lenox Ridge Ct NE", "address_2": "NA", - "city": "Atlanta", "state": "GA", "zip": "30319", "country": "US", "phone": - "6787613864", "balance": 0.0, "tax_id": "", "billing_source": "linode", "credit_card": - {"last_four": "1488", "expiry": "02/2022"}, "balance_uninvoiced": 0.0, "active_since": + body: '{"company": "Linode", "email": "foo@linode.com", "first_name": "foo", + "last_name": "bar", "address_1": "123 Street Street", "address_2": "NA", + "city": "Philadelphia", "state": "PA", "zip": "30000", "country": "US", "phone": + "1234567891", "balance": 0.0, "tax_id": "", "billing_source": "linode", "credit_card": + {"last_four": "1234", "expiry": "02/2020"}, "balance_uninvoiced": 0.0, "active_since": "2018-01-02T03:04:05", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "LKE HA Control Planes", - "Machine Images", "Managed Databases"], "active_promotions": [], "euuid": "590F6313-2E4D-47CE-90943D2F724A87CB"}' + "Machine Images", "Managed Databases"], "active_promotions": [], "euuid": "FFFFFFFF-2E4D-47CE-FFFFFFFFFFFFFFFFF"}' headers: Access-Control-Allow-Credentials: - "true" diff --git a/test/integration/fixtures/TestAccountBetaPrograms.yaml b/test/integration/fixtures/TestAccountBetaPrograms.yaml index c3040b623..a60712c72 100644 --- a/test/integration/fixtures/TestAccountBetaPrograms.yaml +++ b/test/integration/fixtures/TestAccountBetaPrograms.yaml @@ -14,30 +14,20 @@ interactions: url: https://api.linode.com/v4beta/betas?page=1 method: GET response: - body: '{"data": [{"id": "vpc_beta", "label": "Virtual Private Cloud (VPC) Pre-Registration", - "description": "VPC is coming to beta in select data centers soon! Virtual Private - Cloud (VPC) solution. A VPC is an isolated network that enables cloud resources - to privately communicate with each other and selectively gate access to the - public internet or other private networks. VPC will be available at no additional - cost both during the beta and when it enters general availability.\r\n\r\nPlease - note: VPC is not currently available in beta testing. By signing up to participate - in this beta when it becomes available, you consent to be subscribed to receive - emails from Akamai cloud computing services marketing and be contacted via email - when VPC is available.", "started": "2018-01-02T03:04:05", "ended": null, "greenlight_only": - false, "more_info": "https://www.linode.com/green-light/"}, {"id": "global_load_balancer_beta", - "label": "Akamai Global Load Balancer Pre-Registration", "description": "The - Akamai Global Load Balancer (AGLB) is a layer 4 and 7 load balancer that distributes - traffic based on performance, weight, and content (HTTP headers, query strings, - etc.). The AGLB is a multi-region, multicloud, independent of Akamai Delivery, - and built for East-West and North-South traffic. Key features include multi-region - load balancing and method selection. Beta for this product is coming soon\u2013 - sign up to be contacted first when AGLB is available.\r\n\r\nPlease note: Akamai - Global Load Balancer is not currently available in beta testing. By signing - up to participate in this beta when it becomes available, you consent to be - subscribed to receive emails from Akamai cloud computing services marketing - and be contacted via email when the beta period begins.", "started": "2018-01-02T03:04:05", - "ended": null, "greenlight_only": false, "more_info": "https://www.linode.com/green-light/"}], - "page": 1, "pages": 1, "results": 2}' + body: '{"data": [{"id": "global_load_balancer_beta", "label": "Akamai Global Load + Balancer Pre-Registration", "description": "The Akamai Global Load Balancer + (AGLB) is a layer 4 and 7 load balancer that distributes traffic based on performance, + weight, and content (HTTP headers, query strings, etc.). The AGLB is a multi-region, + multicloud, independent of Akamai Delivery, and built for East-West and North-South + traffic. Key features include multi-region load balancing and method selection. + Beta for this product is coming soon\u2013 sign up to be contacted first when + AGLB is available.\r\n\r\nPlease note: Akamai Global Load Balancer is not currently + available in beta testing. By signing up to participate in this beta when it + becomes available, you consent to be subscribed to receive emails from Akamai + cloud computing services marketing and be contacted via email when the beta + period begins.", "started": "2018-01-02T03:04:05", "ended": null, "greenlight_only": + false, "more_info": "https://www.linode.com/green-light/"}], "page": 1, "pages": + 1, "results": 1}' headers: Access-Control-Allow-Credentials: - "true" @@ -50,19 +40,23 @@ interactions: Access-Control-Expose-Headers: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - - private, max-age=0, s-maxage=0, no-cache, no-store - - private, max-age=60, s-maxage=60 + - max-age=0, no-cache, no-store + Connection: + - keep-alive Content-Security-Policy: - default-src 'none' Content-Type: - application/json - Server: - - nginx + Expires: + - Tue, 13 Feb 2024 18:57:39 GMT + Pragma: + - no-cache Strict-Transport-Security: - max-age=31536000 Vary: - Authorization, X-Filter - Authorization, X-Filter + - Accept-Encoding X-Accepted-Oauth-Scopes: - '*' X-Content-Type-Options: @@ -73,14 +67,14 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "800" + - "400" X-Xss-Protection: - 1; mode=block status: 200 OK code: 200 duration: "" - request: - body: '{"id":"vpc_beta"}' + body: '{"id":"global_load_balancer_beta"}' form: {} headers: Accept: @@ -105,15 +99,19 @@ interactions: Access-Control-Expose-Headers: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - - private, max-age=60, s-maxage=60 + - max-age=0, no-cache, no-store + Connection: + - keep-alive Content-Length: - "2" Content-Security-Policy: - default-src 'none' Content-Type: - application/json - Server: - - nginx + Expires: + - Tue, 13 Feb 2024 18:57:39 GMT + Pragma: + - no-cache Strict-Transport-Security: - max-age=31536000 Vary: @@ -128,7 +126,7 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "800" + - "400" X-Xss-Protection: - 1; mode=block status: 200 OK @@ -160,17 +158,10 @@ interactions: to be subscribed to receive emails from Akamai cloud computing services marketing and be contacted via email when the beta period begins.", "started": "2018-01-02T03:04:05", "ended": null}, {"id": "vpc_beta", "label": "Virtual Private Cloud (VPC) Pre-Registration", - "enrolled": "2018-01-02T03:04:05", "description": "VPC is coming to beta in - select data centers soon! Virtual Private Cloud (VPC) solution. A VPC is an - isolated network that enables cloud resources to privately communicate with - each other and selectively gate access to the public internet or other private - networks. VPC will be available at no additional cost both during the beta and - when it enters general availability.\r\n\r\nPlease note: VPC is not currently - available in beta testing. By signing up to participate in this beta when it - becomes available, you consent to be subscribed to receive emails from Akamai - cloud computing services marketing and be contacted via email when VPC is available.", - "started": "2018-01-02T03:04:05", "ended": null}], "page": 1, "pages": 1, "results": - 2}' + "enrolled": "2018-01-02T03:04:05", "description": "VPC is now available in open + beta for all customers. Select VPC in the side navigation to get started.", + "started": "2018-01-02T03:04:05", "ended": "2018-01-02T03:04:05"}], "page": + 1, "pages": 1, "results": 2}' headers: Access-Control-Allow-Credentials: - "true" @@ -183,19 +174,23 @@ interactions: Access-Control-Expose-Headers: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - - private, max-age=0, s-maxage=0, no-cache, no-store - - private, max-age=60, s-maxage=60 + - max-age=0, no-cache, no-store + Connection: + - keep-alive Content-Security-Policy: - default-src 'none' Content-Type: - application/json - Server: - - nginx + Expires: + - Tue, 13 Feb 2024 18:57:39 GMT + Pragma: + - no-cache Strict-Transport-Security: - max-age=31536000 Vary: - Authorization, X-Filter - Authorization, X-Filter + - Accept-Encoding X-Accepted-Oauth-Scopes: - account:read_only X-Content-Type-Options: @@ -206,7 +201,7 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "800" + - "400" X-Xss-Protection: - 1; mode=block status: 200 OK @@ -250,21 +245,23 @@ interactions: Access-Control-Expose-Headers: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - - private, max-age=0, s-maxage=0, no-cache, no-store - - private, max-age=60, s-maxage=60 - Content-Length: - - "970" + - max-age=0, no-cache, no-store + Connection: + - keep-alive Content-Security-Policy: - default-src 'none' Content-Type: - application/json - Server: - - nginx + Expires: + - Tue, 13 Feb 2024 18:57:39 GMT + Pragma: + - no-cache Strict-Transport-Security: - max-age=31536000 Vary: - Authorization, X-Filter - Authorization, X-Filter + - Accept-Encoding X-Accepted-Oauth-Scopes: - account:read_only X-Content-Type-Options: @@ -275,7 +272,7 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "800" + - "400" X-Xss-Protection: - 1; mode=block status: 200 OK diff --git a/test/integration/fixtures/TestAccountChild_basic.yaml b/test/integration/fixtures/TestAccountChild_basic.yaml new file mode 100644 index 000000000..e554ea761 --- /dev/null +++ b/test/integration/fixtures/TestAccountChild_basic.yaml @@ -0,0 +1,187 @@ +--- +version: 1 +interactions: +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/account/child-accounts?page=1 + method: GET + response: + body: '{"data": [{"company": "DX Child Account", "email": "dl-linode-dev-dx@akamai.com", + "first_name": "DX-Child", "last_name": "Team", "address_1": "", "address_2": + "", "city": "", "state": "", "zip": "", "country": "", "phone": "", "balance": + 0.0, "tax_id": "", "billing_source": "akamai", "credit_card": {"last_four": + null, "expiry": null}, "balance_uninvoiced": 0.0, "active_since": "2018-01-02T03:04:05", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", + "Kubernetes", "Cloud Firewall", "Vlans", "LKE HA Control Planes", "Machine Images", + "VPCs"], "active_promotions": [], "euuid": "E89C475E-7476-4B95-95EA82BB4EE866E3"}], + "page": 1, "pages": 1, "results": 1}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Accept-Encoding + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - child_account:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "1200" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/account/child-accounts/E89C475E-7476-4B95-95EA82BB4EE866E3 + method: GET + response: + body: '{"company": "DX Child Account", "email": "dl-linode-dev-dx@akamai.com", + "first_name": "DX-Child", "last_name": "Team", "address_1": "", "address_2": + "", "city": "", "state": "", "zip": "", "country": "", "phone": "", "balance": + 0.0, "tax_id": "", "billing_source": "akamai", "credit_card": {"last_four": + null, "expiry": null}, "balance_uninvoiced": 0.0, "active_since": "2018-01-02T03:04:05", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", + "Kubernetes", "Cloud Firewall", "Vlans", "LKE HA Control Planes", "Machine Images", + "VPCs"], "active_promotions": [], "euuid": "E89C475E-7476-4B95-95EA82BB4EE866E3"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=0, s-maxage=0, no-cache, no-store + - private, max-age=60, s-maxage=60 + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Accept-Encoding + - Authorization, X-Filter + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - child_account:read_only + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "1200" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" +- request: + body: "" + form: {} + headers: + Accept: + - application/json + Content-Type: + - application/json + User-Agent: + - linodego/dev https://github.com/linode/linodego + url: https://api.linode.com/v4beta/account/child-accounts/E89C475E-7476-4B95-95EA82BB4EE866E3/token + method: POST + response: + body: '{"id": 118940, "scopes": "*", "created": "2018-01-02T03:04:05", "label": + "dx-parent-account_411983_1709135656", "token": "bc15402a4afa325689ed1c208607394f6f180121a52e53889e84bf28b2c0c5cd", + "expiry": "2018-01-02T03:04:05"}' + headers: + Access-Control-Allow-Credentials: + - "true" + Access-Control-Allow-Headers: + - Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter + Access-Control-Allow-Methods: + - HEAD, GET, OPTIONS, POST, PUT, DELETE + Access-Control-Allow-Origin: + - '*' + Access-Control-Expose-Headers: + - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status + Cache-Control: + - private, max-age=60, s-maxage=60 + Content-Length: + - "221" + Content-Security-Policy: + - default-src 'none' + Content-Type: + - application/json + Server: + - nginx + Strict-Transport-Security: + - max-age=31536000 + Vary: + - Authorization, X-Filter + X-Accepted-Oauth-Scopes: + - child_account:read_write + X-Content-Type-Options: + - nosniff + X-Frame-Options: + - DENY + - DENY + X-Oauth-Scopes: + - '*' + X-Ratelimit-Limit: + - "1200" + X-Xss-Protection: + - 1; mode=block + status: 200 OK + code: 200 + duration: "" diff --git a/test/integration/fixtures/TestAccountEvents_List.yaml b/test/integration/fixtures/TestAccountEvents_List.yaml index 227515af1..1e0b66182 100644 --- a/test/integration/fixtures/TestAccountEvents_List.yaml +++ b/test/integration/fixtures/TestAccountEvents_List.yaml @@ -17,71 +17,197 @@ interactions: body: '{"data": [{"id": "ap-west", "label": "Mumbai, IN", "country": "in", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "GPU Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], "status": - "ok", "resolvers": {"ipv4": "172.105.34.5,172.105.35.5,172.105.36.5,172.105.37.5,172.105.38.5,172.105.39.5,172.105.40.5,172.105.41.5,172.105.42.5,172.105.43.5", - "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}}, - {"id": "ca-central", "label": "Toronto, CA", "country": "ca", "capabilities": - ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", - "Vlans", "Block Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": - {"ipv4": "172.105.0.5,172.105.3.5,172.105.4.5,172.105.5.5,172.105.6.5,172.105.7.5,172.105.8.5,172.105.9.5,172.105.10.5,172.105.11.5", - "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}}, - {"id": "ap-southeast", "label": "Sydney, AU", "country": "au", "capabilities": - ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", - "Vlans", "Block Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": - {"ipv4": "172.105.166.5,172.105.169.5,172.105.168.5,172.105.172.5,172.105.162.5,172.105.170.5,172.105.167.5,172.105.171.5,172.105.181.5,172.105.161.5", - "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}}, + "ok", "resolvers": {"ipv4": "172.105.34.5, 172.105.35.5, 172.105.36.5, 172.105.37.5, + 172.105.38.5, 172.105.39.5, 172.105.40.5, 172.105.41.5, 172.105.42.5, 172.105.43.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "ca-central", "label": "Toronto, CA", + "country": "ca", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed + Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.0.5, 172.105.3.5, + 172.105.4.5, 172.105.5.5, 172.105.6.5, 172.105.7.5, 172.105.8.5, 172.105.9.5, + 172.105.10.5, 172.105.11.5", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "ap-southeast", + "label": "Sydney, AU", "country": "au", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "172.105.166.5, + 172.105.169.5, 172.105.168.5, 172.105.172.5, 172.105.162.5, 172.105.170.5, 172.105.167.5, + 172.105.171.5, 172.105.181.5, 172.105.161.5", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, {"id": "us-iad", "label": "Washington, DC", "country": "us", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", - "Cloud Firewall", "Vlans", "Managed Databases"], "status": "ok", "resolvers": - {"ipv4": "139.144.192.62,139.144.192.60,139.144.192.61,139.144.192.53,139.144.192.54,139.144.192.67,139.144.192.69,139.144.192.66,139.144.192.52,139.144.192.68", - "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}}, + "Cloud Firewall", "Vlans", "VPCs", "Managed Databases", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "139.144.192.62, 139.144.192.60, + 139.144.192.61, 139.144.192.53, 139.144.192.54, 139.144.192.67, 139.144.192.69, + 139.144.192.66, 139.144.192.52, 139.144.192.68", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-ord", "label": "Chicago, IL", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "VPCs", "Managed Databases", "Metadata", "Premium Plans"], "status": + "ok", "resolvers": {"ipv4": "172.232.0.17, 172.232.0.16, 172.232.0.21, 172.232.0.13, 172.232.0.22, 172.232.0.9, 172.232.0.19, 172.232.0.20, 172.232.0.15, 172.232.0.18", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, {"id": "fr-par", "label": "Paris, FR", "country": "fr", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", - "Vlans", "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "172.232.32.21, 172.232.32.23, 172.232.32.17, 172.232.32.18, 172.232.32.16, 172.232.32.22, 172.232.32.20, 172.232.32.14, 172.232.32.11, 172.232.32.12", - "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, - {"id": "se-sto", "label": "Stockholm, SE", "country": "se", "capabilities": - ["Linodes", "NodeBalancers", "Block Storage", "Managed Databases"], "status": - "ok", "resolvers": {"ipv4": "172.232.128.24, 172.232.128.26, 172.232.128.20, 172.232.128.22, 172.232.128.25, 172.232.128.19, 172.232.128.23, 172.232.128.18, 172.232.128.21, 172.232.128.27", + "Vlans", "VPCs", "Managed Databases", "Metadata", "Premium Plans"], "status": + "ok", "resolvers": {"ipv4": "172.232.32.21, 172.232.32.23, 172.232.32.17, 172.232.32.18, 172.232.32.16, 172.232.32.22, 172.232.32.20, 172.232.32.14, 172.232.32.11, 172.232.32.12", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, - {"id": "us-central", "label": "Dallas, TX", "country": "us", "capabilities": - ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", - "Block Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": - {"ipv4": "72.14.179.5,72.14.188.5,173.255.199.5,66.228.53.5,96.126.122.5,96.126.124.5,96.126.127.5,198.58.107.5,198.58.111.5,23.239.24.5", - "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}}, - {"id": "us-west", "label": "Fremont, CA", "country": "us", "capabilities": ["Linodes", - "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", "Block Storage - Migrations", "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "173.230.145.5,173.230.147.5,173.230.155.5,173.255.212.5,173.255.219.5,173.255.241.5,173.255.243.5,173.255.244.5,74.207.241.5,74.207.242.5", - "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}}, + {"id": "us-sea", "label": "Seattle, WA", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "VPCs", "Metadata", "Premium Plans"], "status": "ok", "resolvers": + {"ipv4": "172.232.160.19, 172.232.160.21, 172.232.160.17, 172.232.160.15, 172.232.160.18, + 172.232.160.8, 172.232.160.12, 172.232.160.11, 172.232.160.14, 172.232.160.16", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "br-gru", "label": "Sao Paulo, BR", + "country": "br", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Metadata", + "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.233.0.4, 172.233.0.9, + 172.233.0.7, 172.233.0.12, 172.233.0.5, 172.233.0.13, 172.233.0.10, 172.233.0.6, + 172.233.0.8, 172.233.0.11", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "nl-ams", + "label": "Amsterdam, NL", "country": "nl", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "VPCs", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.33.36, 172.233.33.38, 172.233.33.35, 172.233.33.39, 172.233.33.34, + 172.233.33.33, 172.233.33.31, 172.233.33.30, 172.233.33.37, 172.233.33.32", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "se-sto", "label": "Stockholm, SE", + "country": "se", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Metadata", + "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.128.24, 172.232.128.26, + 172.232.128.20, 172.232.128.22, 172.232.128.25, 172.232.128.19, 172.232.128.23, + 172.232.128.18, 172.232.128.21, 172.232.128.27", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "es-mad", "label": "Madrid, ES", "country": "es", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "VPCs", "Metadata", "Premium Plans"], "status": "ok", "resolvers": + {"ipv4": "172.233.111.6, 172.233.111.17, 172.233.111.21, 172.233.111.25, 172.233.111.19, + 172.233.111.12, 172.233.111.26, 172.233.111.16, 172.233.111.18, 172.233.111.9", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "in-maa", "label": "Chennai, IN", + "country": "in", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Metadata", + "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.96.17, 172.232.96.26, + 172.232.96.19, 172.232.96.20, 172.232.96.25, 172.232.96.21, 172.232.96.18, 172.232.96.22, + 172.232.96.23, 172.232.96.24", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "jp-osa", + "label": "Osaka, JP", "country": "jp", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", + "VPCs", "Metadata", "Premium Plans"], "status": "ok", "resolvers": {"ipv4": + "172.233.64.44, 172.233.64.43, 172.233.64.37, 172.233.64.40, 172.233.64.46, + 172.233.64.41, 172.233.64.39, 172.233.64.42, 172.233.64.45, 172.233.64.38", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "it-mil", "label": "Milan, IT", "country": + "it", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object + Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Metadata", "Premium + Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.192.19, 172.232.192.18, + 172.232.192.16, 172.232.192.20, 172.232.192.24, 172.232.192.21, 172.232.192.22, + 172.232.192.17, 172.232.192.15, 172.232.192.23", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-mia", "label": "Miami, FL", "country": "us", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", + "Vlans", "VPCs", "Metadata", "Premium Plans"], "status": "ok", "resolvers": + {"ipv4": "172.233.160.34, 172.233.160.27, 172.233.160.30, 172.233.160.29, 172.233.160.32, + 172.233.160.28, 172.233.160.33, 172.233.160.26, 172.233.160.25, 172.233.160.31", + "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "id-cgk", "label": "Jakarta, ID", + "country": "id", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", + "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "VPCs", "Metadata", + "Premium Plans"], "status": "ok", "resolvers": {"ipv4": "172.232.224.23, 172.232.224.32, + 172.232.224.26, 172.232.224.27, 172.232.224.21, 172.232.224.24, 172.232.224.22, + 172.232.224.20, 172.232.224.31, 172.232.224.28", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}, + {"id": "us-lax", "label": "Los Angeles, CA", "country": "us", "capabilities": + ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "VPCs", "Metadata", "Premium Plans"], "status": "ok", + "resolvers": {"ipv4": "172.233.128.45, 172.233.128.38, 172.233.128.53, 172.233.128.37, + 172.233.128.34, 172.233.128.36, 172.233.128.33, 172.233.128.39, 172.233.128.43, + 172.233.128.44", "ipv6": "1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678"}}, {"id": "us-central", + "label": "Dallas, TX", "country": "us", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", + "Managed Databases"], "status": "ok", "resolvers": {"ipv4": "72.14.179.5, 72.14.188.5, + 173.255.199.5, 66.228.53.5, 96.126.122.5, 96.126.124.5, 96.126.127.5, 198.58.107.5, + 198.58.111.5, 23.239.24.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "us-west", "label": "Fremont, CA", "country": "us", + "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", + "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed Databases"], + "status": "ok", "resolvers": {"ipv4": "173.230.145.5, 173.230.147.5, 173.230.155.5, + 173.255.212.5, 173.255.219.5, 173.255.241.5, 173.255.243.5, 173.255.244.5, 74.207.241.5, + 74.207.242.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, {"id": "us-southeast", "label": "Atlanta, GA", "country": "us", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed - Databases"], "status": "ok", "resolvers": {"ipv4": "74.207.231.5,173.230.128.5,173.230.129.5,173.230.136.5,173.230.140.5,66.228.59.5,66.228.62.5,50.116.35.5,50.116.41.5,23.239.18.5", - "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}}, - {"id": "us-east", "label": "Newark, NJ", "country": "us", "capabilities": ["Linodes", - "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", - "Cloud Firewall", "Bare Metal", "Vlans", "Block Storage Migrations", "Managed - Databases"], "status": "ok", "resolvers": {"ipv4": "66.228.42.5,96.126.106.5,50.116.53.5,50.116.58.5,50.116.61.5,50.116.62.5,66.175.211.5,97.107.133.4,207.192.69.4,207.192.69.5", - "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}}, - {"id": "eu-west", "label": "London, UK", "country": "uk", "capabilities": ["Linodes", - "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block - Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": {"ipv4": - "178.79.182.5,176.58.107.5,176.58.116.5,176.58.121.5,151.236.220.5,212.71.252.5,212.71.253.5,109.74.192.20,109.74.193.20,109.74.194.20", - "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}}, - {"id": "ap-south", "label": "Singapore, SG", "country": "sg", "capabilities": - ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", - "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed - Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.11.5,139.162.13.5,139.162.14.5,139.162.15.5,139.162.16.5,139.162.21.5,139.162.27.5,103.3.60.18,103.3.60.19,103.3.60.20", - "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}}, - {"id": "eu-central", "label": "Frankfurt, DE", "country": "de", "capabilities": + Databases"], "status": "ok", "resolvers": {"ipv4": "74.207.231.5, 173.230.128.5, + 173.230.129.5, 173.230.136.5, 173.230.140.5, 66.228.59.5, 66.228.62.5, 50.116.35.5, + 50.116.41.5, 23.239.18.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "us-east", "label": "Newark, NJ", "country": "us", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", "Cloud Firewall", "Vlans", "Block Storage Migrations", "Managed - Databases"], "status": "ok", "resolvers": {"ipv4": "139.162.130.5,139.162.131.5,139.162.132.5,139.162.133.5,139.162.134.5,139.162.135.5,139.162.136.5,139.162.137.5,139.162.138.5,139.162.139.5", - "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}}, - {"id": "ap-northeast", "label": "Tokyo, JP", "country": "jp", "capabilities": + Databases"], "status": "ok", "resolvers": {"ipv4": "66.228.42.5, 96.126.106.5, + 50.116.53.5, 50.116.58.5, 50.116.61.5, 50.116.62.5, 66.175.211.5, 97.107.133.4, + 207.192.69.4, 207.192.69.5", "ipv6": "1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678"}}, {"id": "eu-west", "label": "London, UK", "country": "gb", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", - "Block Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": - {"ipv4": "139.162.66.5,139.162.67.5,139.162.68.5,139.162.69.5,139.162.70.5,139.162.71.5,139.162.72.5,139.162.73.5,139.162.74.5,139.162.75.5", - "ipv6": "1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678,1234::5678"}}], - "page": 1, "pages": 1, "results": 14}' + "Vlans", "Block Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": + {"ipv4": "178.79.182.5, 176.58.107.5, 176.58.116.5, 176.58.121.5, 151.236.220.5, + 212.71.252.5, 212.71.253.5, 109.74.192.20, 109.74.193.20, 109.74.194.20", "ipv6": + "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, {"id": "ap-south", + "label": "Singapore, SG", "country": "sg", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", "Cloud Firewall", + "Vlans", "Block Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": + {"ipv4": "139.162.11.5, 139.162.13.5, 139.162.14.5, 139.162.15.5, 139.162.16.5, + 139.162.21.5, 139.162.27.5, 103.3.60.18, 103.3.60.19, 103.3.60.20", "ipv6": + "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, {"id": "eu-central", + "label": "Frankfurt, DE", "country": "de", "capabilities": ["Linodes", "NodeBalancers", + "Block Storage", "Object Storage", "GPU Linodes", "Kubernetes", "Cloud Firewall", + "Vlans", "Block Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": + {"ipv4": "139.162.130.5, 139.162.131.5, 139.162.132.5, 139.162.133.5, 139.162.134.5, + 139.162.135.5, 139.162.136.5, 139.162.137.5, 139.162.138.5, 139.162.139.5", + "ipv6": "1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678"}}, {"id": + "ap-northeast", "label": "Tokyo, JP", "country": "jp", "capabilities": ["Linodes", + "NodeBalancers", "Block Storage", "Kubernetes", "Cloud Firewall", "Vlans", "Block + Storage Migrations", "Managed Databases"], "status": "ok", "resolvers": {"ipv4": + "139.162.66.5, 139.162.67.5, 139.162.68.5, 139.162.69.5, 139.162.70.5, 139.162.71.5, + 139.162.72.5, 139.162.73.5, 139.162.74.5, 139.162.75.5", "ipv6": "1234::5678, + 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, 1234::5678, + 1234::5678, 1234::5678, 1234::5678"}}], "page": 1, "pages": 1, "results": + 25}' headers: Access-Control-Allow-Credentials: - "true" @@ -94,19 +220,23 @@ interactions: Access-Control-Expose-Headers: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - - private, max-age=900 - - private, max-age=60, s-maxage=60 + - max-age=0, no-cache, no-store + Connection: + - keep-alive Content-Security-Policy: - default-src 'none' Content-Type: - application/json - Server: - - nginx + Expires: + - Tue, 13 Feb 2024 18:57:39 GMT + Pragma: + - no-cache Strict-Transport-Security: - max-age=31536000 Vary: - Authorization, X-Filter - Authorization, X-Filter + - Accept-Encoding X-Accepted-Oauth-Scopes: - '*' X-Content-Type-Options: @@ -117,14 +247,14 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "800" + - "400" X-Xss-Protection: - 1; mode=block status: 200 OK code: 200 duration: "" - request: - body: '{"region":"ap-west","type":"g6-nanode-1","label":"go-test-ins-5k0mfy94hi15","root_pass":"R34lBAdP455LONGLONGLONGLONG","image":"linode/debian9","booted":false}' + body: '{"region":"ap-west","type":"g6-nanode-1","label":"go-test-ins-m46za03ow68d","root_pass":"9yCC9:61nQy`,QPY0l3c3l\\,a6v~sX@\u003cS.V0M4|RQ$46?v(RqV90{iiL?]p9qQ4c","image":"linode/debian9","booted":false}' form: {} headers: Accept: @@ -136,15 +266,15 @@ interactions: url: https://api.linode.com/v4beta/linode/instances method: POST response: - body: '{"id": 46936365, "label": "go-test-ins-5k0mfy94hi15", "group": "", "status": + body: '{"id": 54901429, "label": "go-test-ins-m46za03ow68d", "group": "", "status": "provisioning", "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", - "type": "g6-nanode-1", "ipv4": ["194.195.119.209"], "ipv6": "1234::5678/128", + "type": "g6-nanode-1", "ipv4": ["172.105.37.117"], "ipv6": "1234::5678/128", "image": "linode/debian9", "region": "ap-west", "specs": {"disk": 25600, "memory": 1024, "vcpus": 1, "gpus": 0, "transfer": 1000}, "alerts": {"cpu": 90, "network_in": 10, "network_out": 10, "transfer_quota": 80, "io": 10000}, "backups": {"enabled": false, "available": false, "schedule": {"day": null, "window": null}, "last_successful": null}, "hypervisor": "kvm", "watchdog_enabled": true, "tags": [], "host_uuid": - "5d091e7cd8be0eda03fd5427bc793e60b152a517"}' + "fa64d019358bf632d06312534742340b36a8d0bc", "has_user_data": false}' headers: Access-Control-Allow-Credentials: - "true" @@ -157,15 +287,19 @@ interactions: Access-Control-Expose-Headers: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - - private, max-age=60, s-maxage=60 + - max-age=0, no-cache, no-store + Connection: + - keep-alive Content-Length: - - "719" + - "742" Content-Security-Policy: - default-src 'none' Content-Type: - application/json - Server: - - nginx + Expires: + - Tue, 13 Feb 2024 18:57:40 GMT + Pragma: + - no-cache Strict-Transport-Security: - max-age=31536000 Vary: @@ -196,10 +330,10 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/46936365/configs + url: https://api.linode.com/v4beta/linode/instances/54901429/configs method: POST response: - body: '{"id": 49791866, "label": "test-config", "helpers": {"updatedb_disabled": + body: '{"id": 58004569, "label": "test-config", "helpers": {"updatedb_disabled": true, "distro": true, "modules_dep": true, "network": true, "devtmpfs_automount": true}, "kernel": "linode/latest-64bit", "comments": "", "memory_limit": 0, "created": "2018-01-02T03:04:05", "updated": "2018-01-02T03:04:05", "root_device": "/dev/sda", @@ -218,15 +352,19 @@ interactions: Access-Control-Expose-Headers: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - - private, max-age=60, s-maxage=60 + - max-age=0, no-cache, no-store + Connection: + - keep-alive Content-Length: - "525" Content-Security-Policy: - default-src 'none' Content-Type: - application/json - Server: - - nginx + Expires: + - Tue, 13 Feb 2024 18:57:40 GMT + Pragma: + - no-cache Strict-Transport-Security: - max-age=31536000 Vary: @@ -241,7 +379,7 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "800" + - "400" X-Xss-Protection: - 1; mode=block status: 200 OK @@ -258,16 +396,16 @@ interactions: User-Agent: - linodego/dev https://github.com/linode/linodego X-Filter: - - '{"action":"linode_config_create","entity.id":46936365,"entity.type":"linode"}' + - '{"action":"linode_config_create","entity.id":54901429,"entity.type":"linode"}' url: https://api.linode.com/v4beta/account/events method: GET response: - body: '{"data": [{"id": 511080170, "created": "2018-01-02T03:04:05", "seen": false, + body: '{"data": [{"id": 648679792, "created": "2018-01-02T03:04:05", "seen": false, "read": false, "percent_complete": null, "time_remaining": null, "rate": null, - "duration": null, "action": "linode_config_create", "username": "zliang27", - "entity": {"label": "go-test-ins-5k0mfy94hi15", "id": 46936365, "type": "linode", - "url": "/v4/linode/instances/46936365"}, "status": "notification", "secondary_entity": - {"id": 49791866, "type": "linode_config", "label": "test-config", "url": "/v4/linode/instances/46936365/configs/49791866"}, + "duration": null, "action": "linode_config_create", "username": "lgarber-dev", + "entity": {"label": "go-test-ins-m46za03ow68d", "id": 54901429, "type": "linode", + "url": "/v4/linode/instances/54901429"}, "status": "notification", "secondary_entity": + {"id": 58004569, "type": "linode_config", "label": "test-config", "url": "/v4/linode/instances/54901429/configs/58004569"}, "message": ""}], "page": 1, "pages": 1, "results": 1}' headers: Access-Control-Allow-Credentials: @@ -281,16 +419,19 @@ interactions: Access-Control-Expose-Headers: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - - private, max-age=0, s-maxage=0, no-cache, no-store - - private, max-age=60, s-maxage=60 + - max-age=0, no-cache, no-store + Connection: + - keep-alive Content-Length: - - "578" + - "581" Content-Security-Policy: - default-src 'none' Content-Type: - application/json - Server: - - nginx + Expires: + - Tue, 13 Feb 2024 18:57:40 GMT + Pragma: + - no-cache Strict-Transport-Security: - max-age=31536000 Vary: @@ -306,7 +447,7 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "800" + - "400" X-Xss-Protection: - 1; mode=block status: 200 OK @@ -322,7 +463,7 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/linode/instances/46936365 + url: https://api.linode.com/v4beta/linode/instances/54901429 method: DELETE response: body: '{}' @@ -338,15 +479,19 @@ interactions: Access-Control-Expose-Headers: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - - private, max-age=60, s-maxage=60 + - max-age=0, no-cache, no-store + Connection: + - keep-alive Content-Length: - "2" Content-Security-Policy: - default-src 'none' Content-Type: - application/json - Server: - - nginx + Expires: + - Tue, 13 Feb 2024 18:57:41 GMT + Pragma: + - no-cache Strict-Transport-Security: - max-age=31536000 Vary: @@ -361,7 +506,7 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "800" + - "400" X-Xss-Protection: - 1; mode=block status: 200 OK diff --git a/test/integration/fixtures/TestAccountLogins_List.yaml b/test/integration/fixtures/TestAccountLogins_List.yaml index 04d8240b1..401c50e56 100644 --- a/test/integration/fixtures/TestAccountLogins_List.yaml +++ b/test/integration/fixtures/TestAccountLogins_List.yaml @@ -14,16 +14,16 @@ interactions: url: https://api.linode.com/v4beta/account/logins method: GET response: - body: '{"data": [{"id": 1563948056, "datetime": "2018-01-02T03:04:05", "ip": "1234::5678", - "username": "ErikZilber", "status": "successful", "restricted": false}, {"id": - 1563982298, "datetime": "2018-01-02T03:04:05", "ip": "24.63.69.52", "username": - "ErikZilber", "status": "successful", "restricted": false}, {"id": 1564542275, - "datetime": "2018-01-02T03:04:05", "ip": "1234::5678", - "username": "ErikZilber", "status": "failed", "restricted": false}, {"id": 1564542300, - "datetime": "2018-01-02T03:04:05", "ip": "1234::5678", - "username": "ErikZilber", "status": "successful", "restricted": false}, {"id": - 1564542307, "datetime": "2018-01-02T03:04:05", "ip": "1234::5678", - "username": "ErikZilber", "status": "successful", "restricted": false}], "page": + body: '{"data": [{"id": 1568954245, "datetime": "2018-01-02T03:04:05", "ip": "1234::5678", + "username": "lgarber-dev", "status": "successful", "restricted": false}, {"id": + 1569235189, "datetime": "2018-01-02T03:04:05", "ip": "1234::5678", + "username": "lgarber-dev", "status": "successful", "restricted": false}, {"id": + 1569637840, "datetime": "2018-01-02T03:04:05", "ip": "1234::5678", + "username": "lgarber-dev", "status": "successful", "restricted": false}, {"id": + 1569835290, "datetime": "2018-01-02T03:04:05", "ip": "1234::5678", + "username": "lgarber-dev", "status": "successful", "restricted": false}, {"id": + 1569852953, "datetime": "2018-01-02T03:04:05", "ip": "1234::5678", + "username": "lgarber-dev", "status": "successful", "restricted": false}], "page": 1, "pages": 1, "results": 5}' headers: Access-Control-Allow-Credentials: @@ -37,21 +37,23 @@ interactions: Access-Control-Expose-Headers: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - - private, max-age=0, s-maxage=0, no-cache, no-store - - private, max-age=60, s-maxage=60 - Content-Length: - - "878" + - max-age=0, no-cache, no-store + Connection: + - keep-alive Content-Security-Policy: - default-src 'none' Content-Type: - application/json - Server: - - nginx + Expires: + - Tue, 13 Feb 2024 18:57:41 GMT + Pragma: + - no-cache Strict-Transport-Security: - max-age=31536000 Vary: - Authorization, X-Filter - Authorization, X-Filter + - Accept-Encoding X-Accepted-Oauth-Scopes: - account:read_only X-Content-Type-Options: @@ -62,7 +64,7 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "800" + - "400" X-Xss-Protection: - 1; mode=block status: 200 OK @@ -78,11 +80,11 @@ interactions: - application/json User-Agent: - linodego/dev https://github.com/linode/linodego - url: https://api.linode.com/v4beta/account/logins/1563948056 + url: https://api.linode.com/v4beta/account/logins/1568954245 method: GET response: - body: '{"id": 1563948056, "datetime": "2018-01-02T03:04:05", "ip": "1234::5678", - "username": "ErikZilber", "status": "successful", "restricted": false}' + body: '{"id": 1568954245, "datetime": "2018-01-02T03:04:05", "ip": "1234::5678", + "username": "lgarber-dev", "status": "successful", "restricted": false}' headers: Access-Control-Allow-Credentials: - "true" @@ -95,16 +97,19 @@ interactions: Access-Control-Expose-Headers: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - - private, max-age=0, s-maxage=0, no-cache, no-store - - private, max-age=60, s-maxage=60 + - max-age=0, no-cache, no-store + Connection: + - keep-alive Content-Length: - - "170" + - "174" Content-Security-Policy: - default-src 'none' Content-Type: - application/json - Server: - - nginx + Expires: + - Tue, 13 Feb 2024 18:57:41 GMT + Pragma: + - no-cache Strict-Transport-Security: - max-age=31536000 Vary: @@ -120,7 +125,7 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "800" + - "400" X-Xss-Protection: - 1; mode=block status: 200 OK diff --git a/test/integration/fixtures/TestAccountNotifications_List.yaml b/test/integration/fixtures/TestAccountNotifications_List.yaml index 080bf04c6..5aef500a1 100644 --- a/test/integration/fixtures/TestAccountNotifications_List.yaml +++ b/test/integration/fixtures/TestAccountNotifications_List.yaml @@ -27,16 +27,19 @@ interactions: Access-Control-Expose-Headers: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - - private, max-age=0, s-maxage=0, no-cache, no-store - - private, max-age=60, s-maxage=60 + - max-age=0, no-cache, no-store + Connection: + - keep-alive Content-Length: - "49" Content-Security-Policy: - default-src 'none' Content-Type: - application/json - Server: - - nginx + Expires: + - Tue, 13 Feb 2024 18:57:42 GMT + Pragma: + - no-cache Strict-Transport-Security: - max-age=31536000 Vary: @@ -52,7 +55,7 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "800" + - "400" X-Xss-Protection: - 1; mode=block status: 200 OK diff --git a/test/integration/fixtures/TestAccount_Get.yaml b/test/integration/fixtures/TestAccount_Get.yaml index b91df39f1..4f4beacac 100644 --- a/test/integration/fixtures/TestAccount_Get.yaml +++ b/test/integration/fixtures/TestAccount_Get.yaml @@ -14,14 +14,14 @@ interactions: url: https://api.linode.com/v4beta/account method: GET response: - body: '{"company": "Linode", "email": "REDACTED", "first_name": "REDACTED", - "last_name": "REDACTED", "address_1": "REDACTED", "address_2": "NA", - "city": "REDACTED", "state": "REDACTED", "zip": "REDACTED", "country": "US", "phone": - "REDACTED", "balance": 0.0, "tax_id": "", "billing_source": "linode", "credit_card": - {"last_four": "REDACTED", "expiry": "REDACTED"}, "balance_uninvoiced": 0.0, "active_since": + body: '{"company": "Linode", "email": "foo@linode.com", "first_name": "foo", + "last_name": "bar", "address_1": "123 Street Street", "address_2": "NA", + "city": "Philadelphia", "state": "PA", "zip": "30000", "country": "US", "phone": + "1234567891", "balance": 0.0, "tax_id": "", "billing_source": "linode", "credit_card": + {"last_four": "1234", "expiry": "02/2020"}, "balance_uninvoiced": 0.0, "active_since": "2018-01-02T03:04:05", "capabilities": ["Linodes", "NodeBalancers", "Block Storage", "Object Storage", "Kubernetes", "Cloud Firewall", "Vlans", "LKE HA Control Planes", - "Machine Images", "Managed Databases"], "active_promotions": [], "euuid": "REDACTED"}' + "Machine Images", "Managed Databases"], "active_promotions": [], "euuid": "FFFFFFFF-2E4D-47CE-FFFFFFFFFFFFFFFFF"}' headers: Access-Control-Allow-Credentials: - "true" @@ -34,16 +34,19 @@ interactions: Access-Control-Expose-Headers: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - - private, max-age=0, s-maxage=0, no-cache, no-store - - private, max-age=60, s-maxage=60 + - max-age=0, no-cache, no-store + Connection: + - keep-alive Content-Length: - - "687" + - "695" Content-Security-Policy: - default-src 'none' Content-Type: - application/json - Server: - - nginx + Expires: + - Tue, 13 Feb 2024 18:57:42 GMT + Pragma: + - no-cache Strict-Transport-Security: - max-age=31536000 Vary: @@ -59,7 +62,7 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "800" + - "400" X-Xss-Protection: - 1; mode=block status: 200 OK diff --git a/test/integration/fixtures/TestUserGrants_Update.yaml b/test/integration/fixtures/TestUserGrants_Update.yaml index 8771a3333..4657aba54 100644 --- a/test/integration/fixtures/TestUserGrants_Update.yaml +++ b/test/integration/fixtures/TestUserGrants_Update.yaml @@ -16,7 +16,7 @@ interactions: response: body: '{"username": "linodegotest-updateusergrants", "email": "linodegotest-updateusergrants@example.com", "restricted": true, "ssh_keys": [], "tfa_enabled": false, "verified_phone_number": - null}' + null, "password_created": null, "last_login": null, "user_type": "default"}' headers: Access-Control-Allow-Credentials: - "true" @@ -29,15 +29,19 @@ interactions: Access-Control-Expose-Headers: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - - private, max-age=60, s-maxage=60 + - max-age=0, no-cache, no-store + Connection: + - keep-alive Content-Length: - - "188" + - "258" Content-Security-Policy: - default-src 'none' Content-Type: - application/json - Server: - - nginx + Expires: + - Tue, 13 Feb 2024 19:39:30 GMT + Pragma: + - no-cache Strict-Transport-Security: - max-age=31536000 Vary: @@ -52,14 +56,14 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "800" + - "400" X-Xss-Protection: - 1; mode=block status: 200 OK code: 200 duration: "" - request: - body: '{"global":{"account_access":"read_only","add_domains":false,"add_databases":true,"add_firewalls":true,"add_images":true,"add_linodes":false,"add_longview":true,"add_nodebalancers":false,"add_stackscripts":true,"add_volumes":true,"cancel_account":false,"longview_subscription":false}}' + body: '{"global":{"account_access":"read_only","add_databases":true,"add_domains":false,"add_firewalls":true,"add_images":true,"add_linodes":false,"add_longview":true,"add_nodebalancers":false,"add_stackscripts":true,"add_volumes":true,"cancel_account":false,"longview_subscription":false}}' form: {} headers: Accept: @@ -71,51 +75,23 @@ interactions: url: https://api.linode.com/v4beta/account/users/linodegotest-updateusergrants/grants method: PUT response: - body: '{"linode": [{"id": 41591158, "label": "ansible-test-inventory", "permissions": - null}, {"id": 41658354, "label": "tf_test-5934556314800509826", "permissions": - null}, {"id": 41658415, "label": "tf_test-9137808634680747348", "permissions": - null}, {"id": 41658417, "label": "tf_test-6820438710173430308", "permissions": - null}, {"id": 41658428, "label": "tf_test-7984198885518639651", "permissions": - null}, {"id": 41658616, "label": "tf_test-7823563263536727759", "permissions": - null}, {"id": 41658675, "label": "tf_test-7500823998336775767", "permissions": - null}, {"id": 41658677, "label": "tf_test-9039857053321143333", "permissions": - null}, {"id": 41658694, "label": "tf_test-958893655126211430", "permissions": - null}, {"id": 41823145, "label": "ubuntu-us-east-testing", "permissions": null}], - "nodebalancer": [], "domain": [], "stackscript": [{"id": 1110207, "label": "ansible-test-197619451", - "permissions": null}], "longview": [], "image": [{"id": 18529728, "label": "tf_test-6820438710173430308", - "permissions": null}, {"id": 18529729, "label": "tf_test-2510365653812729564", - "permissions": null}, {"id": 18529730, "label": "tf_test-9137808634680747348", - "permissions": null}, {"id": 18529737, "label": "tf_test-7984198885518639651", - "permissions": null}, {"id": 18529738, "label": "tf_test-7984198885518639651", - "permissions": null}, {"id": 18529812, "label": "tf_test-7500823998336775767", - "permissions": null}, {"id": 18529815, "label": "tf_test-9039857053321143333", - "permissions": null}, {"id": 18529816, "label": "tf_test-958893655126211430", - "permissions": null}, {"id": 18529817, "label": "tf_test-958893655126211430", - "permissions": null}], "volume": [], "firewall": [], "database": [{"id": 14637, - "label": "tf_test-563520466150203250", "permissions": null}, {"id": 14638, "label": - "tf_test-6390117349771558899", "permissions": null}, {"id": 14639, "label": - "tf_test-1374137760482804261", "permissions": null}, {"id": 14640, "label": - "tf_test-3347111867749673643", "permissions": null}, {"id": 14641, "label": - "tf_test-6859397732720482476", "permissions": null}, {"id": 14642, "label": - "tf_test-8291666874639770804", "permissions": null}, {"id": 14643, "label": - "tf_test-8193840941368456464", "permissions": null}, {"id": 14644, "label": - "tf_test-4799969768229110427", "permissions": null}, {"id": 14645, "label": - "tf_test-580262857426233267", "permissions": null}, {"id": 14646, "label": "tf_test-4469883573221458079", - "permissions": null}, {"id": 14647, "label": "tf_test-2509947882041115336", - "permissions": null}, {"id": 14648, "label": "tf_test-2870651309179209554", - "permissions": null}, {"id": 14649, "label": "tf_test-5837446087162928096", - "permissions": null}, {"id": 14650, "label": "tf_test-6665087439142600447", - "permissions": null}, {"id": 14651, "label": "tf_test-5999066805637904071", - "permissions": null}, {"id": 14652, "label": "tf_test-4281084641894890037", - "permissions": null}, {"id": 14653, "label": "tf_test-7554465936951395838", - "permissions": null}, {"id": 14654, "label": "tf_test-4133636875310411703", - "permissions": null}, {"id": 14655, "label": "tf_test-8469382010146043663", - "permissions": null}, {"id": 14656, "label": "tf_test-1209200813276963127", - "permissions": null}], "global": {"add_domains": false, "add_linodes": false, - "add_longview": true, "longview_subscription": false, "add_stackscripts": true, - "add_nodebalancers": false, "add_images": true, "add_volumes": true, "add_firewalls": - true, "add_databases": true, "account_access": "read_only", "cancel_account": - false}}' + body: '{"linode": [{"id": 54772819, "label": "test-instance", "permissions": null}, + {"id": 54779923, "label": "test-instance-2", "permissions": null}], "nodebalancer": + [], "domain": [], "stackscript": [{"id": 1173356, "label": "foo", "permissions": + null}], "longview": [], "image": [], "volume": [], "firewall": [{"id": 346984, + "label": "cool-firewall", "permissions": null}], "database": [{"id": 522, "label": + "scalegridgoestojapanpt2", "permissions": null}, {"id": 6806, "label": "tf_test-6495208472049336246", + "permissions": null}, {"id": 6807, "label": "tf_test-6874476732250362643", "permissions": + null}, {"id": 6808, "label": "tf_test-3486893335994149933", "permissions": null}, + {"id": 22775, "label": "IntTestSDK_1686065805updatedSQLDB", "permissions": null}], + "vpc": [{"id": 21774, "label": "test", "permissions": null}, {"id": 21790, "label": + "1707494018673859000label", "permissions": null}, {"id": 21791, "label": "1707494037856246000label", + "permissions": null}, {"id": 21795, "label": "test-vpc", "permissions": null}, + {"id": 21804, "label": "1707497046369793000label", "permissions": null}], "global": + {"add_volumes": true, "add_databases": true, "add_stackscripts": true, "add_domains": + false, "add_images": true, "add_firewalls": true, "longview_subscription": false, + "add_longview": true, "add_vpcs": false, "add_nodebalancers": false, "add_linodes": + false, "account_access": "read_only", "cancel_account": false}}' headers: Access-Control-Allow-Credentials: - "true" @@ -128,17 +104,22 @@ interactions: Access-Control-Expose-Headers: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - - private, max-age=60, s-maxage=60 + - max-age=0, no-cache, no-store + Connection: + - keep-alive Content-Security-Policy: - default-src 'none' Content-Type: - application/json - Server: - - nginx + Expires: + - Tue, 13 Feb 2024 19:39:31 GMT + Pragma: + - no-cache Strict-Transport-Security: - max-age=31536000 Vary: - Authorization, X-Filter + - Accept-Encoding X-Accepted-Oauth-Scopes: - account:read_write X-Content-Type-Options: @@ -149,7 +130,7 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "800" + - "400" X-Xss-Protection: - 1; mode=block status: 200 OK @@ -181,15 +162,19 @@ interactions: Access-Control-Expose-Headers: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - - private, max-age=60, s-maxage=60 + - max-age=0, no-cache, no-store + Connection: + - keep-alive Content-Length: - "2" Content-Security-Policy: - default-src 'none' Content-Type: - application/json - Server: - - nginx + Expires: + - Tue, 13 Feb 2024 19:39:31 GMT + Pragma: + - no-cache Strict-Transport-Security: - max-age=31536000 Vary: @@ -204,7 +189,7 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "800" + - "400" X-Xss-Protection: - 1; mode=block status: 200 OK diff --git a/test/integration/fixtures/TestUserGrants_UpdateNoAccess.yaml b/test/integration/fixtures/TestUserGrants_UpdateNoAccess.yaml index a8f53d906..2bfad674f 100644 --- a/test/integration/fixtures/TestUserGrants_UpdateNoAccess.yaml +++ b/test/integration/fixtures/TestUserGrants_UpdateNoAccess.yaml @@ -16,7 +16,7 @@ interactions: response: body: '{"username": "linodegotest-updateusergrantsna", "email": "linodegotest-updateusergrants@example.com", "restricted": true, "ssh_keys": [], "tfa_enabled": false, "verified_phone_number": - null}' + null, "password_created": null, "last_login": null, "user_type": "default"}' headers: Access-Control-Allow-Credentials: - "true" @@ -29,15 +29,19 @@ interactions: Access-Control-Expose-Headers: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - - private, max-age=60, s-maxage=60 + - max-age=0, no-cache, no-store + Connection: + - keep-alive Content-Length: - - "190" + - "260" Content-Security-Policy: - default-src 'none' Content-Type: - application/json - Server: - - nginx + Expires: + - Tue, 13 Feb 2024 19:39:32 GMT + Pragma: + - no-cache Strict-Transport-Security: - max-age=31536000 Vary: @@ -52,14 +56,14 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "800" + - "400" X-Xss-Protection: - 1; mode=block status: 200 OK code: 200 duration: "" - request: - body: '{"global":{"account_access":null,"add_domains":false,"add_databases":false,"add_firewalls":false,"add_images":false,"add_linodes":false,"add_longview":false,"add_nodebalancers":false,"add_stackscripts":false,"add_volumes":false,"cancel_account":false,"longview_subscription":false}}' + body: '{"global":{"account_access":null,"add_databases":false,"add_domains":false,"add_firewalls":false,"add_images":false,"add_linodes":false,"add_longview":false,"add_nodebalancers":false,"add_stackscripts":false,"add_volumes":false,"cancel_account":false,"longview_subscription":false}}' form: {} headers: Accept: @@ -71,50 +75,23 @@ interactions: url: https://api.linode.com/v4beta/account/users/linodegotest-updateusergrantsna/grants method: PUT response: - body: '{"linode": [{"id": 41591158, "label": "ansible-test-inventory", "permissions": - null}, {"id": 41658354, "label": "tf_test-5934556314800509826", "permissions": - null}, {"id": 41658415, "label": "tf_test-9137808634680747348", "permissions": - null}, {"id": 41658417, "label": "tf_test-6820438710173430308", "permissions": - null}, {"id": 41658428, "label": "tf_test-7984198885518639651", "permissions": - null}, {"id": 41658616, "label": "tf_test-7823563263536727759", "permissions": - null}, {"id": 41658675, "label": "tf_test-7500823998336775767", "permissions": - null}, {"id": 41658677, "label": "tf_test-9039857053321143333", "permissions": - null}, {"id": 41658694, "label": "tf_test-958893655126211430", "permissions": - null}, {"id": 41823145, "label": "ubuntu-us-east-testing", "permissions": null}], - "nodebalancer": [], "domain": [], "stackscript": [{"id": 1110207, "label": "ansible-test-197619451", - "permissions": null}], "longview": [], "image": [{"id": 18529728, "label": "tf_test-6820438710173430308", - "permissions": null}, {"id": 18529729, "label": "tf_test-2510365653812729564", - "permissions": null}, {"id": 18529730, "label": "tf_test-9137808634680747348", - "permissions": null}, {"id": 18529737, "label": "tf_test-7984198885518639651", - "permissions": null}, {"id": 18529738, "label": "tf_test-7984198885518639651", - "permissions": null}, {"id": 18529812, "label": "tf_test-7500823998336775767", - "permissions": null}, {"id": 18529815, "label": "tf_test-9039857053321143333", - "permissions": null}, {"id": 18529816, "label": "tf_test-958893655126211430", - "permissions": null}, {"id": 18529817, "label": "tf_test-958893655126211430", - "permissions": null}], "volume": [], "firewall": [], "database": [{"id": 14637, - "label": "tf_test-563520466150203250", "permissions": null}, {"id": 14638, "label": - "tf_test-6390117349771558899", "permissions": null}, {"id": 14639, "label": - "tf_test-1374137760482804261", "permissions": null}, {"id": 14640, "label": - "tf_test-3347111867749673643", "permissions": null}, {"id": 14641, "label": - "tf_test-6859397732720482476", "permissions": null}, {"id": 14642, "label": - "tf_test-8291666874639770804", "permissions": null}, {"id": 14643, "label": - "tf_test-8193840941368456464", "permissions": null}, {"id": 14644, "label": - "tf_test-4799969768229110427", "permissions": null}, {"id": 14645, "label": - "tf_test-580262857426233267", "permissions": null}, {"id": 14646, "label": "tf_test-4469883573221458079", - "permissions": null}, {"id": 14647, "label": "tf_test-2509947882041115336", - "permissions": null}, {"id": 14648, "label": "tf_test-2870651309179209554", - "permissions": null}, {"id": 14649, "label": "tf_test-5837446087162928096", - "permissions": null}, {"id": 14650, "label": "tf_test-6665087439142600447", - "permissions": null}, {"id": 14651, "label": "tf_test-5999066805637904071", - "permissions": null}, {"id": 14652, "label": "tf_test-4281084641894890037", - "permissions": null}, {"id": 14653, "label": "tf_test-7554465936951395838", - "permissions": null}, {"id": 14654, "label": "tf_test-4133636875310411703", - "permissions": null}, {"id": 14655, "label": "tf_test-8469382010146043663", - "permissions": null}, {"id": 14656, "label": "tf_test-1209200813276963127", - "permissions": null}], "global": {"add_domains": false, "add_linodes": false, - "add_longview": false, "longview_subscription": false, "add_stackscripts": false, - "add_nodebalancers": false, "add_images": false, "add_volumes": false, "add_firewalls": - false, "add_databases": false, "account_access": null, "cancel_account": false}}' + body: '{"linode": [{"id": 54772819, "label": "test-instance", "permissions": null}, + {"id": 54779923, "label": "test-instance-2", "permissions": null}], "nodebalancer": + [], "domain": [], "stackscript": [{"id": 1173356, "label": "foo", "permissions": + null}], "longview": [], "image": [], "volume": [], "firewall": [{"id": 346984, + "label": "cool-firewall", "permissions": null}], "database": [{"id": 522, "label": + "scalegridgoestojapanpt2", "permissions": null}, {"id": 6806, "label": "tf_test-6495208472049336246", + "permissions": null}, {"id": 6807, "label": "tf_test-6874476732250362643", "permissions": + null}, {"id": 6808, "label": "tf_test-3486893335994149933", "permissions": null}, + {"id": 22775, "label": "IntTestSDK_1686065805updatedSQLDB", "permissions": null}], + "vpc": [{"id": 21774, "label": "test", "permissions": null}, {"id": 21790, "label": + "1707494018673859000label", "permissions": null}, {"id": 21791, "label": "1707494037856246000label", + "permissions": null}, {"id": 21795, "label": "test-vpc", "permissions": null}, + {"id": 21804, "label": "1707497046369793000label", "permissions": null}], "global": + {"add_databases": false, "add_nodebalancers": false, "add_volumes": false, "add_firewalls": + false, "add_longview": false, "add_domains": false, "add_linodes": false, "add_vpcs": + false, "add_images": false, "add_stackscripts": false, "longview_subscription": + false, "account_access": null, "cancel_account": false}}' headers: Access-Control-Allow-Credentials: - "true" @@ -127,17 +104,22 @@ interactions: Access-Control-Expose-Headers: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - - private, max-age=60, s-maxage=60 + - max-age=0, no-cache, no-store + Connection: + - keep-alive Content-Security-Policy: - default-src 'none' Content-Type: - application/json - Server: - - nginx + Expires: + - Tue, 13 Feb 2024 19:39:32 GMT + Pragma: + - no-cache Strict-Transport-Security: - max-age=31536000 Vary: - Authorization, X-Filter + - Accept-Encoding X-Accepted-Oauth-Scopes: - account:read_write X-Content-Type-Options: @@ -148,7 +130,7 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "800" + - "400" X-Xss-Protection: - 1; mode=block status: 200 OK @@ -180,15 +162,19 @@ interactions: Access-Control-Expose-Headers: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - - private, max-age=60, s-maxage=60 + - max-age=0, no-cache, no-store + Connection: + - keep-alive Content-Length: - "2" Content-Security-Policy: - default-src 'none' Content-Type: - application/json - Server: - - nginx + Expires: + - Tue, 13 Feb 2024 19:39:32 GMT + Pragma: + - no-cache Strict-Transport-Security: - max-age=31536000 Vary: @@ -203,7 +189,7 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "800" + - "400" X-Xss-Protection: - 1; mode=block status: 200 OK diff --git a/test/integration/fixtures/TestUser_Get.yaml b/test/integration/fixtures/TestUser_Get.yaml index 1f8f277b5..a789c87af 100644 --- a/test/integration/fixtures/TestUser_Get.yaml +++ b/test/integration/fixtures/TestUser_Get.yaml @@ -16,7 +16,7 @@ interactions: response: body: '{"username": "linodegotest-getuser", "email": "linodegotest-getuser@example.com", "restricted": true, "ssh_keys": [], "tfa_enabled": false, "verified_phone_number": - null, "password_created": null}' + null, "password_created": null, "last_login": null, "user_type": "default"}' headers: Access-Control-Allow-Credentials: - "true" @@ -29,15 +29,19 @@ interactions: Access-Control-Expose-Headers: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - - private, max-age=60, s-maxage=60 + - max-age=0, no-cache, no-store + Connection: + - keep-alive Content-Length: - - "196" + - "240" Content-Security-Policy: - default-src 'none' Content-Type: - application/json - Server: - - nginx + Expires: + - Tue, 13 Feb 2024 19:39:34 GMT + Pragma: + - no-cache Strict-Transport-Security: - max-age=31536000 Vary: @@ -52,7 +56,7 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "800" + - "400" X-Xss-Protection: - 1; mode=block status: 200 OK @@ -73,7 +77,7 @@ interactions: response: body: '{"username": "linodegotest-getuser", "email": "linodegotest-getuser@example.com", "restricted": true, "ssh_keys": [], "tfa_enabled": false, "verified_phone_number": - null, "password_created": null}' + null, "password_created": null, "last_login": null, "user_type": "default"}' headers: Access-Control-Allow-Credentials: - "true" @@ -86,16 +90,19 @@ interactions: Access-Control-Expose-Headers: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - - private, max-age=0, s-maxage=0, no-cache, no-store - - private, max-age=60, s-maxage=60 + - max-age=0, no-cache, no-store + Connection: + - keep-alive Content-Length: - - "196" + - "240" Content-Security-Policy: - default-src 'none' Content-Type: - application/json - Server: - - nginx + Expires: + - Tue, 13 Feb 2024 19:39:34 GMT + Pragma: + - no-cache Strict-Transport-Security: - max-age=31536000 Vary: @@ -111,7 +118,7 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "800" + - "400" X-Xss-Protection: - 1; mode=block status: 200 OK @@ -143,15 +150,19 @@ interactions: Access-Control-Expose-Headers: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - - private, max-age=60, s-maxage=60 + - max-age=0, no-cache, no-store + Connection: + - keep-alive Content-Length: - "2" Content-Security-Policy: - default-src 'none' Content-Type: - application/json - Server: - - nginx + Expires: + - Tue, 13 Feb 2024 19:39:34 GMT + Pragma: + - no-cache Strict-Transport-Security: - max-age=31536000 Vary: @@ -166,7 +177,7 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "800" + - "400" X-Xss-Protection: - 1; mode=block status: 200 OK diff --git a/test/integration/fixtures/TestUser_GetMissing.yaml b/test/integration/fixtures/TestUser_GetMissing.yaml index 17859b4ef..4f6059800 100644 --- a/test/integration/fixtures/TestUser_GetMissing.yaml +++ b/test/integration/fixtures/TestUser_GetMissing.yaml @@ -23,13 +23,17 @@ interactions: Access-Control-Allow-Origin: - '*' Cache-Control: - - private, max-age=0, s-maxage=0, no-cache, no-store + - max-age=0, no-cache, no-store + Connection: + - keep-alive Content-Length: - "37" Content-Type: - application/json - Server: - - nginx + Expires: + - Tue, 13 Feb 2024 19:39:32 GMT + Pragma: + - no-cache Vary: - Authorization, X-Filter X-Accepted-Oauth-Scopes: @@ -39,7 +43,7 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "800" + - "400" status: 404 Not Found code: 404 duration: "" diff --git a/test/integration/fixtures/TestUser_Update.yaml b/test/integration/fixtures/TestUser_Update.yaml index a4f968c55..455b98f86 100644 --- a/test/integration/fixtures/TestUser_Update.yaml +++ b/test/integration/fixtures/TestUser_Update.yaml @@ -16,7 +16,7 @@ interactions: response: body: '{"username": "linodegotest-updateuser", "email": "linodegotest-updateuser@example.com", "restricted": false, "ssh_keys": [], "tfa_enabled": false, "verified_phone_number": - null}' + null, "password_created": null, "last_login": null, "user_type": "default"}' headers: Access-Control-Allow-Credentials: - "true" @@ -29,15 +29,19 @@ interactions: Access-Control-Expose-Headers: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - - private, max-age=60, s-maxage=60 + - max-age=0, no-cache, no-store + Connection: + - keep-alive Content-Length: - - "177" + - "247" Content-Security-Policy: - default-src 'none' Content-Type: - application/json - Server: - - nginx + Expires: + - Tue, 13 Feb 2024 19:39:35 GMT + Pragma: + - no-cache Strict-Transport-Security: - max-age=31536000 Vary: @@ -52,7 +56,7 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "800" + - "400" X-Xss-Protection: - 1; mode=block status: 200 OK @@ -73,7 +77,7 @@ interactions: response: body: '{"username": "linodegotest-updateuser-updated", "email": "linodegotest-updateuser@example.com", "restricted": true, "ssh_keys": [], "tfa_enabled": false, "verified_phone_number": - null}' + null, "password_created": null, "last_login": null, "user_type": "default"}' headers: Access-Control-Allow-Credentials: - "true" @@ -86,15 +90,19 @@ interactions: Access-Control-Expose-Headers: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - - private, max-age=60, s-maxage=60 + - max-age=0, no-cache, no-store + Connection: + - keep-alive Content-Length: - - "184" + - "254" Content-Security-Policy: - default-src 'none' Content-Type: - application/json - Server: - - nginx + Expires: + - Tue, 13 Feb 2024 19:39:35 GMT + Pragma: + - no-cache Strict-Transport-Security: - max-age=31536000 Vary: @@ -109,7 +117,7 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "800" + - "400" X-Xss-Protection: - 1; mode=block status: 200 OK @@ -141,15 +149,19 @@ interactions: Access-Control-Expose-Headers: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - - private, max-age=60, s-maxage=60 + - max-age=0, no-cache, no-store + Connection: + - keep-alive Content-Length: - "2" Content-Security-Policy: - default-src 'none' Content-Type: - application/json - Server: - - nginx + Expires: + - Tue, 13 Feb 2024 19:39:35 GMT + Pragma: + - no-cache Strict-Transport-Security: - max-age=31536000 Vary: @@ -164,7 +176,7 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "800" + - "400" X-Xss-Protection: - 1; mode=block status: 200 OK diff --git a/test/integration/fixtures/TestUsers_List.yaml b/test/integration/fixtures/TestUsers_List.yaml index 1265acb81..3cf94d2fc 100644 --- a/test/integration/fixtures/TestUsers_List.yaml +++ b/test/integration/fixtures/TestUsers_List.yaml @@ -16,7 +16,7 @@ interactions: response: body: '{"username": "linodegotest-listuser", "email": "linodegotest-listuser@example.com", "restricted": false, "ssh_keys": [], "tfa_enabled": false, "verified_phone_number": - null, "password_created": null}' + null, "password_created": null, "last_login": null, "user_type": "default"}' headers: Access-Control-Allow-Credentials: - "true" @@ -29,15 +29,19 @@ interactions: Access-Control-Expose-Headers: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - - private, max-age=60, s-maxage=60 + - max-age=0, no-cache, no-store + Connection: + - keep-alive Content-Length: - - "199" + - "243" Content-Security-Policy: - default-src 'none' Content-Type: - application/json - Server: - - nginx + Expires: + - Tue, 13 Feb 2024 19:39:36 GMT + Pragma: + - no-cache Strict-Transport-Security: - max-age=31536000 Vary: @@ -52,7 +56,7 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "800" + - "400" X-Xss-Protection: - 1; mode=block status: 200 OK @@ -71,11 +75,15 @@ interactions: url: https://api.linode.com/v4beta/account/users method: GET response: - body: '{"data": [{"username": "ychen123", "email": "yechen@akamai.com", "restricted": - false, "ssh_keys": [], "tfa_enabled": true, "verified_phone_number": null, "password_created": - null}, {"username": "linodegotest-listuser", "email": "linodegotest-listuser@example.com", + body: '{"data": [{"username": "lgarber-dev", "email": "lgarber@akamai.com", "restricted": + false, "ssh_keys": ["tf_test_authorized_keys", "main", "tf_test_authorized_keys", + "dev-server-rsa", "tf_test_authorized_keys", "foo", "fosdfo"], "tfa_enabled": + true, "verified_phone_number": null, "password_created": null, "last_login": + {"login_datetime": "2018-01-02T03:04:05", "status": "successful"}, "user_type": + "default"}, {"username": "linodegotest-listuser", "email": "linodegotest-listuser@example.com", "restricted": false, "ssh_keys": [], "tfa_enabled": false, "verified_phone_number": - null, "password_created": null}], "page": 1, "pages": 1, "results": 2}' + null, "password_created": null, "last_login": null, "user_type": "default"}], + "page": 1, "pages": 1, "results": 2}' headers: Access-Control-Allow-Credentials: - "true" @@ -88,16 +96,19 @@ interactions: Access-Control-Expose-Headers: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - - private, max-age=0, s-maxage=0, no-cache, no-store - - private, max-age=60, s-maxage=60 + - max-age=0, no-cache, no-store + Connection: + - keep-alive Content-Length: - - "419" + - "694" Content-Security-Policy: - default-src 'none' Content-Type: - application/json - Server: - - nginx + Expires: + - Tue, 13 Feb 2024 19:39:36 GMT + Pragma: + - no-cache Strict-Transport-Security: - max-age=31536000 Vary: @@ -113,7 +124,7 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "800" + - "400" X-Xss-Protection: - 1; mode=block status: 200 OK @@ -145,15 +156,19 @@ interactions: Access-Control-Expose-Headers: - X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status Cache-Control: - - private, max-age=60, s-maxage=60 + - max-age=0, no-cache, no-store + Connection: + - keep-alive Content-Length: - "2" Content-Security-Policy: - default-src 'none' Content-Type: - application/json - Server: - - nginx + Expires: + - Tue, 13 Feb 2024 19:39:37 GMT + Pragma: + - no-cache Strict-Transport-Security: - max-age=31536000 Vary: @@ -168,7 +183,7 @@ interactions: X-Oauth-Scopes: - '*' X-Ratelimit-Limit: - - "800" + - "400" X-Xss-Protection: - 1; mode=block status: 200 OK diff --git a/test/integration/integration_suite_test.go b/test/integration/integration_suite_test.go index d416aab32..a4534cc6e 100644 --- a/test/integration/integration_suite_test.go +++ b/test/integration/integration_suite_test.go @@ -19,6 +19,8 @@ import ( ) var ( + optInTestPrefixes []string + testingMode = recorder.ModeDisabled debugAPI = false validTestAPIKey = "NOTANAPIKEY" diff --git a/test/unit/account_child_test.go b/test/unit/account_child_test.go new file mode 100644 index 000000000..a58d9ea04 --- /dev/null +++ b/test/unit/account_child_test.go @@ -0,0 +1,103 @@ +package unit + +import ( + "context" + "fmt" + "reflect" + "testing" + + "github.com/jarcoal/httpmock" + "github.com/linode/linodego" + "github.com/linode/linodego/internal/testutil" + "github.com/stretchr/testify/require" +) + +var testChildAccount = linodego.ChildAccount{ + Address1: "123 Main Street", + Address2: "Suite A", + Balance: 200, + BalanceUninvoiced: 145, + Capabilities: []string{ + "Linodes", + "NodeBalancers", + "Block Storage", + "Object Storage", + }, + City: "Philadelphia", + Company: "Linode LLC", + Country: "US", + CreditCard: &linodego.CreditCard{ + Expiry: "11/2022", + LastFour: "1111", + }, + Email: "john.smith@linode.com", + EUUID: "E1AF5EEC-526F-487D-B317EBEB34C87D71", + FirstName: "John", + LastName: "Smith", + Phone: "215-555-1212", + State: "PA", + TaxID: "ATU99999999", + Zip: "19102-1234", +} + +func TestAccountChild_list(t *testing.T) { + client := createMockClient(t) + + desiredResponse := map[string]any{ + "page": 1, + "pages": 1, + "results": 1, + "data": []linodego.ChildAccount{ + testChildAccount, + }, + } + + httpmock.RegisterRegexpResponder( + "GET", + testutil.MockRequestURL("/account/child-accounts"), + httpmock.NewJsonResponderOrPanic(200, &desiredResponse), + ) + + accounts, err := client.ListChildAccounts(context.Background(), nil) + require.NoError(t, err) + + require.True(t, reflect.DeepEqual(accounts, desiredResponse["data"])) +} + +func TestAccountChild_get(t *testing.T) { + client := createMockClient(t) + + httpmock.RegisterRegexpResponder( + "GET", + testutil.MockRequestURL(fmt.Sprintf("/account/child-accounts/%s", testChildAccount.EUUID)), + httpmock.NewJsonResponderOrPanic(200, &testChildAccount), + ) + + account, err := client.GetChildAccount(context.Background(), testChildAccount.EUUID) + require.NoError(t, err) + + require.True(t, reflect.DeepEqual(*account, testChildAccount)) +} + +func TestAccountChild_createToken(t *testing.T) { + client := createMockClient(t) + + desiredResponse := linodego.ChildAccountToken{ + ID: 123, + Scopes: "*", + Label: "child_token", + } + + httpmock.RegisterRegexpResponder( + "POST", + testutil.MockRequestURL( + fmt.Sprintf("/account/child-accounts/%s/token", testChildAccount.EUUID), + ), + httpmock.NewJsonResponderOrPanic(200, &desiredResponse), + ) + + token, err := client.CreateChildAccountToken(context.Background(), testChildAccount.EUUID) + require.NoError(t, err) + + require.True(t, reflect.DeepEqual(*token, desiredResponse)) +}