Skip to content

Commit

Permalink
PDI-1813: Export block HCL generation for PingFederate (#136)
Browse files Browse the repository at this point in the history
* Update current pingfederate resource terraform plan tests to remove/modify plan error messages.

* Update go packages

* Rename PF resource to 'pingfederate_local_identity_profile'

* Rename PF resource to 'pingfederate_notification_publisher_settings'

* Add PF resource export 'pingfederate_oauth_server_settings'

* Add PF resource export 'pingfederate_openid_connect_policy'

* Rename PF resource export to 'pingfederate_openid_connect_settings'

* Add PF resource export 'pingfederate_pingone_connection'

* Add PF resource export 'pingfederate_server_settings_general'

* Add PF resource export 'pingfederate_session_authentication_policies_global'

* Add PF resource export 'pingfederate_session_application_policy'
  • Loading branch information
erikostien-pingidentity authored Sep 24, 2024
1 parent 1cc16e9 commit ea99a82
Show file tree
Hide file tree
Showing 23 changed files with 695 additions and 84 deletions.
20 changes: 11 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
module github.com/pingidentity/pingctl

go 1.21.6
go 1.22.0

toolchain go1.23.1

require (
github.com/fatih/color v1.17.0
Expand All @@ -12,7 +14,7 @@ require (
github.com/patrickcping/pingone-go-sdk-v2/mfa v0.20.0
github.com/patrickcping/pingone-go-sdk-v2/risk v0.16.0
github.com/pavius/impi v0.0.3
github.com/pingidentity/pingfederate-go-client/v1210 v1210.0.2
github.com/pingidentity/pingfederate-go-client/v1210 v1210.0.3
github.com/rs/zerolog v1.33.0
github.com/spf13/cobra v1.8.1
github.com/spf13/pflag v1.0.5
Expand Down Expand Up @@ -133,7 +135,7 @@ require (
github.com/patrickcping/pingone-go-sdk-v2/authorize v0.6.0 // indirect
github.com/patrickcping/pingone-go-sdk-v2/credentials v0.9.0 // indirect
github.com/patrickcping/pingone-go-sdk-v2/verify v0.7.0 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/polyfloyd/go-errorlint v1.4.5 // indirect
github.com/prometheus/client_golang v1.12.1 // indirect
Expand Down Expand Up @@ -187,14 +189,14 @@ require (
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.24.0 // indirect
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect
golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833 // indirect
golang.org/x/mod v0.20.0 // indirect
golang.org/x/oauth2 v0.22.0 // indirect
golang.org/x/mod v0.21.0 // indirect
golang.org/x/oauth2 v0.23.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/tools v0.24.0 // indirect
golang.org/x/sys v0.25.0 // indirect
golang.org/x/text v0.18.0 // indirect
golang.org/x/tools v0.25.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
36 changes: 18 additions & 18 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,10 @@ github.com/patrickcping/pingone-go-sdk-v2/verify v0.7.0 h1:m6aLDyttXySQaUTNMubJM
github.com/patrickcping/pingone-go-sdk-v2/verify v0.7.0/go.mod h1:CYnq6n5E8YDg3FYieSfldjjT/2EyMyYCgdoNAiqNZFc=
github.com/pavius/impi v0.0.3 h1:DND6MzU+BLABhOZXbELR3FU8b+zDgcq4dOCNLhiTYuI=
github.com/pavius/impi v0.0.3/go.mod h1:x/hU0bfdWIhuOT1SKwiJg++yvkk6EuOtJk8WtDZqgr8=
github.com/pelletier/go-toml/v2 v2.2.2 h1:aYUidT7k73Pcl9nb2gScu7NSrKCSHIDE89b3+6Wq+LM=
github.com/pelletier/go-toml/v2 v2.2.2/go.mod h1:1t835xjRzz80PqgE6HHgN2JOsmgYu/h4qDAS4n929Rs=
github.com/pingidentity/pingfederate-go-client/v1210 v1210.0.2 h1:fF2XfQvN8Ef+R6W4C/Tr44MfYuzBUKAp31QT39dKnl4=
github.com/pingidentity/pingfederate-go-client/v1210 v1210.0.2/go.mod h1:6FV76bV3LF98Rn1Q62RRxcPk1XqRzRNcI6PeFe9MNbk=
github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNHvL12M=
github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc=
github.com/pingidentity/pingfederate-go-client/v1210 v1210.0.3 h1:KY6GmIfOJB5Nc3fX/f66fsWnPt1Fc0+QqQIbvAsyYkM=
github.com/pingidentity/pingfederate-go-client/v1210 v1210.0.3/go.mod h1:6FV76bV3LF98Rn1Q62RRxcPk1XqRzRNcI6PeFe9MNbk=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
Expand Down Expand Up @@ -634,8 +634,8 @@ golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u0
golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4=
golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM=
golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU=
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa h1:ELnwvuAXPNtPk1TJRuGkI9fDTwym6AYBu0qzT8AcHdI=
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa/go.mod h1:akd2r19cwCdwSwWeIdzYQGa/EZZyqcOdwWiwj5L5eKQ=
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 h1:e66Fs6Z+fZTbFBAxKfP3PALWBtpfqks2bwGcexMxgtk=
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0/go.mod h1:2TbTHSBQa924w8M6Xs1QcRcFwyucIwBGpK1p2f1YFFY=
golang.org/x/exp/typeparams v0.0.0-20220428152302-39d4317da171/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk=
golang.org/x/exp/typeparams v0.0.0-20230203172020-98cc5a0785f9/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk=
golang.org/x/exp/typeparams v0.0.0-20230307190834-24139beb5833 h1:jWGQJV4niP+CCmFW9ekjA9Zx8vYORzOUH2/Nl5WPuLQ=
Expand Down Expand Up @@ -668,8 +668,8 @@ golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91
golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI=
golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.20.0 h1:utOm6MM3R3dnawAiJgn0y+xvuYRsm1RKM/4giyfDgV0=
golang.org/x/mod v0.20.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0=
golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY=
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
Expand Down Expand Up @@ -708,16 +708,16 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
golang.org/x/net v0.5.0/go.mod h1:DivGGAXEgPSlEBzxGzZI+ZLohi+xUj054jfeKui00ws=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo=
golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
golang.org/x/oauth2 v0.22.0 h1:BzDx2FehcG7jJwgWLELCdmLuxk2i+x9UDpSiss2u0ZA=
golang.org/x/oauth2 v0.22.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs=
golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand Down Expand Up @@ -789,8 +789,8 @@ golang.org/x/sys v0.4.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
Expand All @@ -807,8 +807,8 @@ golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.6.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
Expand Down Expand Up @@ -874,8 +874,8 @@ golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA=
golang.org/x/tools v0.3.0/go.mod h1:/rWhSS2+zyEVwoJf8YAX6L2f0ntZ7Kn/mGgAWcipA5k=
golang.org/x/tools v0.5.0/go.mod h1:N+Kgy78s5I24c24dU8OfWNEotWjutIs8SnJvn5IDq+k=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.24.0 h1:J1shsA93PJUEVaUSaay7UXAyE8aimq3GW0pjlolpa24=
golang.org/x/tools v0.24.0/go.mod h1:YhNqVBIfWHdzvTLs0d8LCuMhkKUgSUKldakyV7W/WDQ=
golang.org/x/tools v0.25.0 h1:oFU9pkj/iJgs+0DT+VMHrx+oBKs/LJMV+Uvg78sl+fE=
golang.org/x/tools v0.25.0/go.mod h1:/vtpO8WL1N9cQC3FN5zPqb//fRXskFHbLKk4OW1Q7rg=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
10 changes: 8 additions & 2 deletions internal/connector/pingfederate/pingfederate_connector.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,24 @@ func (c *PingfederateConnector) Export(format, outputDir string, overwriteExport
resources.IDPSPConnection(&c.clientInfo),
resources.IncomingProxySettings(&c.clientInfo),
resources.KerberosRealm(&c.clientInfo),
resources.LocalIdentityIdentityProfile(&c.clientInfo),
resources.NotificationPublishersSettings(&c.clientInfo),
resources.LocalIdentityProfile(&c.clientInfo),
resources.NotificationPublisherSettings(&c.clientInfo),
resources.OAuthAccessTokenManager(&c.clientInfo),
resources.OAuthAccessTokenMapping(&c.clientInfo),
resources.OAuthCIBAServerPolicySettings(&c.clientInfo),
resources.OAuthClient(&c.clientInfo),
resources.OAuthIssuer(&c.clientInfo),
resources.OAuthServerSettings(&c.clientInfo),
resources.OpenIDConnectPolicy(&c.clientInfo),
resources.OpenIDConnectSettings(&c.clientInfo),
resources.PasswordCredentialValidator(&c.clientInfo),
resources.PingoneConnection(&c.clientInfo),
resources.RedirectValidation(&c.clientInfo),
resources.ServerSettings(&c.clientInfo),
resources.ServerSettingsGeneral(&c.clientInfo),
resources.ServerSettingsSystemKeys(&c.clientInfo),
resources.SessionApplicationPolicy(&c.clientInfo),
resources.SessionAuthenticationPoliciesGlobal(&c.clientInfo),
resources.SessionSettings(&c.clientInfo),
resources.SPAuthenticationPolicyContractMapping(&c.clientInfo),
resources.VirtualHostNames(&c.clientInfo),
Expand Down
72 changes: 48 additions & 24 deletions internal/connector/pingfederate/pingfederate_connector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ func TestPingFederateTerraformPlan(t *testing.T) {
ignoredErrors []string
}{
{
name: "PingFederateAuthenticationApiApplication",
resource: resources.AuthenticationApiApplication(PingFederateClientInfo),
ignoredErrors: []string{
"Error: Invalid Attribute Value", // TODO - Remove with PDI-1925 fix
},
name: "PingFederateAuthenticationApiApplication",
resource: resources.AuthenticationApiApplication(PingFederateClientInfo),
ignoredErrors: nil,
},
{
name: "PingFederateAuthenticationApiSettings",
Expand Down Expand Up @@ -69,7 +67,7 @@ func TestPingFederateTerraformPlan(t *testing.T) {
name: "PingFederateDataStore",
resource: resources.DataStore(PingFederateClientInfo),
ignoredErrors: []string{
"Error: 'password' and 'user_dn' must be set together",
"Error: Invalid attribute configuration",
},
},
{
Expand Down Expand Up @@ -104,17 +102,17 @@ func TestPingFederateTerraformPlan(t *testing.T) {
name: "PingFederateKerberosRealm",
resource: resources.KerberosRealm(PingFederateClientInfo),
ignoredErrors: []string{
"Error: Property Required:",
"Error: Invalid attribute configuration",
},
},
{
name: "PingFederateLocalIdentityIdentityProfile",
resource: resources.LocalIdentityIdentityProfile(PingFederateClientInfo),
name: "PingFederateLocalIdentityProfile",
resource: resources.LocalIdentityProfile(PingFederateClientInfo),
ignoredErrors: nil,
},
{
name: "PingFederateNotificationPublishersSettings",
resource: resources.NotificationPublishersSettings(PingFederateClientInfo),
resource: resources.NotificationPublisherSettings(PingFederateClientInfo),
ignoredErrors: nil,
},
{
Expand All @@ -126,7 +124,7 @@ func TestPingFederateTerraformPlan(t *testing.T) {
name: "PingFederateOAuthAccessTokenMapping",
resource: resources.OAuthAccessTokenMapping(PingFederateClientInfo),
ignoredErrors: []string{
"Error: Invalid attribute combination",
"Error: Invalid attribute configuration",
"Error: Invalid Attribute Value Length",
},
},
Expand All @@ -139,9 +137,7 @@ func TestPingFederateTerraformPlan(t *testing.T) {
name: "PingFederateOAuthClient",
resource: resources.OAuthClient(PingFederateClientInfo),
ignoredErrors: []string{
"Error: persistent_grant_expiration_type must be configured to \"OVERRIDE_SERVER_DEFAULT\" to modify the other persistent_grant_expiration values.",
"Error: client_auth.secret cannot be empty when \"CLIENT_CREDENTIALS\" is included in grant_types.",
"Error: Invalid Attribute Value",
"Error: Invalid attribute configuration",
},
},
{
Expand All @@ -150,19 +146,32 @@ func TestPingFederateTerraformPlan(t *testing.T) {
ignoredErrors: nil,
},
{
name: "PingFederateOpenIDConnectSettings",
resource: resources.OpenIDConnectSettings(PingFederateClientInfo),
name: "PingFederateOAuthServerSettings",
resource: resources.OAuthServerSettings(PingFederateClientInfo),
ignoredErrors: nil,
},
{
name: "PingFederateOpenIDConnectPolicy",
resource: resources.OpenIDConnectPolicy(PingFederateClientInfo),
ignoredErrors: nil,
},
{
name: "PingFederateOpenIDConnectSettings",
resource: resources.OpenIDConnectSettings(PingFederateClientInfo),
ignoredErrors: nil,
},
{
name: "PingFederatePasswordCredentialValidator",
resource: resources.PasswordCredentialValidator(PingFederateClientInfo),
ignoredErrors: []string{
"Error: Missing Configuration for Required Attribute",
},
},
{
name: "PingFederatePasswordCredentialValidator",
resource: resources.PasswordCredentialValidator(PingFederateClientInfo),
name: "PingFederatePingoneConnection",
resource: resources.PingoneConnection(PingFederateClientInfo),
ignoredErrors: []string{
"Error: The \"LDAP Datastore\" field is required for the LDAP Username Password Credential Validator",
"Error: The \"Search Base\" field is required for the LDAP Username Password Credential Validator",
"Error: The \"Search Filter\" field is required for the LDAP Username Password Credential Validator",
"Error: Missing Configuration for Required Attribute",
},
},
{
Expand All @@ -178,10 +187,25 @@ func TestPingFederateTerraformPlan(t *testing.T) {
},
},
{
name: "PingFederateServerSettingsSystemKeys",
resource: resources.ServerSettingsSystemKeys(PingFederateClientInfo),
name: "PingFederateServerSettingsGeneral",
resource: resources.ServerSettingsGeneral(PingFederateClientInfo),
ignoredErrors: nil,
},
{
name: "PingFederateServerSettingsSystemKeys",
resource: resources.ServerSettingsSystemKeys(PingFederateClientInfo),
ignoredErrors: nil,
},
{
name: "PingFederateSessionApplicationPolicy",
resource: resources.SessionApplicationPolicy(PingFederateClientInfo),
ignoredErrors: nil,
},
{
name: "PingFederateSessionAuthenticationPoliciesGlobal",
resource: resources.SessionAuthenticationPoliciesGlobal(PingFederateClientInfo),
ignoredErrors: []string{
"Error: Invalid Attribute Combination",
"Error: Invalid attribute configuration",
},
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,21 @@ import (

// Verify that the resource satisfies the exportable resource interface
var (
_ connector.ExportableResource = &PingFederateLocalIdentityIdentityProfileResource{}
_ connector.ExportableResource = &PingFederateLocalIdentityProfileResource{}
)

type PingFederateLocalIdentityIdentityProfileResource struct {
type PingFederateLocalIdentityProfileResource struct {
clientInfo *connector.PingFederateClientInfo
}

// Utility method for creating a PingFederateLocalIdentityIdentityProfileResource
func LocalIdentityIdentityProfile(clientInfo *connector.PingFederateClientInfo) *PingFederateLocalIdentityIdentityProfileResource {
return &PingFederateLocalIdentityIdentityProfileResource{
// Utility method for creating a PingFederateLocalIdentityProfileResource
func LocalIdentityProfile(clientInfo *connector.PingFederateClientInfo) *PingFederateLocalIdentityProfileResource {
return &PingFederateLocalIdentityProfileResource{
clientInfo: clientInfo,
}
}

func (r *PingFederateLocalIdentityIdentityProfileResource) ExportAll() (*[]connector.ImportBlock, error) {
func (r *PingFederateLocalIdentityProfileResource) ExportAll() (*[]connector.ImportBlock, error) {
l := logger.Get()

l.Debug().Msgf("Fetching all %s resources...", r.ResourceType())
Expand Down Expand Up @@ -62,9 +62,9 @@ func (r *PingFederateLocalIdentityIdentityProfileResource) ExportAll() (*[]conne

if localIdentityProfileIdOk && localIdentityProfileNameOk {
commentData := map[string]string{
"Resource Type": r.ResourceType(),
"Local Identity Identity Profile Resource ID": *localIdentityProfileId,
"Local Identity Identity Profile Resource Name": *localIdentityProfileName,
"Resource Type": r.ResourceType(),
"Local Identity Profile Resource ID": *localIdentityProfileId,
"Local Identity Profile Resource Name": *localIdentityProfileName,
}

importBlocks = append(importBlocks, connector.ImportBlock{
Expand All @@ -79,6 +79,6 @@ func (r *PingFederateLocalIdentityIdentityProfileResource) ExportAll() (*[]conne
return &importBlocks, nil
}

func (r *PingFederateLocalIdentityIdentityProfileResource) ResourceType() string {
return "pingfederate_local_identity_identity_profile"
func (r *PingFederateLocalIdentityProfileResource) ResourceType() string {
return "pingfederate_local_identity_profile"
}
Loading

0 comments on commit ea99a82

Please sign in to comment.