frontegg / terraform-provider-frontegg

Terraform Provider for Frontegg
Mozilla Public License 2.0
8 stars 16 forks source link

Webhook delete appears broken on 0.2.44 #103

Closed jubrad closed 1 year ago

jubrad commented 1 year ago

Terraform version

Terraform v1.4.6
on darwin_arm64
+ provider registry.terraform.io/frontegg/frontegg v0.2.44

Affected resources

0.2.44 Please list the resources as a list, for example:

Terraform configuration files

# Copy-paste your Terraform configurations here - for large Terraform configs,
# please use a service like Dropbox and share a link to the ZIP file.

Debug Output

 Error: restclient: request failed: DELETE https://frontegg-prod.frontegg.com/webhook/<redacted>: 400 Bad Request: map[Cf-Cache-Status:[DYNAMIC] Cf-Ray:[7e8c27a4098a1130-ORD] Content-Length:[36] Content-Security-Policy:[default-src 'self';base-uri 'self';block-all-mixed-content;font-src 'self' https: data:;frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests] Content-Type:[application/json; charset=utf-8] Date:[Tue, 18 Jul 2023 16:38:25 GMT] Etag:[W/"24-EpjjG7cILmcP/cORBpyWYDAOe8w"] Expect-Ct:[max-age=0] Frontegg-Trace-Id:[0e05e6f0-67e2-4a17-a4cc-63d5868d9b36] Origin-Agent-Cluster:[?1] Referrer-Policy:[no-referrer] Server:[cloudflare] Strict-Transport-Security:[max-age=15552000; includeSubDomains] X-Content-Type-Options:[nosniff] X-Dns-Prefetch-Control:[off] X-Download-Options:[noopen] X-Frame-Options:[SAMEORIGIN] X-Permitted-Cross-Domain-Policies:[none] X-Xss-Protection:[0]]: {"errors":["Invalid JSON provided"]}

Expected Behavior

Webhook should be delted

Actual Behavior

Delete fails with 400, invalid json provided

Steps to reproduce

provider "frontegg" {
  client_id      = "<id>"
  secret_key     = "<secret>"
  api_base_url    = "https://api.frontegg.com"
}

terraform {
  required_providers {
    frontegg = {
      source = "frontegg/frontegg"
      version = "0.2.44"
    }
  }
}

resource "frontegg_webhook" "example" {
  enabled     = true
  name        = "Example webhook"
  description = "An example of a webhook"
  url         = "https://test-url.com/api/internal/webhooks/frontegg-test"
  secret      = "example-secret"
  events = [
    "frontegg.user.authenticated"
  ]
}
  1. terraform init
  2. terraform apply
  3. terraform destroy

Important factoids

It appears that this was brought on between v0.2.38 and v0.2.44 as it was seen after update of https://github.com/MaterializeInc/pulumi-frontegg from 0.2.25 to 0.2.26

jubrad commented 1 year ago

This appears to work on v0.2.45 based on the above repro steps.

We'll upgrade the pulumi-frontegg provider.