Skip to content
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.

Commit

Permalink
Merge pull request #285 from iwarapter/issue263
Browse files Browse the repository at this point in the history
workaround for #263 #266
  • Loading branch information
iwarapter authored Apr 25, 2023
2 parents 142edd8 + 148dbc3 commit c167b35
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
7 changes: 7 additions & 0 deletions internal/framework/pingfederate_oauth_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package framework
import (
"context"
"fmt"
"math/big"

"github.com/hashicorp/terraform-plugin-framework/attr"

Expand Down Expand Up @@ -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
}

Expand Down
6 changes: 4 additions & 2 deletions internal/framework/pingfederate_oauth_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package framework
import (
"context"
"fmt"
"math/big"
"testing"

"github.com/hashicorp/terraform-plugin-framework/attr"
Expand Down Expand Up @@ -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))
})
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand All @@ -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"
Expand Down

0 comments on commit c167b35

Please sign in to comment.