diff --git a/consul/resource_consul_config_entry_ce_test.go b/consul/resource_consul_config_entry_ce_test.go index 3fcd3b90..8a8590de 100644 --- a/consul/resource_consul_config_entry_ce_test.go +++ b/consul/resource_consul_config_entry_ce_test.go @@ -182,15 +182,19 @@ func TestAccConsulConfigEntryCE_JWTProvider(t *testing.T) { { Config: TestAccConsulConfigEntryCE_jwtRemote, Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("consul_config_entry.jwt_provider", "id", "jwt-provider-okta"), resource.TestCheckResourceAttr("consul_config_entry.jwt_provider", "name", "okta"), resource.TestCheckResourceAttr("consul_config_entry.jwt_provider", "kind", "jwt-provider"), + resource.TestCheckResourceAttr("consul_config_entry.jwt_provider", "config_json", "{\"ClockSkewSeconds\":30,\"Forwarding\":{\"HeaderName\":\"test-token\"},\"Issuer\":\"test-issuer\",\"JSONWebKeySet\":{\"Remote\":{\"FetchAsynchronously\":true,\"URI\":\"https://127.0.0.1:9091\"}}}"), ), }, { Config: TestAccConsulConfigEntryCE_jwtLocal, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("consul_config_entry.jwt_provider", "name", "okta"), + resource.TestCheckResourceAttr("consul_config_entry.jwt_provider", "id", "jwt-provider-auth0"), + resource.TestCheckResourceAttr("consul_config_entry.jwt_provider", "name", "auth0"), resource.TestCheckResourceAttr("consul_config_entry.jwt_provider", "kind", "jwt-provider"), + resource.TestCheckResourceAttr("consul_config_entry.jwt_provider", "config_json", "{\"ClockSkewSeconds\":30,\"Forwarding\":{\"HeaderName\":\"test-token\"},\"Issuer\":\"auth0-issuer\",\"JSONWebKeySet\":{\"Local\":{\"JWKS\":\"eyJrZXlzIjogW3sKICAiY3J2IjogIlAtMjU2IiwKICAia2V5X29wcyI6IFsKICAgICJ2ZXJpZnkiCiAgXSwKICAia3R5IjogIkVDIiwKICAieCI6ICJXYzl1WnVQYUI3S2gyRk1jOXd0SmpSZThYRDR5VDJBWU5BQWtyWWJWanV3IiwKICAieSI6ICI2OGhSVEppSk5Pd3RyaDRFb1BYZVZuUnVIN2hpU0RKX2xtYmJqZkRmV3EwIiwKICAiYWxnIjogIkVTMjU2IiwKICAidXNlIjogInNpZyIsCiAgImtpZCI6ICJhYzFlOGY5MGVkZGY2MWM0MjljNjFjYTA1YjRmMmUwNyIKfV19\"}}}"), ), }, }, @@ -748,19 +752,16 @@ resource "consul_config_entry" "jwt_provider" { const TestAccConsulConfigEntryCE_jwtLocal = ` resource "consul_config_entry" "jwt_provider" { - name = "okta" + name = "auth0" kind = "jwt-provider" config_json = jsonencode({ - Issuer = "test-issuer" + Issuer = "auth0-issuer" JSONWebKeySet = { Local = { JWKS = "eyJrZXlzIjogW3sKICAiY3J2IjogIlAtMjU2IiwKICAia2V5X29wcyI6IFsKICAgICJ2ZXJpZnkiCiAgXSwKICAia3R5IjogIkVDIiwKICAieCI6ICJXYzl1WnVQYUI3S2gyRk1jOXd0SmpSZThYRDR5VDJBWU5BQWtyWWJWanV3IiwKICAieSI6ICI2OGhSVEppSk5Pd3RyaDRFb1BYZVZuUnVIN2hpU0RKX2xtYmJqZkRmV3EwIiwKICAiYWxnIjogIkVTMjU2IiwKICAidXNlIjogInNpZyIsCiAgImtpZCI6ICJhYzFlOGY5MGVkZGY2MWM0MjljNjFjYTA1YjRmMmUwNyIKfV19" } } - Forwarding = { - HeaderName = "test-token" - } }) } ` diff --git a/consul/resource_consul_config_entry_ee_test.go b/consul/resource_consul_config_entry_ee_test.go index 7c05f074..53f8eba6 100644 --- a/consul/resource_consul_config_entry_ee_test.go +++ b/consul/resource_consul_config_entry_ee_test.go @@ -205,15 +205,19 @@ func TestAccConsulConfigEntryEE_JWTProvider(t *testing.T) { { Config: TestAccConsulConfigEntryEE_jwtRemote, Check: resource.ComposeAggregateTestCheckFunc( + resource.TestCheckResourceAttr("consul_config_entry.jwt_provider", "id", "jwt-provider-okta"), resource.TestCheckResourceAttr("consul_config_entry.jwt_provider", "name", "okta"), resource.TestCheckResourceAttr("consul_config_entry.jwt_provider", "kind", "jwt-provider"), + resource.TestCheckResourceAttr("consul_config_entry.jwt_provider", "config_json", "{\"ClockSkewSeconds\":30,\"Forwarding\":{\"HeaderName\":\"test-token\"},\"Issuer\":\"test-issuer\",\"JSONWebKeySet\":{\"Remote\":{\"FetchAsynchronously\":true,\"URI\":\"https://127.0.0.1:9091\"}}}"), ), }, { Config: TestAccConsulConfigEntryEE_jwtLocal, Check: resource.ComposeAggregateTestCheckFunc( - resource.TestCheckResourceAttr("consul_config_entry.jwt_provider", "name", "okta"), + resource.TestCheckResourceAttr("consul_config_entry.jwt_provider", "id", "jwt-provider-auth0"), + resource.TestCheckResourceAttr("consul_config_entry.jwt_provider", "name", "auth0"), resource.TestCheckResourceAttr("consul_config_entry.jwt_provider", "kind", "jwt-provider"), + resource.TestCheckResourceAttr("consul_config_entry.jwt_provider", "config_json", "{\"ClockSkewSeconds\":30,\"Forwarding\":{\"HeaderName\":\"test-token\"},\"Issuer\":\"auth0-issuer\",\"JSONWebKeySet\":{\"Local\":{\"JWKS\":\"eyJrZXlzIjogW3sKICAiY3J2IjogIlAtMjU2IiwKICAia2V5X29wcyI6IFsKICAgICJ2ZXJpZnkiCiAgXSwKICAia3R5IjogIkVDIiwKICAieCI6ICJXYzl1WnVQYUI3S2gyRk1jOXd0SmpSZThYRDR5VDJBWU5BQWtyWWJWanV3IiwKICAieSI6ICI2OGhSVEppSk5Pd3RyaDRFb1BYZVZuUnVIN2hpU0RKX2xtYmJqZkRmV3EwIiwKICAiYWxnIjogIkVTMjU2IiwKICAidXNlIjogInNpZyIsCiAgImtpZCI6ICJhYzFlOGY5MGVkZGY2MWM0MjljNjFjYTA1YjRmMmUwNyIKfV19\"}}}"), ), }, }, @@ -876,19 +880,16 @@ resource "consul_config_entry" "jwt_provider" { const TestAccConsulConfigEntryEE_jwtLocal = ` resource "consul_config_entry" "jwt_provider" { - name = "okta" + name = "auth0" kind = "jwt-provider" config_json = jsonencode({ - Issuer = "test-issuer" + Issuer = "auth0-issuer" JSONWebKeySet = { Local = { JWKS = "eyJrZXlzIjogW3sKICAiY3J2IjogIlAtMjU2IiwKICAia2V5X29wcyI6IFsKICAgICJ2ZXJpZnkiCiAgXSwKICAia3R5IjogIkVDIiwKICAieCI6ICJXYzl1WnVQYUI3S2gyRk1jOXd0SmpSZThYRDR5VDJBWU5BQWtyWWJWanV3IiwKICAieSI6ICI2OGhSVEppSk5Pd3RyaDRFb1BYZVZuUnVIN2hpU0RKX2xtYmJqZkRmV3EwIiwKICAiYWxnIjogIkVTMjU2IiwKICAidXNlIjogInNpZyIsCiAgImtpZCI6ICJhYzFlOGY5MGVkZGY2MWM0MjljNjFjYTA1YjRmMmUwNyIKfV19" } } - Forwarding = { - HeaderName = "test-token" - } }) } `