diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 4a4799c9..e196b282 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - pingfederate-version: [ 10.2.7, 10.3.7, 11.0.4, 11.1.1 ] + pingfederate-version: [ 10.2.7, 10.3.7, 11.0.4, 11.1.1, 11.2.0 ] services: ldap: image: osixia/openldap:1.5.0 diff --git a/docker-compose.yml b/docker-compose.yml index 6e3b2128..b271b378 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,7 +8,7 @@ services: - pfnet pingfederate: - image: pingidentity/pingfederate:11.1.1-edge + image: pingidentity/pingfederate:11.2.0-edge depends_on: - ldap environment: diff --git a/internal/framework/pingfederate_oauth_client.go b/internal/framework/pingfederate_oauth_client.go index 6c5c4a38..a282fad6 100644 --- a/internal/framework/pingfederate_oauth_client.go +++ b/internal/framework/pingfederate_oauth_client.go @@ -3,6 +3,7 @@ package framework import ( "context" "fmt" + "math/big" "github.com/hashicorp/terraform-plugin-framework/attr" @@ -372,6 +373,12 @@ func (r *pingfederateOAuthClientResource) versionResponseModifier(data *ClientDa data.RequireJwtSecuredAuthorizationResponseMode = types.BoolValue(false) } + // depending on the backing store for oauth clients, the following fields may be null + // if they are null, we need to set them to 0 so that the state is happy + if data.PersistentGrantExpirationTime.IsNull() { + data.PersistentGrantExpirationTime = types.NumberValue(big.NewFloat(0)) + } + return data } diff --git a/internal/framework/pingfederate_oauth_client_test.go b/internal/framework/pingfederate_oauth_client_test.go index bf72deef..2af31e53 100644 --- a/internal/framework/pingfederate_oauth_client_test.go +++ b/internal/framework/pingfederate_oauth_client_test.go @@ -3,6 +3,7 @@ package framework import ( "context" "fmt" + "math/big" "testing" "github.com/hashicorp/terraform-plugin-framework/attr" @@ -776,8 +777,9 @@ func Test_resourcePingFederateOAuthClientResourceVersionModifications(t *testing before := defaults res.versionRequestModifier(&before) assert.Equal(t, tt.after, before) - - assert.Equal(t, defaults, *res.versionResponseModifier(&before)) + defaultsCopy := defaults + defaultsCopy.PersistentGrantExpirationTime = types.NumberValue(big.NewFloat(0)) + assert.Equal(t, defaultsCopy, *res.versionResponseModifier(&before)) }) } } diff --git a/internal/sdkv2provider/resource_pingfederate_notification_publisher_test.go b/internal/sdkv2provider/resource_pingfederate_notification_publisher_test.go index feba7ec2..e411e6fa 100644 --- a/internal/sdkv2provider/resource_pingfederate_notification_publisher_test.go +++ b/internal/sdkv2provider/resource_pingfederate_notification_publisher_test.go @@ -82,6 +82,7 @@ data "pingfederate_version" "instance" {} locals { isSupported = length(regexall("(10|11).[0-9]", data.pingfederate_version.instance.version)) > 0 + isPF11_2 = length(regexall("(11).[2-9]", data.pingfederate_version.instance.version)) > 0 } resource "pingfederate_notification_publisher" "demo" { @@ -98,6 +99,13 @@ resource "pingfederate_notification_publisher" "demo" { name = "UTF-8 Message Header Support" value = "false" } + } + dynamic "fields" { + for_each = local.isPF11_2 ? [1] : [] + content { + name = "Sender Name" + value = "false" + } } fields { name = "From Address"