Skip to content

Commit

Permalink
specs update
Browse files Browse the repository at this point in the history
  • Loading branch information
roncodingenthusiast committed Jul 13, 2023
1 parent b915a26 commit 68963c9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
13 changes: 7 additions & 6 deletions consul/resource_consul_config_entry_ce_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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\"}}}"),
),
},
},
Expand Down Expand Up @@ -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"
}
})
}
`
13 changes: 7 additions & 6 deletions consul/resource_consul_config_entry_ee_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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\"}}}"),
),
},
},
Expand Down Expand Up @@ -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"
}
})
}
`

0 comments on commit 68963c9

Please sign in to comment.