diff --git a/.travis.yml b/.travis.yml index 58f14c7158..ae20cb6e22 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,8 +9,8 @@ env: matrix: fast_finish: true include: - - go: 1.11.x - go: 1.12.x + - go: 1.13.x - go: 1.x - go: tip allow_failures: diff --git a/cloudflare/cloudflare_sweeper_test.go b/cloudflare/cloudflare_sweeper_test.go index 0931cf1c93..61b94af7c3 100644 --- a/cloudflare/cloudflare_sweeper_test.go +++ b/cloudflare/cloudflare_sweeper_test.go @@ -15,7 +15,7 @@ func TestMain(m *testing.M) { // sharedClient returns a common Cloudflare client setup needed for the // sweeper functions. func sharedClient() (*cloudflare.API, error) { - client, err := cloudflare.New(os.Getenv("CLOUDFLARE_TOKEN"), os.Getenv("CLOUDFLARE_EMAIL")) + client, err := cloudflare.New(os.Getenv("CLOUDFLARE_API_KEY"), os.Getenv("CLOUDFLARE_EMAIL")) if err != nil { return client, err diff --git a/cloudflare/config.go b/cloudflare/config.go index 9d8a88ab2d..e2668af195 100644 --- a/cloudflare/config.go +++ b/cloudflare/config.go @@ -9,7 +9,7 @@ import ( type Config struct { Email string - Token string + APIKey string APIToken string Options []cloudflare.Option } @@ -22,7 +22,7 @@ func (c *Config) Client() (*cloudflare.API, error) { if c.APIToken != "" { client, err = cloudflare.NewWithAPIToken(c.APIToken, c.Options...) } else { - client, err = cloudflare.New(c.Token, c.Email, c.Options...) + client, err = cloudflare.New(c.APIKey, c.Email, c.Options...) } if err != nil { return nil, fmt.Errorf("Error creating new Cloudflare client: %s", err) diff --git a/cloudflare/data_source_ip_ranges_test.go b/cloudflare/data_source_ip_ranges_test.go index fed3bf6a9a..21b8bd5e45 100644 --- a/cloudflare/data_source_ip_ranges_test.go +++ b/cloudflare/data_source_ip_ranges_test.go @@ -3,7 +3,6 @@ package cloudflare import ( "fmt" "net" - "os" "sort" "strconv" "testing" @@ -32,8 +31,6 @@ func testAccCloudflareIPRanges(n string) resource.TestCheckFunc { r := s.RootModule().Resources[n] a := r.Primary.Attributes - fmt.Fprintf(os.Stderr, "%#v", a) - var ( cidrBlockSize int err error diff --git a/cloudflare/import_cloudflare_load_balancer_test.go b/cloudflare/import_cloudflare_load_balancer_test.go index 52c181eedb..1c230be6c4 100644 --- a/cloudflare/import_cloudflare_load_balancer_test.go +++ b/cloudflare/import_cloudflare_load_balancer_test.go @@ -1,11 +1,10 @@ package cloudflare import ( + "fmt" "os" "testing" - "fmt" - "github.com/cloudflare/cloudflare-go" "github.com/hashicorp/terraform/helper/resource" ) @@ -14,6 +13,7 @@ func TestAccCloudflareLoadBalancer_Import(t *testing.T) { t.Parallel() var loadBalancer cloudflare.LoadBalancer zone := os.Getenv("CLOUDFLARE_DOMAIN") + zoneID := os.Getenv("CLOUDFLARE_ZONE_ID") rnd := generateRandomResourceName() name := "cloudflare_load_balancer." + rnd @@ -22,20 +22,20 @@ func TestAccCloudflareLoadBalancer_Import(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckCloudflareLoadBalancerConfigBasic(zone, rnd), + Config: testAccCheckCloudflareLoadBalancerConfigBasic(zoneID, zone, rnd), Check: resource.ComposeTestCheckFunc( testAccCheckCloudflareLoadBalancerExists(name, &loadBalancer), - testAccCheckCloudflareLoadBalancerIDIsValid(name, zone), + testAccCheckCloudflareLoadBalancerIDIsValid(name, zoneID), ), }, { ResourceName: name, - ImportStateIdPrefix: fmt.Sprintf("%s/", zone), + ImportStateIdPrefix: fmt.Sprintf("%s/", zoneID), ImportState: true, ImportStateVerify: true, Check: resource.ComposeTestCheckFunc( testAccCheckCloudflareLoadBalancerExists(name, &loadBalancer), - testAccCheckCloudflareLoadBalancerIDIsValid(name, zone), + testAccCheckCloudflareLoadBalancerIDIsValid(name, zoneID), ), }, }, diff --git a/cloudflare/import_cloudflare_page_rule_test.go b/cloudflare/import_cloudflare_page_rule_test.go index cb9a089c5b..577b739a1d 100644 --- a/cloudflare/import_cloudflare_page_rule_test.go +++ b/cloudflare/import_cloudflare_page_rule_test.go @@ -13,9 +13,9 @@ import ( func TestAccCloudflarePageRule_Import(t *testing.T) { t.Parallel() var pageRule cloudflare.PageRule - zone := os.Getenv("CLOUDFLARE_DOMAIN") + zoneID := os.Getenv("CLOUDFLARE_ZONE_ID") name := "cloudflare_page_rule.test" - target := fmt.Sprintf("test-import.%s", zone) + target := fmt.Sprintf("test-import.%s", os.Getenv("CLOUDFLARE_DOMAIN")) resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) }, @@ -23,14 +23,14 @@ func TestAccCloudflarePageRule_Import(t *testing.T) { CheckDestroy: testAccCheckCloudflarePageRuleDestroy, Steps: []resource.TestStep{ { - Config: testAccCheckCloudflarePageRuleConfigFullySpecified(zone, target), + Config: testAccCheckCloudflarePageRuleConfigFullySpecified(zoneID, target), Check: resource.ComposeTestCheckFunc( testAccCheckCloudflarePageRuleExists(name, &pageRule), ), }, { ResourceName: name, - ImportStateIdPrefix: fmt.Sprintf("%s/", zone), + ImportStateIdPrefix: fmt.Sprintf("%s/", zoneID), ImportState: true, ImportStateVerify: true, Check: resource.ComposeTestCheckFunc( @@ -43,7 +43,7 @@ func TestAccCloudflarePageRule_Import(t *testing.T) { func TestAccCloudflarePageRule_ImportWithBrowserCacheTTL30(t *testing.T) { var pageRule cloudflare.PageRule - zone := os.Getenv("CLOUDFLARE_DOMAIN") + zoneID := os.Getenv("CLOUDFLARE_ZONE_ID") name := "cloudflare_page_rule.test" testAccRunResourceTestSteps(t, []resource.TestStep{ { @@ -54,7 +54,7 @@ func TestAccCloudflarePageRule_ImportWithBrowserCacheTTL30(t *testing.T) { }, { ResourceName: name, - ImportStateIdPrefix: fmt.Sprintf("%s/", zone), + ImportStateIdPrefix: fmt.Sprintf("%s/", zoneID), ImportState: true, ImportStateVerify: true, Check: resource.ComposeTestCheckFunc( @@ -66,7 +66,7 @@ func TestAccCloudflarePageRule_ImportWithBrowserCacheTTL30(t *testing.T) { func TestAccCloudflarePageRule_ImportWithoutBrowserCacheTTL(t *testing.T) { var pageRule cloudflare.PageRule - zone := os.Getenv("CLOUDFLARE_DOMAIN") + zoneID := os.Getenv("CLOUDFLARE_ZONE_ID") name := "cloudflare_page_rule.test" testAccRunResourceTestSteps(t, []resource.TestStep{ { @@ -77,7 +77,7 @@ func TestAccCloudflarePageRule_ImportWithoutBrowserCacheTTL(t *testing.T) { }, { ResourceName: name, - ImportStateIdPrefix: fmt.Sprintf("%s/", zone), + ImportStateIdPrefix: fmt.Sprintf("%s/", zoneID), ImportState: true, ImportStateVerify: true, Check: resource.ComposeTestCheckFunc( diff --git a/cloudflare/import_cloudflare_rate_limit_test.go b/cloudflare/import_cloudflare_rate_limit_test.go index 964049dc12..cfb67a86e9 100644 --- a/cloudflare/import_cloudflare_rate_limit_test.go +++ b/cloudflare/import_cloudflare_rate_limit_test.go @@ -13,7 +13,8 @@ import ( func TestAccCloudflareRateLimit_Import(t *testing.T) { t.Parallel() var rateLimit cloudflare.RateLimit - zone := os.Getenv("CLOUDFLARE_DOMAIN") + domain := os.Getenv("CLOUDFLARE_DOMAIN") + zoneID := os.Getenv("CLOUDFLARE_ZONE_ID") rnd := generateRandomResourceName() name := "cloudflare_rate_limit." + rnd @@ -22,20 +23,20 @@ func TestAccCloudflareRateLimit_Import(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckCloudflareRateLimitConfigMatchingUrl(zone, rnd), + Config: testAccCheckCloudflareRateLimitConfigMatchingUrl(zoneID, rnd, domain), Check: resource.ComposeTestCheckFunc( testAccCheckCloudflareRateLimitExists(name, &rateLimit), - testAccCheckCloudflareRateLimitIDIsValid(name, zone), + testAccCheckCloudflareRateLimitIDIsValid(name, zoneID), ), }, { ResourceName: name, - ImportStateIdPrefix: fmt.Sprintf("%s/", zone), + ImportStateIdPrefix: fmt.Sprintf("%s/", zoneID), ImportState: true, ImportStateVerify: true, Check: resource.ComposeTestCheckFunc( testAccCheckCloudflareRateLimitExists(name, &rateLimit), - testAccCheckCloudflareRateLimitIDIsValid(name, zone), + testAccCheckCloudflareRateLimitIDIsValid(name, zoneID), ), }, }, diff --git a/cloudflare/import_cloudflare_waf_rule_test.go b/cloudflare/import_cloudflare_waf_rule_test.go index ac61a716a3..872c6f24a8 100644 --- a/cloudflare/import_cloudflare_waf_rule_test.go +++ b/cloudflare/import_cloudflare_waf_rule_test.go @@ -10,7 +10,7 @@ import ( func TestAccCloudflareWAFRule_Import(t *testing.T) { t.Parallel() - zone := os.Getenv("CLOUDFLARE_DOMAIN") + zoneID := os.Getenv("CLOUDFLARE_ZONE_ID") ruleID := "100000" name := generateRandomResourceName() @@ -20,11 +20,11 @@ func TestAccCloudflareWAFRule_Import(t *testing.T) { CheckDestroy: testAccCheckCloudflareWAFRuleDestroy, Steps: []resource.TestStep{ { - Config: testAccCheckCloudflareWAFRuleConfig(zone, ruleID, "block", name), + Config: testAccCheckCloudflareWAFRuleConfig(zoneID, ruleID, "block", name), }, { ResourceName: "cloudflare_waf_rule." + name, - ImportStateIdPrefix: fmt.Sprintf("%s/", zone), + ImportStateIdPrefix: fmt.Sprintf("%s/", zoneID), ImportState: true, ImportStateVerify: true, }, diff --git a/cloudflare/import_cloudflare_worker_route_test.go b/cloudflare/import_cloudflare_worker_route_test.go index ef4bf30bda..7bb2c816f9 100644 --- a/cloudflare/import_cloudflare_worker_route_test.go +++ b/cloudflare/import_cloudflare_worker_route_test.go @@ -5,13 +5,24 @@ import ( "os" "testing" - "github.com/cloudflare/cloudflare-go" + cloudflare "github.com/cloudflare/cloudflare-go" "github.com/hashicorp/terraform/helper/resource" ) func TestAccCloudflareWorkerRoute_Import(t *testing.T) { + // Temporarily unset CLOUDFLARE_API_TOKEN if it is set as the Workers + // service does not yet support the API tokens and it results in + // misleading state error messages. + if os.Getenv("CLOUDFLARE_API_TOKEN") != "" { + defer func(apiToken string) { + os.Setenv("CLOUDFLARE_API_TOKEN", apiToken) + }(os.Getenv("CLOUDFLARE_API_TOKEN")) + os.Setenv("CLOUDFLARE_API_TOKEN", "") + } + var route cloudflare.WorkerRoute zone := os.Getenv("CLOUDFLARE_DOMAIN") + zoneID := os.Getenv("CLOUDFLARE_ZONE_ID") routeRnd := generateRandomResourceName() routeName := "cloudflare_worker_route." + routeRnd pattern := fmt.Sprintf("%s/%s", zone, generateRandomResourceName()) @@ -26,14 +37,14 @@ func TestAccCloudflareWorkerRoute_Import(t *testing.T) { CheckDestroy: testAccCheckCloudflareWorkerRouteDestroy, Steps: []resource.TestStep{ { - Config: testAccCheckCloudflareWorkerRouteConfigMultiScriptInitial(zone, routeRnd, scriptRnd, pattern), + Config: testAccCheckCloudflareWorkerRouteConfigMultiScriptInitial(zoneID, routeRnd, scriptRnd, pattern), Check: resource.ComposeTestCheckFunc( testAccCheckCloudflareWorkerRouteExists(routeName, &route), ), }, { ResourceName: routeName, - ImportStateIdPrefix: fmt.Sprintf("%s/", zone), + ImportStateIdPrefix: fmt.Sprintf("%s/", zoneID), ImportState: true, ImportStateVerify: true, Check: resource.ComposeTestCheckFunc( diff --git a/cloudflare/import_cloudflare_worker_script_test.go b/cloudflare/import_cloudflare_worker_script_test.go index a5a22dd305..749417563f 100644 --- a/cloudflare/import_cloudflare_worker_script_test.go +++ b/cloudflare/import_cloudflare_worker_script_test.go @@ -4,13 +4,22 @@ import ( "os" "testing" - "github.com/cloudflare/cloudflare-go" + cloudflare "github.com/cloudflare/cloudflare-go" "github.com/hashicorp/terraform/helper/resource" ) func TestAccCloudflareWorkerScript_Import(t *testing.T) { + // Temporarily unset CLOUDFLARE_API_TOKEN if it is set as the Workers + // service does not yet support the API tokens and it results in + // misleading state error messages. + if os.Getenv("CLOUDFLARE_API_TOKEN") != "" { + defer func(apiToken string) { + os.Setenv("CLOUDFLARE_API_TOKEN", apiToken) + }(os.Getenv("CLOUDFLARE_API_TOKEN")) + os.Setenv("CLOUDFLARE_API_TOKEN", "") + } + var script cloudflare.WorkerScript - zone := os.Getenv("CLOUDFLARE_DOMAIN") rnd := generateRandomResourceName() name := "cloudflare_worker_script." + rnd @@ -20,7 +29,7 @@ func TestAccCloudflareWorkerScript_Import(t *testing.T) { CheckDestroy: testAccCheckCloudflareWorkerScriptDestroy, Steps: []resource.TestStep{ { - Config: testAccCheckCloudflareWorkerScriptConfigSingleScriptInitial(zone, rnd), + Config: testAccCheckCloudflareWorkerScriptConfigMultiScriptInitial(rnd), Check: resource.ComposeTestCheckFunc( testAccCheckCloudflareWorkerScriptExists(name, &script), ), diff --git a/cloudflare/import_resource_cloudflare_record_test.go b/cloudflare/import_resource_cloudflare_record_test.go index 3bcb5fcb19..3bf02ddf9e 100644 --- a/cloudflare/import_resource_cloudflare_record_test.go +++ b/cloudflare/import_resource_cloudflare_record_test.go @@ -9,7 +9,7 @@ import ( ) func TestAccCloudflareRecord_Import(t *testing.T) { - zone := os.Getenv("CLOUDFLARE_DOMAIN") + zoneID := os.Getenv("CLOUDFLARE_ZONE_ID") name := "cloudflare_record.foobar" resource.Test(t, resource.TestCase{ @@ -17,11 +17,11 @@ func TestAccCloudflareRecord_Import(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckCloudflareRecordConfigBasic(zone, name), + Config: testAccCheckCloudflareRecordConfigBasic(zoneID, name), }, { ResourceName: name, - ImportStateIdPrefix: fmt.Sprintf("%s/", zone), + ImportStateIdPrefix: fmt.Sprintf("%s/", zoneID), ImportState: true, ImportStateVerify: true, }, diff --git a/cloudflare/provider.go b/cloudflare/provider.go index 90a33e55ef..fc66f0d4d5 100644 --- a/cloudflare/provider.go +++ b/cloudflare/provider.go @@ -5,8 +5,8 @@ import ( "log" "os" - "github.com/cloudflare/cloudflare-go" - "github.com/hashicorp/go-cleanhttp" + cloudflare "github.com/cloudflare/cloudflare-go" + cleanhttp "github.com/hashicorp/go-cleanhttp" "github.com/hashicorp/terraform/helper/logging" "github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/httpclient" @@ -25,10 +25,10 @@ func Provider() terraform.ResourceProvider { Description: "A registered Cloudflare email address.", }, - "token": { + "api_key": { Type: schema.TypeString, Optional: true, - DefaultFunc: schema.EnvDefaultFunc("CLOUDFLARE_TOKEN", nil), + DefaultFunc: schema.EnvDefaultFunc("CLOUDFLARE_API_KEY", nil), Description: "The API key for operations.", }, @@ -74,18 +74,11 @@ func Provider() terraform.ResourceProvider { Description: "Whether to print logs from the API client (using the default log library logger)", }, - "use_org_from_zone": { + "account_id": { Type: schema.TypeString, Optional: true, - DefaultFunc: schema.EnvDefaultFunc("CLOUDFLARE_ORG_ZONE", nil), - Description: "If specified zone is owned by an organization, configure API client to always use that organization", - }, - - "org_id": { - Type: schema.TypeString, - Optional: true, - DefaultFunc: schema.EnvDefaultFunc("CLOUDFLARE_ORG_ID", nil), - Description: "Configure API client to always use that organization. If set this will override 'user_owner_from_zone'", + DefaultFunc: schema.EnvDefaultFunc("CLOUDFLARE_ACCOUNT_ID", nil), + Description: "Configure API client to always use that account.", }, }, @@ -156,8 +149,8 @@ func providerConfigure(d *schema.ResourceData, terraformVersion string) (interfa if v, ok := d.GetOk("api_token"); ok { config.APIToken = v.(string) - } else if v, ok := d.GetOk("token"); ok { - config.Token = v.(string) + } else if v, ok := d.GetOk("api_key"); ok { + config.APIKey = v.(string) if v, ok = d.GetOk("email"); ok { config.Email = v.(string) } else { @@ -172,38 +165,9 @@ func providerConfigure(d *schema.ResourceData, terraformVersion string) (interfa return nil, err } - if orgId, ok := d.GetOk("org_id"); ok { - log.Printf("[INFO] Using specified organization id %s in Cloudflare provider", orgId.(string)) - options = append(options, cloudflare.UsingOrganization(orgId.(string))) - } else if zoneName, ok := d.GetOk("use_org_from_zone"); ok { - zoneId, err := client.ZoneIDByName(zoneName.(string)) - if err != nil { - return nil, fmt.Errorf("error finding zone %q: %s", zoneName.(string), err) - } - - zone, err := client.ZoneDetails(zoneId) - if err != nil { - return nil, err - } - log.Printf("[DEBUG] Looked up zone to match organization details to: %#v", zone) - - orgs, _, err := client.ListOrganizations() - if err != nil { - return nil, fmt.Errorf("error listing organizations: %s", err.Error()) - } - log.Printf("[DEBUG] Found organizations for current user: %#v", orgs) - - orgIds := make([]string, len(orgs)) - for _, org := range orgs { - orgIds = append(orgIds, org.ID) - } - - if contains(orgIds, zone.Owner.ID) { - log.Printf("[INFO] Using organization %#v in Cloudflare provider", zone.Owner) - options = append(options, cloudflare.UsingOrganization(zone.Owner.ID)) - } else { - log.Printf("[INFO] Zone ownership specified but organization owner not found. Falling back to using user API for Cloudflare provider") - } + if accountID, ok := d.GetOk("account_id"); ok { + log.Printf("[INFO] Using specified account id %s in Cloudflare provider", accountID.(string)) + options = append(options, cloudflare.UsingAccount(accountID.(string))) } else { return client, err } diff --git a/cloudflare/provider_test.go b/cloudflare/provider_test.go index 0c74b68b54..fbef53ad5e 100644 --- a/cloudflare/provider_test.go +++ b/cloudflare/provider_test.go @@ -36,8 +36,8 @@ func testAccPreCheck(t *testing.T) { t.Fatal("CLOUDFLARE_EMAIL must be set for acceptance tests") } - if v := os.Getenv("CLOUDFLARE_TOKEN"); v == "" { - t.Fatal("CLOUDFLARE_TOKEN must be set for acceptance tests") + if v := os.Getenv("CLOUDFLARE_API_KEY"); v == "" { + t.Fatal("CLOUDFLARE_API_KEY must be set for acceptance tests") } if v := os.Getenv("CLOUDFLARE_DOMAIN"); v == "" { @@ -53,11 +53,15 @@ func testAccPreCheckAltDomain(t *testing.T) { if v := os.Getenv("CLOUDFLARE_ALT_DOMAIN"); v == "" { t.Fatal("CLOUDFLARE_ALT_DOMAIN must be set for this acceptance test") } + + if v := os.Getenv("CLOUDFLARE_ALT_ZONE_ID"); v == "" { + t.Fatal("CLOUDFLARE_ALT_ZONE_ID must be set for this acceptance test") + } } -func testAccPreCheckOrg(t *testing.T) { - if v := os.Getenv("CLOUDFLARE_ORG_ID"); v == "" { - t.Fatal("CLOUDFLARE_ORG_ID must be set for this acceptance test") +func testAccPreCheckAccount(t *testing.T) { + if v := os.Getenv("CLOUDFLARE_ACCOUNT_ID"); v == "" { + t.Fatal("CLOUDFLARE_ACCOUNT_ID must be set for this acceptance test") } } diff --git a/cloudflare/resource_cloudflare_access_rule.go b/cloudflare/resource_cloudflare_access_rule.go index 5b2f5e1b3e..62d8e0623a 100644 --- a/cloudflare/resource_cloudflare_access_rule.go +++ b/cloudflare/resource_cloudflare_access_rule.go @@ -21,13 +21,6 @@ func resourceCloudflareAccessRule() *schema.Resource { }, Schema: map[string]*schema.Schema{ - "zone": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Computed: true, - Deprecated: "`zone` is deprecated in favour of explicit `zone_id` and will be removed in the next major release", - }, "zone_id": { Type: schema.TypeString, Optional: true, @@ -68,7 +61,6 @@ func resourceCloudflareAccessRule() *schema.Resource { func resourceCloudflareAccessRuleCreate(d *schema.ResourceData, meta interface{}) error { client := meta.(*cloudflare.API) - zone := d.Get("zone").(string) zoneID := d.Get("zone_id").(string) newRule := cloudflare.AccessRule{ @@ -88,22 +80,13 @@ func resourceCloudflareAccessRuleCreate(d *schema.ResourceData, meta interface{} var r *cloudflare.AccessRuleResponse var err error - if zone == "" && zoneID == "" { - if client.OrganizationID != "" { - r, err = client.CreateOrganizationAccessRule(client.OrganizationID, newRule) + if zoneID == "" { + if client.AccountID != "" { + r, err = client.CreateAccountAccessRule(client.AccountID, newRule) } else { r, err = client.CreateUserAccessRule(newRule) } } else { - if zoneID == "" { - zoneID, err = client.ZoneIDByName(zone) - if err != nil { - return fmt.Errorf("Error finding zone %q: %s", zone, err) - } - - d.Set("zone_id", zoneID) - } - r, err = client.CreateZoneAccessRule(zoneID, newRule) } @@ -123,27 +106,13 @@ func resourceCloudflareAccessRuleCreate(d *schema.ResourceData, meta interface{} func resourceCloudflareAccessRuleRead(d *schema.ResourceData, meta interface{}) error { client := meta.(*cloudflare.API) zoneID := d.Get("zone_id").(string) - zoneName := d.Get("zone").(string) - if zoneID == "" { - zoneID, _ = client.ZoneIDByName(zoneName) - } else { - zones, err := client.ListZones() - if err != nil { - return fmt.Errorf("failed to lookup all zones: %s", err) - } - for _, zone := range zones { - if zone.ID == zoneID { - zoneName = zone.Name - } - } - } var accessRuleResponse *cloudflare.AccessRuleResponse var err error if zoneID == "" { - if client.OrganizationID != "" { - accessRuleResponse, err = client.OrganizationAccessRule(client.OrganizationID, d.Id()) + if client.AccountID != "" { + accessRuleResponse, err = client.AccountAccessRule(client.AccountID, d.Id()) } else { accessRuleResponse, err = client.UserAccessRule(d.Id()) @@ -166,7 +135,6 @@ func resourceCloudflareAccessRuleRead(d *schema.ResourceData, meta interface{}) log.Printf("[DEBUG] Cloudflare Access Rule read configuration: %#v", accessRuleResponse) - d.Set("zone", zoneName) d.Set("zone_id", zoneID) d.Set("mode", accessRuleResponse.Result.Mode) d.Set("notes", accessRuleResponse.Result.Notes) @@ -203,8 +171,8 @@ func resourceCloudflareAccessRuleUpdate(d *schema.ResourceData, meta interface{} var err error if zoneID == "" { - if client.OrganizationID != "" { - _, err = client.UpdateOrganizationAccessRule(client.OrganizationID, d.Id(), newRule) + if client.AccountID != "" { + _, err = client.UpdateAccountAccessRule(client.AccountID, d.Id(), newRule) } else { _, err = client.UpdateUserAccessRule(d.Id(), newRule) } @@ -228,8 +196,8 @@ func resourceCloudflareAccessRuleDelete(d *schema.ResourceData, meta interface{} var err error if zoneID == "" { - if client.OrganizationID != "" { - _, err = client.DeleteOrganizationAccessRule(client.OrganizationID, d.Id()) + if client.AccountID != "" { + _, err = client.DeleteAccountAccessRule(client.AccountID, d.Id()) } else { _, err = client.DeleteUserAccessRule(d.Id()) } @@ -264,7 +232,7 @@ func resourceCloudflareAccessRuleImport(d *schema.ResourceData, meta interface{} switch accessRuleType { case "account": - client.OrganizationID = accessRuleTypeIdentifier + client.AccountID = accessRuleTypeIdentifier case "zone": d.Set("zone_id", accessRuleTypeIdentifier) } diff --git a/cloudflare/resource_cloudflare_access_rule_test.go b/cloudflare/resource_cloudflare_access_rule_test.go index f2a469d5ec..3ed3595891 100644 --- a/cloudflare/resource_cloudflare_access_rule_test.go +++ b/cloudflare/resource_cloudflare_access_rule_test.go @@ -32,7 +32,7 @@ func testAccessRuleAccountConfig(mode, notes, target, value string) string { resource "cloudflare_access_rule" "test" { notes = "%[2]s" mode = "%[1]s" - configuration = { + configuration = { target = "%[3]s" value = "%[4]s" } diff --git a/cloudflare/resource_cloudflare_account_member.go b/cloudflare/resource_cloudflare_account_member.go index 9a3f784a8e..9bf5f264d2 100644 --- a/cloudflare/resource_cloudflare_account_member.go +++ b/cloudflare/resource_cloudflare_account_member.go @@ -46,7 +46,7 @@ func resourceCloudflareAccountMember() *schema.Resource { func resourceCloudflareAccountMemberRead(d *schema.ResourceData, meta interface{}) error { client := meta.(*cloudflare.API) - _, err := client.AccountMember(client.OrganizationID, d.Id()) + _, err := client.AccountMember(client.AccountID, d.Id()) if err != nil { if strings.Contains(err.Error(), "Member not found") || strings.Contains(err.Error(), "HTTP status 404") { @@ -67,7 +67,7 @@ func resourceCloudflareAccountMemberDelete(d *schema.ResourceData, meta interfac log.Printf("[INFO] Deleting Cloudflare account member ID: %s", d.Id()) - err := client.DeleteAccountMember(client.OrganizationID, d.Id()) + err := client.DeleteAccountMember(client.AccountID, d.Id()) if err != nil { return fmt.Errorf("error deleting Cloudflare account member: %s", err) } @@ -86,7 +86,7 @@ func resourceCloudflareAccountMemberCreate(d *schema.ResourceData, meta interfac accountMemberRoleIDs = append(accountMemberRoleIDs, roleID.(string)) } - r, err := client.CreateAccountMember(client.OrganizationID, memberEmailAddress, accountMemberRoleIDs) + r, err := client.CreateAccountMember(client.AccountID, memberEmailAddress, accountMemberRoleIDs) if err != nil { return fmt.Errorf("error creating Cloudflare account member: %s", err) @@ -107,12 +107,12 @@ func resourceCloudflareAccountMemberUpdate(d *schema.ResourceData, meta interfac memberRoles := d.Get("role_ids").([]interface{}) for _, r := range memberRoles { - accountRole, _ := client.AccountRole(client.OrganizationID, r.(string)) + accountRole, _ := client.AccountRole(client.AccountID, r.(string)) accountRoles = append(accountRoles, accountRole) } updatedAccountMember := cloudflare.AccountMember{Roles: accountRoles} - _, err := client.UpdateAccountMember(client.OrganizationID, d.Id(), updatedAccountMember) + _, err := client.UpdateAccountMember(client.AccountID, d.Id(), updatedAccountMember) if err != nil { return fmt.Errorf("failed to update Cloudflare account member: %s", err) } diff --git a/cloudflare/resource_cloudflare_filter.go b/cloudflare/resource_cloudflare_filter.go index e31be22fe3..a2667d3615 100644 --- a/cloudflare/resource_cloudflare_filter.go +++ b/cloudflare/resource_cloudflare_filter.go @@ -21,18 +21,10 @@ func resourceCloudflareFilter() *schema.Resource { }, Schema: map[string]*schema.Schema{ - "zone": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Computed: true, - Deprecated: "`zone` is deprecated in favour of explicit `zone_id` and will be removed in the next major release", - }, "zone_id": { Type: schema.TypeString, - Optional: true, + Required: true, ForceNew: true, - Computed: true, }, "paused": { Type: schema.TypeBool, @@ -61,21 +53,10 @@ func resourceCloudflareFilter() *schema.Resource { func resourceCloudflareFilterCreate(d *schema.ResourceData, meta interface{}) error { client := meta.(*cloudflare.API) - zoneName := d.Get("zone").(string) zoneID := d.Get("zone_id").(string) var err error - if zoneName == "" && zoneID == "" { - return fmt.Errorf("'zone' or 'zone_id' is required") - } else if zoneID == "" { - zoneID, err = client.ZoneIDByName(zoneName) - if err != nil { - return fmt.Errorf("Error finding zone %q: %s", zoneName, err) - } - d.Set("zone_id", zoneID) - } - var newFilter cloudflare.Filter if paused, ok := d.GetOk("paused"); ok { @@ -116,22 +97,6 @@ func resourceCloudflareFilterCreate(d *schema.ResourceData, meta interface{}) er func resourceCloudflareFilterRead(d *schema.ResourceData, meta interface{}) error { client := meta.(*cloudflare.API) zoneID := d.Get("zone_id").(string) - zoneName := d.Get("zone").(string) - - if zoneID == "" { - zoneID, _ = client.ZoneIDByName(zoneName) - } else { - zones, err := client.ListZones() - if err != nil { - return fmt.Errorf("failed to lookup all zones: %s", err) - } - - for _, zone := range zones { - if zone.ID == zoneID { - zoneName = zone.Name - } - } - } log.Printf("[DEBUG] Getting a Filter record for zone %q, id %s", zoneID, d.Id()) filter, err := client.Filter(zoneID, d.Id()) @@ -150,8 +115,6 @@ func resourceCloudflareFilterRead(d *schema.ResourceData, meta interface{}) erro log.Printf("[DEBUG] Cloudflare Filter read configuration: %#v", filter) - d.Set("zone", zoneName) - d.Set("zone_id", zoneID) d.Set("paused", filter.Paused) d.Set("description", filter.Description) d.Set("expression", filter.Expression) diff --git a/cloudflare/resource_cloudflare_filter_test.go b/cloudflare/resource_cloudflare_filter_test.go index f920c5ea95..df78c851ab 100644 --- a/cloudflare/resource_cloudflare_filter_test.go +++ b/cloudflare/resource_cloudflare_filter_test.go @@ -11,7 +11,7 @@ import ( func TestAccFilterSimple(t *testing.T) { rnd := generateRandomResourceName() name := "cloudflare_filter." + rnd - zone := os.Getenv("CLOUDFLARE_DOMAIN") + zoneID := os.Getenv("CLOUDFLARE_ZONE_ID") filterQuoted := `(http.request.uri.path ~ \".*wp-login-` + rnd + `.php\" or http.request.uri.path ~ \".*xmlrpc.php\") and ip.src ne 192.0.2.1` filterUnquoted := `(http.request.uri.path ~ ".*wp-login-` + rnd + `.php" or http.request.uri.path ~ ".*xmlrpc.php") and ip.src ne 192.0.2.1` @@ -21,33 +21,32 @@ func TestAccFilterSimple(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testFilterConfig(rnd, zone, "true", "this is notes", filterQuoted), + Config: testFilterConfig(rnd, zoneID, "true", "this is notes", filterQuoted), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr(name, "description", "this is notes"), resource.TestCheckResourceAttr(name, "expression", filterUnquoted), resource.TestCheckResourceAttr(name, "paused", "true"), - resource.TestCheckResourceAttr(name, "zone", zone), - resource.TestCheckResourceAttrSet(name, "zone_id"), + resource.TestCheckResourceAttr(name, "zone_id", zoneID), ), }, }, }) } -func testFilterConfig(resourceID, zoneName, paused, description, expression string) string { +func testFilterConfig(resourceID, zoneID, paused, description, expression string) string { return fmt.Sprintf(` resource "cloudflare_filter" "%[1]s" { - zone = "%[2]s" + zone_id = "%[2]s" paused = "%[3]s" description = "%[4]s" expression = "%[5]s" } - `, resourceID, zoneName, paused, description, expression) + `, resourceID, zoneID, paused, description, expression) } const multiLineFilter = ` resource "cloudflare_filter" "%[1]s" { - zone = "%[2]s" + zone_id = "%[2]s" paused = "%[3]s" description = "%[4]s" expression = < {event.respondWith(new Response('test 2'))});` ) -func TestAccCloudflareWorkerScript_SingleScriptNonEnt(t *testing.T) { - // Temporarily unset CLOUDFLARE_ORG_ID if it is set in order - // to test non-ENT behavior - if os.Getenv("CLOUDFLARE_ORG_ID") != "" { - defer func(orgId string) { - os.Setenv("CLOUDFLARE_ORG_ID", orgId) - }(os.Getenv("CLOUDFLARE_ORG_ID")) - os.Setenv("CLOUDFLARE_ORG_ID", "") - } - - testAccCloudflareWorkerScript_SingleScript(t, nil) -} - -// ENT customers should still be able to use the single-script -// configuration format if they want to -func TestAccCloudflareWorkerScript_SingleScriptEnt(t *testing.T) { - testAccCloudflareWorkerScript_SingleScript(t, testAccPreCheckOrg) -} - -func testAccCloudflareWorkerScript_SingleScript(t *testing.T, preCheck preCheckFunc) { - var script cloudflare.WorkerScript - zone := os.Getenv("CLOUDFLARE_DOMAIN") - rnd := generateRandomResourceName() - name := "cloudflare_worker_script." + rnd - - resource.Test(t, resource.TestCase{ - PreCheck: func() { - testAccPreCheck(t) - if preCheck != nil { - preCheck(t) - } - }, - Providers: testAccProviders, - CheckDestroy: testAccCheckCloudflareWorkerScriptDestroy, - Steps: []resource.TestStep{ - { - Config: testAccCheckCloudflareWorkerScriptConfigSingleScriptInitial(zone, rnd), - Check: resource.ComposeTestCheckFunc( - testAccCheckCloudflareWorkerScriptExists(name, &script), - resource.TestCheckResourceAttr(name, "zone", zone), - resource.TestMatchResourceAttr(name, "zone_id", regexp.MustCompile("^[a-z0-9]{32}$")), - resource.TestCheckResourceAttr(name, "content", scriptContent1), - resource.TestCheckNoResourceAttr(name, "name"), - ), - }, - { - Config: testAccCheckCloudflareWorkerScriptConfigSingleScriptUpdate(zone, rnd), - Check: resource.ComposeTestCheckFunc( - testAccCheckCloudflareWorkerScriptExists(name, &script), - resource.TestCheckResourceAttr(name, "zone", zone), - resource.TestMatchResourceAttr(name, "zone_id", regexp.MustCompile("^[a-z0-9]{32}$")), - resource.TestCheckResourceAttr(name, "content", scriptContent2), - resource.TestCheckNoResourceAttr(name, "name"), - ), - }, - }, - }) -} - -func testAccCheckCloudflareWorkerScriptConfigSingleScriptInitial(zone, rnd string) string { - return fmt.Sprintf(` -resource "cloudflare_worker_script" "%[2]s" { - zone = "%[1]s" - content = "%[3]s" -}`, zone, rnd, scriptContent1) -} - -func testAccCheckCloudflareWorkerScriptConfigSingleScriptUpdate(zone, rnd string) string { - return fmt.Sprintf(` -resource "cloudflare_worker_script" "%[2]s" { - zone = "%[1]s" - content = "%[3]s" -}`, zone, rnd, scriptContent2) -} - func TestAccCloudflareWorkerScript_MultiScriptEnt(t *testing.T) { t.Parallel() @@ -101,7 +24,7 @@ func TestAccCloudflareWorkerScript_MultiScriptEnt(t *testing.T) { resource.Test(t, resource.TestCase{ PreCheck: func() { testAccPreCheck(t) - testAccPreCheckOrg(t) + testAccPreCheckAccount(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckCloudflareWorkerScriptDestroy, @@ -112,8 +35,6 @@ func TestAccCloudflareWorkerScript_MultiScriptEnt(t *testing.T) { testAccCheckCloudflareWorkerScriptExists(name, &script), resource.TestCheckResourceAttr(name, "name", rnd), resource.TestCheckResourceAttr(name, "content", scriptContent1), - resource.TestCheckNoResourceAttr(name, "zone"), - resource.TestCheckNoResourceAttr(name, "zone_id"), ), }, { @@ -122,8 +43,6 @@ func TestAccCloudflareWorkerScript_MultiScriptEnt(t *testing.T) { testAccCheckCloudflareWorkerScriptExists(name, &script), resource.TestCheckResourceAttr(name, "name", rnd), resource.TestCheckResourceAttr(name, "content", scriptContent2), - resource.TestCheckNoResourceAttr(name, "zone"), - resource.TestCheckNoResourceAttr(name, "zone_id"), ), }, }, @@ -147,15 +66,8 @@ resource "cloudflare_worker_script" "%[1]s" { } func getRequestParamsFromResource(rs *terraform.ResourceState) cloudflare.WorkerRequestParams { - var params cloudflare.WorkerRequestParams - if rs.Primary.Attributes["name"] != "" { - params = cloudflare.WorkerRequestParams{ - ScriptName: rs.Primary.Attributes["name"], - } - } else { - params = cloudflare.WorkerRequestParams{ - ZoneID: rs.Primary.Attributes["zone_id"], - } + params := cloudflare.WorkerRequestParams{ + ScriptName: rs.Primary.Attributes["name"], } return params diff --git a/cloudflare/resource_cloudflare_zone.go b/cloudflare/resource_cloudflare_zone.go index bf28673a0c..4fd481021a 100644 --- a/cloudflare/resource_cloudflare_zone.go +++ b/cloudflare/resource_cloudflare_zone.go @@ -111,13 +111,13 @@ func resourceCloudflareZoneCreate(d *schema.ResourceData, meta interface{}) erro zoneName := d.Get("zone").(string) jumpstart := d.Get("jump_start").(bool) zoneType := d.Get("type").(string) - organization := cloudflare.Organization{ - ID: client.OrganizationID, + account := cloudflare.Account{ + ID: client.AccountID, } log.Printf("[INFO] Creating Cloudflare Zone: name %s", zoneName) - zone, err := client.CreateZone(zoneName, jumpstart, organization, zoneType) + zone, err := client.CreateZone(zoneName, jumpstart, account, zoneType) if err != nil { return fmt.Errorf("Error creating zone %q: %s", zoneName, err) diff --git a/cloudflare/resource_cloudflare_zone_lockdown.go b/cloudflare/resource_cloudflare_zone_lockdown.go index fad6b21481..c43220e5b7 100644 --- a/cloudflare/resource_cloudflare_zone_lockdown.go +++ b/cloudflare/resource_cloudflare_zone_lockdown.go @@ -21,18 +21,10 @@ func resourceCloudflareZoneLockdown() *schema.Resource { }, Schema: map[string]*schema.Schema{ - "zone": { - Type: schema.TypeString, - Optional: true, - ForceNew: true, - Computed: true, - Deprecated: "`zone` is deprecated in favour of explicit `zone_id` and will be removed in the next major release", - }, "zone_id": { Type: schema.TypeString, - Optional: true, + Required: true, ForceNew: true, - Computed: true, }, "paused": { Type: schema.TypeBool, @@ -80,21 +72,10 @@ func resourceCloudflareZoneLockdown() *schema.Resource { func resourceCloudflareZoneLockdownCreate(d *schema.ResourceData, meta interface{}) error { client := meta.(*cloudflare.API) - zoneName := d.Get("zone").(string) zoneID := d.Get("zone_id").(string) var err error - if zoneName == "" && zoneID == "" { - return fmt.Errorf("'zone' or 'zone_id' is required") - } else if zoneID == "" { - zoneID, err = client.ZoneIDByName(zoneName) - if err != nil { - return fmt.Errorf("Error finding zone %q: %s", zoneName, err) - } - d.Set("zone_id", zoneID) - } - var newZoneLockdown cloudflare.ZoneLockdown if paused, ok := d.GetOk("paused"); ok { @@ -124,7 +105,7 @@ func resourceCloudflareZoneLockdownCreate(d *schema.ResourceData, meta interface r, err = client.CreateZoneLockdown(zoneID, newZoneLockdown) if err != nil { - return fmt.Errorf("error creating zone lockdown for zone %q: %s", zoneName, err) + return fmt.Errorf("error creating zone lockdown for zone ID %q: %s", zoneID, err) } if r.Result.ID == "" { @@ -254,27 +235,23 @@ func expandZoneLockdownConfig(configs *schema.Set) []cloudflare.ZoneLockdownConf } func resourceCloudflareZoneLockdownImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) { - client := meta.(*cloudflare.API) - // split the id so we can lookup idAttr := strings.SplitN(d.Id(), "/", 2) - var zoneName string + var zoneID string var zoneLockdownID string if len(idAttr) == 2 { - zoneName = idAttr[0] + zoneID = idAttr[0] zoneLockdownID = idAttr[1] - d.Set("zone", zoneName) + d.Set("zone_id", zoneID) d.SetId(zoneLockdownID) } else { - return nil, fmt.Errorf("invalid id (%q) specified, should be in format \"zoneName/zoneLockdownId\"", d.Id()) - } - zoneID, err := client.ZoneIDByName(zoneName) - if err != nil { - return nil, fmt.Errorf("couldn't find zone %q while trying to import zone lockdown %q : %q", zoneName, d.Id(), err) + return nil, fmt.Errorf("invalid id (%q) specified, should be in format \"zoneID/zoneLockdownId\"", d.Id()) } - d.Set("zone_id", zoneID) - log.Printf("[DEBUG] zone: %s", zoneName) + log.Printf("[DEBUG] zoneID: %s", zoneID) log.Printf("[DEBUG] Resource ID : %s", zoneLockdownID) + + resourceCloudflareZoneLockdownRead(d, meta) + return []*schema.ResourceData{d}, nil } diff --git a/cloudflare/resource_cloudflare_zone_lockdown_test.go b/cloudflare/resource_cloudflare_zone_lockdown_test.go index 43cbcfbae5..ffd9fb13fc 100644 --- a/cloudflare/resource_cloudflare_zone_lockdown_test.go +++ b/cloudflare/resource_cloudflare_zone_lockdown_test.go @@ -3,14 +3,14 @@ package cloudflare import ( "fmt" "os" - "regexp" "testing" "github.com/hashicorp/terraform/helper/resource" ) func TestAccCloudflareZoneLockdown(t *testing.T) { - zone := os.Getenv("CLOUDFLARE_DOMAIN") + zoneName := os.Getenv("CLOUDFLARE_DOMAIN") + zoneID := os.Getenv("CLOUDFLARE_ZONE_ID") rnd := generateRandomResourceName() name := "cloudflare_zone_lockdown." + rnd @@ -19,10 +19,9 @@ func TestAccCloudflareZoneLockdown(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testCloudflareZoneLockdownConfig(rnd, zone, "false", "1", "this is notes", rnd+"."+zone+"/*", "ip", "198.51.100.4"), + Config: testCloudflareZoneLockdownConfig(rnd, zoneID, "false", "1", "this is notes", rnd+"."+zoneName+"/*", "ip", "198.51.100.4"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(name, "zone", zone), - resource.TestMatchResourceAttr(name, "zone_id", regexp.MustCompile("^[a-z0-9]{32}$")), + resource.TestCheckResourceAttr(name, "zone_id", zoneID), resource.TestCheckResourceAttr(name, "paused", "false"), resource.TestCheckResourceAttr(name, "priority", "1"), resource.TestCheckResourceAttr(name, "description", "this is notes"), @@ -36,7 +35,8 @@ func TestAccCloudflareZoneLockdown(t *testing.T) { // test creating a config with only the required fields func TestAccCloudflareZoneLockdown_OnlyRequired(t *testing.T) { - zone := os.Getenv("CLOUDFLARE_DOMAIN") + zoneName := os.Getenv("CLOUDFLARE_DOMAIN") + zoneID := os.Getenv("CLOUDFLARE_ZONE_ID") rnd := generateRandomResourceName() name := "cloudflare_zone_lockdown." + rnd @@ -45,10 +45,9 @@ func TestAccCloudflareZoneLockdown_OnlyRequired(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testCloudflareZoneLockdownConfig(rnd, zone, "false", "1", "this is notes", rnd+"."+zone+"/*", "ip", "198.51.100.4"), + Config: testCloudflareZoneLockdownConfig(rnd, zoneID, "false", "1", "this is notes", rnd+"."+zoneName+"/*", "ip", "198.51.100.4"), Check: resource.ComposeTestCheckFunc( - resource.TestCheckResourceAttr(name, "zone", zone), - resource.TestMatchResourceAttr(name, "zone_id", regexp.MustCompile("^[a-z0-9]{32}$")), + resource.TestCheckResourceAttr(name, "zone_id", zoneID), resource.TestCheckResourceAttr(name, "urls.#", "1"), resource.TestCheckResourceAttr(name, "configurations.#", "1"), ), @@ -58,7 +57,8 @@ func TestAccCloudflareZoneLockdown_OnlyRequired(t *testing.T) { } func TestAccCloudflareZoneLockdown_Import(t *testing.T) { - zone := os.Getenv("CLOUDFLARE_DOMAIN") + zoneName := os.Getenv("CLOUDFLARE_DOMAIN") + zoneID := os.Getenv("CLOUDFLARE_ZONE_ID") rnd := generateRandomResourceName() name := "cloudflare_zone_lockdown." + rnd @@ -68,11 +68,11 @@ func TestAccCloudflareZoneLockdown_Import(t *testing.T) { CheckDestroy: testAccCheckCloudflareWAFRuleDestroy, Steps: []resource.TestStep{ { - Config: testCloudflareZoneLockdownConfig(rnd, zone, "false", "1", "this is notes", rnd+"."+zone+"/*", "ip", "198.51.100.4"), + Config: testCloudflareZoneLockdownConfig(rnd, zoneID, "false", "1", "this is notes", rnd+"."+zoneName+"/*", "ip", "198.51.100.4"), }, { ResourceName: name, - ImportStateIdPrefix: fmt.Sprintf("%s/", zone), + ImportStateIdPrefix: fmt.Sprintf("%s/", zoneID), ImportState: true, ImportStateVerify: true, }, @@ -80,10 +80,10 @@ func TestAccCloudflareZoneLockdown_Import(t *testing.T) { }) } -func testCloudflareZoneLockdownConfig(resourceID, zone, paused, priority, description, url, target, value string) string { +func testCloudflareZoneLockdownConfig(resourceID, zoneID, paused, priority, description, url, target, value string) string { return fmt.Sprintf(` resource "cloudflare_zone_lockdown" "%[1]s" { - zone = "%[2]s" + zone_id = "%[2]s" paused = "%[3]s" priority = "%[4]s" description = "%[5]s" @@ -92,5 +92,5 @@ func testCloudflareZoneLockdownConfig(resourceID, zone, paused, priority, descri target = "%[7]s" value = "%[8]s" } - }`, resourceID, zone, paused, priority, description, url, target, value) + }`, resourceID, zoneID, paused, priority, description, url, target, value) } diff --git a/cloudflare/resource_cloudflare_zone_settings_override.go b/cloudflare/resource_cloudflare_zone_settings_override.go index 2cea1397a5..a52bb2025b 100644 --- a/cloudflare/resource_cloudflare_zone_settings_override.go +++ b/cloudflare/resource_cloudflare_zone_settings_override.go @@ -10,7 +10,7 @@ import ( "reflect" - "github.com/cloudflare/cloudflare-go" + cloudflare "github.com/cloudflare/cloudflare-go" "github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/helper/validation" "github.com/pkg/errors" @@ -25,7 +25,7 @@ func resourceCloudflareZoneSettingsOverride() *schema.Resource { SchemaVersion: 0, Schema: map[string]*schema.Schema{ - "name": { + "zone_id": { Type: schema.TypeString, Required: true, ForceNew: true, @@ -472,11 +472,8 @@ var resourceCloudflareZoneSettingsSchema = map[string]*schema.Schema{ func resourceCloudflareZoneSettingsOverrideCreate(d *schema.ResourceData, meta interface{}) error { client := meta.(*cloudflare.API) - zoneId, err := client.ZoneIDByName(d.Get("name").(string)) - if err != nil { - return fmt.Errorf("couldn't find zone %q while trying to import it: %q", d.Get("name").(string), err) - } - d.SetId(zoneId) + zoneID := d.Get("zone_id").(string) + d.SetId(zoneID) log.Printf("[INFO] Creating zone settings resource for zone ID: %s", d.Id()) diff --git a/cloudflare/resource_cloudflare_zone_settings_override_test.go b/cloudflare/resource_cloudflare_zone_settings_override_test.go index 9cdd6dd86e..5959eec30f 100644 --- a/cloudflare/resource_cloudflare_zone_settings_override_test.go +++ b/cloudflare/resource_cloudflare_zone_settings_override_test.go @@ -8,13 +8,13 @@ import ( "reflect" "strings" - "github.com/cloudflare/cloudflare-go" + cloudflare "github.com/cloudflare/cloudflare-go" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/terraform" ) func TestAccCloudflareZoneSettingsOverride_Empty(t *testing.T) { - zoneName := os.Getenv("CLOUDFLARE_DOMAIN") + zoneID := os.Getenv("CLOUDFLARE_ZONE_ID") name := "cloudflare_zone_settings_override.test" resource.Test(t, resource.TestCase{ @@ -22,7 +22,7 @@ func TestAccCloudflareZoneSettingsOverride_Empty(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckCloudflareZoneSettingsOverrideConfigEmpty(zoneName), + Config: testAccCheckCloudflareZoneSettingsOverrideConfigEmpty(zoneID), Check: resource.ComposeTestCheckFunc( testAccCheckCloudflareZoneSettingsEmpty(name), ), @@ -32,7 +32,7 @@ func TestAccCloudflareZoneSettingsOverride_Empty(t *testing.T) { } func TestAccCloudflareZoneSettingsOverride_Full(t *testing.T) { - zoneName := os.Getenv("CLOUDFLARE_DOMAIN") + zoneID := os.Getenv("CLOUDFLARE_ZONE_ID") name := "cloudflare_zone_settings_override.test" initialSettings := make(map[string]interface{}) @@ -41,13 +41,13 @@ func TestAccCloudflareZoneSettingsOverride_Full(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckCloudflareZoneSettingsOverrideConfigEmpty(zoneName), + Config: testAccCheckCloudflareZoneSettingsOverrideConfigEmpty(zoneID), Check: resource.ComposeTestCheckFunc( - testAccGetInitialZoneSettings(t, zoneName, initialSettings), + testAccGetInitialZoneSettings(t, zoneID, initialSettings), ), }, { - Config: testAccCheckCloudflareZoneSettingsOverrideConfigNormal(zoneName), + Config: testAccCheckCloudflareZoneSettingsOverrideConfigNormal(zoneID), Check: resource.ComposeTestCheckFunc( testAccCheckCloudflareZoneSettings(name), resource.TestCheckResourceAttr( @@ -59,12 +59,12 @@ func TestAccCloudflareZoneSettingsOverride_Full(t *testing.T) { ), }, }, - CheckDestroy: testAccCheckInitialZoneSettings(zoneName, initialSettings), + CheckDestroy: testAccCheckInitialZoneSettings(zoneID, initialSettings), }) } func TestAccCloudflareZoneSettingsOverride_RemoveAttributes(t *testing.T) { - zoneName := os.Getenv("CLOUDFLARE_DOMAIN") + zoneID := os.Getenv("CLOUDFLARE_ZONE_ID") name := "cloudflare_zone_settings_override.test" initialSettings := make(map[string]interface{}) @@ -73,25 +73,25 @@ func TestAccCloudflareZoneSettingsOverride_RemoveAttributes(t *testing.T) { Providers: testAccProviders, Steps: []resource.TestStep{ { - Config: testAccCheckCloudflareZoneSettingsOverrideConfigEmpty(zoneName), + Config: testAccCheckCloudflareZoneSettingsOverrideConfigEmpty(zoneID), Check: resource.ComposeTestCheckFunc( - testAccGetInitialZoneSettings(t, zoneName, initialSettings), + testAccGetInitialZoneSettings(t, zoneID, initialSettings), ), }, { - Config: testAccCheckCloudflareZoneSettingsOverrideConfigNormal(zoneName), + Config: testAccCheckCloudflareZoneSettingsOverrideConfigNormal(zoneID), Check: resource.ComposeTestCheckFunc( testAccCheckCloudflareZoneSettings(name), ), }, { - Config: testAccCheckCloudflareZoneSettingsOverrideConfigEmpty(zoneName), + Config: testAccCheckCloudflareZoneSettingsOverrideConfigEmpty(zoneID), Check: resource.ComposeTestCheckFunc( testAccCheckCloudflareZoneSettings(name), ), }, }, - CheckDestroy: testAccCheckInitialZoneSettings(zoneName, initialSettings), + CheckDestroy: testAccCheckInitialZoneSettings(zoneID, initialSettings), }) } @@ -160,14 +160,10 @@ func testAccCheckCloudflareZoneSettings(n string) resource.TestCheckFunc { } } -func testAccGetInitialZoneSettings(t *testing.T, zoneName string, settings map[string]interface{}) resource.TestCheckFunc { +func testAccGetInitialZoneSettings(t *testing.T, zoneID string, settings map[string]interface{}) resource.TestCheckFunc { return func(s *terraform.State) error { client := testAccProvider.Meta().(*cloudflare.API) - zoneID, err := client.ZoneIDByName(zoneName) - if err != nil { - t.Fatalf("couldn't find zone %q: %s ", zoneName, err.Error()) - } foundZone, err := client.ZoneSettings(zoneID) if err != nil { t.Fatalf(err.Error()) @@ -184,14 +180,10 @@ func testAccGetInitialZoneSettings(t *testing.T, zoneName string, settings map[s } } -func testAccCheckInitialZoneSettings(zoneName string, initialSettings map[string]interface{}) resource.TestCheckFunc { +func testAccCheckInitialZoneSettings(zoneID string, initialSettings map[string]interface{}) resource.TestCheckFunc { return func(s *terraform.State) error { client := testAccProvider.Meta().(*cloudflare.API) - zoneID, err := client.ZoneIDByName(zoneName) - if err != nil { - return fmt.Errorf("couldn't find zone %q : %s", zoneName, err.Error()) - } foundZone, err := client.ZoneSettings(zoneID) if err != nil { return err @@ -210,17 +202,17 @@ func testAccCheckInitialZoneSettings(zoneName string, initialSettings map[string } } -func testAccCheckCloudflareZoneSettingsOverrideConfigEmpty(zone string) string { +func testAccCheckCloudflareZoneSettingsOverrideConfigEmpty(zoneID string) string { return fmt.Sprintf(` resource "cloudflare_zone_settings_override" "test" { - name = "%s" -}`, zone) + zone_id = "%s" +}`, zoneID) } -func testAccCheckCloudflareZoneSettingsOverrideConfigNormal(zone string) string { +func testAccCheckCloudflareZoneSettingsOverrideConfigNormal(zoneID string) string { return fmt.Sprintf(` resource "cloudflare_zone_settings_override" "test" { - name = "%s" + zone_id = "%s" settings { brotli = "on" challenge_ttl = 2700 @@ -236,5 +228,5 @@ resource "cloudflare_zone_settings_override" "test" { enabled = true } } -}`, zone) +}`, zoneID) } diff --git a/go.mod b/go.mod index b9bd4893c0..cd596721c8 100644 --- a/go.mod +++ b/go.mod @@ -3,11 +3,13 @@ module github.com/terraform-providers/terraform-provider-cloudflare go 1.12 require ( - github.com/cloudflare/cloudflare-go v0.9.4 + github.com/cloudflare/cloudflare-go v0.10.0 github.com/hashicorp/go-cleanhttp v0.5.1 github.com/hashicorp/go-hclog v0.9.2 // indirect github.com/hashicorp/terraform v0.12.8 github.com/pkg/errors v0.8.1 + github.com/stretchr/testify v1.4.0 // indirect golang.org/x/net v0.0.0-20190628185345-da137c7871d7 - google.golang.org/genproto v0.0.0-20190819205937-24fa4b261c55 // indirect + golang.org/x/time v0.0.0-20190513212739-9d24e82272b4 // indirect + google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 // indirect ) diff --git a/go.sum b/go.sum index cd08d6ed8a..ad333d0bde 100644 --- a/go.sum +++ b/go.sum @@ -1,4 +1,3 @@ -cloud.google.com/go v0.26.0 h1:e0WKqKTd5BnrG8aKH3J3h+QvEIQtSUcf2n5UZ5ZgLtQ= cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.31.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= @@ -9,25 +8,18 @@ dmitri.shuralyov.com/html/belt v0.0.0-20180602232347-f7d459c86be0/go.mod h1:JLBr dmitri.shuralyov.com/service/change v0.0.0-20181023043359-a85b471d5412/go.mod h1:a1inKt/atXimZ4Mv927x+r7UpyzRUf4emIoiiSC2TN4= dmitri.shuralyov.com/state v0.0.0-20180228185332-28bcc343414c/go.mod h1:0PRwlb0D6DFvNNtx+9ybjezNCa8XF0xaYcETyp6rHWU= git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg= -github.com/Azure/azure-sdk-for-go v21.3.0+incompatible h1:YFvAka2WKAl2xnJkYV1e1b7E2z88AgFszDzWU18ejMY= github.com/Azure/azure-sdk-for-go v21.3.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/go-autorest v10.15.4+incompatible h1:q+DRrRdbCnkY7f2WxQBx58TwCGkEdMAK/hkZ10g0Pzk= github.com/Azure/go-autorest v10.15.4+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-ntlmssp v0.0.0-20180810175552-4a21cbd618b4 h1:pSm8mp0T2OH2CPmPDPtwHPr3VAQaOwVF/JbllOPP4xA= github.com/Azure/go-ntlmssp v0.0.0-20180810175552-4a21cbd618b4/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= -github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022 h1:y8Gs8CzNfDF5AZvjr+5UyGQvQEBL7pwo+v+wX6q9JI8= github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022/go.mod h1:nuWgzSkT5PnyOd+272uUmV0dnAnAn42Mk7PiQC5VzN4= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= -github.com/Unknwon/com v0.0.0-20151008135407-28b053d5a292 h1:tuQ7w+my8a8mkwN7x2TSd7OzTjkZ7rAeSyH4xncuAMI= github.com/Unknwon/com v0.0.0-20151008135407-28b053d5a292/go.mod h1:KYCjqMOeHpNuTOiFQU6WEcTG7poCJrUs0YgyHNtn1no= github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af/go.mod h1:5Jv4cbFiHJMsVxt52+i0Ha45fjshj6wxYr1r19tB9bw= -github.com/agext/levenshtein v1.2.1 h1:QmvMAjj2aEICytGiWzmxoE0x2KZvE0fvmqMOfy2tjT8= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= -github.com/agl/ed25519 v0.0.0-20150830182803-278e1ec8e8a6 h1:LoeFxdq5zUCBQPhbQKE6zvoGwHMxCBlqwbH9+9kHoHA= github.com/agl/ed25519 v0.0.0-20150830182803-278e1ec8e8a6/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -40,19 +32,15 @@ github.com/antchfx/xquery v0.0.0-20180515051857-ad5b8c7a47b0/go.mod h1:LzD22aAzD github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apparentlymart/go-cidr v1.0.0 h1:lGDvXx8Lv9QHjrAVP7jyzleG4F9+FkRhJcEsDFxeb8w= github.com/apparentlymart/go-cidr v1.0.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= -github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3 h1:ZSTrOEhiM5J5RFxEaFvMZVEAM1KvT1YzbEOwB2EAGjA= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= -github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFUye+ZcSR6opIgz9Co7WcDx6ZcY+RjfFHoA0I= github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= -github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2 h1:7Ip0wMmLHLRJdrloDxZfhMm0xrLXZS8+COSu2bXmEQs= github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= -github.com/aws/aws-sdk-go v1.15.78 h1:LaXy6lWR0YK7LKyuU0QWy2ws/LWTPfYV/UgfiBu4tvY= github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/aws/aws-sdk-go v1.16.36/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= github.com/aws/aws-sdk-go v1.22.0 h1:e88V6+dSEyBibUy0ekOydtTfNWzqG3hrtCR8SF6UqqY= @@ -74,27 +62,21 @@ github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXH github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= 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/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/cloudflare/cloudflare-go v0.9.4 h1:L3P7f+/Y9TYqZwjXBpVe/DRXcSmaujdaV2N07ZgDxR4= -github.com/cloudflare/cloudflare-go v0.9.4/go.mod h1:X6KWDVXllCSjZ6KOlwVGfGIiSosjc7/5DtR6sbcwMDw= +github.com/cloudflare/cloudflare-go v0.10.0 h1:wJPNqfrQO0w3fCiQcf/2T4lR2y6Q2fAwRszllljgb8I= +github.com/cloudflare/cloudflare-go v0.10.0/go.mod h1:fOESqHl/jzAmCtEyjceLkw3v0rVjzl8V9iehxZPynXY= github.com/coreos/bbolt v1.3.0/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible h1:jFneRYjIvLMLhDLCzuTuU4rSJUjRplcJQ7pD7MnhC04= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-semver v0.2.0 h1:3Jm3tLmsgAYcjC+4Up7hJrFBPr+n7rAqYeSw/SZazuY= github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dimchansky/utfbom v1.0.0 h1:fGC2kkf4qOoKqZ4q7iIh+Vef4ubC1c38UDsEyZynZPc= github.com/dimchansky/utfbom v1.0.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= github.com/dnaeon/go-vcr v0.0.0-20180920040454-5637cf3d8a31/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= -github.com/dylanmei/iso8601 v0.1.0 h1:812NGQDBcqquTfH5Yeo7lwR0nzx/cKdsmf3qMjPURUI= github.com/dylanmei/iso8601 v0.1.0/go.mod h1:w9KhXSgIyROl1DefbMYIE7UVSIvELTbMrCfx+QkYnoQ= github.com/dylanmei/winrmtest v0.0.0-20190225150635-99b7fe2fddf1/go.mod h1:lcy9/2gH1jn/VCLouHA6tOEwLoNVd4GW6zhuKLmHC2Y= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= @@ -109,36 +91,27 @@ github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aev github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.0 h1:xU6/SpYbvkNYiptHJYEDRseDLvYE7wSqhYYNy0QSUzI= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:tluoj9z5200jBnyusfRPU2LqT6J+DAorxEvtC7LHB+E= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.2.0 h1:28o5sBqPkBsMGnC6b4MvE2TzSr5/AT4c/1fLqVGIwlk= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= -github.com/golang/mock v1.3.1 h1:qGJ6qTW+x6xX/my+8YUVl4WNpX9B7+/l2tRsHGZ7f2s= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= -github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-github v17.0.0+incompatible/go.mod h1:zLgOLi98H3fifZn+44m+umXrS52loVEgC2AApnigrVQ= -github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= -github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= @@ -147,11 +120,8 @@ github.com/googleapis/gax-go v2.0.0+incompatible h1:j0GKcs05QVmm7yesiZq2+9cxHkNK github.com/googleapis/gax-go v2.0.0+incompatible/go.mod h1:SFVmujtThgffbyetf+mdk2eWhX2bMyUtNHzFKcPA9HY= github.com/googleapis/gax-go/v2 v2.0.3 h1:siORttZ36U2R/WjiJuDz8znElWBiAlO9rVt+mqJt0Cc= github.com/googleapis/gax-go/v2 v2.0.3/go.mod h1:LLvjysVCY1JZeum8Z6l8qUty8fiNwE08qbEPm1M08qg= -github.com/gophercloud/gophercloud v0.0.0-20190208042652-bc37892e1968 h1:Pu+HW4kcQozw0QyrTTgLE+3RXNqFhQNNzhbnoLFL83c= github.com/gophercloud/gophercloud v0.0.0-20190208042652-bc37892e1968/go.mod h1:3WdhXV3rUYy9p6AUW8d94kr+HS62Y4VL9mBnFxsD8q4= -github.com/gophercloud/utils v0.0.0-20190128072930-fbb6ab446f01 h1:OgCNGSnEalfkRpn//WGJHhpo7fkP+LhTpvEITZ7CkK4= github.com/gophercloud/utils v0.0.0-20190128072930-fbb6ab446f01/go.mod h1:wjDF8z83zTeg5eMLml5EBSlAhbF7G8DobyI1YsMuyzw= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg= github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs= @@ -162,16 +132,12 @@ github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgf github.com/grpc-ecosystem/grpc-gateway v1.5.0/go.mod h1:RSKVYQBd5MCa4OVpNdGskqpgL2+G+NZTnrVHpWWfpdw= github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/hashicorp/aws-sdk-go-base v0.3.0/go.mod h1:ZIWACGGi0N7a4DZbf15yuE1JQORmWLtBcVM6F5SXNFU= -github.com/hashicorp/consul v0.0.0-20171026175957-610f3c86a089 h1:1eDpXAxTh0iPv+1kc9/gfSI2pxRERDsTk/lNGolwHn8= github.com/hashicorp/consul v0.0.0-20171026175957-610f3c86a089/go.mod h1:mFrjN1mfidgJfYP1xrJCF+AfRhr6Eaqhb2+sfyn/OOI= github.com/hashicorp/errwrap v0.0.0-20180715044906-d6c0cd880357/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-azure-helpers v0.0.0-20190129193224-166dfd221bb2 h1:VBRx+yPYUZaobnn5ANBcOUf4hhWpTHSQgftG4TcDkhI= github.com/hashicorp/go-azure-helpers v0.0.0-20190129193224-166dfd221bb2/go.mod h1:lu62V//auUow6k0IykxLK2DCNW8qTmpm8KqhYVWattA= -github.com/hashicorp/go-checkpoint v0.5.0 h1:MFYpPZCnQqQTE18jFwSII6eUQrD/oxMFp3mlgcqk5mU= github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= -github.com/hashicorp/go-cleanhttp v0.5.0 h1:wvCrVc9TjDls6+YGAF2hAifE1E5U1+b4tH6KdvN3Gig= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= @@ -188,18 +154,13 @@ github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uP github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-plugin v1.0.1-0.20190610192547-a1bc61569a26 h1:hRho44SAoNu1CBtn5r8Q9J3rCs4ZverWZ4R+UeeNuWM= github.com/hashicorp/go-plugin v1.0.1-0.20190610192547-a1bc61569a26/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= -github.com/hashicorp/go-retryablehttp v0.5.2 h1:AoISa4P4IsW0/m4T6St8Yw38gTl5GtBAgfkhYh1xAz4= github.com/hashicorp/go-retryablehttp v0.5.2/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-rootcerts v1.0.0 h1:Rqb66Oo1X/eSV1x66xbDccZjhJigjg0+e82kpwzSwCI= github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= -github.com/hashicorp/go-slug v0.3.0 h1:L0c+AvH/J64iMNF4VqRaRku2DMTEuHioPVS7kMjWIU8= github.com/hashicorp/go-slug v0.3.0/go.mod h1:I5tq5Lv0E2xcNXNkmx7BSfzi1PsJ2cNjs3cC3LwyhK8= github.com/hashicorp/go-sockaddr v0.0.0-20180320115054-6d291a969b86/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-tfe v0.3.16 h1:GS2yv580p0co4j3FBVaC6Zahd9mxdCGehhJ0qqzFMH0= github.com/hashicorp/go-tfe v0.3.16/go.mod h1:SuPHR+OcxvzBZNye7nGPfwZTEyd3rWPfLVbCgyZPezM= -github.com/hashicorp/go-uuid v1.0.0 h1:RS8zrF7PhGwyNPOtxSClXXj9HA8feRnJzgnI1RJCSnM= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= @@ -216,7 +177,6 @@ github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590/go.mod h1:n2TSygSNws github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= github.com/hashicorp/memberlist v0.1.0/go.mod h1:ncdBp14cuox2iFOq3kDiquKU6fqsTBc3W6JvZwjxxsE= -github.com/hashicorp/serf v0.0.0-20160124182025-e4ec8cc423bb h1:ZbgmOQt8DOg796figP87/EFCVx2v2h9yRvwHF/zceX4= github.com/hashicorp/serf v0.0.0-20160124182025-e4ec8cc423bb/go.mod h1:h/Ru6tmZazX7WO/GDmwdpS975F019L4t5ng5IgwbNrE= github.com/hashicorp/terraform v0.12.8 h1:51Z5K8oj42KZi0IiTf99wMTujDpvsTd3eaF1k5z1URk= github.com/hashicorp/terraform v0.12.8/go.mod h1:8rXMj8q+hRsR/28WWWyiHu1GEDSjWaHPoV14E66X5VU= @@ -232,52 +192,35 @@ github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/joyent/triton-go v0.0.0-20180313100802-d8f9c0314926 h1:kie3qOosvRKqwij2HGzXWffwpXvcqfPPXRUw8I4F/mg= github.com/joyent/triton-go v0.0.0-20180313100802-d8f9c0314926/go.mod h1:U+RSyWxWd04xTqnuOQxnai7XGS2PrPY2cfGoDKtMHjA= github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= -github.com/jtolds/gls v4.2.1+incompatible h1:fSuqC+Gmlu6l/ZYAoZzx2pyucC8Xza35fpRVWLVmUEE= github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kardianos/osext v0.0.0-20170510131534-ae77be60afb1/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= -github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0 h1:iQTw/8FWTuc7uiaSepXwyf3o52HaUYcV+Tu66S3F5GA= github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= -github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba h1:NARVGAAgEXvoMeNPHhPFt1SBt1VMznA3Gnz9d0qj+co= github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= -github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.3/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A= github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/lusis/go-artifactory v0.0.0-20160115162124-7e4ce345df82 h1:wnfcqULT+N2seWf6y4yHzmi7GD2kNx4Ute0qArktD48= github.com/lusis/go-artifactory v0.0.0-20160115162124-7e4ce345df82/go.mod h1:y54tfGmO3NKssKveTEFFzH8C/akrSOy/iW9qEAUDV84= -github.com/marstr/guid v1.1.0 h1:/M4H/1G4avsieL6BbUwCOBzulmoeKVP5ux/3mQNnbyI= github.com/marstr/guid v1.1.0/go.mod h1:74gB1z2wpxxInTG6yaqA7KrtM0NZ+RbrcqDvYHefzho= -github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9 h1:SmVbOZFWAlyQshuMfOkiAx1f5oUTsOGG5IXplAEYeeM= github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= -github.com/masterzen/winrm v0.0.0-20190223112901-5e5c9a7fe54b h1:/1RFh2SLCJ+tEnT73+Fh5R2AO89sQqs8ba7o+hx1G0Y= github.com/masterzen/winrm v0.0.0-20190223112901-5e5c9a7fe54b/go.mod h1:wr1VqkwW0AB5JS0QLy5GpVMS9E3VtRoSYXUYyVk46KY= -github.com/mattn/go-colorable v0.0.9 h1:UVL0vNpWh04HeJXV0KLcaT7r06gOH2l4OW6ddYRUIY4= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1 h1:G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0XgOg= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= -github.com/mattn/go-isatty v0.0.3 h1:ns/ykhmWi7G9O+8a448SecJU3nSMBXJfqQkl0upE1jI= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= -github.com/mattn/go-isatty v0.0.4 h1:bnP0vzxcAdeI1zdubAl5PjU6zsERjGZb7raWodagDYs= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5 h1:tHXDdz1cpzGaovsTB+TVB8q90WEokoVmfMqoVcrLUgw= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-shellwords v1.0.4 h1:xmZZyxuP+bYKAKkA9ABYXVNJ+G/Wf3R8d8vAP3LDJJk= github.com/mattn/go-shellwords v1.0.4/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/microcosm-cc/bluemonday v1.0.1/go.mod h1:hsXNsILzKxV+sX77C5b8FSuKF00vh2OMYv+xgHpAMF4= @@ -288,11 +231,9 @@ github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2Em github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= -github.com/mitchellh/go-homedir v1.0.0 h1:vKb8ShqSby24Yrqr/yDYkuFz8d0WUjys40rvnGC8aR0= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-linereader v0.0.0-20190213213312-1b945b3263eb h1:GRiLv4rgyqjqzxbhJke65IYUf4NCOOvrPOJbV/sPxkM= github.com/mitchellh/go-linereader v0.0.0-20190213213312-1b945b3263eb/go.mod h1:OaY7UOoTkkrX3wRwjpYRKafIkkyeD0UtweSHAWWiqQM= github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= @@ -304,9 +245,7 @@ github.com/mitchellh/hashstructure v1.0.0 h1:ZkRJX1CyOoTkar7p/mLS5TZU4nJ1Rn/F8u9 github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/panicwrap v0.0.0-20190213213626-17011010aaa4 h1:jw9tsdJ1FQmUkyTXdIF/nByTX+mMnnp16glnvGZMsC4= github.com/mitchellh/panicwrap v0.0.0-20190213213626-17011010aaa4/go.mod h1:YYMf4xtQnR8LRC0vKi3afvQ5QwRPQ17zjcpkBCufb+I= -github.com/mitchellh/prefixedio v0.0.0-20190213213902-5733675afd51 h1:eD92Am0Qf3rqhsOeA1zwBHSfRkoHrt4o6uORamdmJP8= github.com/mitchellh/prefixedio v0.0.0-20190213213902-5733675afd51/go.mod h1:kB1naBgV9ORnkiTVeyJOI1DavaJkG4oNIq0Af6ZVKUo= github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= @@ -315,7 +254,6 @@ github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3Rllmb github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo= github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM= -github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d h1:VhgPp6v9qf9Agr/56bj7Y/xa04UccTW04VP0Qed4vnQ= github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= @@ -325,14 +263,12 @@ github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/openzipkin/zipkin-go v0.1.1/go.mod h1:NtoC/o8u3JlF1lSlyPNswIbeQH9bJTmOf0Erfk+hxe8= github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw= -github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58 h1:m3CEgv3ah1Rhy82L+c0QG/U3VyY1UsvsIdkh0/rU97Y= github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.1 h1:LrvDIY//XNo65Lq84G/akBuMGlawHvGBABv8f/ZN6DI= @@ -350,10 +286,8 @@ github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= -github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= -github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= github.com/shurcooL/component v0.0.0-20170202220835-f88ec8f54cc4/go.mod h1:XhFIlyj5a1fBNx5aJTbKoIq0mNaPvOagO+HjB3EtxrY= github.com/shurcooL/events v0.0.0-20181021180414-410e4ca65f48/go.mod h1:5u70Mqkb5O5cxEA8nxTsgrgLehJeAw6Oc4Ab1c/P1HM= @@ -389,36 +323,28 @@ github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnIn github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/svanharmelen/jsonapi v0.0.0-20180618144545-0c0828c3f16d h1:Z4EH+5EffvBEhh37F0C0DnpklTMh00JOkjW5zK3ofBI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/svanharmelen/jsonapi v0.0.0-20180618144545-0c0828c3f16d/go.mod h1:BSTlc8jOjh0niykqEGVXOLXdi9o0r0kR8tCYiMvjFgw= github.com/tarm/serial v0.0.0-20180830185346-98f6abe2eb07/go.mod h1:kDXzergiv9cbyO7IOYJZWg1U88JhDg3PB6klq9Hg2pA= -github.com/terraform-providers/terraform-provider-openstack v1.15.0 h1:adpjqej+F8BAX9dHmuPF47sUIkgifeqBu6p7iCsyj0Y= github.com/terraform-providers/terraform-provider-openstack v1.15.0/go.mod h1:2aQ6n/BtChAl1y2S60vebhyJyZXBsuAI5G4+lHrT1Ew= github.com/tmc/grpc-websocket-proxy v0.0.0-20171017195756-830351dc03c6/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/ugorji/go v0.0.0-20180813092308-00b869d2f4a5 h1:cMjKdf4PxEBN9K5HaD9UMW8gkTbM0kMzkTa9SJe0WNQ= github.com/ugorji/go v0.0.0-20180813092308-00b869d2f4a5/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ= github.com/ulikunitz/xz v0.5.5 h1:pFrO0lVpTBXLpYw+pnLj6TbvHuyjXMfjGeCwSqCVwok= github.com/ulikunitz/xz v0.5.5/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= -github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= +github.com/urfave/cli v1.21.0/go.mod h1:lxDj6qX9Q6lWQxIrbrT0nwecwUtRnhVZAJjJZrVUZZQ= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.1+incompatible h1:RMF1enSPeKTlXrXdOcqjFUElywVZjjC6pqse21bKbEU= github.com/vmihailenco/msgpack v4.0.1+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= -github.com/xanzy/ssh-agent v0.2.1 h1:TCbipTQL2JiiCprBWx9frJ2eJlCYT00NmctrHxVAr70= github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xlab/treeprint v0.0.0-20161029104018-1d6e34225557 h1:Jpn2j6wHkC9wJv5iMfJhKqrZJx3TahFx+7sbZ7zQdxs= github.com/xlab/treeprint v0.0.0-20161029104018-1d6e34225557/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= -github.com/zclconf/go-cty v1.0.0 h1:EWtv3gKe2wPLIB9hQRQJa7k/059oIfAqcEkCNnaVckk= github.com/zclconf/go-cty v1.0.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= github.com/zclconf/go-cty v1.0.1-0.20190708163926-19588f92a98f h1:sq2p8SN6ji66CFEQFIWLlD/gFmGtr5hBrOzv5nLlGfA= github.com/zclconf/go-cty v1.0.1-0.20190708163926-19588f92a98f/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= github.com/zclconf/go-cty-yaml v1.0.1 h1:up11wlgAaDvlAGENcFDnZgkn0qUJurso7k6EpURKNF8= github.com/zclconf/go-cty-yaml v1.0.1/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= -go.opencensus.io v0.18.0 h1:Mk5rgZcggtbvtAun5aJzAtjKKN/t0R3jJPlWILlv938= go.opencensus.io v0.18.0/go.mod h1:vKdFvxhtzZ9onBp9VKHK8z/sRpBMnKAsufL7wlDrCOA= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2 h1:NAfh7zF0/3/HqtMvJNZ/RFrSlCE6ZTlHmKfhL/Dm1Jk= @@ -434,7 +360,6 @@ golang.org/x/crypto v0.0.0-20181112202954-3d3f9f413869/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190222235706-ffb98f73852f/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734 h1:p/H982KKEjUnLJkM3tt/LemDnOc1GiZL5FCVlORJ5zo= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 h1:HuIa8hRrWRSrqYzx1qI49NNxhdi2PrY7gxVSq1JjLDc= golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= @@ -443,12 +368,10 @@ golang.org/x/lint v0.0.0-20180702182130-06c8688daad7/go.mod h1:UVdnD1Gm6xHRNCYTk golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= -golang.org/x/lint v0.0.0-20190511005446-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181029044818-c44066c5c816 h1:mVFkLpejdFLXVUv9E42f3XJVfMdqd0IVLVIVLjZWn5o= golang.org/x/net v0.0.0-20181029044818-c44066c5c816/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181106065722-10aee1819953/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -458,25 +381,19 @@ golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190502183928-7f726cade0ab h1:9RfW3ktsOZxgo9YNbBAjq1FWzc/igwEcUzZz8IXgSbk= golang.org/x/net v0.0.0-20190502183928-7f726cade0ab/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190628185345-da137c7871d7 h1:rTIdg5QFRR7XCaK4LCjBiPbx8j4DQRpdYMnGn/bJUEU= golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be h1:vEDujvNQGv4jgYKudGeI/+DAX4Jffq6hpD55MmoEvKs= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= -golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890 h1:uESlIz09WIHT2I+pasSXcpLYqYK8wHcdCetU3VuMBJE= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421 h1:Wo7BWFiOk0QRFMLYMqJGFMd9CgUAcGx7V+qEg/h5IBI= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/perf v0.0.0-20180704124530-6e6d33e29852/go.mod h1:JLpeXjPJfIyPr5TlbXLkXWLhP8nz10XfvxElABhCtcw= -golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f h1:wMNYb4v58l5UBM7MYRLPG6ZhfOqbKu7X5eyFl8ZhKvA= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4 h1:YUO/7uOKsKeq9UokNS62b8FYywz3ker1l1vDZRCRefw= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -488,26 +405,17 @@ golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5h golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181213200352-4d1cda033e06/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82 h1:vsphBvatvfbhlb4PO1BYSr9dzugGxJ/SQHoNufZJq1w= golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa h1:KIDDMLT1O0Nr7TSxp8xM5tJcdn8tgyAONntO829og1M= -golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2 h1:z99zHgr7hKfrUcX/KsoJk5FJfjTceCKIp96+biqP4To= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= -golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2 h1:+DCIGbF/swA92ohVg0//6X2IVY3KZs6p9mix0ziNYJM= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20181108054448-85acf8d2951c h1:fqgJT0MGcGpPgpWU7VRdRjuArfcOvC4AoJmILihzhDg= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190513212739-9d24e82272b4 h1:RMGusaKverhgGR5KBERIKiTyWoWHRd84GCtsNlvLvIo= golang.org/x/time v0.0.0-20190513212739-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -516,19 +424,16 @@ golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGm golang.org/x/tools v0.0.0-20181030000716-a0a13e073c7b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= google.golang.org/api v0.0.0-20180910000450-7ca32eb868bf/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= google.golang.org/api v0.0.0-20181030000543-1d582fd0359e/go.mod h1:4mhQ8q/RsB7i+udVvVy5NUi08OU8ZlA0gRVgrF7VFY0= -google.golang.org/api v0.1.0 h1:K6z2u68e86TPdSdefXdzvXgR1zEMa+459vBSfWYAZkI= google.golang.org/api v0.1.0/go.mod h1:UGEZY7KEX120AnNLIHFMKIo4obdJhkp2tPbaPlQx13Y= google.golang.org/api v0.3.1 h1:oJra/lMfmtm13/rgY/8i3MzjFWYXvQIAKjQ3HqofMk8= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= -google.golang.org/appengine v1.4.0 h1:/wp5JvzpHIxhs/dumFmF7BXTf3Z+dd4uXta4kVyO508= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= @@ -536,18 +441,18 @@ google.golang.org/genproto v0.0.0-20181029155118-b69ba1387ce2/go.mod h1:JiN7NxoA google.golang.org/genproto v0.0.0-20181202183823-bd91e49a0898/go.mod h1:7Ep/1NZk928CDR8SjdVbjWNpdIf6nzjE3BTgJDr2Atg= google.golang.org/genproto v0.0.0-20190201180003-4b09977fb922/go.mod h1:L3J43x8/uS+qIUoksaLKe6OS3nUKxOKuIFz1sl2/jx4= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819205937-24fa4b261c55 h1:WAZY35xVaX9Rjp3Ypl1G+qhutX0CaIx0m5fIzyNAMNQ= google.golang.org/genproto v0.0.0-20190819205937-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.16.0/go.mod h1:0JHn/cJsOMiMfNA9+DeHDlAU7KAAB5GDlYFpa9MZMio= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= -google.golang.org/grpc v1.19.0 h1:cfg4PD8YEdSFnm7qLV4++93WcmhH2nIUhMjhdCvl3j8= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.19.1 h1:TrBcJ1yqAl1G++wO39nD/qtgpsW9/1+QGrluyMGEYgM= google.golang.org/grpc v1.19.1/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= @@ -556,9 +461,7 @@ gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= grpc.go4.org v0.0.0-20170609214715-11d0a25b4919/go.mod h1:77eQGdRu53HpSqPFJFmuJdjuHRquDANNeA4x7B8WQ9o= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/vendor/github.com/cloudflare/cloudflare-go/.travis.yml b/vendor/github.com/cloudflare/cloudflare-go/.travis.yml index 8026d5edb5..fce3ee17db 100644 --- a/vendor/github.com/cloudflare/cloudflare-go/.travis.yml +++ b/vendor/github.com/cloudflare/cloudflare-go/.travis.yml @@ -9,6 +9,7 @@ env: global: - MOD_VENDOR="-mod=vendor" - GO111MODULE=on + - GOPROXY=https://proxy.golang.org matrix: fast_finish: true diff --git a/vendor/github.com/cloudflare/cloudflare-go/LICENSE b/vendor/github.com/cloudflare/cloudflare-go/LICENSE index c035bb48d3..33865c30fb 100644 --- a/vendor/github.com/cloudflare/cloudflare-go/LICENSE +++ b/vendor/github.com/cloudflare/cloudflare-go/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2015-2016, Cloudflare. All rights reserved. +Copyright (c) 2015-2019, Cloudflare. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/vendor/github.com/cloudflare/cloudflare-go/cloudflare.go b/vendor/github.com/cloudflare/cloudflare-go/cloudflare.go index b0ae65cd80..498b9f468d 100644 --- a/vendor/github.com/cloudflare/cloudflare-go/cloudflare.go +++ b/vendor/github.com/cloudflare/cloudflare-go/cloudflare.go @@ -38,7 +38,7 @@ type API struct { APIUserServiceKey string APIToken string BaseURL string - OrganizationID string + AccountID string UserAgent string headers http.Header httpClient *http.Client @@ -142,13 +142,13 @@ func (api *API) ZoneIDByName(zoneName string) (string, error) { return "", errors.Wrap(err, "ListZonesContext command failed") } - if len(res.Result) > 1 && api.OrganizationID == "" { + if len(res.Result) > 1 && api.AccountID == "" { return "", errors.New("ambiguous zone name used without an account ID") } for _, zone := range res.Result { - if api.OrganizationID != "" { - if zone.Name == zoneName && api.OrganizationID == zone.Account.ID { + if api.AccountID != "" { + if zone.Name == zoneName && api.AccountID == zone.Account.ID { return zone.ID, nil } } else { @@ -326,14 +326,15 @@ func (api *API) request(ctx context.Context, method, uri string, reqBody io.Read return resp, nil } -// Returns the base URL to use for API endpoints that exist for both accounts and organizations. -// If an Organization option was used when creating the API instance, returns the org URL. +// Returns the base URL to use for API endpoints that exist for accounts. +// If an account option was used when creating the API instance, returns +// the account URL. // -// accountBase is the base URL for endpoints referring to the current user. It exists as a -// parameter because it is not consistent across APIs. +// accountBase is the base URL for endpoints referring to the current user. +// It exists as a parameter because it is not consistent across APIs. func (api *API) userBaseURL(accountBase string) string { - if api.OrganizationID != "" { - return "/accounts/" + api.OrganizationID + if api.AccountID != "" { + return "/accounts/" + api.AccountID } return accountBase } diff --git a/vendor/github.com/cloudflare/cloudflare-go/firewall.go b/vendor/github.com/cloudflare/cloudflare-go/firewall.go index 1f1dfe5e0c..4b61a7ca51 100644 --- a/vendor/github.com/cloudflare/cloudflare-go/firewall.go +++ b/vendor/github.com/cloudflare/cloudflare-go/firewall.go @@ -132,45 +132,45 @@ func (api *API) DeleteZoneAccessRule(zoneID, accessRuleID string) (*AccessRuleRe return api.deleteAccessRule("/zones/"+zoneID, accessRuleID) } -// ListOrganizationAccessRules returns a slice of access rules for the given -// organization identifier. +// ListAccountAccessRules returns a slice of access rules for the given +// account identifier. // // This takes an AccessRule to allow filtering of the results returned. // -// API reference: https://api.cloudflare.com/#organization-level-firewall-access-rule-list-access-rules -func (api *API) ListOrganizationAccessRules(organizationID string, accessRule AccessRule, page int) (*AccessRuleListResponse, error) { - return api.listAccessRules("/accounts/"+organizationID, accessRule, page) +// API reference: https://api.cloudflare.com/#account-level-firewall-access-rule-list-access-rules +func (api *API) ListAccountAccessRules(accountID string, accessRule AccessRule, page int) (*AccessRuleListResponse, error) { + return api.listAccessRules("/accounts/"+accountID, accessRule, page) } -// CreateOrganizationAccessRule creates a firewall access rule for the given -// organization identifier. +// CreateAccountAccessRule creates a firewall access rule for the given +// account identifier. // -// API reference: https://api.cloudflare.com/#organization-level-firewall-access-rule-create-access-rule -func (api *API) CreateOrganizationAccessRule(organizationID string, accessRule AccessRule) (*AccessRuleResponse, error) { - return api.createAccessRule("/accounts/"+organizationID, accessRule) +// API reference: https://api.cloudflare.com/#account-level-firewall-access-rule-create-access-rule +func (api *API) CreateAccountAccessRule(accountID string, accessRule AccessRule) (*AccessRuleResponse, error) { + return api.createAccessRule("/accounts/"+accountID, accessRule) } -// OrganizationAccessRule returns the details of an organization's access rule. +// AccountAccessRule returns the details of an account's access rule. // // API reference: https://api.cloudflare.com/#account-level-firewall-access-rule-access-rule-details -func (api *API) OrganizationAccessRule(organizationID string, accessRuleID string) (*AccessRuleResponse, error) { - return api.retrieveAccessRule("/accounts/"+organizationID, accessRuleID) +func (api *API) AccountAccessRule(accountID string, accessRuleID string) (*AccessRuleResponse, error) { + return api.retrieveAccessRule("/accounts/"+accountID, accessRuleID) } -// UpdateOrganizationAccessRule updates a single access rule for the given -// organization & access rule identifiers. +// UpdateAccountAccessRule updates a single access rule for the given +// account & access rule identifiers. // -// API reference: https://api.cloudflare.com/#organization-level-firewall-access-rule-update-access-rule -func (api *API) UpdateOrganizationAccessRule(organizationID, accessRuleID string, accessRule AccessRule) (*AccessRuleResponse, error) { - return api.updateAccessRule("/accounts/"+organizationID, accessRuleID, accessRule) +// API reference: https://api.cloudflare.com/#account-level-firewall-access-rule-update-access-rule +func (api *API) UpdateAccountAccessRule(accountID, accessRuleID string, accessRule AccessRule) (*AccessRuleResponse, error) { + return api.updateAccessRule("/accounts/"+accountID, accessRuleID, accessRule) } -// DeleteOrganizationAccessRule deletes a single access rule for the given -// organization and access rule identifiers. +// DeleteAccountAccessRule deletes a single access rule for the given +// account and access rule identifiers. // -// API reference: https://api.cloudflare.com/#organization-level-firewall-access-rule-delete-access-rule -func (api *API) DeleteOrganizationAccessRule(organizationID, accessRuleID string) (*AccessRuleResponse, error) { - return api.deleteAccessRule("/accounts/"+organizationID, accessRuleID) +// API reference: https://api.cloudflare.com/#account-level-firewall-access-rule-delete-access-rule +func (api *API) DeleteAccountAccessRule(accountID, accessRuleID string) (*AccessRuleResponse, error) { + return api.deleteAccessRule("/accounts/"+accountID, accessRuleID) } func (api *API) listAccessRules(prefix string, accessRule AccessRule, page int) (*AccessRuleListResponse, error) { diff --git a/vendor/github.com/cloudflare/cloudflare-go/go.mod b/vendor/github.com/cloudflare/cloudflare-go/go.mod index 148e645d27..e458cc93b3 100644 --- a/vendor/github.com/cloudflare/cloudflare-go/go.mod +++ b/vendor/github.com/cloudflare/cloudflare-go/go.mod @@ -1,12 +1,13 @@ module github.com/cloudflare/cloudflare-go +go 1.11 + require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/mattn/go-runewidth v0.0.4 // indirect github.com/olekukonko/tablewriter v0.0.1 github.com/pkg/errors v0.8.1 github.com/stretchr/testify v1.3.0 - github.com/urfave/cli v1.20.0 - golang.org/x/lint v0.0.0-20190511005446-959b441ac422 // indirect - golang.org/x/time v0.0.0-20190513212739-9d24e82272b4 + github.com/urfave/cli v1.21.0 + golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 ) diff --git a/vendor/github.com/cloudflare/cloudflare-go/go.sum b/vendor/github.com/cloudflare/cloudflare-go/go.sum index c7f43407d2..0e0bd1238e 100644 --- a/vendor/github.com/cloudflare/cloudflare-go/go.sum +++ b/vendor/github.com/cloudflare/cloudflare-go/go.sum @@ -1,3 +1,4 @@ +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -12,13 +13,9 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/urfave/cli v1.20.0 h1:fDqGv3UG/4jbVl/QkFwEdddtEDjh/5Ov6X+0B/3bPaw= -github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/lint v0.0.0-20190511005446-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= -golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/time v0.0.0-20190513212739-9d24e82272b4 h1:RMGusaKverhgGR5KBERIKiTyWoWHRd84GCtsNlvLvIo= -golang.org/x/time v0.0.0-20190513212739-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= -golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +github.com/urfave/cli v1.21.0 h1:wYSSj06510qPIzGSua9ZqsncMmWE3Zr55KBERygyrxE= +github.com/urfave/cli v1.21.0/go.mod h1:lxDj6qX9Q6lWQxIrbrT0nwecwUtRnhVZAJjJZrVUZZQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 h1:SvFZT6jyqRaOeXpc5h/JSfZenJ2O330aBsf7JfSUXmQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/vendor/github.com/cloudflare/cloudflare-go/options.go b/vendor/github.com/cloudflare/cloudflare-go/options.go index 6cd6fc116a..1bf4f60bd9 100644 --- a/vendor/github.com/cloudflare/cloudflare-go/options.go +++ b/vendor/github.com/cloudflare/cloudflare-go/options.go @@ -28,11 +28,11 @@ func Headers(headers http.Header) Option { } } -// UsingOrganization allows you to apply account-level changes (Load Balancing, -// Railguns) to an organization instead. -func UsingOrganization(orgID string) Option { +// UsingAccount allows you to apply account-level changes (Load Balancing, +// Railguns) to an account instead. +func UsingAccount(accountID string) Option { return func(api *API) error { - api.OrganizationID = orgID + api.AccountID = accountID return nil } } diff --git a/vendor/github.com/cloudflare/cloudflare-go/organizations.go b/vendor/github.com/cloudflare/cloudflare-go/organizations.go deleted file mode 100644 index 02765159c2..0000000000 --- a/vendor/github.com/cloudflare/cloudflare-go/organizations.go +++ /dev/null @@ -1,186 +0,0 @@ -package cloudflare - -import ( - "encoding/json" - "time" - - "github.com/pkg/errors" -) - -// Organization represents a multi-user organization. -type Organization struct { - ID string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - Status string `json:"status,omitempty"` - Permissions []string `json:"permissions,omitempty"` - Roles []string `json:"roles,omitempty"` -} - -// organizationResponse represents the response from the Organization endpoint. -type organizationResponse struct { - Response - Result []Organization `json:"result"` - ResultInfo `json:"result_info"` -} - -// OrganizationMember has details on a member. -type OrganizationMember struct { - ID string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - Email string `json:"email,omitempty"` - Status string `json:"status,omitempty"` - Roles []OrganizationRole `json:"roles,omitempty"` -} - -// OrganizationInvite has details on an invite. -type OrganizationInvite struct { - ID string `json:"id,omitempty"` - InvitedMemberID string `json:"invited_member_id,omitempty"` - InvitedMemberEmail string `json:"invited_member_email,omitempty"` - OrganizationID string `json:"organization_id,omitempty"` - OrganizationName string `json:"organization_name,omitempty"` - Roles []OrganizationRole `json:"roles,omitempty"` - InvitedBy string `json:"invited_by,omitempty"` - InvitedOn *time.Time `json:"invited_on,omitempty"` - ExpiresOn *time.Time `json:"expires_on,omitempty"` - Status string `json:"status,omitempty"` -} - -// OrganizationRole has details on a role. -type OrganizationRole struct { - ID string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - Description string `json:"description,omitempty"` - Permissions []string `json:"permissions,omitempty"` -} - -// OrganizationDetails represents details of an organization. -type OrganizationDetails struct { - ID string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - Members []OrganizationMember `json:"members"` - Invites []OrganizationInvite `json:"invites"` - Roles []OrganizationRole `json:"roles,omitempty"` -} - -// organizationDetailsResponse represents the response from the OrganizationDetails endpoint. -type organizationDetailsResponse struct { - Response - Result OrganizationDetails `json:"result"` -} - -// ListOrganizations lists organizations of the logged-in user. -// -// API reference: https://api.cloudflare.com/#user-s-organizations-list-organizations -func (api *API) ListOrganizations() ([]Organization, ResultInfo, error) { - var r organizationResponse - res, err := api.makeRequest("GET", "/user/organizations", nil) - if err != nil { - return []Organization{}, ResultInfo{}, errors.Wrap(err, errMakeRequestError) - } - - err = json.Unmarshal(res, &r) - if err != nil { - return []Organization{}, ResultInfo{}, errors.Wrap(err, errUnmarshalError) - } - - return r.Result, r.ResultInfo, nil -} - -// OrganizationDetails returns details for the specified organization of the logged-in user. -// -// API reference: https://api.cloudflare.com/#organizations-organization-details -func (api *API) OrganizationDetails(organizationID string) (OrganizationDetails, error) { - var r organizationDetailsResponse - uri := "/organizations/" + organizationID - res, err := api.makeRequest("GET", uri, nil) - if err != nil { - return OrganizationDetails{}, errors.Wrap(err, errMakeRequestError) - } - - err = json.Unmarshal(res, &r) - if err != nil { - return OrganizationDetails{}, errors.Wrap(err, errUnmarshalError) - } - - return r.Result, nil -} - -// organizationMembersResponse represents the response from the Organization members endpoint. -type organizationMembersResponse struct { - Response - Result []OrganizationMember `json:"result"` - ResultInfo `json:"result_info"` -} - -// OrganizationMembers returns list of members for specified organization of the logged-in user. -// -// API reference: https://api.cloudflare.com/#organization-members-list-members -func (api *API) OrganizationMembers(organizationID string) ([]OrganizationMember, ResultInfo, error) { - var r organizationMembersResponse - uri := "/organizations/" + organizationID + "/members" - res, err := api.makeRequest("GET", uri, nil) - if err != nil { - return []OrganizationMember{}, ResultInfo{}, errors.Wrap(err, errMakeRequestError) - } - - err = json.Unmarshal(res, &r) - if err != nil { - return []OrganizationMember{}, ResultInfo{}, errors.Wrap(err, errUnmarshalError) - } - - return r.Result, r.ResultInfo, nil -} - -// organizationInvitesResponse represents the response from the Organization invites endpoint. -type organizationInvitesResponse struct { - Response - Result []OrganizationInvite `json:"result"` - ResultInfo `json:"result_info"` -} - -// OrganizationInvites returns list of invites for specified organization of -// the logged-in user. -// -// API reference: https://api.cloudflare.com/#organization-invites -func (api *API) OrganizationInvites(organizationID string) ([]OrganizationInvite, ResultInfo, error) { - var r organizationInvitesResponse - uri := "/organizations/" + organizationID + "/invites" - res, err := api.makeRequest("GET", uri, nil) - if err != nil { - return []OrganizationInvite{}, ResultInfo{}, errors.Wrap(err, errMakeRequestError) - } - - err = json.Unmarshal(res, &r) - if err != nil { - return []OrganizationInvite{}, ResultInfo{}, errors.Wrap(err, errUnmarshalError) - } - - return r.Result, r.ResultInfo, nil -} - -// organizationRolesResponse represents the response from the Organization roles endpoint. -type organizationRolesResponse struct { - Response - Result []OrganizationRole `json:"result"` - ResultInfo `json:"result_info"` -} - -// OrganizationRoles returns list of roles for specified organization of the logged-in user. -// -// API reference: https://api.cloudflare.com/#organization-roles-list-roles -func (api *API) OrganizationRoles(organizationID string) ([]OrganizationRole, ResultInfo, error) { - var r organizationRolesResponse - uri := "/organizations/" + organizationID + "/roles" - res, err := api.makeRequest("GET", uri, nil) - if err != nil { - return []OrganizationRole{}, ResultInfo{}, errors.Wrap(err, errMakeRequestError) - } - - err = json.Unmarshal(res, &r) - if err != nil { - return []OrganizationRole{}, ResultInfo{}, errors.Wrap(err, errUnmarshalError) - } - - return r.Result, r.ResultInfo, nil -} diff --git a/vendor/github.com/cloudflare/cloudflare-go/universal_ssl.go b/vendor/github.com/cloudflare/cloudflare-go/universal_ssl.go index ae809e5c7e..4bf8ffde71 100644 --- a/vendor/github.com/cloudflare/cloudflare-go/universal_ssl.go +++ b/vendor/github.com/cloudflare/cloudflare-go/universal_ssl.go @@ -16,6 +16,28 @@ type universalSSLSettingResponse struct { Result UniversalSSLSetting `json:"result"` } +// UniversalSSLVerificationDetails represents a universal ssl verifcation's properties. +type UniversalSSLVerificationDetails struct { + CertificateStatus string `json:"certificate_status"` + VerificationType string `json:"verification_type"` + ValidationMethod string `json:"validation_method"` + CertPackUUID string `json:"cert_pack_uuid"` + VerificationStatus bool `json:"verification_status"` + BrandCheck bool `json:"brand_check"` + VerificationInfo UniversalSSLVerificationInfo `json:"verification_info"` +} + +// UniversalSSLVerificationInfo represents DCV record. +type UniversalSSLVerificationInfo struct { + RecordName string `json:"record_name"` + RecordTarget string `json:"record_target"` +} + +type universalSSLVerificationResponse struct { + Response + Result []UniversalSSLVerificationDetails `json:"result"` +} + // UniversalSSLSettingDetails returns the details for a universal ssl setting // // API reference: https://api.cloudflare.com/#universal-ssl-settings-for-a-zone-universal-ssl-settings-details @@ -48,3 +70,19 @@ func (api *API) EditUniversalSSLSetting(zoneID string, setting UniversalSSLSetti return r.Result, nil } + +// UniversalSSLVerificationDetails returns the details for a universal ssl verifcation +// +// API reference: https://api.cloudflare.com/#ssl-verification-ssl-verification-details +func (api *API) UniversalSSLVerificationDetails(zoneID string) ([]UniversalSSLVerificationDetails, error) { + uri := "/zones/" + zoneID + "/ssl/verification" + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return []UniversalSSLVerificationDetails{}, errors.Wrap(err, errMakeRequestError) + } + var r universalSSLVerificationResponse + if err := json.Unmarshal(res, &r); err != nil { + return []UniversalSSLVerificationDetails{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} diff --git a/vendor/github.com/cloudflare/cloudflare-go/user.go b/vendor/github.com/cloudflare/cloudflare-go/user.go index b42641e926..bf2f47a578 100644 --- a/vendor/github.com/cloudflare/cloudflare-go/user.go +++ b/vendor/github.com/cloudflare/cloudflare-go/user.go @@ -9,20 +9,20 @@ import ( // User describes a user account. type User struct { - ID string `json:"id,omitempty"` - Email string `json:"email,omitempty"` - FirstName string `json:"first_name,omitempty"` - LastName string `json:"last_name,omitempty"` - Username string `json:"username,omitempty"` - Telephone string `json:"telephone,omitempty"` - Country string `json:"country,omitempty"` - Zipcode string `json:"zipcode,omitempty"` - CreatedOn *time.Time `json:"created_on,omitempty"` - ModifiedOn *time.Time `json:"modified_on,omitempty"` - APIKey string `json:"api_key,omitempty"` - TwoFA bool `json:"two_factor_authentication_enabled,omitempty"` - Betas []string `json:"betas,omitempty"` - Organizations []Organization `json:"organizations,omitempty"` + ID string `json:"id,omitempty"` + Email string `json:"email,omitempty"` + FirstName string `json:"first_name,omitempty"` + LastName string `json:"last_name,omitempty"` + Username string `json:"username,omitempty"` + Telephone string `json:"telephone,omitempty"` + Country string `json:"country,omitempty"` + Zipcode string `json:"zipcode,omitempty"` + CreatedOn *time.Time `json:"created_on,omitempty"` + ModifiedOn *time.Time `json:"modified_on,omitempty"` + APIKey string `json:"api_key,omitempty"` + TwoFA bool `json:"two_factor_authentication_enabled,omitempty"` + Betas []string `json:"betas,omitempty"` + Accounts []Account `json:"organizations,omitempty"` } // UserResponse wraps a response containing User accounts. diff --git a/vendor/github.com/cloudflare/cloudflare-go/waf.go b/vendor/github.com/cloudflare/cloudflare-go/waf.go index cc7c5e78cb..71878368e2 100644 --- a/vendor/github.com/cloudflare/cloudflare-go/waf.go +++ b/vendor/github.com/cloudflare/cloudflare-go/waf.go @@ -24,6 +24,38 @@ type WAFPackagesResponse struct { ResultInfo ResultInfo `json:"result_info"` } +// WAFPackageResponse represents the response from the WAF package endpoint. +type WAFPackageResponse struct { + Response + Result WAFPackage `json:"result"` + ResultInfo ResultInfo `json:"result_info"` +} + +// WAFPackageOptions represents options to edit a WAF package. +type WAFPackageOptions struct { + Sensitivity string `json:"sensitivity,omitempty"` + ActionMode string `json:"action_mode,omitempty"` +} + +// WAFGroup represents a WAF rule group. +type WAFGroup struct { + ID string `json:"id"` + Name string `json:"name"` + Description string `json:"description"` + RulesCount int `json:"rules_count"` + ModifiedRulesCount int `json:"modified_rules_count"` + PackageID string `json:"package_id"` + Mode string `json:"mode"` + AllowedModes []string `json:"allowed_modes"` +} + +// WAFGroupsResponse represents the response from the WAF groups endpoint. +type WAFGroupsResponse struct { + Response + Result []WAFGroup `json:"result"` + ResultInfo ResultInfo `json:"result_info"` +} + // WAFRule represents a WAF rule. type WAFRule struct { ID string `json:"id"` @@ -85,6 +117,74 @@ func (api *API) ListWAFPackages(zoneID string) ([]WAFPackage, error) { return packages, nil } +// WAFPackage returns a WAF package for the given zone. +// +// API Reference: https://api.cloudflare.com/#waf-rule-packages-firewall-package-details +func (api *API) WAFPackage(zoneID, packageID string) (WAFPackage, error) { + uri := "/zones/" + zoneID + "/firewall/waf/packages/" + packageID + res, err := api.makeRequest("GET", uri, nil) + if err != nil { + return WAFPackage{}, errors.Wrap(err, errMakeRequestError) + } + + var r WAFPackageResponse + err = json.Unmarshal(res, &r) + if err != nil { + return WAFPackage{}, errors.Wrap(err, errUnmarshalError) + } + + return r.Result, nil +} + +// UpdateWAFPackage lets you update the a WAF Package. +// +// API Reference: https://api.cloudflare.com/#waf-rule-packages-edit-firewall-package +func (api *API) UpdateWAFPackage(zoneID, packageID string, opts WAFPackageOptions) (WAFPackage, error) { + uri := "/zones/" + zoneID + "/firewall/waf/packages/" + packageID + res, err := api.makeRequest("PATCH", uri, opts) + if err != nil { + return WAFPackage{}, errors.Wrap(err, errMakeRequestError) + } + + var r WAFPackageResponse + err = json.Unmarshal(res, &r) + if err != nil { + return WAFPackage{}, errors.Wrap(err, errUnmarshalError) + } + return r.Result, nil +} + +// ListWAFGroups returns a slice of the WAF groups for the given WAF package. +// +// API Reference: https://api.cloudflare.com/#waf-rule-groups-list-rule-groups +func (api *API) ListWAFGroups(zoneID, packageID string) ([]WAFGroup, error) { + var groups []WAFGroup + var res []byte + var err error + + uri := "/zones/" + zoneID + "/firewall/waf/packages/" + packageID + "/groups" + res, err = api.makeRequest("GET", uri, nil) + if err != nil { + return []WAFGroup{}, errors.Wrap(err, errMakeRequestError) + } + + var r WAFGroupsResponse + err = json.Unmarshal(res, &r) + if err != nil { + return []WAFGroup{}, errors.Wrap(err, errUnmarshalError) + } + + if !r.Success { + // TODO: Provide an actual error message instead of always returning nil + return []WAFGroup{}, err + } + + for gi := range r.Result { + groups = append(groups, r.Result[gi]) + } + return groups, nil +} + // ListWAFRules returns a slice of the WAF rules for the given WAF package. // // API Reference: https://api.cloudflare.com/#waf-rules-list-rules diff --git a/vendor/github.com/cloudflare/cloudflare-go/workers.go b/vendor/github.com/cloudflare/cloudflare-go/workers.go index ee7267caf9..1ab795ec4e 100644 --- a/vendor/github.com/cloudflare/cloudflare-go/workers.go +++ b/vendor/github.com/cloudflare/cloudflare-go/workers.go @@ -86,14 +86,14 @@ func (api *API) DeleteWorker(requestParams *WorkerRequestParams) (WorkerScriptRe // DeleteWorkerWithName deletes worker for a zone. // This is an enterprise only feature https://developers.cloudflare.com/workers/api/config-api-for-enterprise -// organizationID must be specified as api option https://godoc.org/github.com/cloudflare/cloudflare-go#UsingOrganization +// account must be specified as api option https://godoc.org/github.com/cloudflare/cloudflare-go#UsingAccount // // API reference: https://api.cloudflare.com/#worker-script-delete-worker func (api *API) deleteWorkerWithName(scriptName string) (WorkerScriptResponse, error) { - if api.OrganizationID == "" { - return WorkerScriptResponse{}, errors.New("organization ID required for enterprise only request") + if api.AccountID == "" { + return WorkerScriptResponse{}, errors.New("account ID required for enterprise only request") } - uri := "/accounts/" + api.OrganizationID + "/workers/scripts/" + scriptName + uri := "/accounts/" + api.AccountID + "/workers/scripts/" + scriptName res, err := api.makeRequest("DELETE", uri, nil) var r WorkerScriptResponse if err != nil { @@ -129,10 +129,10 @@ func (api *API) DownloadWorker(requestParams *WorkerRequestParams) (WorkerScript // // API reference: https://api.cloudflare.com/#worker-script-download-worker func (api *API) downloadWorkerWithName(scriptName string) (WorkerScriptResponse, error) { - if api.OrganizationID == "" { - return WorkerScriptResponse{}, errors.New("organization ID required for enterprise only request") + if api.AccountID == "" { + return WorkerScriptResponse{}, errors.New("account ID required for enterprise only request") } - uri := "/accounts/" + api.OrganizationID + "/workers/scripts/" + scriptName + uri := "/accounts/" + api.AccountID + "/workers/scripts/" + scriptName res, err := api.makeRequest("GET", uri, nil) var r WorkerScriptResponse if err != nil { @@ -143,15 +143,16 @@ func (api *API) downloadWorkerWithName(scriptName string) (WorkerScriptResponse, return r, nil } -// ListWorkerScripts returns list of worker scripts for given organization +// ListWorkerScripts returns list of worker scripts for given account. +// // This is an enterprise only feature https://developers.cloudflare.com/workers/api/config-api-for-enterprise // // API reference: https://developers.cloudflare.com/workers/api/config-api-for-enterprise/ func (api *API) ListWorkerScripts() (WorkerListResponse, error) { - if api.OrganizationID == "" { - return WorkerListResponse{}, errors.New("organization ID required for enterprise only request") + if api.AccountID == "" { + return WorkerListResponse{}, errors.New("account ID required for enterprise only request") } - uri := "/accounts/" + api.OrganizationID + "/workers/scripts" + uri := "/accounts/" + api.AccountID + "/workers/scripts" res, err := api.makeRequest("GET", uri, nil) if err != nil { return WorkerListResponse{}, errors.Wrap(err, errMakeRequestError) @@ -164,7 +165,7 @@ func (api *API) ListWorkerScripts() (WorkerListResponse, error) { return r, nil } -// UploadWorker push raw script content for your worker +// UploadWorker push raw script content for your worker. // // API reference: https://api.cloudflare.com/#worker-script-upload-worker func (api *API) UploadWorker(requestParams *WorkerRequestParams, data string) (WorkerScriptResponse, error) { @@ -186,15 +187,16 @@ func (api *API) UploadWorker(requestParams *WorkerRequestParams, data string) (W return r, nil } -// UploadWorkerWithName push raw script content for your worker +// UploadWorkerWithName push raw script content for your worker. +// // This is an enterprise only feature https://developers.cloudflare.com/workers/api/config-api-for-enterprise/ // // API reference: https://api.cloudflare.com/#worker-script-upload-worker func (api *API) uploadWorkerWithName(scriptName string, data string) (WorkerScriptResponse, error) { - if api.OrganizationID == "" { - return WorkerScriptResponse{}, errors.New("organization ID required for enterprise only request") + if api.AccountID == "" { + return WorkerScriptResponse{}, errors.New("account ID required for enterprise only request") } - uri := "/accounts/" + api.OrganizationID + "/workers/scripts/" + scriptName + uri := "/accounts/" + api.AccountID + "/workers/scripts/" + scriptName headers := make(http.Header) headers.Set("Content-Type", "application/javascript") res, err := api.makeRequestWithHeaders("PUT", uri, []byte(data), headers) @@ -217,8 +219,8 @@ func (api *API) CreateWorkerRoute(zoneID string, route WorkerRoute) (WorkerRoute // to use the single-script or multi-script endpoint. pathComponent := "filters" if route.Script != "" { - if api.OrganizationID == "" { - return WorkerRouteResponse{}, errors.New("organization ID required for enterprise only request") + if api.AccountID == "" { + return WorkerRouteResponse{}, errors.New("account ID required for enterprise only request") } pathComponent = "routes" } @@ -260,7 +262,7 @@ func (api *API) DeleteWorkerRoute(zoneID string, routeID string) (WorkerRouteRes // API reference: https://api.cloudflare.com/#worker-filters-list-filters func (api *API) ListWorkerRoutes(zoneID string) (WorkerRoutesResponse, error) { pathComponent := "filters" - if api.OrganizationID != "" { + if api.AccountID != "" { pathComponent = "routes" } uri := "/zones/" + zoneID + "/workers/" + pathComponent @@ -293,8 +295,8 @@ func (api *API) UpdateWorkerRoute(zoneID string, routeID string, route WorkerRou // to use the single-script or multi-script endpoint. pathComponent := "filters" if route.Script != "" { - if api.OrganizationID == "" { - return WorkerRouteResponse{}, errors.New("organization ID required for enterprise only request") + if api.AccountID == "" { + return WorkerRouteResponse{}, errors.New("account ID required for enterprise only request") } pathComponent = "routes" } diff --git a/vendor/github.com/cloudflare/cloudflare-go/workers_kv.go b/vendor/github.com/cloudflare/cloudflare-go/workers_kv.go index f5df6fae45..92197af086 100644 --- a/vendor/github.com/cloudflare/cloudflare-go/workers_kv.go +++ b/vendor/github.com/cloudflare/cloudflare-go/workers_kv.go @@ -54,7 +54,7 @@ type ListStorageKeysResponse struct { // // API reference: https://api.cloudflare.com/#workers-kv-namespace-create-a-namespace func (api *API) CreateWorkersKVNamespace(ctx context.Context, req *WorkersKVNamespaceRequest) (WorkersKVNamespaceResponse, error) { - uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces", api.OrganizationID) + uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces", api.AccountID) res, err := api.makeRequestContext(ctx, http.MethodPost, uri, req) if err != nil { return WorkersKVNamespaceResponse{}, errors.Wrap(err, errMakeRequestError) @@ -72,7 +72,7 @@ func (api *API) CreateWorkersKVNamespace(ctx context.Context, req *WorkersKVName // // API reference: https://api.cloudflare.com/#workers-kv-namespace-list-namespaces func (api *API) ListWorkersKVNamespaces(ctx context.Context) (ListWorkersKVNamespacesResponse, error) { - uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces", api.OrganizationID) + uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces", api.AccountID) res, err := api.makeRequestContext(ctx, http.MethodGet, uri, nil) if err != nil { return ListWorkersKVNamespacesResponse{}, errors.Wrap(err, errMakeRequestError) @@ -90,7 +90,7 @@ func (api *API) ListWorkersKVNamespaces(ctx context.Context) (ListWorkersKVNames // // API reference: https://api.cloudflare.com/#workers-kv-namespace-remove-a-namespace func (api *API) DeleteWorkersKVNamespace(ctx context.Context, namespaceID string) (Response, error) { - uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces/%s", api.OrganizationID, namespaceID) + uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces/%s", api.AccountID, namespaceID) res, err := api.makeRequestContext(ctx, http.MethodDelete, uri, nil) if err != nil { return Response{}, errors.Wrap(err, errMakeRequestError) @@ -108,7 +108,7 @@ func (api *API) DeleteWorkersKVNamespace(ctx context.Context, namespaceID string // // API reference: https://api.cloudflare.com/#workers-kv-namespace-rename-a-namespace func (api *API) UpdateWorkersKVNamespace(ctx context.Context, namespaceID string, req *WorkersKVNamespaceRequest) (Response, error) { - uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces/%s", api.OrganizationID, namespaceID) + uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces/%s", api.AccountID, namespaceID) res, err := api.makeRequestContext(ctx, http.MethodPut, uri, req) if err != nil { return Response{}, errors.Wrap(err, errMakeRequestError) @@ -127,7 +127,7 @@ func (api *API) UpdateWorkersKVNamespace(ctx context.Context, namespaceID string // API reference: https://api.cloudflare.com/#workers-kv-namespace-write-key-value-pair func (api *API) WriteWorkersKV(ctx context.Context, namespaceID, key string, value []byte) (Response, error) { key = url.PathEscape(key) - uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces/%s/values/%s", api.OrganizationID, namespaceID, key) + uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces/%s/values/%s", api.AccountID, namespaceID, key) res, err := api.makeRequestWithAuthTypeAndHeaders( ctx, http.MethodPut, uri, value, api.authType, http.Header{"Content-Type": []string{"application/octet-stream"}}, ) @@ -148,7 +148,7 @@ func (api *API) WriteWorkersKV(ctx context.Context, namespaceID, key string, val // API reference: https://api.cloudflare.com/#workers-kv-namespace-read-key-value-pair func (api API) ReadWorkersKV(ctx context.Context, namespaceID, key string) ([]byte, error) { key = url.PathEscape(key) - uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces/%s/values/%s", api.OrganizationID, namespaceID, key) + uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces/%s/values/%s", api.AccountID, namespaceID, key) res, err := api.makeRequestContext(ctx, http.MethodGet, uri, nil) if err != nil { return nil, errors.Wrap(err, errMakeRequestError) @@ -161,7 +161,7 @@ func (api API) ReadWorkersKV(ctx context.Context, namespaceID, key string) ([]by // API reference: https://api.cloudflare.com/#workers-kv-namespace-delete-key-value-pair func (api API) DeleteWorkersKV(ctx context.Context, namespaceID, key string) (Response, error) { key = url.PathEscape(key) - uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces/%s/values/%s", api.OrganizationID, namespaceID, key) + uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces/%s/values/%s", api.AccountID, namespaceID, key) res, err := api.makeRequestContext(ctx, http.MethodDelete, uri, nil) if err != nil { return Response{}, errors.Wrap(err, errMakeRequestError) @@ -178,7 +178,7 @@ func (api API) DeleteWorkersKV(ctx context.Context, namespaceID, key string) (Re // // API Reference: https://api.cloudflare.com/#workers-kv-namespace-list-a-namespace-s-keys func (api API) ListWorkersKVs(ctx context.Context, namespaceID string) (ListStorageKeysResponse, error) { - uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces/%s/keys", api.OrganizationID, namespaceID) + uri := fmt.Sprintf("/accounts/%s/storage/kv/namespaces/%s/keys", api.AccountID, namespaceID) res, err := api.makeRequestContext(ctx, http.MethodGet, uri, nil) if err != nil { return ListStorageKeysResponse{}, errors.Wrap(err, errMakeRequestError) diff --git a/vendor/github.com/cloudflare/cloudflare-go/zone.go b/vendor/github.com/cloudflare/cloudflare-go/zone.go index d545819760..951ca23d36 100644 --- a/vendor/github.com/cloudflare/cloudflare-go/zone.go +++ b/vendor/github.com/cloudflare/cloudflare-go/zone.go @@ -265,7 +265,7 @@ type newZone struct { Type string `json:"type"` // We use a pointer to get a nil type when the field is empty. // This allows us to completely omit this with json.Marshal(). - Organization *Organization `json:"organization,omitempty"` + Account *Account `json:"organization,omitempty"` } // CreateZone creates a zone on an account. @@ -273,16 +273,16 @@ type newZone struct { // Setting jumpstart to true will attempt to automatically scan for existing // DNS records. Setting this to false will create the zone with no DNS records. // -// If Organization is non-empty, it must have at least the ID field populated. -// This will add the new zone to the specified multi-user organization. +// If account is non-empty, it must have at least the ID field populated. +// This will add the new zone to the specified multi-user account. // // API reference: https://api.cloudflare.com/#zone-create-a-zone -func (api *API) CreateZone(name string, jumpstart bool, org Organization, zoneType string) (Zone, error) { +func (api *API) CreateZone(name string, jumpstart bool, account Account, zoneType string) (Zone, error) { var newzone newZone newzone.Name = name newzone.JumpStart = jumpstart - if org.ID != "" { - newzone.Organization = &org + if account.ID != "" { + newzone.Account = &account } if zoneType == "partial" { diff --git a/vendor/modules.txt b/vendor/modules.txt index 51fcb1a74e..333095a27e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -57,9 +57,7 @@ github.com/bgentry/go-netrc/netrc github.com/bgentry/speakeasy # github.com/blang/semver v3.5.1+incompatible github.com/blang/semver -# github.com/bmatcuk/doublestar v1.1.5 -github.com/bmatcuk/doublestar -# github.com/cloudflare/cloudflare-go v0.9.4 +# github.com/cloudflare/cloudflare-go v0.10.0 github.com/cloudflare/cloudflare-go # github.com/davecgh/go-spew v1.1.1 github.com/davecgh/go-spew/spew diff --git a/website/cloudflare.erb b/website/cloudflare.erb index b83933faf6..3705f83ad4 100644 --- a/website/cloudflare.erb +++ b/website/cloudflare.erb @@ -10,6 +10,15 @@ Cloudflare Provider + > + Guides + + + > Data Sources