diff --git a/Makefile b/Makefile index e3cb2c6c..126f6e67 100644 --- a/Makefile +++ b/Makefile @@ -33,8 +33,8 @@ starttestcontainer: -p 9999:9999 \ --env-file "${HOME}/.pingidentity/config" \ -v $$(pwd)/server-profiles/shared-profile:/opt/in \ - -v $$(pwd)/server-profiles/12.1/data.json:/opt/in/instance/bulk-config/data.json \ - pingidentity/pingfederate:latest + -v $$(pwd)/server-profiles/12.2/data.json:/opt/in/instance/bulk-config/data.json \ + pingidentity/pingfederate:12.2.0-latest # Wait for the instance to become ready sleep 1 duration=0 diff --git a/cmd/platform/export_test.go b/cmd/platform/export_test.go index ce4892c2..523d9b88 100644 --- a/cmd/platform/export_test.go +++ b/cmd/platform/export_test.go @@ -197,11 +197,28 @@ func TestPlatformExportCmd_PingFederateBasicAuthFlagsRequiredTogether(t *testing testutils.CheckExpectedError(t, err, &expectedErrorPattern) } +// Test Platform Export Command fails when provided invalid PingOne Client Credential flags +func TestPlatformExportCmd_PingOneClientCredentialFlagsInvalid(t *testing.T) { + outputDir := t.TempDir() + + expectedErrorPattern := `^failed to initialize pingone API client\. Check worker client ID, worker client secret, worker environment ID, and pingone region code configuration values\. oauth2: \"invalid_client\" \"Request denied: Unsupported authentication method \(Correlation ID: .*\)\"$` + err := testutils_cobra.ExecutePingcli(t, "platform", "export", + "--output-directory", outputDir, + "--overwrite", + "--services", "pingone-protect", + "--pingone-worker-environment-id", os.Getenv(options.PingOneAuthenticationWorkerEnvironmentIDOption.EnvVar), + "--pingone-worker-client-id", os.Getenv(options.PingOneAuthenticationWorkerClientIDOption.EnvVar), + "--pingone-worker-client-secret", "invalid", + "--pingone-region-code", os.Getenv(options.PingOneRegionCodeOption.EnvVar), + ) + testutils.CheckExpectedError(t, err, &expectedErrorPattern) +} + // Test Platform Export Command fails when provided invalid PingFederate Basic Auth flags func TestPlatformExportCmd_PingFederateBasicAuthFlagsInvalid(t *testing.T) { outputDir := t.TempDir() - expectedErrorPattern := `^failed to export 'pingfederate' service: failed to export resource .*\. err: .* Request for resource '.*' was not successful\.\s+Response Code: 401 Unauthorized\s+Response Body: {{"resultId":"invalid_credentials","message":"The credentials you provided were not recognized\."}}\s+Error: 401 Unauthorized$` + expectedErrorPattern := `^failed to initialize PingFederate Go Client. Check authentication type and credentials$` err := testutils_cobra.ExecutePingcli(t, "platform", "export", "--output-directory", outputDir, "--overwrite", @@ -242,7 +259,7 @@ func TestPlatformExportCmd_PingFederateClientCredentialsAuthFlagsRequiredTogethe func TestPlatformExportCmd_PingFederateClientCredentialsAuthFlagsInvalid(t *testing.T) { outputDir := t.TempDir() - expectedErrorPattern := `^failed to export 'pingfederate' service: failed to export resource .*\. err: .* Request for resource '.*' was not successful\. Response is nil\. Error: oauth2: "invalid_client" "Invalid client or client credentials\."$` + expectedErrorPattern := `^failed to initialize PingFederate Go Client. Check authentication type and credentials$` err := testutils_cobra.ExecutePingcli(t, "platform", "export", "--output-directory", outputDir, "--overwrite", @@ -259,7 +276,7 @@ func TestPlatformExportCmd_PingFederateClientCredentialsAuthFlagsInvalid(t *test func TestPlatformExportCmd_PingFederateClientCredentialsAuthFlagsInvalidTokenURL(t *testing.T) { outputDir := t.TempDir() - expectedErrorPattern := `(?s)^failed to export 'pingfederate' service: failed to export resource.*\. err:.*Request for resource '.*' was not successful\. Response is nil\. Error: oauth2: cannot fetch token: 404 Not Found\s+Response: \\s+.*$` + expectedErrorPattern := `^failed to initialize PingFederate Go Client. Check authentication type and credentials$` err := testutils_cobra.ExecutePingcli(t, "platform", "export", "--output-directory", outputDir, "--overwrite", @@ -308,7 +325,7 @@ func TestPlatformExportCmd_PingFederateTrustAllTLSFlag(t *testing.T) { func TestPlatformExportCmd_PingFederateTrustAllTLSFlagFalse(t *testing.T) { outputDir := t.TempDir() - expectedErrorPattern := `^failed to export '.*' service: failed to export resource .*\. err: .* Request for resource '.*' was not successful\. Response is nil\. Error: Get "https.*": tls: failed to verify certificate: x509: certificate signed by unknown authority$` + expectedErrorPattern := `^failed to initialize PingFederate Go Client. Check authentication type and credentials$` err := testutils_cobra.ExecutePingcli(t, "platform", "export", "--output-directory", outputDir, "--overwrite", diff --git a/go.mod b/go.mod index 62f0754d..d76aef6d 100644 --- a/go.mod +++ b/go.mod @@ -13,6 +13,7 @@ require ( github.com/manifoldco/promptui v0.9.0 github.com/patrickcping/pingone-go-sdk-v2 v0.12.9 github.com/patrickcping/pingone-go-sdk-v2/management v0.49.0 + github.com/patrickcping/pingone-go-sdk-v2/mfa v0.23.0 github.com/patrickcping/pingone-go-sdk-v2/risk v0.19.0 github.com/pingidentity/pingfederate-go-client/v1210 v1210.0.5 github.com/rs/zerolog v1.33.0 @@ -34,7 +35,7 @@ require ( github.com/Crocmagnon/fatcontext v0.7.1 // indirect github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 // indirect github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0 // indirect - github.com/Masterminds/semver/v3 v3.3.1 // indirect + github.com/Masterminds/semver/v3 v3.3.0 // indirect github.com/OpenPeeDeeP/depguard/v2 v2.2.0 // indirect github.com/alecthomas/go-check-sumtype v0.3.1 // indirect github.com/alexkohler/nakedret/v2 v2.0.5 // indirect @@ -56,7 +57,7 @@ require ( github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/charithe/durationcheck v0.0.10 // indirect github.com/chavacava/garif v0.1.0 // indirect - github.com/chzyer/readline v1.5.1 // indirect + github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e // indirect github.com/ckaznocha/intrange v0.3.0 // indirect github.com/curioswitch/go-reassign v0.3.0 // indirect github.com/daixiang0/gci v0.13.5 // indirect @@ -65,7 +66,7 @@ require ( github.com/ettle/strcase v0.2.0 // indirect github.com/fatih/structtag v1.2.0 // indirect github.com/firefart/nonamedreturns v1.0.5 // indirect - github.com/fsnotify/fsnotify v1.8.0 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/fzipp/gocyclo v0.6.0 // indirect github.com/ghostiam/protogetter v0.3.9 // indirect github.com/go-critic/go-critic v0.12.0 // indirect @@ -80,6 +81,7 @@ require ( github.com/go-xmlfmt/xmlfmt v1.1.3 // indirect github.com/gobwas/glob v0.2.3 // indirect github.com/gofrs/flock v0.12.1 // indirect + github.com/golang/protobuf v1.5.3 // indirect github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a // indirect github.com/golangci/go-printf-func-name v0.1.0 // indirect github.com/golangci/gofmt v0.0.0-20250106114630-d62b90e6713d // indirect @@ -91,7 +93,7 @@ require ( github.com/google/go-cmp v0.6.0 // indirect github.com/gordonklaus/ineffassign v0.1.0 // indirect github.com/gostaticanalysis/analysisutil v0.7.1 // indirect - github.com/gostaticanalysis/comment v1.5.0 // indirect + github.com/gostaticanalysis/comment v1.4.2 // indirect github.com/gostaticanalysis/forcetypeassert v0.2.0 // indirect github.com/gostaticanalysis/nilerr v0.1.1 // indirect github.com/hashicorp/go-immutable-radix/v2 v2.1.0 // indirect @@ -118,18 +120,18 @@ require ( github.com/ldez/usetesting v0.4.2 // indirect github.com/leonklingele/grouper v1.1.2 // indirect github.com/macabu/inamedparam v0.1.3 // indirect - github.com/magiconair/properties v1.8.9 // indirect + github.com/magiconair/properties v1.8.7 // indirect github.com/maratori/testableexamples v1.0.0 // indirect github.com/maratori/testpackage v1.1.1 // indirect github.com/matoous/godox v1.1.0 // indirect github.com/mattn/go-colorable v0.1.14 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mattn/go-runewidth v0.0.16 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect github.com/mgechev/revive v1.6.1 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/mapstructure v1.5.0 // indirect github.com/moricho/tparallel v0.3.2 // indirect - github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/nakabonne/nestif v0.3.1 // indirect github.com/nishanths/exhaustive v0.12.0 // indirect github.com/nishanths/predeclared v0.2.2 // indirect @@ -137,16 +139,15 @@ require ( github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/patrickcping/pingone-go-sdk-v2/authorize v0.8.0 // indirect github.com/patrickcping/pingone-go-sdk-v2/credentials v0.11.0 // indirect - github.com/patrickcping/pingone-go-sdk-v2/mfa v0.23.0 // indirect github.com/patrickcping/pingone-go-sdk-v2/verify v0.9.0 // indirect github.com/pavius/impi v0.0.3 // 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.7.1 // indirect - github.com/prometheus/client_golang v1.20.5 // indirect - github.com/prometheus/client_model v0.6.1 // indirect - github.com/prometheus/common v0.61.0 // indirect - github.com/prometheus/procfs v0.15.1 // indirect + github.com/prometheus/client_golang v1.12.1 // indirect + github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/common v0.32.1 // indirect + github.com/prometheus/procfs v0.7.3 // indirect github.com/quasilyte/go-ruleguard v0.4.3-0.20240823090925-0fe6f58b47b1 // indirect github.com/quasilyte/go-ruleguard/dsl v0.3.22 // indirect github.com/quasilyte/gogrep v0.5.0 // indirect @@ -154,10 +155,10 @@ require ( github.com/quasilyte/stdinfo v0.0.0-20220114132959-f7386bf02567 // indirect github.com/raeperd/recvcheck v0.2.0 // indirect github.com/rivo/uniseg v0.4.7 // indirect - github.com/rogpeppe/go-internal v1.13.2-0.20241226121412-a5dc8ff20d0a // indirect + github.com/rogpeppe/go-internal v1.13.1 // indirect github.com/ryancurrah/gomodguard v1.3.5 // indirect github.com/ryanrolds/sqlclosecheck v0.5.1 // indirect - github.com/sagikazarmark/locafero v0.6.0 // indirect + github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect github.com/sanposhiho/wastedassign/v2 v2.1.0 // indirect github.com/santhosh-tekuri/jsonschema/v6 v6.0.1 // indirect @@ -171,7 +172,7 @@ require ( github.com/sourcegraph/conc v0.3.0 // indirect github.com/sourcegraph/go-diff v0.7.0 // indirect github.com/spf13/afero v1.12.0 // indirect - github.com/spf13/cast v1.7.1 // indirect + github.com/spf13/cast v1.6.0 // indirect github.com/ssgreg/nlreturn/v2 v2.2.1 // indirect github.com/stbenjam/no-sprintf-host-port v0.2.0 // indirect github.com/stretchr/objx v0.5.2 // indirect @@ -179,7 +180,7 @@ require ( github.com/subosito/gotenv v1.6.0 // indirect github.com/tdakkota/asciicheck v0.4.0 // indirect github.com/tetafro/godot v1.4.20 // indirect - github.com/timakin/bodyclose v0.0.0-20241222091800-1db5c5ca4d67 // indirect + github.com/timakin/bodyclose v0.0.0-20241017074812-ed6a65f985e3 // indirect github.com/timonwong/loggercheck v0.10.1 // indirect github.com/tomarrell/wrapcheck/v2 v2.10.0 // indirect github.com/tommy-muehle/go-mnd/v2 v2.5.1 // indirect @@ -194,10 +195,11 @@ require ( gitlab.com/bosi/decorder v0.4.2 // indirect go-simpler.org/musttag v0.13.0 // indirect go-simpler.org/sloglint v0.9.0 // indirect + go.uber.org/atomic v1.9.0 // indirect go.uber.org/automaxprocs v1.6.0 // indirect - go.uber.org/multierr v1.11.0 // indirect - go.uber.org/zap v1.27.0 // indirect - golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 // indirect + go.uber.org/multierr v1.9.0 // indirect + go.uber.org/zap v1.24.0 // indirect + golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect golang.org/x/exp/typeparams v0.0.0-20250210185358-939b2ce775ac // indirect golang.org/x/mod v0.23.0 // indirect golang.org/x/oauth2 v0.26.0 // indirect @@ -210,5 +212,5 @@ require ( gopkg.in/yaml.v2 v2.4.0 // indirect honnef.co/go/tools v0.6.0 // indirect mvdan.cc/gofumpt v0.7.0 // indirect - mvdan.cc/unparam v0.0.0-20241226123437-447d509598f3 // indirect + mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f // indirect ) diff --git a/go.sum b/go.sum index 5c452a54..24d08f5c 100644 --- a/go.sum +++ b/go.sum @@ -2,6 +2,39 @@ 4d63.com/gocheckcompilerdirectives v1.2.1/go.mod h1:yjDJSxmDTtIHHCqX0ufRYZDL6vQtMG7tJdKVeWwsqvs= 4d63.com/gochecknoglobals v0.2.2 h1:H1vdnwnMaZdQW/N+NrkT1SZMTBmcwHe9Vq8lJcYYTtU= 4d63.com/gochecknoglobals v0.2.2/go.mod h1:lLxwTQjL5eIesRbvnzIP3jZtG140FnTdz+AlMa+ogt0= +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/4meepo/tagalign v1.4.1 h1:GYTu2FaPGOGb/xJalcqHeD4il5BiCywyEYZOA55P6J4= github.com/4meepo/tagalign v1.4.1/go.mod h1:2H9Yu6sZ67hmuraFgfZkNcg5Py9Ch/Om9l2K/2W1qS4= github.com/Abirdcfly/dupword v0.1.3 h1:9Pa1NuAsZvpFPi9Pqkd93I7LIYRURj+A//dFd5tgBeE= @@ -12,16 +45,18 @@ github.com/Antonboom/nilnil v1.0.1 h1:C3Tkm0KUxgfO4Duk3PM+ztPncTFlOf0b2qadmS0s4x github.com/Antonboom/nilnil v1.0.1/go.mod h1:CH7pW2JsRNFgEh8B2UaPZTEPhCMuFowP/e8Udp9Nnb0= github.com/Antonboom/testifylint v1.5.2 h1:4s3Xhuv5AvdIgbd8wOOEeo0uZG7PbDKQyKY5lGoQazk= github.com/Antonboom/testifylint v1.5.2/go.mod h1:vxy8VJ0bc6NavlYqjZfmp6EfqXMtBgQ4+mhCojwC1P8= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c h1:pxW6RcqyfI9/kWtOwnv/G+AzdKuy2ZrqINhenH4HyNs= github.com/BurntSushi/toml v1.4.1-0.20240526193622-a339e1f7089c/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/Crocmagnon/fatcontext v0.7.1 h1:SC/VIbRRZQeQWj/TcQBS6JmrXcfA+BU4OGSVUt54PjM= github.com/Crocmagnon/fatcontext v0.7.1/go.mod h1:1wMvv3NXEBJucFGfwOJBxSVWcoIO6emV215SMkW9MFU= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24 h1:sHglBQTwgx+rWPdisA5ynNEsoARbiCBOyGcJM4/OzsM= github.com/Djarvur/go-err113 v0.0.0-20210108212216-aea10b59be24/go.mod h1:4UJr5HIiMZrwgkSPdsjy2uOQExX/WEILpIrO9UPGuXs= github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0 h1:/fTUt5vmbkAcMBt4YQiuC23cV0kEsN1MVMNqeOW43cU= github.com/GaijinEntertainment/go-exhaustruct/v3 v3.3.0/go.mod h1:ONJg5sxcbsdQQ4pOW8TGdTidT2TMAUy/2Xhr8mrYaao= -github.com/Masterminds/semver/v3 v3.3.1 h1:QtNSWtVZ3nBfk8mAOu/B6v7FMJ+NHTIgUPi7rj+4nv4= -github.com/Masterminds/semver/v3 v3.3.1/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= +github.com/Masterminds/semver/v3 v3.3.0 h1:B8LGeaivUe71a5qox1ICM/JLl0NqZSW5CHyL+hmvYS0= +github.com/Masterminds/semver/v3 v3.3.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= github.com/OpenPeeDeeP/depguard/v2 v2.2.0 h1:vDfG60vDtIuf0MEOhmLlLLSzqaRM8EMcgJPdp74zmpA= github.com/OpenPeeDeeP/depguard/v2 v2.2.0/go.mod h1:CIzddKRvLBC4Au5aYP/i3nyaWQ+ClszLIuVocRiCYFQ= github.com/alecthomas/assert/v2 v2.11.0 h1:2Q9r3ki8+JYXvGsDyBXwH3LcJ+WK5D0gc5E8vS6K3D0= @@ -30,6 +65,11 @@ github.com/alecthomas/go-check-sumtype v0.3.1 h1:u9aUvbGINJxLVXiFvHUlPEaD7VDULsr github.com/alecthomas/go-check-sumtype v0.3.1/go.mod h1:A8TSiN3UPRw3laIgWEUOHHLPa6/r9MtoigdlP5h3K/E= github.com/alecthomas/repr v0.4.0 h1:GhI2A8MACjfegCPVq9f1FLvIBS+DrQ2KQBFZP1iFzXc= github.com/alecthomas/repr v0.4.0/go.mod h1:Fr0507jx4eOXV7AlPV6AVZLYrLIuIeSOWtW57eE/O/4= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/alexkohler/nakedret/v2 v2.0.5 h1:fP5qLgtwbx9EJE8dGEERT02YwS8En4r9nnZ71RK+EVU= github.com/alexkohler/nakedret/v2 v2.0.5/go.mod h1:bF5i0zF2Wo2o4X4USt9ntUWve6JbFv02Ff4vlkmS/VU= github.com/alexkohler/prealloc v1.0.0 h1:Hbq0/3fJPQhNkN0dR95AVrr6R7tou91y0uHG5pOcUuw= @@ -42,6 +82,10 @@ github.com/ashanbrown/forbidigo v1.6.0 h1:D3aewfM37Yb3pxHujIPSpTf6oQk9sc9WZi8ger github.com/ashanbrown/forbidigo v1.6.0/go.mod h1:Y8j9jy9ZYAEHXdu723cUlraTqbzjKF1MUyfOKL+AjcU= github.com/ashanbrown/makezero v1.2.0 h1:/2Lp1bypdmK9wDIq7uWBlDF1iMUpIIS4A+pF6C9IEUU= github.com/ashanbrown/makezero v1.2.0/go.mod h1:dxlPhHbDMC6N6xICzFBSK+4njQDdK8euNO0qjQMtGY4= +github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bkielbasa/cyclop v1.2.3 h1:faIVMIGDIANuGPWH031CZJTi2ymOQBULs9H21HSMa5w= @@ -62,23 +106,25 @@ github.com/catenacyber/perfsprint v0.8.1 h1:bGOHuzHe0IkoGeY831RW4aSlt1lPRd3WRASc github.com/catenacyber/perfsprint v0.8.1/go.mod h1:/wclWYompEyjUD2FuIIDVKNkqz7IgBIWXIH3V0Zol50= github.com/ccojocar/zxcvbn-go v1.0.2 h1:na/czXU8RrhXO4EZme6eQJLR4PzcGsahsBOAwU6I3Vg= github.com/ccojocar/zxcvbn-go v1.0.2/go.mod h1:g1qkXtUSvHP8lhHp5GrSmTz6uWALGRMQdw6Qnz/hi60= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/charithe/durationcheck v0.0.10 h1:wgw73BiocdBDQPik+zcEoBG/ob8uyBHf2iyoHGPf5w4= github.com/charithe/durationcheck v0.0.10/go.mod h1:bCWXb7gYRysD1CU3C+u4ceO49LoGOY1C1L6uouGNreQ= github.com/chavacava/garif v0.1.0 h1:2JHa3hbYf5D9dsgseMKAmc/MZ109otzgNFk5s87H9Pc= github.com/chavacava/garif v0.1.0/go.mod h1:XMyYCkEL58DF0oyW4qDjjnPWONs2HBqYKI+UIPD+Gww= +github.com/chzyer/logex v1.1.10 h1:Swpa1K6QvQznwJRcfTfQJmTE72DqScAa40E+fbHEXEE= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= -github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= -github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e h1:fY5BOSpyZCqRo5OhCuC+XN+r/bBCmeuuJtjz+bCNIf8= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= -github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= -github.com/chzyer/readline v1.5.1/go.mod h1:Eh+b79XXUwfKfcPLepksvw2tcLE/Ct21YObkaSkeBlk= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1 h1:q763qf9huN11kDQavWsoZXJNW3xEE4JJyHa5Q25/sd8= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= -github.com/chzyer/test v1.0.0 h1:p3BQDXSxOhOG0P9z6/hGnII4LGiEPOYBhs8asl/fC04= -github.com/chzyer/test v1.0.0/go.mod h1:2JlltgoNkt4TW/z9V/IzDdFaMTM2JPIi26O1pF38GC8= github.com/ckaznocha/intrange v0.3.0 h1:VqnxtK32pxgkhJgYQEeOArVidIPg+ahLP7WBOXZd5ZY= github.com/ckaznocha/intrange v0.3.0/go.mod h1:+I/o2d2A1FBHgGELbGxzIcyd3/9l9DuwjM8FsbSS3Lo= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g= github.com/curioswitch/go-reassign v0.3.0 h1:dh3kpQHuADL3cobV/sSGETA8DOv457dwl+fbBAhrQPs= @@ -93,6 +139,10 @@ github.com/denis-tingaikin/go-header v0.5.0 h1:SRdnP5ZKvcO9KKRP1KJrhFR3RrlGuD+42 github.com/denis-tingaikin/go-header v0.5.0/go.mod h1:mMenU5bWrok6Wl2UsZjy+1okegmwQ3UgWl4V1D8gjlY= github.com/dlclark/regexp2 v1.11.0 h1:G/nrcoOa7ZXlpoa/91N3X7mM3r8eIlMBBJZvsz/mxKI= github.com/dlclark/regexp2 v1.11.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/ettle/strcase v0.2.0 h1:fGNiVF21fHXpX1niBgk0aROov1LagYsOwV/xqKDKR/Q= github.com/ettle/strcase v0.2.0/go.mod h1:DajmHElDSaX76ITe3/VHVyMin4LWSJN5Z909Wp+ED1A= github.com/fatih/color v1.18.0 h1:S8gINlzdQ840/4pfAwic/ZE0djQEH3wM94VfqLTZcOM= @@ -103,18 +153,28 @@ github.com/firefart/nonamedreturns v1.0.5 h1:tM+Me2ZaXs8tfdDw3X6DOX++wMCOqzYUho6 github.com/firefart/nonamedreturns v1.0.5/go.mod h1:gHJjDqhGM4WyPt639SOZs+G89Ko7QKH5R5BhnO6xJhw= github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8= github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= -github.com/fsnotify/fsnotify v1.8.0 h1:dAwr6QBTBZIkG8roQaJjGof0pp0EeF+tNV7YBP3F/8M= -github.com/fsnotify/fsnotify v1.8.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0= +github.com/fsnotify/fsnotify v1.7.0 h1:8JEhPFa5W2WU7YfeZzPNqzMP6Lwt7L2715Ggo0nosvA= +github.com/fsnotify/fsnotify v1.7.0/go.mod h1:40Bi/Hjc2AVfZrqy+aj+yEI+/bRxZnMJyTJwOpGvigM= github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo= github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA= github.com/ghostiam/protogetter v0.3.9 h1:j+zlLLWzqLay22Cz/aYwTHKQ88GE2DQ6GkWSYFOI4lQ= github.com/ghostiam/protogetter v0.3.9/go.mod h1:WZ0nw9pfzsgxuRsPOFQomgDVSWtDLJRfQJEhsGbmQMA= github.com/go-critic/go-critic v0.12.0 h1:iLosHZuye812wnkEz1Xu3aBwn5ocCPfc9yqmFG9pa6w= github.com/go-critic/go-critic v0.12.0/go.mod h1:DpE0P6OVc6JzVYzmM5gq5jMU31zLr4am5mB/VfFK64w= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY= github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= github.com/go-quicktest/qt v1.101.0 h1:O1K29Txy5P2OK0dGo59b7b0LR6wKfIhttaAhHUyn7eI= github.com/go-quicktest/qt v1.101.0/go.mod h1:14Bz/f7NwaXPtdYEgzsx46kqSxVwTbzVZsDC26tQJow= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI= github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8= github.com/go-toolsmith/astcast v1.1.0 h1:+JN9xZV1A+Re+95pgnMgDboWNVnIMMQXwfBwLRPgSC8= @@ -145,6 +205,36 @@ github.com/gobwas/glob v0.2.3/go.mod h1:d3Ez4x06l9bZtSvzIay5+Yzi0fmZzPgnTbPcKjJA github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/flock v0.12.1 h1:MTLVXXHf8ekldpJk3AKicLij9MdwOWkZ+a/jHHZby9E= github.com/gofrs/flock v0.12.1/go.mod h1:9zxTsyu5xtJ9DK+1tFZyibEV7y3uwDxPPfbxeeHCoD0= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a h1:w8hkcTqaFpzKqonE9uMCefW1WDie15eSP/4MssdenaM= github.com/golangci/dupl v0.0.0-20180902072040-3e9179ac440a/go.mod h1:ryS0uhF+x9jgbj/N71xsEqODy9BN81/GonCZiOzirOk= github.com/golangci/go-printf-func-name v0.1.0 h1:dVokQP+NMTO7jwO4bwsRwLWeudOVUPPyAKJuzv8pEJU= @@ -161,23 +251,44 @@ github.com/golangci/revgrep v0.8.0 h1:EZBctwbVd0aMeRnNUsFogoyayvKHyxlV3CdUA46FX2 github.com/golangci/revgrep v0.8.0/go.mod h1:U4R/s9dlXZsg8uJmaR1GrloUr14D7qDl8gi2iPXJH8k= github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed h1:IURFTjxeTfNFP0hTEi1YKjB/ub8zkpaOqFFMApi2EAs= github.com/golangci/unconvert v0.0.0-20240309020433-c5143eacb3ed/go.mod h1:XLXN8bNw4CGRPaqgl3bv/lhz7bsGPh4/xSaMTbo2vkQ= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad h1:a6HEuzUHeKH6hwfN/ZoQgRgVIWFJljSWa/zetS2WTvg= github.com/google/pprof v0.0.0-20241210010833-40e02aabc2ad/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gordonklaus/ineffassign v0.1.0 h1:y2Gd/9I7MdY1oEIt+n+rowjBNDcLQq3RsH5hwJd0f9s= github.com/gordonklaus/ineffassign v0.1.0/go.mod h1:Qcp2HIAYhR7mNUVSIxZww3Guk4it82ghYcEXIAk+QT0= github.com/gostaticanalysis/analysisutil v0.7.1 h1:ZMCjoue3DtDWQ5WyU16YbjbQEQ3VuzwxALrpYd+HeKk= github.com/gostaticanalysis/analysisutil v0.7.1/go.mod h1:v21E3hY37WKMGSnbsw2S/ojApNWb6C1//mXO48CXbVc= github.com/gostaticanalysis/comment v1.4.1/go.mod h1:ih6ZxzTHLdadaiSnF5WY3dxUoXfXAlTaRzuaNDlSado= +github.com/gostaticanalysis/comment v1.4.2 h1:hlnx5+S2fY9Zo9ePo4AhgYsYHbM2+eAv8m/s1JiCd6Q= github.com/gostaticanalysis/comment v1.4.2/go.mod h1:KLUTGDv6HOCotCH8h2erHKmpci2ZoR8VPu34YA2uzdM= -github.com/gostaticanalysis/comment v1.5.0 h1:X82FLl+TswsUMpMh17srGRuKaaXprTaytmEpgnKIDu8= -github.com/gostaticanalysis/comment v1.5.0/go.mod h1:V6eb3gpCv9GNVqb6amXzEUX3jXLVK/AdA+IrAMSqvEc= github.com/gostaticanalysis/forcetypeassert v0.2.0 h1:uSnWrrUEYDr86OCxWa4/Tp2jeYDlogZiZHzGkWFefTk= github.com/gostaticanalysis/forcetypeassert v0.2.0/go.mod h1:M5iPavzE9pPqWyeiVXSFghQjljW1+l/Uke3PXHS6ILY= github.com/gostaticanalysis/nilerr v0.1.1 h1:ThE+hJP0fEp4zWLkWHWcRyI2Od0p7DlgYG3Uqrmrcpk= @@ -192,12 +303,15 @@ github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/b github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKeRZfjY= github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jgautheron/goconst v1.7.1 h1:VpdAG7Ca7yvvJk5n8dMwQhfEZJh95kl/Hl9S1OI5Jkk= @@ -206,6 +320,15 @@ github.com/jingyugao/rowserrcheck v1.1.1 h1:zibz55j/MJtLsjP1OF4bSdgXxwL1b+Vn7Tjz github.com/jingyugao/rowserrcheck v1.1.1/go.mod h1:4yvlZSDb3IyDTUZJUmpZfm2Hwok+Dtp+nu2qOq+er9c= github.com/jjti/go-spancheck v0.6.4 h1:Tl7gQpYf4/TMU7AT84MN83/6PutY21Nb9fuQjFTpRRc= github.com/jjti/go-spancheck v0.6.4/go.mod h1:yAEYdKJ2lRkDA8g7X+oKUHXOWVAXSBJRv04OhF+QUjk= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/julz/importas v0.2.0 h1:y+MJN/UdL63QbFJHws9BVC5RpA2iq0kpjrFajTGivjQ= github.com/julz/importas v0.2.0/go.mod h1:pThlt589EnCYtMnmhmRYY/qn9lCf/frPOK+WMx3xiJY= github.com/karamaru-alpha/copyloopvar v1.2.1 h1:wmZaZYIjnJ0b5UoKDjUHrikcV0zuPyyxI4SVplLd2CI= @@ -216,10 +339,14 @@ github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kkHAIKE/contextcheck v1.1.5 h1:CdnJh63tcDe53vG+RebdpdXJTc9atMgGqdx8LXxiilg= github.com/kkHAIKE/contextcheck v1.1.5/go.mod h1:O930cpht4xb1YQpK+1+AgoM3mFsvxr7uyFptcnWTYUA= -github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= -github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kulti/thelper v0.6.3 h1:ElhKf+AlItIu+xGnI990no4cE2+XaSu1ULymV2Yulxs= @@ -242,8 +369,8 @@ github.com/leonklingele/grouper v1.1.2 h1:o1ARBDLOmmasUaNDesWqWCIFH3u7hoFlM84Yrj github.com/leonklingele/grouper v1.1.2/go.mod h1:6D0M/HVkhs2yRKRFZUoGjeDy7EZTfFBE9gl4kjmIGkA= github.com/macabu/inamedparam v0.1.3 h1:2tk/phHkMlEL/1GNe/Yf6kkR/hkcUdAEY3L0hjYV1Mk= github.com/macabu/inamedparam v0.1.3/go.mod h1:93FLICAIk/quk7eaPPQvbzihUdn/QkGDwIZEoLtpH6I= -github.com/magiconair/properties v1.8.9 h1:nWcCbLq1N2v/cpNsy5WvQ37Fb+YElfq20WJ/a8RkpQM= -github.com/magiconair/properties v1.8.9/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= +github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= +github.com/magiconair/properties v1.8.7/go.mod h1:Dhd985XPs7jluiymwWYZ0G4Z61jb3vdS329zhj2hYo0= github.com/manifoldco/promptui v0.9.0 h1:3V4HzJk1TtXW1MTZMP7mdlwbBpIinw3HztaIlYthEiA= github.com/manifoldco/promptui v0.9.0/go.mod h1:ka04sppxSGFAtxX0qhlYQjISsg9mR4GWtQEhdbn6Pgg= github.com/maratori/testableexamples v1.0.0 h1:dU5alXRrD8WKSjOUnmJZuzdxWOEQ57+7s93SLMxb2vI= @@ -264,16 +391,23 @@ github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m2gUSrubnMI= github.com/mattn/go-runewidth v0.0.16 h1:E5ScNMtiwvlvB5paMFdw9p4kSQzbXFikJ5SQO6TULQc= github.com/mattn/go-runewidth v0.0.16/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= +github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/mgechev/revive v1.6.1 h1:ncK0ZCMWtb8GXwVAmk+IeWF2ULIDsvRxSRfg5sTwQ2w= github.com/mgechev/revive v1.6.1/go.mod h1:/2tfHWVO8UQi/hqJsIYNEKELi+DJy/e+PQpLgTB1v88= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/moricho/tparallel v0.3.2 h1:odr8aZVFA3NZrNybggMkYO3rgPRcqjeQUlBBFVxKHTI= github.com/moricho/tparallel v0.3.2/go.mod h1:OQ+K3b4Ln3l2TZveGCywybl68glfLEwFGqvnjok8b+U= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 h1:C3w9PqII01/Oq1c1nUAm88MOHcQC9l5mIlSMApZMrHA= -github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nakabonne/nestif v0.3.1 h1:wm28nZjhQY5HyYPx+weN3Q65k6ilSBxDb8v5S81B81U= github.com/nakabonne/nestif v0.3.1/go.mod h1:9EtoZochLn5iUprVDmDjqGKPofoUEBL8U4Ngq6aY7OE= github.com/nishanths/exhaustive v0.12.0 h1:vIY9sALmw6T/yxiASewa4TQcFsVYZQQRUQJhKRf3Swg= @@ -315,6 +449,9 @@ github.com/pelletier/go-toml/v2 v2.2.3 h1:YmeHyLY8mFWbdkNWwpr+qIL2bEqT0o95WSdkNH github.com/pelletier/go-toml/v2 v2.2.3/go.mod h1:MfCQTFTvCcUyyvvwm1+G6H/jORL20Xlb6rzQu9GuUkc= github.com/pingidentity/pingfederate-go-client/v1210 v1210.0.5 h1:Hem1TdVF0CZivFKwCMLUYwL978MaeyPL2WWE3eM6qjQ= github.com/pingidentity/pingfederate-go-client/v1210 v1210.0.5/go.mod h1:UeqdbbpFTqN4llGpjQJqHWu73is6F9CZCBShEEffSa8= +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= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= @@ -323,14 +460,28 @@ github.com/polyfloyd/go-errorlint v1.7.1 h1:RyLVXIbosq1gBdk/pChWA8zWYLsq9UEw7a1L github.com/polyfloyd/go-errorlint v1.7.1/go.mod h1:aXjNb1x2TNhoLsk26iv1yl7a+zTnXPhwEMtEXukiLR8= github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= -github.com/prometheus/client_golang v1.20.5 h1:cxppBPuYhUnsO6yo/aoRol4L7q7UFfdm+bR9r+8l63Y= -github.com/prometheus/client_golang v1.20.5/go.mod h1:PIEt8X02hGcP8JWbeHyeZ53Y/jReSnHgO035n//V5WE= -github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= -github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= -github.com/prometheus/common v0.61.0 h1:3gv/GThfX0cV2lpO7gkTUwZru38mxevy90Bj8YFSRQQ= -github.com/prometheus/common v0.61.0/go.mod h1:zr29OCN/2BsJRaFwG8QOBr41D6kkchKbpeNH7pAjb/s= -github.com/prometheus/procfs v0.15.1 h1:YagwOFzUgYfKKHX6Dr+sHT7km/hxC76UB0learggepc= -github.com/prometheus/procfs v0.15.1/go.mod h1:fB45yRUv8NstnjriLhBQLuOUt+WW4BsoGhij/e3PBqk= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.12.1 h1:ZiaPsmm9uiBeaSMRznKsCDNtPCS0T3JVDGF+06gjBzk= +github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= +github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= +github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/quasilyte/go-ruleguard v0.4.3-0.20240823090925-0fe6f58b47b1 h1:+Wl/0aFp0hpuHM3H//KMft64WQ1yX9LdJY64Qm/gFCo= github.com/quasilyte/go-ruleguard v0.4.3-0.20240823090925-0fe6f58b47b1/go.mod h1:GJLgqsLeo4qgavUoL8JeGFNS7qcisx3awV/w9eWTmNI= github.com/quasilyte/go-ruleguard/dsl v0.3.22 h1:wd8zkOhSNr+I+8Qeciml08ivDt1pSXe60+5DqOpCjPE= @@ -346,8 +497,9 @@ github.com/raeperd/recvcheck v0.2.0/go.mod h1:n04eYkwIR0JbgD73wT8wL4JjPC3wm0nFtz github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ= github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88= -github.com/rogpeppe/go-internal v1.13.2-0.20241226121412-a5dc8ff20d0a h1:w3tdWGKbLGBPtR/8/oO74W6hmz0qE5q0z9aqSAewaaM= -github.com/rogpeppe/go-internal v1.13.2-0.20241226121412-a5dc8ff20d0a/go.mod h1:S8kfXMp+yh77OxPD4fdM6YUknrZpQxLhvxzS4gDHENY= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.13.1 h1:KvO1DLK/DRN07sQ1LQKScxyZJuNnedQ5/wKSR38lUII= +github.com/rogpeppe/go-internal v1.13.1/go.mod h1:uMEvuHeurkdAXX61udpOXGD/AzZDWNMNyH2VO9fmH0o= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.33.0 h1:1cU2KZkvPxNyfgEmhHAz/1A9Bz+llsdYzklWFzgp0r8= github.com/rs/zerolog v1.33.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= @@ -356,8 +508,8 @@ github.com/ryancurrah/gomodguard v1.3.5 h1:cShyguSwUEeC0jS7ylOiG/idnd1TpJ1LfHGpV github.com/ryancurrah/gomodguard v1.3.5/go.mod h1:MXlEPQRxgfPQa62O8wzK3Ozbkv9Rkqr+wKjSxTdsNJE= github.com/ryanrolds/sqlclosecheck v0.5.1 h1:dibWW826u0P8jNLsLN+En7+RqWWTYrjCB9fJfSfdyCU= github.com/ryanrolds/sqlclosecheck v0.5.1/go.mod h1:2g3dUjoS6AL4huFdv6wn55WpLIDjY7ZgUR4J8HOO/XQ= -github.com/sagikazarmark/locafero v0.6.0 h1:ON7AQg37yzcRPU69mt7gwhFEBwxI6P9T4Qu3N51bwOk= -github.com/sagikazarmark/locafero v0.6.0/go.mod h1:77OmuIc6VTraTXKXIs/uvUxKGUXjE1GbemJYHqdNjX0= +github.com/sagikazarmark/locafero v0.4.0 h1:HApY1R9zGo4DBgr7dqsTH/JJxLTTsOt7u6keLGt6kNQ= +github.com/sagikazarmark/locafero v0.4.0/go.mod h1:Pe1W6UlPYUk/+wc/6KFhbORCfqzgYEpgQ3O5fPuL3H4= github.com/sagikazarmark/slog-shim v0.1.0 h1:diDBnUNK9N/354PgrxMywXnAwEr1QZcOr6gto+ugjYE= github.com/sagikazarmark/slog-shim v0.1.0/go.mod h1:SrcSrq8aKtyuqEI1uvTDTK1arOWRIczQRv+GVI1AkeQ= github.com/sanposhiho/wastedassign/v2 v2.1.0 h1:crurBF7fJKIORrV85u9UUpePDYGWnwvv3+A96WvwXT0= @@ -372,6 +524,9 @@ github.com/securego/gosec/v2 v2.22.1 h1:IcBt3TpI5Y9VN1YlwjSpM2cHu0i3Iw52QM+PQeg7 github.com/securego/gosec/v2 v2.22.1/go.mod h1:4bb95X4Jz7VSEPdVjC0hD7C/yR6kdeUBvCPOy9gDQ0g= github.com/shurcooL/go v0.0.0-20180423040247-9e1955d9fb6e/go.mod h1:TDJrrUr11Vxrven61rcy3hJMUqaf/CLWYhHNPmT14Lk= github.com/shurcooL/go-goon v0.0.0-20170922171312-37c2f522c041/go.mod h1:N5mDOmsrJOB+vfqUK+7DmDyjhSLIIBnXo9lvZJj3MWQ= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ= github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/sivchari/containedctx v1.0.3 h1:x+etemjbsh2fB5ewm5FeLNi5bUjK0V8n0RB+Wwfd0XE= @@ -386,8 +541,8 @@ github.com/sourcegraph/go-diff v0.7.0 h1:9uLlrd5T46OXs5qpp8L/MTltk0zikUGi0sNNyCp github.com/sourcegraph/go-diff v0.7.0/go.mod h1:iBszgVvyxdc8SFZ7gm69go2KDdt3ag071iBaWPF6cjs= github.com/spf13/afero v1.12.0 h1:UcOPyRBYczmFn6yvphxkn9ZEOY65cpwGKb5mL36mrqs= github.com/spf13/afero v1.12.0/go.mod h1:ZTlWwG4/ahT8W7T0WQ5uYmjI9duaLQGy3Q2OAl4sk/4= -github.com/spf13/cast v1.7.1 h1:cuNEagBQEHWN1FnbGEjCXL2szYEXqfJPbP2HNUaca9Y= -github.com/spf13/cast v1.7.1/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= +github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0= +github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo= github.com/spf13/cobra v1.9.1 h1:CXSaggrXdbHK9CF+8ywj8Amf7PBRmPCOJugH954Nnlo= github.com/spf13/cobra v1.9.1/go.mod h1:nDyEzZ8ogv936Cinf6g1RU9MRY64Ir93oCnqb9wxYW0= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= @@ -400,10 +555,12 @@ github.com/ssgreg/nlreturn/v2 v2.2.1/go.mod h1:E/iiPB78hV7Szg2YfRgyIrk1AD6JVMTRk github.com/stbenjam/no-sprintf-host-port v0.2.0 h1:i8pxvGrt1+4G0czLr/WnmyH7zbZ8Bg8etvARQ1rpyl4= github.com/stbenjam/no-sprintf-host-port v0.2.0/go.mod h1:eL0bQ9PasS0hsyTyfTjjG+E80QIyPnBVQbYZyv20Jfk= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= @@ -423,8 +580,8 @@ github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3 h1:f+jULpR github.com/tenntenn/text/transform v0.0.0-20200319021203-7eef512accb3/go.mod h1:ON8b8w4BN/kE1EOhwT0o+d62W65a6aPw1nouo9LMgyY= github.com/tetafro/godot v1.4.20 h1:z/p8Ek55UdNvzt4TFn2zx2KscpW4rWqcnUrdmvWJj7E= github.com/tetafro/godot v1.4.20/go.mod h1:2oVxTBSftRTh4+MVfUaUXR6bn2GDXCaMcOG4Dk3rfio= -github.com/timakin/bodyclose v0.0.0-20241222091800-1db5c5ca4d67 h1:9LPGD+jzxMlnk5r6+hJnar67cgpDIz/iyD+rfl5r2Vk= -github.com/timakin/bodyclose v0.0.0-20241222091800-1db5c5ca4d67/go.mod h1:mkjARE7Yr8qU23YcGMSALbIxTQ9r9QBVahQOBRfU460= +github.com/timakin/bodyclose v0.0.0-20241017074812-ed6a65f985e3 h1:y4mJRFlM6fUyPhoXuFg/Yu02fg/nIPFMOY8tOqppoFg= +github.com/timakin/bodyclose v0.0.0-20241017074812-ed6a65f985e3/go.mod h1:mkjARE7Yr8qU23YcGMSALbIxTQ9r9QBVahQOBRfU460= github.com/timonwong/loggercheck v0.10.1 h1:uVZYClxQFpw55eh+PIoqM7uAOHMrhVcDoWDery9R8Lg= github.com/timonwong/loggercheck v0.10.1/go.mod h1:HEAWU8djynujaAVX7QI65Myb8qgfcZ1uKbdpg3ZzKl8= github.com/tomarrell/wrapcheck/v2 v2.10.0 h1:SzRCryzy4IrAH7bVGG4cK40tNUhmVmMDuJujy4XwYDg= @@ -448,6 +605,7 @@ github.com/yeya24/promlinter v0.3.0/go.mod h1:cDfJQQYv9uYciW60QT0eeHlFodotkYZlL+ github.com/ykadowak/zerologlint v0.1.5 h1:Gy/fMz1dFQN9JZTPjv1hxEk+sRWm05row04Yoolgdiw= github.com/ykadowak/zerologlint v0.1.5/go.mod h1:KaUskqF3e/v59oPmdq1U1DnKcuHokl2/K1U4pmIELKg= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= @@ -461,26 +619,64 @@ go-simpler.org/musttag v0.13.0 h1:Q/YAW0AHvaoaIbsPj3bvEI5/QFP7w696IMUpnKXQfCE= go-simpler.org/musttag v0.13.0/go.mod h1:FTzIGeK6OkKlUDVpj0iQUXZLUO1Js9+mvykDQy9C5yM= go-simpler.org/sloglint v0.9.0 h1:/40NQtjRx9txvsB/RN022KsUJU+zaaSb/9q9BSefSrE= go-simpler.org/sloglint v0.9.0/go.mod h1:G/OrAF6uxj48sHahCzrbarVMptL2kjWTaUeC8+fOGww= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= go.uber.org/automaxprocs v1.6.0 h1:O3y2/QNTOdbF+e/dpXNNW7Rx2hZ4sTIPyybbxyNqTUs= go.uber.org/automaxprocs v1.6.0/go.mod h1:ifeIMSnPZuznNm6jmdzmU3/bfk01Fe2fotchwEFJ8r8= -go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= -go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= -go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= -go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= -go.uber.org/zap v1.27.0 h1:aJMhYGrd5QSmlpLMr2MftRKl7t8J8PTZPA732ud/XR8= -go.uber.org/zap v1.27.0/go.mod h1:GB2qFLM7cTU87MWRP2mPIjqfIDnGu+VIO4V/SdhGo2E= +go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI= +go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/multierr v1.9.0 h1:7fIwc/ZtS0q++VgcfqFDxSBZVv/Xo49/SYnDFupUwlI= +go.uber.org/multierr v1.9.0/go.mod h1:X2jQV1h+kxSjClGpnseKVIxpmcjrj7MNnI0bnlfKTVQ= +go.uber.org/zap v1.24.0 h1:FiJd5l1UOLj0wCgbSE0rwwXHzEdAZS6hiiSnxJN/D60= +go.uber.org/zap v1.24.0/go.mod h1:2kMP+WWQ8aoFoedH3T2sq6iJ2yDWpHbP0f6MQbS9Gkg= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc= golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= -golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 h1:1UoZQm6f0P/ZO0w1Ri+f+ifG/gXhegadRdwBIXEFWDo= -golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67/go.mod h1:qj5a5QZpwLU2NLQudwIN5koi3beDhSAlJwa67PuM98c= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +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-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-20250210185358-939b2ce775ac h1:TSSpLIG4v+p0rPv1pNOQtl1I8knsO4S9trOxNMOLVP4= golang.org/x/exp/typeparams v0.0.0-20250210185358-939b2ce775ac/go.mod h1:AbB0pIl9nAr9wVwH+Z2ZpaocVmF5I4GyWCDIsVjR0bk= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -494,13 +690,38 @@ golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM= golang.org/x/mod v0.23.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= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= @@ -511,12 +732,24 @@ golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.35.0 h1:T5GQRQb2y08kTAByq9L4/bz8cipCdA8FbRTXewonqY8= golang.org/x/net v0.35.0/go.mod h1:EglIi67kWsHKlRzzVMUD93VMSWGFOMSZgxFjparz1Qk= +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.26.0 h1:afQXWNNaeC4nvZ0Ed9XvCCzXM6UHJG7iCg0W4fPqSBE= golang.org/x/oauth2 v0.26.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= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -524,20 +757,49 @@ golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.11.0 h1:GGz8+XQP4FvTTrjZPzNKTMFtSXH80RAzG+5ghFPgK9w= golang.org/x/sync v0.11.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211105183446-c75c47738b0c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -558,7 +820,9 @@ golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -570,12 +834,53 @@ golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM= golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY= +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= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= golang.org/x/tools v0.0.0-20200324003944-a576cf524670/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.0.0-20200329025819-fd4102a86c65/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20200724022722-7017fd6b1305/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200820010801-b793a1359eac/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20201023174141-c8cfbd0f21e6/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1-0.20210205202024-ef80cdb6ec6d/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= golang.org/x/tools v0.1.1-0.20210302220138-2ac05c832e1a/go.mod h1:9bzcO0MWcOuT0tm1iBGzDVPshzfwoVvREIui8C+MHqU= @@ -594,22 +899,115 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T 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= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.36.4 h1:6A3ZDJHn/eNqc1i+IdefRzy/9PokBTPvcqMySR7NNIM= google.golang.org/protobuf v1.36.4/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA= gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.6.0 h1:TAODvD3knlq75WCp2nyGJtT4LeRV/o7NN9nYPeVJXf8= honnef.co/go/tools v0.6.0/go.mod h1:3puzxxljPCe8RGJX7BIy1plGbxEOZni5mR2aXe3/uk4= mvdan.cc/gofumpt v0.7.0 h1:bg91ttqXmi9y2xawvkuMXyvAA/1ZGJqYAEGjXuP0JXU= mvdan.cc/gofumpt v0.7.0/go.mod h1:txVFJy/Sc/mvaycET54pV8SW8gWxTlUuGHVEcncmNUo= -mvdan.cc/unparam v0.0.0-20241226123437-447d509598f3 h1:OPdLMIX29kquQXSiXmnwzHP1bc+JlH0S2l8SfVK9yWE= -mvdan.cc/unparam v0.0.0-20241226123437-447d509598f3/go.mod h1:VQc4l9ccF55E7EwPxcGqwierxEf0KG8MRR8hJ9tpngw= +mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f h1:lMpcwN6GxNbWtbpI1+xzFLSW8XzX0u72NttUGVFjO3U= +mvdan.cc/unparam v0.0.0-20240528143540-8a5130ca722f/go.mod h1:RSLa7mKKCNeTTMHBw5Hsy2rfJmd6O2ivt9Dw9ZqCQpQ= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/internal/commands/platform/export_internal.go b/internal/commands/platform/export_internal.go index 0fd62fb4..d1d692c3 100644 --- a/internal/commands/platform/export_internal.go +++ b/internal/commands/platform/export_internal.go @@ -212,6 +212,13 @@ func initPingFederateServices(ctx context.Context, pingcliVersion string) (err e return fmt.Errorf("failed to initialize PingFederate services. unrecognized authentication type '%s'", authType) } + // Test PF API client with create Context Auth + _, response, err := pingfederateApiClient.VersionAPI.GetVersion(pingfederateContext).Execute() + ok, err := common.HandleClientResponse(response, err, "GetVersion", "pingfederate_client_init") + if err != nil || !ok { + return fmt.Errorf("failed to initialize PingFederate Go Client. Check authentication type and credentials") + } + return nil } @@ -347,8 +354,8 @@ func createOrValidateOutputDir(outputDir string, overwriteExport bool) (resolved // Check if outputDir is empty if outputDir == "" { - return "", fmt.Errorf("Failed to export services. The output directory is not set. Specify the output directory "+ - "via the '--%s' flag, '%s' environment variable, or key '%s' in the configuration file.", + return "", fmt.Errorf("failed to export services. The output directory is not set. Specify the output directory "+ + "via the '--%s' flag, '%s' environment variable, or key '%s' in the configuration file", options.PlatformExportOutputDirectoryOption.CobraParamName, options.PlatformExportOutputDirectoryOption.EnvVar, options.PlatformExportOutputDirectoryOption.ViperKey) @@ -430,10 +437,13 @@ func validatePingOneExportEnvID(ctx context.Context) (err error) { } environment, response, err := pingoneApiClient.ManagementAPIClient.EnvironmentsApi.ReadOneEnvironment(ctx, pingoneExportEnvID).Execute() - err = common.HandleClientResponse(response, err, "ReadOneEnvironment", "pingone_environment") + ok, err := common.HandleClientResponse(response, err, "ReadOneEnvironment", "pingone_environment") if err != nil { return err } + if !ok { + return fmt.Errorf("failed to validate pingone environment ID '%s'", pingoneExportEnvID) + } if environment == nil { return fmt.Errorf("failed to validate pingone environment ID '%s'. environment matching ID does not exist", pingoneExportEnvID) diff --git a/internal/connector/common/resources_common.go b/internal/connector/common/resources_common.go index f01bb25c..dbb84b37 100644 --- a/internal/connector/common/resources_common.go +++ b/internal/connector/common/resources_common.go @@ -6,34 +6,53 @@ import ( "net/http" "slices" - "github.com/pingidentity/pingcli/internal/logger" + "github.com/pingidentity/pingcli/internal/output" ) const ( SINGLETON_ID_COMMENT_DATA = "This resource is a singleton, so the value of 'ID' in the import block does not matter - it is just a placeholder and required by terraform." ) -func HandleClientResponse(response *http.Response, err error, apiFunctionName string, resourceType string) error { - l := logger.Get() +func HandleClientResponse(response *http.Response, err error, apiFunctionName string, resourceType string) (bool, error) { + if err != nil { + // Only warn the user on client error and skip export of resource + output.Warn("API client error.", map[string]interface{}{ + "API Function Name": apiFunctionName, + "Resource Type": resourceType, + "Client Error": err, + }) - if response == nil { - l.Error().Err(err).Msgf("%s Request for resource '%s' was not successful. Response is nil.", apiFunctionName, resourceType) - return fmt.Errorf("%s Request for resource '%s' was not successful. Response is nil. Error: %v", apiFunctionName, resourceType, err) + return false, nil } + if response == nil { + return false, fmt.Errorf("%s Request for resource '%s' was not successful. Response is nil", apiFunctionName, resourceType) + } defer response.Body.Close() - if err != nil || response.StatusCode >= 300 || response.StatusCode < 200 { - l.Error().Err(err).Msgf("%s Request for resource '%s' was not successful. \nResponse Code: %s\nResponse Body: %s", apiFunctionName, resourceType, response.Status, response.Body) - return fmt.Errorf("%s Request for resource '%s' was not successful. \nResponse Code: %s\nResponse Body: %s\n Error: %v", apiFunctionName, resourceType, response.Status, response.Body, err) + // When the client returns forbidden, warn user and skip export of resource + if response.StatusCode == 403 { + output.Warn("API client 403 forbidden response.", map[string]interface{}{ + "API Function Name": apiFunctionName, + "Resource Type": resourceType, + "Response Code": response.StatusCode, + "Response Body": response.Body, + }) + + return false, nil + } + + // Error on any other non-200 response + if response.StatusCode >= 300 || response.StatusCode < 200 { + return false, fmt.Errorf("%s Request for resource '%s' was not successful. \nResponse Code: %s\nResponse Body: %s", apiFunctionName, resourceType, response.Status, response.Body) } - return nil + return true, nil } func DataNilError(resourceType string, response *http.Response) error { return fmt.Errorf("failed to export resource '%s'.\n"+ - "PingOne API request for resource '%s' was not successful. response data is nil.\n"+ + "API Client request for resource '%s' was not successful. response data is nil.\n"+ "response code: %s\n"+ "response body: %s", resourceType, resourceType, response.Status, response.Body) diff --git a/internal/connector/pingfederate/resources/pingfederate_authentication_api_application.go b/internal/connector/pingfederate/resources/pingfederate_authentication_api_application.go index 49ab9b5e..1bde0167 100644 --- a/internal/connector/pingfederate/resources/pingfederate_authentication_api_application.go +++ b/internal/connector/pingfederate/resources/pingfederate_authentication_api_application.go @@ -37,7 +37,7 @@ func (r *PingFederateAuthenticationApiApplicationResource) ExportAll() (*[]conne return nil, err } - for appId, appName := range *applicationData { + for appId, appName := range applicationData { commentData := map[string]string{ "Authentication API Application ID": appId, "Authentication API Application Name": appName, @@ -57,14 +57,17 @@ func (r *PingFederateAuthenticationApiApplicationResource) ExportAll() (*[]conne return &importBlocks, nil } -func (r *PingFederateAuthenticationApiApplicationResource) getApplicationData() (*map[string]string, error) { +func (r *PingFederateAuthenticationApiApplicationResource) getApplicationData() (map[string]string, error) { applicationData := make(map[string]string) authnApiApplications, response, err := r.clientInfo.ApiClient.AuthenticationApiAPI.GetAuthenticationApiApplications(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetAuthenticationApiApplications", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetAuthenticationApiApplications", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if authnApiApplications == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -84,5 +87,5 @@ func (r *PingFederateAuthenticationApiApplicationResource) getApplicationData() } } - return &applicationData, nil + return applicationData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_authentication_policies_fragment.go b/internal/connector/pingfederate/resources/pingfederate_authentication_policies_fragment.go index 89ab1416..66132c30 100644 --- a/internal/connector/pingfederate/resources/pingfederate_authentication_policies_fragment.go +++ b/internal/connector/pingfederate/resources/pingfederate_authentication_policies_fragment.go @@ -37,7 +37,7 @@ func (r *PingFederateAuthenticationPoliciesFragmentResource) ExportAll() (*[]con return nil, err } - for fragmentId, fragmentName := range *fragmentData { + for fragmentId, fragmentName := range fragmentData { commentData := map[string]string{ "Authentication Policies Fragment ID": fragmentId, "Authentication Policies Fragment Name": fragmentName, @@ -57,14 +57,17 @@ func (r *PingFederateAuthenticationPoliciesFragmentResource) ExportAll() (*[]con return &importBlocks, nil } -func (r *PingFederateAuthenticationPoliciesFragmentResource) getFragmentData() (*map[string]string, error) { +func (r *PingFederateAuthenticationPoliciesFragmentResource) getFragmentData() (map[string]string, error) { fragmentData := make(map[string]string) authnPoliciesFragments, response, err := r.clientInfo.ApiClient.AuthenticationPoliciesAPI.GetFragments(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetFragments", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetFragments", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if authnPoliciesFragments == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -84,5 +87,5 @@ func (r *PingFederateAuthenticationPoliciesFragmentResource) getFragmentData() ( } } - return &fragmentData, nil + return fragmentData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_authentication_policy_contract.go b/internal/connector/pingfederate/resources/pingfederate_authentication_policy_contract.go index 819f0f08..ce43e22d 100644 --- a/internal/connector/pingfederate/resources/pingfederate_authentication_policy_contract.go +++ b/internal/connector/pingfederate/resources/pingfederate_authentication_policy_contract.go @@ -37,7 +37,7 @@ func (r *PingFederateAuthenticationPolicyContractResource) ExportAll() (*[]conne return nil, err } - for authnPolicyContractId, authnPolicyContractName := range *authenticationPolicyContractData { + for authnPolicyContractId, authnPolicyContractName := range authenticationPolicyContractData { commentData := map[string]string{ "Authentication Policy Contract ID": authnPolicyContractId, "Authentication Policy Contract Name": authnPolicyContractName, @@ -57,14 +57,17 @@ func (r *PingFederateAuthenticationPolicyContractResource) ExportAll() (*[]conne return &importBlocks, nil } -func (r *PingFederateAuthenticationPolicyContractResource) getAuthenticationPolicyContractData() (*map[string]string, error) { +func (r *PingFederateAuthenticationPolicyContractResource) getAuthenticationPolicyContractData() (map[string]string, error) { authenticationPolicyContractData := make(map[string]string) authnPolicyContracts, response, err := r.clientInfo.ApiClient.AuthenticationPolicyContractsAPI.GetAuthenticationPolicyContracts(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetAuthenticationPolicyContracts", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetAuthenticationPolicyContracts", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if authnPolicyContracts == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -84,5 +87,5 @@ func (r *PingFederateAuthenticationPolicyContractResource) getAuthenticationPoli } } - return &authenticationPolicyContractData, nil + return authenticationPolicyContractData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_authentication_selector.go b/internal/connector/pingfederate/resources/pingfederate_authentication_selector.go index 9fb02cd5..8036160f 100644 --- a/internal/connector/pingfederate/resources/pingfederate_authentication_selector.go +++ b/internal/connector/pingfederate/resources/pingfederate_authentication_selector.go @@ -37,7 +37,7 @@ func (r *PingFederateAuthenticationSelectorResource) ExportAll() (*[]connector.I return nil, err } - for authnSelectorId, authnSelectorName := range *authenticationSelectorData { + for authnSelectorId, authnSelectorName := range authenticationSelectorData { commentData := map[string]string{ "Authentication Selector ID": authnSelectorId, "Authentication Selector Name": authnSelectorName, @@ -57,14 +57,17 @@ func (r *PingFederateAuthenticationSelectorResource) ExportAll() (*[]connector.I return &importBlocks, nil } -func (r *PingFederateAuthenticationSelectorResource) getAuthenticationSelectorData() (*map[string]string, error) { +func (r *PingFederateAuthenticationSelectorResource) getAuthenticationSelectorData() (map[string]string, error) { authenticationSelectorData := make(map[string]string) authnSelectors, response, err := r.clientInfo.ApiClient.AuthenticationSelectorsAPI.GetAuthenticationSelectors(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetAuthenticationSelectors", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetAuthenticationSelectors", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if authnSelectors == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -84,5 +87,5 @@ func (r *PingFederateAuthenticationSelectorResource) getAuthenticationSelectorDa } } - return &authenticationSelectorData, nil + return authenticationSelectorData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_captcha_provider.go b/internal/connector/pingfederate/resources/pingfederate_captcha_provider.go index 2c355d63..c77b87e1 100644 --- a/internal/connector/pingfederate/resources/pingfederate_captcha_provider.go +++ b/internal/connector/pingfederate/resources/pingfederate_captcha_provider.go @@ -37,7 +37,7 @@ func (r *PingFederateCaptchaProviderResource) ExportAll() (*[]connector.ImportBl return nil, err } - for captchaProviderId, captchaProviderName := range *captchaProviderData { + for captchaProviderId, captchaProviderName := range captchaProviderData { commentData := map[string]string{ "Captcha Provider ID": captchaProviderId, "Captcha Provider Name": captchaProviderId, @@ -57,14 +57,17 @@ func (r *PingFederateCaptchaProviderResource) ExportAll() (*[]connector.ImportBl return &importBlocks, nil } -func (r *PingFederateCaptchaProviderResource) getCaptchaProviderData() (*map[string]string, error) { +func (r *PingFederateCaptchaProviderResource) getCaptchaProviderData() (map[string]string, error) { captchaProviderData := make(map[string]string) captchaProviders, response, err := r.clientInfo.ApiClient.CaptchaProvidersAPI.GetCaptchaProviders(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetCaptchaProviders", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetCaptchaProviders", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if captchaProviders == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -84,5 +87,5 @@ func (r *PingFederateCaptchaProviderResource) getCaptchaProviderData() (*map[str } } - return &captchaProviderData, nil + return captchaProviderData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_certificate_ca.go b/internal/connector/pingfederate/resources/pingfederate_certificate_ca.go index 27c6329b..f0d39c55 100644 --- a/internal/connector/pingfederate/resources/pingfederate_certificate_ca.go +++ b/internal/connector/pingfederate/resources/pingfederate_certificate_ca.go @@ -39,7 +39,7 @@ func (r *PingFederateCertificateCAResource) ExportAll() (*[]connector.ImportBloc return nil, err } - for certViewId, certViewInfo := range *trustedCAData { + for certViewId, certViewInfo := range trustedCAData { certViewIssuerDN := certViewInfo[0] certViewSerialNumber := certViewInfo[1] @@ -63,14 +63,17 @@ func (r *PingFederateCertificateCAResource) ExportAll() (*[]connector.ImportBloc return &importBlocks, nil } -func (r *PingFederateCertificateCAResource) getTrustedCAData() (*map[string][]string, error) { +func (r *PingFederateCertificateCAResource) getTrustedCAData() (map[string][]string, error) { trustedCAData := make(map[string][]string) certViews, response, err := r.clientInfo.ApiClient.CertificatesCaAPI.GetTrustedCAs(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetTrustedCAs", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetTrustedCAs", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if certViews == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -91,5 +94,5 @@ func (r *PingFederateCertificateCAResource) getTrustedCAData() (*map[string][]st } } - return &trustedCAData, nil + return trustedCAData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_certificates_revocation_ocsp_certificate.go b/internal/connector/pingfederate/resources/pingfederate_certificates_revocation_ocsp_certificate.go index 832e19c1..42c553d6 100644 --- a/internal/connector/pingfederate/resources/pingfederate_certificates_revocation_ocsp_certificate.go +++ b/internal/connector/pingfederate/resources/pingfederate_certificates_revocation_ocsp_certificate.go @@ -39,7 +39,7 @@ func (r *PingFederateCertificatesRevocationOCSPCertificateResource) ExportAll() return nil, err } - for ocspCertificateId, ocspCertificateInfo := range *ocspCertificateData { + for ocspCertificateId, ocspCertificateInfo := range ocspCertificateData { ocspCertificateIssuerDN := ocspCertificateInfo[0] ocspCertificateSerialNumber := ocspCertificateInfo[1] @@ -63,14 +63,17 @@ func (r *PingFederateCertificatesRevocationOCSPCertificateResource) ExportAll() return &importBlocks, nil } -func (r *PingFederateCertificatesRevocationOCSPCertificateResource) getOcspCertificateData() (*map[string][]string, error) { +func (r *PingFederateCertificatesRevocationOCSPCertificateResource) getOcspCertificateData() (map[string][]string, error) { ocspCertificateData := make(map[string][]string) ocspCertificates, response, err := r.clientInfo.ApiClient.CertificatesRevocationAPI.GetOcspCertificates(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetOcspCertificates", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetOcspCertificates", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if ocspCertificates == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -91,5 +94,5 @@ func (r *PingFederateCertificatesRevocationOCSPCertificateResource) getOcspCerti } } - return &ocspCertificateData, nil + return ocspCertificateData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_data_store.go b/internal/connector/pingfederate/resources/pingfederate_data_store.go index 2de8e196..889abc13 100644 --- a/internal/connector/pingfederate/resources/pingfederate_data_store.go +++ b/internal/connector/pingfederate/resources/pingfederate_data_store.go @@ -39,7 +39,7 @@ func (r *PingFederateDataStoreResource) ExportAll() (*[]connector.ImportBlock, e return nil, err } - for dataStoreId, dataStoreType := range *dataStoreData { + for dataStoreId, dataStoreType := range dataStoreData { commentData := map[string]string{ "Data Store ID": dataStoreId, "Data Store Type": dataStoreType, @@ -59,14 +59,17 @@ func (r *PingFederateDataStoreResource) ExportAll() (*[]connector.ImportBlock, e return &importBlocks, nil } -func (r *PingFederateDataStoreResource) getDataStoreData() (*map[string]string, error) { +func (r *PingFederateDataStoreResource) getDataStoreData() (map[string]string, error) { dataStoreData := make(map[string]string) dataStores, response, err := r.clientInfo.ApiClient.DataStoresAPI.GetDataStores(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetDataStores", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetDataStores", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if dataStores == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -86,5 +89,5 @@ func (r *PingFederateDataStoreResource) getDataStoreData() (*map[string]string, } } - return &dataStoreData, nil + return dataStoreData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_identity_store_provisioner.go b/internal/connector/pingfederate/resources/pingfederate_identity_store_provisioner.go index 0552db4e..e4446ffa 100644 --- a/internal/connector/pingfederate/resources/pingfederate_identity_store_provisioner.go +++ b/internal/connector/pingfederate/resources/pingfederate_identity_store_provisioner.go @@ -37,7 +37,7 @@ func (r *PingFederateIdentityStoreProvisionerResource) ExportAll() (*[]connector return nil, err } - for identityStoreProvisionerId, identityStoreProvisionerName := range *identityStoreProvisionerData { + for identityStoreProvisionerId, identityStoreProvisionerName := range identityStoreProvisionerData { commentData := map[string]string{ "Identity Store Provisioner ID": identityStoreProvisionerId, "Identity Store Provisioner Name": identityStoreProvisionerName, @@ -57,14 +57,17 @@ func (r *PingFederateIdentityStoreProvisionerResource) ExportAll() (*[]connector return &importBlocks, nil } -func (r *PingFederateIdentityStoreProvisionerResource) getIdentityStoreProvisionerData() (*map[string]string, error) { +func (r *PingFederateIdentityStoreProvisionerResource) getIdentityStoreProvisionerData() (map[string]string, error) { identityStoreProvisionerData := make(map[string]string) identityStoreProvisioners, response, err := r.clientInfo.ApiClient.IdentityStoreProvisionersAPI.GetIdentityStoreProvisioners(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetIdentityStoreProvisioners", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetIdentityStoreProvisioners", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if identityStoreProvisioners == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -84,5 +87,5 @@ func (r *PingFederateIdentityStoreProvisionerResource) getIdentityStoreProvision } } - return &identityStoreProvisionerData, nil + return identityStoreProvisionerData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_idp_adapter.go b/internal/connector/pingfederate/resources/pingfederate_idp_adapter.go index 92799094..c341d4ef 100644 --- a/internal/connector/pingfederate/resources/pingfederate_idp_adapter.go +++ b/internal/connector/pingfederate/resources/pingfederate_idp_adapter.go @@ -37,7 +37,7 @@ func (r *PingFederateIDPAdapterResource) ExportAll() (*[]connector.ImportBlock, return nil, err } - for idpAdapterId, idpAdapterName := range *idpAdapterData { + for idpAdapterId, idpAdapterName := range idpAdapterData { commentData := map[string]string{ "IDP Adapter ID": idpAdapterId, "IDP Adapter Name": idpAdapterName, @@ -57,14 +57,17 @@ func (r *PingFederateIDPAdapterResource) ExportAll() (*[]connector.ImportBlock, return &importBlocks, nil } -func (r *PingFederateIDPAdapterResource) getIDPAdapterData() (*map[string]string, error) { +func (r *PingFederateIDPAdapterResource) getIDPAdapterData() (map[string]string, error) { idpAdapterData := make(map[string]string) idpAdapters, response, err := r.clientInfo.ApiClient.IdpAdaptersAPI.GetIdpAdapters(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetIdpAdapters", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetIdpAdapters", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if idpAdapters == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -84,5 +87,5 @@ func (r *PingFederateIDPAdapterResource) getIDPAdapterData() (*map[string]string } } - return &idpAdapterData, nil + return idpAdapterData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_idp_sp_connection.go b/internal/connector/pingfederate/resources/pingfederate_idp_sp_connection.go index eca20af7..01666e50 100644 --- a/internal/connector/pingfederate/resources/pingfederate_idp_sp_connection.go +++ b/internal/connector/pingfederate/resources/pingfederate_idp_sp_connection.go @@ -37,7 +37,7 @@ func (r *PingFederateIDPSPConnectionResource) ExportAll() (*[]connector.ImportBl return nil, err } - for spConnectionId, spConnectionName := range *spConnectionData { + for spConnectionId, spConnectionName := range spConnectionData { commentData := map[string]string{ "IDP SP Connection ID": spConnectionId, "IDP SP Connection Name": spConnectionName, @@ -57,14 +57,17 @@ func (r *PingFederateIDPSPConnectionResource) ExportAll() (*[]connector.ImportBl return &importBlocks, nil } -func (r *PingFederateIDPSPConnectionResource) getSpConnectionData() (*map[string]string, error) { +func (r *PingFederateIDPSPConnectionResource) getSpConnectionData() (map[string]string, error) { spConnectionData := make(map[string]string) spConnections, response, err := r.clientInfo.ApiClient.IdpSpConnectionsAPI.GetSpConnections(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetSpConnections", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetSpConnections", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if spConnections == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -84,5 +87,5 @@ func (r *PingFederateIDPSPConnectionResource) getSpConnectionData() (*map[string } } - return &spConnectionData, nil + return spConnectionData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_idp_sts_request_parameters_contract.go b/internal/connector/pingfederate/resources/pingfederate_idp_sts_request_parameters_contract.go index 512c8d97..8afc529b 100644 --- a/internal/connector/pingfederate/resources/pingfederate_idp_sts_request_parameters_contract.go +++ b/internal/connector/pingfederate/resources/pingfederate_idp_sts_request_parameters_contract.go @@ -37,7 +37,7 @@ func (r *PingFederateIdpStsRequestParametersContractResource) ExportAll() (*[]co return nil, err } - for stsRequestParamContractId, stsRequestParamContractName := range *stsRequestParamContractData { + for stsRequestParamContractId, stsRequestParamContractName := range stsRequestParamContractData { commentData := map[string]string{ "IDP STS Request Parameters Contract ID": stsRequestParamContractId, "IDP STS Request Parameters Contract Name": stsRequestParamContractName, @@ -57,14 +57,17 @@ func (r *PingFederateIdpStsRequestParametersContractResource) ExportAll() (*[]co return &importBlocks, nil } -func (r *PingFederateIdpStsRequestParametersContractResource) getStsRequestParamContractData() (*map[string]string, error) { +func (r *PingFederateIdpStsRequestParametersContractResource) getStsRequestParamContractData() (map[string]string, error) { stsRequestParamContractData := make(map[string]string) stsRequestParamContracts, response, err := r.clientInfo.ApiClient.IdpStsRequestParametersContractsAPI.GetStsRequestParamContracts(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetStsRequestParamContracts", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetStsRequestParamContracts", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if stsRequestParamContracts == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -84,5 +87,5 @@ func (r *PingFederateIdpStsRequestParametersContractResource) getStsRequestParam } } - return &stsRequestParamContractData, nil + return stsRequestParamContractData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_idp_to_sp_adapter_mapping.go b/internal/connector/pingfederate/resources/pingfederate_idp_to_sp_adapter_mapping.go index 209c71c0..b8a68a6d 100644 --- a/internal/connector/pingfederate/resources/pingfederate_idp_to_sp_adapter_mapping.go +++ b/internal/connector/pingfederate/resources/pingfederate_idp_to_sp_adapter_mapping.go @@ -39,7 +39,7 @@ func (r *PingFederateIdpToSpAdapterMappingResource) ExportAll() (*[]connector.Im return nil, err } - for idpToSpAdapterMappingSourceId, idpToSpAdapterMappingTargetId := range *idpToSpAdapterMappingData { + for idpToSpAdapterMappingSourceId, idpToSpAdapterMappingTargetId := range idpToSpAdapterMappingData { commentData := map[string]string{ "IDP To SP Adapter Mapping IDP ID": idpToSpAdapterMappingSourceId, "IDP To SP Adapter Mapping SP ID": idpToSpAdapterMappingTargetId, @@ -59,14 +59,17 @@ func (r *PingFederateIdpToSpAdapterMappingResource) ExportAll() (*[]connector.Im return &importBlocks, nil } -func (r *PingFederateIdpToSpAdapterMappingResource) getIdpToSpAdapterMappingData() (*map[string]string, error) { +func (r *PingFederateIdpToSpAdapterMappingResource) getIdpToSpAdapterMappingData() (map[string]string, error) { idpToSpAdapterMappingData := make(map[string]string) idpToSpAdapterMappings, response, err := r.clientInfo.ApiClient.IdpToSpAdapterMappingAPI.GetIdpToSpAdapterMappings(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetIdpToSpAdapterMappings", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetIdpToSpAdapterMappings", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if idpToSpAdapterMappings == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -86,5 +89,5 @@ func (r *PingFederateIdpToSpAdapterMappingResource) getIdpToSpAdapterMappingData } } - return &idpToSpAdapterMappingData, nil + return idpToSpAdapterMappingData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_idp_token_processor.go b/internal/connector/pingfederate/resources/pingfederate_idp_token_processor.go index a40a0faa..70f411c2 100644 --- a/internal/connector/pingfederate/resources/pingfederate_idp_token_processor.go +++ b/internal/connector/pingfederate/resources/pingfederate_idp_token_processor.go @@ -37,7 +37,7 @@ func (r *PingFederateIdpTokenProcessorResource) ExportAll() (*[]connector.Import return nil, err } - for tokenProcessorId, tokenProcessorName := range *tokenProcessorData { + for tokenProcessorId, tokenProcessorName := range tokenProcessorData { commentData := map[string]string{ "IDP Token Processor ID": tokenProcessorId, "IDP Token Processor Name": tokenProcessorName, @@ -57,14 +57,17 @@ func (r *PingFederateIdpTokenProcessorResource) ExportAll() (*[]connector.Import return &importBlocks, nil } -func (r *PingFederateIdpTokenProcessorResource) getTokenProcessorData() (*map[string]string, error) { +func (r *PingFederateIdpTokenProcessorResource) getTokenProcessorData() (map[string]string, error) { tokenProcessorData := make(map[string]string) tokenProcessors, response, err := r.clientInfo.ApiClient.IdpTokenProcessorsAPI.GetTokenProcessors(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetTokenProcessors", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetTokenProcessors", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if tokenProcessors == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -84,5 +87,5 @@ func (r *PingFederateIdpTokenProcessorResource) getTokenProcessorData() (*map[st } } - return &tokenProcessorData, nil + return tokenProcessorData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_kerberos_realm.go b/internal/connector/pingfederate/resources/pingfederate_kerberos_realm.go index e5218c09..90556baa 100644 --- a/internal/connector/pingfederate/resources/pingfederate_kerberos_realm.go +++ b/internal/connector/pingfederate/resources/pingfederate_kerberos_realm.go @@ -37,7 +37,7 @@ func (r *PingFederateKerberosRealmResource) ExportAll() (*[]connector.ImportBloc return nil, err } - for kerberosRealmId, kerberosRealmName := range *kerberosRealmData { + for kerberosRealmId, kerberosRealmName := range kerberosRealmData { commentData := map[string]string{ "Kerberos Realm ID": kerberosRealmId, "Kerberos Realm Name": kerberosRealmName, @@ -57,14 +57,17 @@ func (r *PingFederateKerberosRealmResource) ExportAll() (*[]connector.ImportBloc return &importBlocks, nil } -func (r *PingFederateKerberosRealmResource) getKerberosRealmData() (*map[string]string, error) { +func (r *PingFederateKerberosRealmResource) getKerberosRealmData() (map[string]string, error) { kerberosRealmData := make(map[string]string) kerberosRealms, response, err := r.clientInfo.ApiClient.KerberosRealmsAPI.GetKerberosRealms(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetKerberosRealms", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetKerberosRealms", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if kerberosRealms == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -84,5 +87,5 @@ func (r *PingFederateKerberosRealmResource) getKerberosRealmData() (*map[string] } } - return &kerberosRealmData, nil + return kerberosRealmData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_keypairs_oauth_openid_connect_additional_key_set.go b/internal/connector/pingfederate/resources/pingfederate_keypairs_oauth_openid_connect_additional_key_set.go index 46554a33..a501e2c3 100644 --- a/internal/connector/pingfederate/resources/pingfederate_keypairs_oauth_openid_connect_additional_key_set.go +++ b/internal/connector/pingfederate/resources/pingfederate_keypairs_oauth_openid_connect_additional_key_set.go @@ -37,7 +37,7 @@ func (r *PingFederateKeypairsOauthOpenidConnectAdditionalKeySetResource) ExportA return nil, err } - for keySetId, keySetName := range *keySetData { + for keySetId, keySetName := range keySetData { commentData := map[string]string{ "Keypairs OAuth OpenID Connect Addition Key Set ID": keySetId, "Keypairs OAuth OpenID Connect Addition Key Set Name": keySetName, @@ -57,14 +57,17 @@ func (r *PingFederateKeypairsOauthOpenidConnectAdditionalKeySetResource) ExportA return &importBlocks, nil } -func (r *PingFederateKeypairsOauthOpenidConnectAdditionalKeySetResource) getKeySetData() (*map[string]string, error) { +func (r *PingFederateKeypairsOauthOpenidConnectAdditionalKeySetResource) getKeySetData() (map[string]string, error) { keySetData := make(map[string]string) keySets, response, err := r.clientInfo.ApiClient.KeyPairsOauthOpenIdConnectAPI.GetKeySets(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetKeySets", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetKeySets", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if keySets == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -84,5 +87,5 @@ func (r *PingFederateKeypairsOauthOpenidConnectAdditionalKeySetResource) getKeyS } } - return &keySetData, nil + return keySetData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_keypairs_signing_key_rotation_settings.go b/internal/connector/pingfederate/resources/pingfederate_keypairs_signing_key_rotation_settings.go index b9adfe93..91e5c34d 100644 --- a/internal/connector/pingfederate/resources/pingfederate_keypairs_signing_key_rotation_settings.go +++ b/internal/connector/pingfederate/resources/pingfederate_keypairs_signing_key_rotation_settings.go @@ -39,7 +39,7 @@ func (r *PingFederateKeypairsSigningKeyRotationSettingsResource) ExportAll() (*[ return nil, err } - for signingKeyPairId, signingKeyPairInfo := range *signingKeyPairData { + for signingKeyPairId, signingKeyPairInfo := range signingKeyPairData { signingKeyPairIssuerDN := signingKeyPairInfo[0] signingKeyPairSerialNumber := signingKeyPairInfo[1] @@ -63,14 +63,17 @@ func (r *PingFederateKeypairsSigningKeyRotationSettingsResource) ExportAll() (*[ return &importBlocks, nil } -func (r *PingFederateKeypairsSigningKeyRotationSettingsResource) getSigningKeyPairData() (*map[string][]string, error) { +func (r *PingFederateKeypairsSigningKeyRotationSettingsResource) getSigningKeyPairData() (map[string][]string, error) { signingKeyPairData := make(map[string][]string) signingKeyPairs, response, err := r.clientInfo.ApiClient.KeyPairsSigningAPI.GetSigningKeyPairs(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetSigningKeyPairs", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetSigningKeyPairs", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if signingKeyPairs == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -95,5 +98,5 @@ func (r *PingFederateKeypairsSigningKeyRotationSettingsResource) getSigningKeyPa } } - return &signingKeyPairData, nil + return signingKeyPairData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_local_identity_profile.go b/internal/connector/pingfederate/resources/pingfederate_local_identity_profile.go index d0ebe8ae..40607f08 100644 --- a/internal/connector/pingfederate/resources/pingfederate_local_identity_profile.go +++ b/internal/connector/pingfederate/resources/pingfederate_local_identity_profile.go @@ -37,7 +37,7 @@ func (r *PingFederateLocalIdentityProfileResource) ExportAll() (*[]connector.Imp return nil, err } - for identityProfileId, identityProfileName := range *identityProfileData { + for identityProfileId, identityProfileName := range identityProfileData { commentData := map[string]string{ "Local Identity Profile ID": identityProfileId, "Local Identity Profile Name": identityProfileName, @@ -57,14 +57,17 @@ func (r *PingFederateLocalIdentityProfileResource) ExportAll() (*[]connector.Imp return &importBlocks, nil } -func (r *PingFederateLocalIdentityProfileResource) getIdentityProfileData() (*map[string]string, error) { +func (r *PingFederateLocalIdentityProfileResource) getIdentityProfileData() (map[string]string, error) { identityProfileData := make(map[string]string) identityProfiles, response, err := r.clientInfo.ApiClient.LocalIdentityIdentityProfilesAPI.GetIdentityProfiles(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetIdentityProfiles", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetIdentityProfiles", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if identityProfiles == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -84,5 +87,5 @@ func (r *PingFederateLocalIdentityProfileResource) getIdentityProfileData() (*ma } } - return &identityProfileData, nil + return identityProfileData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_metadata_url.go b/internal/connector/pingfederate/resources/pingfederate_metadata_url.go index e60b343f..5eabc773 100644 --- a/internal/connector/pingfederate/resources/pingfederate_metadata_url.go +++ b/internal/connector/pingfederate/resources/pingfederate_metadata_url.go @@ -37,7 +37,7 @@ func (r *PingFederateMetadataUrlResource) ExportAll() (*[]connector.ImportBlock, return nil, err } - for metadataUrlId, metadataUrlName := range *metadataUrlData { + for metadataUrlId, metadataUrlName := range metadataUrlData { commentData := map[string]string{ "Metadata URL ID": metadataUrlId, "Metadata URL Name": metadataUrlName, @@ -57,14 +57,17 @@ func (r *PingFederateMetadataUrlResource) ExportAll() (*[]connector.ImportBlock, return &importBlocks, nil } -func (r *PingFederateMetadataUrlResource) getMetadataUrlData() (*map[string]string, error) { +func (r *PingFederateMetadataUrlResource) getMetadataUrlData() (map[string]string, error) { metadataUrlData := make(map[string]string) metadataUrls, response, err := r.clientInfo.ApiClient.MetadataUrlsAPI.GetMetadataUrls(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetMetadataUrls", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetMetadataUrls", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if metadataUrls == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -84,5 +87,5 @@ func (r *PingFederateMetadataUrlResource) getMetadataUrlData() (*map[string]stri } } - return &metadataUrlData, nil + return metadataUrlData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_notification_publisher.go b/internal/connector/pingfederate/resources/pingfederate_notification_publisher.go index 3167ab09..a8b5c3dd 100644 --- a/internal/connector/pingfederate/resources/pingfederate_notification_publisher.go +++ b/internal/connector/pingfederate/resources/pingfederate_notification_publisher.go @@ -37,7 +37,7 @@ func (r *PingFederateNotificationPublisherResource) ExportAll() (*[]connector.Im return nil, err } - for notificationPublisherId, notificationPublisherName := range *notificationPublisherData { + for notificationPublisherId, notificationPublisherName := range notificationPublisherData { commentData := map[string]string{ "Notification Publisher ID": notificationPublisherId, "Notification Publisher Name": notificationPublisherName, @@ -57,14 +57,17 @@ func (r *PingFederateNotificationPublisherResource) ExportAll() (*[]connector.Im return &importBlocks, nil } -func (r *PingFederateNotificationPublisherResource) getNotificationPublisherData() (*map[string]string, error) { +func (r *PingFederateNotificationPublisherResource) getNotificationPublisherData() (map[string]string, error) { notificationPublisherData := make(map[string]string) notificationPublishers, response, err := r.clientInfo.ApiClient.NotificationPublishersAPI.GetNotificationPublishers(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetNotificationPublishers", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetNotificationPublishers", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if notificationPublishers == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -84,5 +87,5 @@ func (r *PingFederateNotificationPublisherResource) getNotificationPublisherData } } - return ¬ificationPublisherData, nil + return notificationPublisherData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_oauth_access_token_manager.go b/internal/connector/pingfederate/resources/pingfederate_oauth_access_token_manager.go index e3eeec22..bc9aaf3c 100644 --- a/internal/connector/pingfederate/resources/pingfederate_oauth_access_token_manager.go +++ b/internal/connector/pingfederate/resources/pingfederate_oauth_access_token_manager.go @@ -37,7 +37,7 @@ func (r *PingFederateOAuthAccessTokenManagerResource) ExportAll() (*[]connector. return nil, err } - for tokenManagerId, tokenManagerName := range *tokenManagerData { + for tokenManagerId, tokenManagerName := range tokenManagerData { commentData := map[string]string{ "OAuth Access Token Manager ID": tokenManagerId, "OAuth Access Token Manager Name": tokenManagerName, @@ -57,14 +57,17 @@ func (r *PingFederateOAuthAccessTokenManagerResource) ExportAll() (*[]connector. return &importBlocks, nil } -func (r *PingFederateOAuthAccessTokenManagerResource) getTokenManagerData() (*map[string]string, error) { +func (r *PingFederateOAuthAccessTokenManagerResource) getTokenManagerData() (map[string]string, error) { tokenManagerData := make(map[string]string) tokenManagers, response, err := r.clientInfo.ApiClient.OauthAccessTokenManagersAPI.GetTokenManagers(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetTokenManagers", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetTokenManagers", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if tokenManagers == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -84,5 +87,5 @@ func (r *PingFederateOAuthAccessTokenManagerResource) getTokenManagerData() (*ma } } - return &tokenManagerData, nil + return tokenManagerData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_oauth_access_token_mapping.go b/internal/connector/pingfederate/resources/pingfederate_oauth_access_token_mapping.go index efe6b9a7..e0a7532e 100644 --- a/internal/connector/pingfederate/resources/pingfederate_oauth_access_token_mapping.go +++ b/internal/connector/pingfederate/resources/pingfederate_oauth_access_token_mapping.go @@ -39,7 +39,7 @@ func (r *PingFederateOAuthAccessTokenMappingResource) ExportAll() (*[]connector. return nil, err } - for mappingId, mappingContextType := range *mappingData { + for mappingId, mappingContextType := range mappingData { commentData := map[string]string{ "OAuth Access Token Mapping ID": mappingId, "OAuth Access Token Mapping Context Type": mappingContextType, @@ -59,14 +59,17 @@ func (r *PingFederateOAuthAccessTokenMappingResource) ExportAll() (*[]connector. return &importBlocks, nil } -func (r *PingFederateOAuthAccessTokenMappingResource) getMappingData() (*map[string]string, error) { +func (r *PingFederateOAuthAccessTokenMappingResource) getMappingData() (map[string]string, error) { mappingData := make(map[string]string) mappings, response, err := r.clientInfo.ApiClient.OauthAccessTokenMappingsAPI.GetMappings(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetMappings", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetMappings", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } for _, mapping := range mappings { mappingId, mappingIdOk := mapping.GetIdOk() @@ -81,5 +84,5 @@ func (r *PingFederateOAuthAccessTokenMappingResource) getMappingData() (*map[str } } - return &mappingData, nil + return mappingData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_oauth_authentication_policy_contract_mapping.go b/internal/connector/pingfederate/resources/pingfederate_oauth_authentication_policy_contract_mapping.go index d51f20c4..fba59194 100644 --- a/internal/connector/pingfederate/resources/pingfederate_oauth_authentication_policy_contract_mapping.go +++ b/internal/connector/pingfederate/resources/pingfederate_oauth_authentication_policy_contract_mapping.go @@ -39,7 +39,7 @@ func (r *PingFederateOAuthAuthenticationPolicyContractMappingResource) ExportAll return nil, err } - for _, mappingId := range *apcToPersistentGrantMappingData { + for _, mappingId := range apcToPersistentGrantMappingData { commentData := map[string]string{ "Authentication Policy Contract Mapping ID": mappingId, "Resource Type": r.ResourceType(), @@ -58,14 +58,17 @@ func (r *PingFederateOAuthAuthenticationPolicyContractMappingResource) ExportAll return &importBlocks, nil } -func (r *PingFederateOAuthAuthenticationPolicyContractMappingResource) getApcToPersistentGrantMappingData() (*[]string, error) { +func (r *PingFederateOAuthAuthenticationPolicyContractMappingResource) getApcToPersistentGrantMappingData() ([]string, error) { apcToPersistentGrantMappingData := []string{} apcToPersistentGrantMappings, response, err := r.clientInfo.ApiClient.OauthAuthenticationPolicyContractMappingsAPI.GetApcMappings(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetApcMappings", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetApcMappings", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if apcToPersistentGrantMappings == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -84,5 +87,5 @@ func (r *PingFederateOAuthAuthenticationPolicyContractMappingResource) getApcToP } } - return &apcToPersistentGrantMappingData, nil + return apcToPersistentGrantMappingData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_oauth_ciba_server_policy_request_policy.go b/internal/connector/pingfederate/resources/pingfederate_oauth_ciba_server_policy_request_policy.go index dbde5ba9..c413b3f3 100644 --- a/internal/connector/pingfederate/resources/pingfederate_oauth_ciba_server_policy_request_policy.go +++ b/internal/connector/pingfederate/resources/pingfederate_oauth_ciba_server_policy_request_policy.go @@ -37,7 +37,7 @@ func (r *PingFederateOAuthCibaServerPolicyRequestPolicyResource) ExportAll() (*[ return nil, err } - for requestPolicyId, requestPolicyName := range *oauthClientData { + for requestPolicyId, requestPolicyName := range oauthClientData { commentData := map[string]string{ "OAuth CIBA Server Policy Request Policy ID": requestPolicyId, "OAuth CIBA Server Policy Request Policy Name": requestPolicyName, @@ -57,14 +57,17 @@ func (r *PingFederateOAuthCibaServerPolicyRequestPolicyResource) ExportAll() (*[ return &importBlocks, nil } -func (r *PingFederateOAuthCibaServerPolicyRequestPolicyResource) getRequestPolicyData() (*map[string]string, error) { +func (r *PingFederateOAuthCibaServerPolicyRequestPolicyResource) getRequestPolicyData() (map[string]string, error) { requestPolicyData := make(map[string]string) requestPolicies, response, err := r.clientInfo.ApiClient.OauthCibaServerPolicyAPI.GetCibaServerPolicies(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetCibaServerPolicies", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetCibaServerPolicies", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if requestPolicies == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -84,5 +87,5 @@ func (r *PingFederateOAuthCibaServerPolicyRequestPolicyResource) getRequestPolic } } - return &requestPolicyData, nil + return requestPolicyData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_oauth_client.go b/internal/connector/pingfederate/resources/pingfederate_oauth_client.go index 93390a07..ce364a4e 100644 --- a/internal/connector/pingfederate/resources/pingfederate_oauth_client.go +++ b/internal/connector/pingfederate/resources/pingfederate_oauth_client.go @@ -37,7 +37,7 @@ func (r *PingFederateOAuthClientResource) ExportAll() (*[]connector.ImportBlock, return nil, err } - for oauthClientId, oauthClientName := range *oauthClientData { + for oauthClientId, oauthClientName := range oauthClientData { commentData := map[string]string{ "OAuth Client ID": oauthClientId, "OAuth Client Name": oauthClientName, @@ -57,14 +57,17 @@ func (r *PingFederateOAuthClientResource) ExportAll() (*[]connector.ImportBlock, return &importBlocks, nil } -func (r *PingFederateOAuthClientResource) getOAuthClientData() (*map[string]string, error) { +func (r *PingFederateOAuthClientResource) getOAuthClientData() (map[string]string, error) { oauthClientData := make(map[string]string) clients, response, err := r.clientInfo.ApiClient.OauthClientsAPI.GetOauthClients(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetOauthClients", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetOauthClients", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if clients == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -84,5 +87,5 @@ func (r *PingFederateOAuthClientResource) getOAuthClientData() (*map[string]stri } } - return &oauthClientData, nil + return oauthClientData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_oauth_client_registration_policy.go b/internal/connector/pingfederate/resources/pingfederate_oauth_client_registration_policy.go index 1fa09d58..b69c201f 100644 --- a/internal/connector/pingfederate/resources/pingfederate_oauth_client_registration_policy.go +++ b/internal/connector/pingfederate/resources/pingfederate_oauth_client_registration_policy.go @@ -37,7 +37,7 @@ func (r *PingFederateOAuthClientRegistrationPolicyResource) ExportAll() (*[]conn return nil, err } - for clientRegistrationPolicyId, clientRegistrationPolicyName := range *clientRegistrationPolicyData { + for clientRegistrationPolicyId, clientRegistrationPolicyName := range clientRegistrationPolicyData { commentData := map[string]string{ "OAuth Client Registration Policy ID": clientRegistrationPolicyId, "OAuth Client Registration Policy Name": clientRegistrationPolicyName, @@ -57,14 +57,17 @@ func (r *PingFederateOAuthClientRegistrationPolicyResource) ExportAll() (*[]conn return &importBlocks, nil } -func (r *PingFederateOAuthClientRegistrationPolicyResource) getClientRegistrationPolicyData() (*map[string]string, error) { +func (r *PingFederateOAuthClientRegistrationPolicyResource) getClientRegistrationPolicyData() (map[string]string, error) { clientRegistrationPolicyData := make(map[string]string) clientRegistrationPolicies, response, err := r.clientInfo.ApiClient.OauthClientRegistrationPoliciesAPI.GetDynamicClientRegistrationPolicies(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetDynamicClientRegistrationPolicies", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetDynamicClientRegistrationPolicies", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if clientRegistrationPolicies == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -84,5 +87,5 @@ func (r *PingFederateOAuthClientRegistrationPolicyResource) getClientRegistratio } } - return &clientRegistrationPolicyData, nil + return clientRegistrationPolicyData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_oauth_idp_adapter_mapping.go b/internal/connector/pingfederate/resources/pingfederate_oauth_idp_adapter_mapping.go index 5b0bf769..992530d9 100644 --- a/internal/connector/pingfederate/resources/pingfederate_oauth_idp_adapter_mapping.go +++ b/internal/connector/pingfederate/resources/pingfederate_oauth_idp_adapter_mapping.go @@ -39,7 +39,7 @@ func (r *PingFederateOAuthIdpAdapterMappingResource) ExportAll() (*[]connector.I return nil, err } - for _, idpAdapterMappingId := range *idpAdapterMappingData { + for _, idpAdapterMappingId := range idpAdapterMappingData { commentData := map[string]string{ "OAuth IDP Adapter Mapping ID": idpAdapterMappingId, "Resource Type": r.ResourceType(), @@ -58,14 +58,17 @@ func (r *PingFederateOAuthIdpAdapterMappingResource) ExportAll() (*[]connector.I return &importBlocks, nil } -func (r *PingFederateOAuthIdpAdapterMappingResource) getIdpAdapterMappingData() (*[]string, error) { +func (r *PingFederateOAuthIdpAdapterMappingResource) getIdpAdapterMappingData() ([]string, error) { idpAdapterMappingData := []string{} idpAdapterMappings, response, err := r.clientInfo.ApiClient.OauthIdpAdapterMappingsAPI.GetIdpAdapterMappings(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetIdpAdapterMappings", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetIdpAdapterMappings", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if idpAdapterMappings == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -84,5 +87,5 @@ func (r *PingFederateOAuthIdpAdapterMappingResource) getIdpAdapterMappingData() } } - return &idpAdapterMappingData, nil + return idpAdapterMappingData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_oauth_issuer.go b/internal/connector/pingfederate/resources/pingfederate_oauth_issuer.go index 5b99c889..e71d5c4b 100644 --- a/internal/connector/pingfederate/resources/pingfederate_oauth_issuer.go +++ b/internal/connector/pingfederate/resources/pingfederate_oauth_issuer.go @@ -37,7 +37,7 @@ func (r *PingFederateOAuthIssuerResource) ExportAll() (*[]connector.ImportBlock, return nil, err } - for oauthIssuerId, oauthIssuerName := range *oauthIssuerData { + for oauthIssuerId, oauthIssuerName := range oauthIssuerData { commentData := map[string]string{ "OAuth Issuer ID": oauthIssuerId, "OAuth Issuer Name": oauthIssuerName, @@ -57,14 +57,17 @@ func (r *PingFederateOAuthIssuerResource) ExportAll() (*[]connector.ImportBlock, return &importBlocks, nil } -func (r *PingFederateOAuthIssuerResource) getOAuthIssuerData() (*map[string]string, error) { +func (r *PingFederateOAuthIssuerResource) getOAuthIssuerData() (map[string]string, error) { issuerData := make(map[string]string) issuers, response, err := r.clientInfo.ApiClient.OauthIssuersAPI.GetOauthIssuers(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetOauthIssuers", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetOauthIssuers", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if issuers == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -84,5 +87,5 @@ func (r *PingFederateOAuthIssuerResource) getOAuthIssuerData() (*map[string]stri } } - return &issuerData, nil + return issuerData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_oauth_token_exchange_token_generator_mapping.go b/internal/connector/pingfederate/resources/pingfederate_oauth_token_exchange_token_generator_mapping.go index 1bcba128..3b2a01d2 100644 --- a/internal/connector/pingfederate/resources/pingfederate_oauth_token_exchange_token_generator_mapping.go +++ b/internal/connector/pingfederate/resources/pingfederate_oauth_token_exchange_token_generator_mapping.go @@ -39,7 +39,7 @@ func (r *PingFederateOAuthTokenExchangeTokenGeneratorMappingResource) ExportAll( return nil, err } - for mappingId, mappingInfo := range *processorPolicyToGeneratorMappingData { + for mappingId, mappingInfo := range processorPolicyToGeneratorMappingData { sourceId := mappingInfo[0] targetId := mappingInfo[1] @@ -63,14 +63,17 @@ func (r *PingFederateOAuthTokenExchangeTokenGeneratorMappingResource) ExportAll( return &importBlocks, nil } -func (r *PingFederateOAuthTokenExchangeTokenGeneratorMappingResource) getProcessorPolicyToGeneratorMappingData() (*map[string][]string, error) { +func (r *PingFederateOAuthTokenExchangeTokenGeneratorMappingResource) getProcessorPolicyToGeneratorMappingData() (map[string][]string, error) { processorPolicyToGeneratorMappingData := make(map[string][]string) processorPolicyToGeneratorMappings, response, err := r.clientInfo.ApiClient.OauthTokenExchangeTokenGeneratorMappingsAPI.GetTokenGeneratorMappings(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetTokenGeneratorMappings", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetTokenGeneratorMappings", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if processorPolicyToGeneratorMappings == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -91,5 +94,5 @@ func (r *PingFederateOAuthTokenExchangeTokenGeneratorMappingResource) getProcess } } - return &processorPolicyToGeneratorMappingData, nil + return processorPolicyToGeneratorMappingData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_openid_connect_policy.go b/internal/connector/pingfederate/resources/pingfederate_openid_connect_policy.go index b4855664..5ba764bd 100644 --- a/internal/connector/pingfederate/resources/pingfederate_openid_connect_policy.go +++ b/internal/connector/pingfederate/resources/pingfederate_openid_connect_policy.go @@ -37,7 +37,7 @@ func (r *PingFederateOpenIDConnectPolicyResource) ExportAll() (*[]connector.Impo return nil, err } - for oidcPolicyId, oidcPolicyName := range *oidcPolicyData { + for oidcPolicyId, oidcPolicyName := range oidcPolicyData { commentData := map[string]string{ "OpenID Connect Policy ID": oidcPolicyId, "OpenID Connect Policy Name": oidcPolicyName, @@ -57,14 +57,17 @@ func (r *PingFederateOpenIDConnectPolicyResource) ExportAll() (*[]connector.Impo return &importBlocks, nil } -func (r *PingFederateOpenIDConnectPolicyResource) getOIDCPolicyData() (*map[string]string, error) { +func (r *PingFederateOpenIDConnectPolicyResource) getOIDCPolicyData() (map[string]string, error) { oidcPolicyData := make(map[string]string) oidcPolicies, response, err := r.clientInfo.ApiClient.OauthOpenIdConnectAPI.GetOIDCPolicies(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetOIDCPolicies", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetOIDCPolicies", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if oidcPolicies == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -84,5 +87,5 @@ func (r *PingFederateOpenIDConnectPolicyResource) getOIDCPolicyData() (*map[stri } } - return &oidcPolicyData, nil + return oidcPolicyData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_password_credential_validator.go b/internal/connector/pingfederate/resources/pingfederate_password_credential_validator.go index 806841e1..6f1ec62f 100644 --- a/internal/connector/pingfederate/resources/pingfederate_password_credential_validator.go +++ b/internal/connector/pingfederate/resources/pingfederate_password_credential_validator.go @@ -37,7 +37,7 @@ func (r *PingFederatePasswordCredentialValidatorResource) ExportAll() (*[]connec return nil, err } - for passwordCredentialValidatorId, passwordCredentialValidatorName := range *passwordCredentialValidatorData { + for passwordCredentialValidatorId, passwordCredentialValidatorName := range passwordCredentialValidatorData { commentData := map[string]string{ "Password Credential Validator ID": passwordCredentialValidatorId, "Password Credential Validator Name": passwordCredentialValidatorName, @@ -57,14 +57,17 @@ func (r *PingFederatePasswordCredentialValidatorResource) ExportAll() (*[]connec return &importBlocks, nil } -func (r *PingFederatePasswordCredentialValidatorResource) getPasswordCredentialValidatorData() (*map[string]string, error) { +func (r *PingFederatePasswordCredentialValidatorResource) getPasswordCredentialValidatorData() (map[string]string, error) { passwordCredentialValidatorData := make(map[string]string) passwordCredentialValidators, response, err := r.clientInfo.ApiClient.PasswordCredentialValidatorsAPI.GetPasswordCredentialValidators(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetPasswordCredentialValidators", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetPasswordCredentialValidators", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if passwordCredentialValidators == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -84,5 +87,5 @@ func (r *PingFederatePasswordCredentialValidatorResource) getPasswordCredentialV } } - return &passwordCredentialValidatorData, nil + return passwordCredentialValidatorData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_pingone_connection.go b/internal/connector/pingfederate/resources/pingfederate_pingone_connection.go index b88888eb..60456858 100644 --- a/internal/connector/pingfederate/resources/pingfederate_pingone_connection.go +++ b/internal/connector/pingfederate/resources/pingfederate_pingone_connection.go @@ -37,7 +37,7 @@ func (r *PingFederatePingOneConnectionResource) ExportAll() (*[]connector.Import return nil, err } - for pingoneConnectionId, pingoneConnectionName := range *pingoneConnectionData { + for pingoneConnectionId, pingoneConnectionName := range pingoneConnectionData { commentData := map[string]string{ "PingOne Connection ID": pingoneConnectionId, "PingOne Connection Name": pingoneConnectionName, @@ -57,14 +57,17 @@ func (r *PingFederatePingOneConnectionResource) ExportAll() (*[]connector.Import return &importBlocks, nil } -func (r *PingFederatePingOneConnectionResource) getPingOneConnectionData() (*map[string]string, error) { +func (r *PingFederatePingOneConnectionResource) getPingOneConnectionData() (map[string]string, error) { pingoneConnectionData := make(map[string]string) pingoneConnections, response, err := r.clientInfo.ApiClient.PingOneConnectionsAPI.GetPingOneConnections(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetPingOneConnections", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetPingOneConnections", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if pingoneConnections == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -84,5 +87,5 @@ func (r *PingFederatePingOneConnectionResource) getPingOneConnectionData() (*map } } - return &pingoneConnectionData, nil + return pingoneConnectionData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_secret_manager.go b/internal/connector/pingfederate/resources/pingfederate_secret_manager.go index cc3d630b..5c86f73d 100644 --- a/internal/connector/pingfederate/resources/pingfederate_secret_manager.go +++ b/internal/connector/pingfederate/resources/pingfederate_secret_manager.go @@ -37,7 +37,7 @@ func (r *PingFederateSecretManagerResource) ExportAll() (*[]connector.ImportBloc return nil, err } - for secretManagerId, secretManagerName := range *secretManagerData { + for secretManagerId, secretManagerName := range secretManagerData { commentData := map[string]string{ "Resource Type": r.ResourceType(), "Secret Manager ID": secretManagerId, @@ -57,14 +57,17 @@ func (r *PingFederateSecretManagerResource) ExportAll() (*[]connector.ImportBloc return &importBlocks, nil } -func (r *PingFederateSecretManagerResource) getSecretManagerData() (*map[string]string, error) { +func (r *PingFederateSecretManagerResource) getSecretManagerData() (map[string]string, error) { secretManagerData := make(map[string]string) secretManagers, response, err := r.clientInfo.ApiClient.SecretManagersAPI.GetSecretManagers(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetSecretManagers", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetSecretManagers", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if secretManagers == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -84,5 +87,5 @@ func (r *PingFederateSecretManagerResource) getSecretManagerData() (*map[string] } } - return &secretManagerData, nil + return secretManagerData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_server_settings_ws_trust_sts_settings_issuer_certificate.go b/internal/connector/pingfederate/resources/pingfederate_server_settings_ws_trust_sts_settings_issuer_certificate.go index 47a3eb2a..ba952a50 100644 --- a/internal/connector/pingfederate/resources/pingfederate_server_settings_ws_trust_sts_settings_issuer_certificate.go +++ b/internal/connector/pingfederate/resources/pingfederate_server_settings_ws_trust_sts_settings_issuer_certificate.go @@ -39,7 +39,7 @@ func (r *PingFederateServerSettingsWsTrustStsSettingsIssuerCertificateResource) return nil, err } - for issuerCertId, issuerCertInfo := range *issuerCertsData { + for issuerCertId, issuerCertInfo := range issuerCertsData { issuerCertDN := issuerCertInfo[0] issuerCertSerialNumber := issuerCertInfo[1] @@ -63,14 +63,17 @@ func (r *PingFederateServerSettingsWsTrustStsSettingsIssuerCertificateResource) return &importBlocks, nil } -func (r *PingFederateServerSettingsWsTrustStsSettingsIssuerCertificateResource) getIssuerCertsData() (*map[string][]string, error) { +func (r *PingFederateServerSettingsWsTrustStsSettingsIssuerCertificateResource) getIssuerCertsData() (map[string][]string, error) { issuerCertsData := make(map[string][]string) issuerCerts, response, err := r.clientInfo.ApiClient.ServerSettingsAPI.GetCerts(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetCerts", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetCerts", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if issuerCerts == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -95,5 +98,5 @@ func (r *PingFederateServerSettingsWsTrustStsSettingsIssuerCertificateResource) } } - return &issuerCertsData, nil + return issuerCertsData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_session_authentication_policy.go b/internal/connector/pingfederate/resources/pingfederate_session_authentication_policy.go index 6203b8e0..20a6dafd 100644 --- a/internal/connector/pingfederate/resources/pingfederate_session_authentication_policy.go +++ b/internal/connector/pingfederate/resources/pingfederate_session_authentication_policy.go @@ -39,7 +39,7 @@ func (r *PingFederateSessionAuthenticationPolicyResource) ExportAll() (*[]connec return nil, err } - for policyId, policyInfo := range *authenticationSessionPolicyData { + for policyId, policyInfo := range authenticationSessionPolicyData { authSourceType := policyInfo[0] authSourceRefId := policyInfo[1] @@ -63,14 +63,17 @@ func (r *PingFederateSessionAuthenticationPolicyResource) ExportAll() (*[]connec return &importBlocks, nil } -func (r *PingFederateSessionAuthenticationPolicyResource) getAuthenticationSessionPolicyData() (*map[string][]string, error) { +func (r *PingFederateSessionAuthenticationPolicyResource) getAuthenticationSessionPolicyData() (map[string][]string, error) { authenticationSessionPolicyData := make(map[string][]string) authenticationSessionPolicies, response, err := r.clientInfo.ApiClient.SessionAPI.GetSourcePolicies(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetSourcePolicies", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetSourcePolicies", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if authenticationSessionPolicies == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -99,5 +102,5 @@ func (r *PingFederateSessionAuthenticationPolicyResource) getAuthenticationSessi } } - return &authenticationSessionPolicyData, nil + return authenticationSessionPolicyData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_sp_adapter.go b/internal/connector/pingfederate/resources/pingfederate_sp_adapter.go index 09a21a7e..0c28d70f 100644 --- a/internal/connector/pingfederate/resources/pingfederate_sp_adapter.go +++ b/internal/connector/pingfederate/resources/pingfederate_sp_adapter.go @@ -37,7 +37,7 @@ func (r *PingFederateSpAdapterResource) ExportAll() (*[]connector.ImportBlock, e return nil, err } - for spAdapterId, spAdapterName := range *spAdaptersData { + for spAdapterId, spAdapterName := range spAdaptersData { commentData := map[string]string{ "Resource Type": r.ResourceType(), "SP Adapter ID": spAdapterId, @@ -57,14 +57,17 @@ func (r *PingFederateSpAdapterResource) ExportAll() (*[]connector.ImportBlock, e return &importBlocks, nil } -func (r *PingFederateSpAdapterResource) getSpAdaptersData() (*map[string]string, error) { +func (r *PingFederateSpAdapterResource) getSpAdaptersData() (map[string]string, error) { spAdaptersData := make(map[string]string) spAdapters, response, err := r.clientInfo.ApiClient.SpAdaptersAPI.GetSpAdapters(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetSpAdapters", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetSpAdapters", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if spAdapters == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -84,5 +87,5 @@ func (r *PingFederateSpAdapterResource) getSpAdaptersData() (*map[string]string, } } - return &spAdaptersData, nil + return spAdaptersData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_sp_authentication_policy_contract_mapping.go b/internal/connector/pingfederate/resources/pingfederate_sp_authentication_policy_contract_mapping.go index dc39afce..7b441384 100644 --- a/internal/connector/pingfederate/resources/pingfederate_sp_authentication_policy_contract_mapping.go +++ b/internal/connector/pingfederate/resources/pingfederate_sp_authentication_policy_contract_mapping.go @@ -39,7 +39,7 @@ func (r *PingFederateSPAuthenticationPolicyContractMappingResource) ExportAll() return nil, err } - for apcToSpAdapterMappingId, apcToSpAdapterMappingInfo := range *apcToSpAdapterMappingData { + for apcToSpAdapterMappingId, apcToSpAdapterMappingInfo := range apcToSpAdapterMappingData { apcToSpAdapterMappingSourceID := apcToSpAdapterMappingInfo[0] apcToSpAdapterMappingTargetID := apcToSpAdapterMappingInfo[1] @@ -63,14 +63,17 @@ func (r *PingFederateSPAuthenticationPolicyContractMappingResource) ExportAll() return &importBlocks, nil } -func (r *PingFederateSPAuthenticationPolicyContractMappingResource) getApcToSpAdapterMappingData() (*map[string][]string, error) { +func (r *PingFederateSPAuthenticationPolicyContractMappingResource) getApcToSpAdapterMappingData() (map[string][]string, error) { apcToSpAdapterMappingData := make(map[string][]string) apcToSpAdapterMappings, response, err := r.clientInfo.ApiClient.SpAuthenticationPolicyContractMappingsAPI.GetApcToSpAdapterMappings(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetApcToSpAdapterMappings", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetApcToSpAdapterMappings", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if apcToSpAdapterMappings == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -91,5 +94,5 @@ func (r *PingFederateSPAuthenticationPolicyContractMappingResource) getApcToSpAd } } - return &apcToSpAdapterMappingData, nil + return apcToSpAdapterMappingData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_sp_idp_connection.go b/internal/connector/pingfederate/resources/pingfederate_sp_idp_connection.go index dc277678..0150b0a2 100644 --- a/internal/connector/pingfederate/resources/pingfederate_sp_idp_connection.go +++ b/internal/connector/pingfederate/resources/pingfederate_sp_idp_connection.go @@ -37,7 +37,7 @@ func (r *PingFederateSpIdpConnectionResource) ExportAll() (*[]connector.ImportBl return nil, err } - for idpConnectionId, idpConnectionName := range *idpConnectionData { + for idpConnectionId, idpConnectionName := range idpConnectionData { commentData := map[string]string{ "Resource Type": r.ResourceType(), "SP IDP Connection ID": idpConnectionId, @@ -57,14 +57,17 @@ func (r *PingFederateSpIdpConnectionResource) ExportAll() (*[]connector.ImportBl return &importBlocks, nil } -func (r *PingFederateSpIdpConnectionResource) getIdpConnectionData() (*map[string]string, error) { +func (r *PingFederateSpIdpConnectionResource) getIdpConnectionData() (map[string]string, error) { idpConnectionData := make(map[string]string) idpConnections, response, err := r.clientInfo.ApiClient.SpIdpConnectionsAPI.GetConnections(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetConnections", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetConnections", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if idpConnections == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -84,5 +87,5 @@ func (r *PingFederateSpIdpConnectionResource) getIdpConnectionData() (*map[strin } } - return &idpConnectionData, nil + return idpConnectionData, nil } diff --git a/internal/connector/pingfederate/resources/pingfederate_token_processor_to_token_generator_mapping.go b/internal/connector/pingfederate/resources/pingfederate_token_processor_to_token_generator_mapping.go index 1371598f..320c4912 100644 --- a/internal/connector/pingfederate/resources/pingfederate_token_processor_to_token_generator_mapping.go +++ b/internal/connector/pingfederate/resources/pingfederate_token_processor_to_token_generator_mapping.go @@ -39,7 +39,7 @@ func (r *PingFederateTokenProcessorToTokenGeneratorMappingResource) ExportAll() return nil, err } - for tokenToTokenMappingId, tokenToTokenMappingInfo := range *tokenToTokenMappingsData { + for tokenToTokenMappingId, tokenToTokenMappingInfo := range tokenToTokenMappingsData { tokenToTokenMappingSourceId := tokenToTokenMappingInfo[0] tokenToTokenMappingTargetId := tokenToTokenMappingInfo[1] @@ -63,14 +63,17 @@ func (r *PingFederateTokenProcessorToTokenGeneratorMappingResource) ExportAll() return &importBlocks, nil } -func (r *PingFederateTokenProcessorToTokenGeneratorMappingResource) getTokenToTokenMappingsData() (*map[string][]string, error) { +func (r *PingFederateTokenProcessorToTokenGeneratorMappingResource) getTokenToTokenMappingsData() (map[string][]string, error) { tokenToTokenMappingsData := make(map[string][]string) tokenToTokenMappings, response, err := r.clientInfo.ApiClient.TokenProcessorToTokenGeneratorMappingsAPI.GetTokenToTokenMappings(r.clientInfo.Context).Execute() - err = common.HandleClientResponse(response, err, "GetTokenToTokenMappings", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetTokenToTokenMappings", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if tokenToTokenMappings == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -91,5 +94,5 @@ func (r *PingFederateTokenProcessorToTokenGeneratorMappingResource) getTokenToTo } } - return &tokenToTokenMappingsData, nil + return tokenToTokenMappingsData, nil } diff --git a/internal/connector/pingone/common.go b/internal/connector/pingone/common.go new file mode 100644 index 00000000..122a7e63 --- /dev/null +++ b/internal/connector/pingone/common.go @@ -0,0 +1,164 @@ +package pingone + +import ( + "fmt" + "net/http" + "reflect" + + "github.com/patrickcping/pingone-go-sdk-v2/management" + "github.com/patrickcping/pingone-go-sdk-v2/mfa" + "github.com/patrickcping/pingone-go-sdk-v2/risk" + "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/output" +) + +func CheckSingletonResource(response *http.Response, err error, apiFuncName, resourceType string) (bool, error) { + ok, err := common.HandleClientResponse(response, err, apiFuncName, resourceType) + if err != nil { + return false, err + } + if !ok { + return false, nil + } + + if response.StatusCode == 204 { + output.Warn("API client 204 No Content response.", map[string]interface{}{ + "API Function Name": apiFuncName, + "Resource Type": resourceType, + "Response Code": response.Status, + "Response Body": response.Body, + }) + return false, nil + } + + return true, nil +} + +func GetManagementAPIObjectsFromIterator[T any](iter management.EntityArrayPagedIterator, clientFuncName, extractionFuncName, resourceType string) ([]T, error) { + apiObjects := []T{} + + for cursor, err := range iter { + ok, err := common.HandleClientResponse(cursor.HTTPResponse, err, clientFuncName, resourceType) + if err != nil { + return nil, err + } + // A warning was given when handling the client response. Return nil apiObjects to skip export of resource + if !ok { + return nil, nil + } + + nilErr := common.DataNilError(resourceType, cursor.HTTPResponse) + + if cursor.EntityArray == nil { + return nil, nilErr + } + + embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() + if !embeddedOk { + return nil, nilErr + } + + apiObject, err := getAPIObjectFromEmbedded[T](reflect.ValueOf(embedded), extractionFuncName, resourceType) + if err != nil { + output.SystemError(err.Error(), nil) + } + + apiObjects = append(apiObjects, apiObject...) + } + + return apiObjects, nil +} + +func GetMfaAPIObjectsFromIterator[T any](iter mfa.EntityArrayPagedIterator, clientFuncName, extractionFuncName, resourceType string) ([]T, error) { + apiObjects := []T{} + + for cursor, err := range iter { + ok, err := common.HandleClientResponse(cursor.HTTPResponse, err, clientFuncName, resourceType) + if err != nil { + return nil, err + } + // A warning was given when handling the client response. Return nil apiObjects to skip export of resource + if !ok { + return nil, nil + } + + nilErr := common.DataNilError(resourceType, cursor.HTTPResponse) + + if cursor.EntityArray == nil { + return nil, nilErr + } + + embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() + if !embeddedOk { + return nil, nilErr + } + + apiObject, err := getAPIObjectFromEmbedded[T](reflect.ValueOf(embedded), extractionFuncName, resourceType) + if err != nil { + output.SystemError(err.Error(), nil) + } + + apiObjects = append(apiObjects, apiObject...) + } + + return apiObjects, nil +} + +func GetRiskAPIObjectsFromIterator[T any](iter risk.EntityArrayPagedIterator, clientFuncName, extractionFuncName, resourceType string) ([]T, error) { + apiObjects := []T{} + + for cursor, err := range iter { + ok, err := common.HandleClientResponse(cursor.HTTPResponse, err, clientFuncName, resourceType) + if err != nil { + return nil, err + } + // A warning was given when handling the client response. Return nil apiObjects to skip export of resource + if !ok { + return nil, nil + } + + nilErr := common.DataNilError(resourceType, cursor.HTTPResponse) + + if cursor.EntityArray == nil { + return nil, nilErr + } + + embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() + if !embeddedOk { + return nil, nilErr + } + + apiObject, err := getAPIObjectFromEmbedded[T](reflect.ValueOf(embedded), extractionFuncName, resourceType) + if err != nil { + output.SystemError(err.Error(), nil) + } + + apiObjects = append(apiObjects, apiObject...) + } + + return apiObjects, nil +} + +func getAPIObjectFromEmbedded[T any](embedded reflect.Value, extractionFuncName, resourceType string) ([]T, error) { + embeddedExtractionFunc := embedded.MethodByName(extractionFuncName) + if !embeddedExtractionFunc.IsValid() { + return nil, fmt.Errorf("failed to find extraction function '%s' for resource '%s'", extractionFuncName, resourceType) + } + + reflectValues := embeddedExtractionFunc.Call(nil) + if len(reflectValues) == 0 { + return nil, fmt.Errorf("failed to get reflect value from embedded. embedded is empty") + } + + rInterface := reflectValues[0].Interface() + if rInterface == nil { + return []T{}, nil + } + + apiObject, apiObjectOk := rInterface.([]T) + if !apiObjectOk { + return nil, fmt.Errorf("failed to cast reflect value to %s", resourceType) + } + + return apiObject, nil +} diff --git a/internal/connector/pingone/mfa/resources/pingone_mfa_application_push_credential.go b/internal/connector/pingone/mfa/resources/pingone_mfa_application_push_credential.go index 0e39440e..bcd10ebc 100644 --- a/internal/connector/pingone/mfa/resources/pingone_mfa_application_push_credential.go +++ b/internal/connector/pingone/mfa/resources/pingone_mfa_application_push_credential.go @@ -4,8 +4,10 @@ import ( "fmt" "github.com/patrickcping/pingone-go-sdk-v2/management" + "github.com/patrickcping/pingone-go-sdk-v2/mfa" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -35,18 +37,18 @@ func (r *PingOneMFAApplicationPushCredentialResource) ExportAll() (*[]connector. importBlocks := []connector.ImportBlock{} - appData, err := r.getApplicationData() + applicationData, err := r.getOIDCApplicationData() if err != nil { return nil, err } - for appId, appName := range *appData { + for appId, appName := range applicationData { pushCredData, err := r.getPushCredentialData(appId) if err != nil { return nil, err } - for pushCredId, pushCredType := range *pushCredData { + for pushCredId, pushCredType := range pushCredData { commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, "MFA Application Push Credential ID": pushCredId, @@ -70,75 +72,50 @@ func (r *PingOneMFAApplicationPushCredentialResource) ExportAll() (*[]connector. return &importBlocks, nil } -func (r *PingOneMFAApplicationPushCredentialResource) getApplicationData() (*map[string]string, error) { - appData := make(map[string]string) +func (r *PingOneMFAApplicationPushCredentialResource) getOIDCApplicationData() (map[string]string, error) { + applicationData := make(map[string]string) - // Fetch all pingone_application resources that could have pingone_mfa_application_push_credentials iter := r.clientInfo.ApiClient.ManagementAPIClient.ApplicationsApi.ReadAllApplications(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + applications, err := pingone.GetManagementAPIObjectsFromIterator[management.ReadOneApplication200Response](iter, "ReadAllApplications", "GetApplications", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllApplications", "pingone_application") - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } + for _, application := range applications { + // MFa application push credentials are only for OIDC Native Apps + if application.ApplicationOIDC != nil { + applicationId, applicationIdOk := application.ApplicationOIDC.GetIdOk() + applicationName, applicationNameOk := application.ApplicationOIDC.GetNameOk() + applicationType, applicationTypeOk := application.ApplicationOIDC.GetTypeOk() - for _, app := range embedded.GetApplications() { - // MFa application push credentials are only for OIDC Native Apps - if app.ApplicationOIDC != nil { - appId, appIdOk := app.ApplicationOIDC.GetIdOk() - appName, appNameOk := app.ApplicationOIDC.GetNameOk() - appType, appTypeOk := app.ApplicationOIDC.GetTypeOk() - - if appIdOk && appNameOk && appTypeOk { - if *appType == management.ENUMAPPLICATIONTYPE_NATIVE_APP { - appData[*appId] = *appName - } + if applicationIdOk && applicationNameOk && applicationTypeOk { + if *applicationType == management.ENUMAPPLICATIONTYPE_NATIVE_APP { + applicationData[*applicationId] = *applicationName } } } } - return &appData, nil + return applicationData, nil } -func (r *PingOneMFAApplicationPushCredentialResource) getPushCredentialData(appId string) (*map[string]string, error) { - pushCredData := make(map[string]string) - - iter := r.clientInfo.ApiClient.MFAAPIClient.ApplicationsApplicationMFAPushCredentialsApi.ReadAllMFAPushCredentials(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID, appId).Execute() +func (r *PingOneMFAApplicationPushCredentialResource) getPushCredentialData(applicationId string) (map[string]string, error) { + mfaPushCredentialData := make(map[string]string) - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllMFAPushCredentials", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } + iter := r.clientInfo.ApiClient.MFAAPIClient.ApplicationsApplicationMFAPushCredentialsApi.ReadAllMFAPushCredentials(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID, applicationId).Execute() + mfaPushCredentials, err := pingone.GetMfaAPIObjectsFromIterator[mfa.MFAPushCredentialResponse](iter, "ReadAllMFAPushCredentials", "GetPushCredentials", r.ResourceType()) + if err != nil { + return nil, err + } - for _, pushCred := range embedded.GetPushCredentials() { - pushCredId, pushCredIdOk := pushCred.GetIdOk() - pushCredType, pushCredTypeOk := pushCred.GetTypeOk() + for _, mfaPushCredential := range mfaPushCredentials { + mfaPushCredentialId, mfaPushCredentialIdOk := mfaPushCredential.GetIdOk() + mfaPushCredentialType, mfaPushCredentialTypeOk := mfaPushCredential.GetTypeOk() - if pushCredIdOk && pushCredTypeOk { - pushCredData[*pushCredId] = string(*pushCredType) - } + if mfaPushCredentialIdOk && mfaPushCredentialTypeOk { + mfaPushCredentialData[*mfaPushCredentialId] = string(*mfaPushCredentialType) } } - return &pushCredData, nil + return mfaPushCredentialData, nil } diff --git a/internal/connector/pingone/mfa/resources/pingone_mfa_device_policy.go b/internal/connector/pingone/mfa/resources/pingone_mfa_device_policy.go index 19088299..85a9fe7d 100644 --- a/internal/connector/pingone/mfa/resources/pingone_mfa_device_policy.go +++ b/internal/connector/pingone/mfa/resources/pingone_mfa_device_policy.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/mfa" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,7 +41,7 @@ func (r *PingOneMFADevicePolicyResource) ExportAll() (*[]connector.ImportBlock, return nil, err } - for devicePolicyId, devicePolicyName := range *deviceAuthPolicyData { + for devicePolicyId, devicePolicyName := range deviceAuthPolicyData { commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, "MFA Device Policy ID": devicePolicyId, @@ -60,35 +62,23 @@ func (r *PingOneMFADevicePolicyResource) ExportAll() (*[]connector.ImportBlock, return &importBlocks, nil } -func (r *PingOneMFADevicePolicyResource) getDeviceAuthPolicyData() (*map[string]string, error) { +func (r *PingOneMFADevicePolicyResource) getDeviceAuthPolicyData() (map[string]string, error) { deviceAuthPolicyData := make(map[string]string) iter := r.clientInfo.ApiClient.MFAAPIClient.DeviceAuthenticationPolicyApi.ReadDeviceAuthenticationPolicies(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + deviceAuthPolicies, err := pingone.GetMfaAPIObjectsFromIterator[mfa.DeviceAuthenticationPolicy](iter, "ReadDeviceAuthenticationPolicies", "GetDeviceAuthenticationPolicies", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadDeviceAuthenticationPolicies", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, devicePolicy := range embedded.GetDeviceAuthenticationPolicies() { - devicePolicyId, devicePolicyIdOk := devicePolicy.GetIdOk() - devicePolicyName, devicePolicyNameOk := devicePolicy.GetNameOk() + for _, devicePolicy := range deviceAuthPolicies { + devicePolicyId, devicePolicyIdOk := devicePolicy.GetIdOk() + devicePolicyName, devicePolicyNameOk := devicePolicy.GetNameOk() - if devicePolicyIdOk && devicePolicyNameOk { - deviceAuthPolicyData[*devicePolicyId] = *devicePolicyName - } + if devicePolicyIdOk && devicePolicyNameOk { + deviceAuthPolicyData[*devicePolicyId] = *devicePolicyName } } - return &deviceAuthPolicyData, nil + return deviceAuthPolicyData, nil } diff --git a/internal/connector/pingone/mfa/resources/pingone_mfa_fido2_policy.go b/internal/connector/pingone/mfa/resources/pingone_mfa_fido2_policy.go index 2b0b47b2..23148310 100644 --- a/internal/connector/pingone/mfa/resources/pingone_mfa_fido2_policy.go +++ b/internal/connector/pingone/mfa/resources/pingone_mfa_fido2_policy.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/mfa" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,7 +41,7 @@ func (r *PingOneMFAFido2PolicyResource) ExportAll() (*[]connector.ImportBlock, e return nil, err } - for fido2PolicyId, fido2PolicyName := range *fido2PolicyData { + for fido2PolicyId, fido2PolicyName := range fido2PolicyData { commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, "FIDO2 Policy ID": fido2PolicyId, @@ -60,35 +62,23 @@ func (r *PingOneMFAFido2PolicyResource) ExportAll() (*[]connector.ImportBlock, e return &importBlocks, nil } -func (r *PingOneMFAFido2PolicyResource) getFido2PolicyData() (*map[string]string, error) { +func (r *PingOneMFAFido2PolicyResource) getFido2PolicyData() (map[string]string, error) { fido2PolicyData := make(map[string]string) iter := r.clientInfo.ApiClient.MFAAPIClient.FIDO2PolicyApi.ReadFIDO2Policies(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + fido2Policies, err := pingone.GetMfaAPIObjectsFromIterator[mfa.FIDO2Policy](iter, "ReadFIDO2Policies", "GetFido2Policies", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadFIDO2Policies", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, fido2Policy := range embedded.GetFido2Policies() { - fido2PolicyId, fido2PolicyIdOk := fido2Policy.GetIdOk() - fido2PolicyName, fido2PolicyNameOk := fido2Policy.GetNameOk() + for _, fido2Policy := range fido2Policies { + fido2PolicyId, fido2PolicyIdOk := fido2Policy.GetIdOk() + fido2PolicyName, fido2PolicyNameOk := fido2Policy.GetNameOk() - if fido2PolicyIdOk && fido2PolicyNameOk { - fido2PolicyData[*fido2PolicyId] = *fido2PolicyName - } + if fido2PolicyIdOk && fido2PolicyNameOk { + fido2PolicyData[*fido2PolicyId] = *fido2PolicyName } } - return &fido2PolicyData, nil + return fido2PolicyData, nil } diff --git a/internal/connector/pingone/mfa/resources/pingone_mfa_settings.go b/internal/connector/pingone/mfa/resources/pingone_mfa_settings.go index 7218c35d..a1c654ca 100644 --- a/internal/connector/pingone/mfa/resources/pingone_mfa_settings.go +++ b/internal/connector/pingone/mfa/resources/pingone_mfa_settings.go @@ -3,6 +3,7 @@ package resources import ( "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -32,10 +33,13 @@ func (r *PingOneMFASettingsResource) ExportAll() (*[]connector.ImportBlock, erro importBlocks := []connector.ImportBlock{} - err := r.checkMFASettingsData() + ok, err := r.checkMFASettingsData() if err != nil { return nil, err } + if !ok { + return &importBlocks, nil + } commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, @@ -54,16 +58,7 @@ func (r *PingOneMFASettingsResource) ExportAll() (*[]connector.ImportBlock, erro return &importBlocks, nil } -func (r *PingOneMFASettingsResource) checkMFASettingsData() error { +func (r *PingOneMFASettingsResource) checkMFASettingsData() (bool, error) { _, response, err := r.clientInfo.ApiClient.MFAAPIClient.MFASettingsApi.ReadMFASettings(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() - err = common.HandleClientResponse(response, err, "ReadMFASettings", r.ResourceType()) - if err != nil { - return err - } - - if response.StatusCode == 204 { - return common.DataNilError(r.ResourceType(), response) - } - - return nil + return pingone.CheckSingletonResource(response, err, "ReadMFASettings", r.ResourceType()) } diff --git a/internal/connector/pingone/platform/resources/pingone_agreement.go b/internal/connector/pingone/platform/resources/pingone_agreement.go index bee948ef..7f021327 100644 --- a/internal/connector/pingone/platform/resources/pingone_agreement.go +++ b/internal/connector/pingone/platform/resources/pingone_agreement.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,7 +41,7 @@ func (r *PingOneAgreementResource) ExportAll() (*[]connector.ImportBlock, error) return nil, err } - for agreementId, agreementName := range *agreementData { + for agreementId, agreementName := range agreementData { commentData := map[string]string{ "Agreement ID": agreementId, "Agreement Name": agreementName, @@ -60,35 +62,23 @@ func (r *PingOneAgreementResource) ExportAll() (*[]connector.ImportBlock, error) return &importBlocks, nil } -func (r *PingOneAgreementResource) getAgreementData() (*map[string]string, error) { +func (r *PingOneAgreementResource) getAgreementData() (map[string]string, error) { agreementData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.AgreementsResourcesApi.ReadAllAgreements(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + agreements, err := pingone.GetManagementAPIObjectsFromIterator[management.Agreement](iter, "ReadAllAgreements", "GetAgreements", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllAgreements", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, agreement := range embedded.GetAgreements() { - agreementId, agreementIdOk := agreement.GetIdOk() - agreementName, agreementNameOk := agreement.GetNameOk() + for _, agreement := range agreements { + agreementId, agreementIdOk := agreement.GetIdOk() + agreementName, agreementNameOk := agreement.GetNameOk() - if agreementIdOk && agreementNameOk { - agreementData[*agreementId] = *agreementName - } + if agreementIdOk && agreementNameOk { + agreementData[*agreementId] = *agreementName } } - return &agreementData, nil + return agreementData, nil } diff --git a/internal/connector/pingone/platform/resources/pingone_agreement_localization.go b/internal/connector/pingone/platform/resources/pingone_agreement_localization.go index 7c5ae9f7..e3f8efdf 100644 --- a/internal/connector/pingone/platform/resources/pingone_agreement_localization.go +++ b/internal/connector/pingone/platform/resources/pingone_agreement_localization.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,26 +41,26 @@ func (r *PingOneAgreementLocalizationResource) ExportAll() (*[]connector.ImportB return nil, err } - for agreementId, agreementName := range *agreementData { - agreementLanguageData, err := r.getAgreementLanguageData(agreementId) + for agreementId, agreementName := range agreementData { + agreementLocalizationData, err := r.getAgreementLocalizationData(agreementId) if err != nil { return nil, err } - for agreementLanguageId, agreementLanguageLocale := range *agreementLanguageData { + for agreementLocalizationId, agreementLocalizationLocale := range agreementLocalizationData { commentData := map[string]string{ - "Agreement ID": agreementId, - "Agreement Language ID": agreementLanguageId, - "Agreement Language Locale": agreementLanguageLocale, - "Agreement Name": agreementName, - "Export Environment ID": r.clientInfo.ExportEnvironmentID, - "Resource Type": r.ResourceType(), + "Agreement ID": agreementId, + "Agreement Name": agreementName, + "Agreement Localization ID": agreementLocalizationId, + "Agreement Localization Locale": agreementLocalizationLocale, + "Export Environment ID": r.clientInfo.ExportEnvironmentID, + "Resource Type": r.ResourceType(), } importBlock := connector.ImportBlock{ ResourceType: r.ResourceType(), - ResourceName: fmt.Sprintf("%s_%s", agreementName, agreementLanguageLocale), - ResourceID: fmt.Sprintf("%s/%s/%s", r.clientInfo.ExportEnvironmentID, agreementId, agreementLanguageId), + ResourceName: fmt.Sprintf("%s_%s", agreementName, agreementLocalizationLocale), + ResourceID: fmt.Sprintf("%s/%s/%s", r.clientInfo.ExportEnvironmentID, agreementId, agreementLocalizationId), CommentInformation: common.GenerateCommentInformation(commentData), } @@ -69,69 +71,46 @@ func (r *PingOneAgreementLocalizationResource) ExportAll() (*[]connector.ImportB return &importBlocks, nil } -func (r *PingOneAgreementLocalizationResource) getAgreementData() (*map[string]string, error) { +func (r *PingOneAgreementLocalizationResource) getAgreementData() (map[string]string, error) { agreementData := make(map[string]string) - iter := r.clientInfo.ApiClient.ManagementAPIClient.AgreementsResourcesApi.ReadAllAgreements(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() - - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllAgreements", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } + iter := r.clientInfo.ApiClient.ManagementAPIClient.AgreementsResourcesApi.ReadAllAgreements(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + agreements, err := pingone.GetManagementAPIObjectsFromIterator[management.Agreement](iter, "ReadAllAgreements", "GetAgreements", r.ResourceType()) + if err != nil { + return nil, err + } - for _, agreement := range embedded.GetAgreements() { - agreementId, agreementIdOk := agreement.GetIdOk() - agreementName, agreementNameOk := agreement.GetNameOk() + for _, agreement := range agreements { + agreementId, agreementIdOk := agreement.GetIdOk() + agreementName, agreementNameOk := agreement.GetNameOk() - if agreementIdOk && agreementNameOk { - agreementData[*agreementId] = *agreementName - } + if agreementIdOk && agreementNameOk { + agreementData[*agreementId] = *agreementName } } - return &agreementData, nil + return agreementData, nil } -func (r *PingOneAgreementLocalizationResource) getAgreementLanguageData(agreementId string) (*map[string]string, error) { - agreementLanguageData := make(map[string]string) +func (r *PingOneAgreementLocalizationResource) getAgreementLocalizationData(agreementId string) (map[string]string, error) { + agreementLocalizationData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.AgreementLanguagesResourcesApi.ReadAllAgreementLanguages(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID, agreementId).Execute() + languageInners, err := pingone.GetManagementAPIObjectsFromIterator[management.EntityArrayEmbeddedLanguagesInner](iter, "ReadAllAgreementLanguages", "GetLanguages", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllAgreementLanguages", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, languageInner := range embedded.GetLanguages() { - if languageInner.AgreementLanguage != nil { - agreementLanguageId, agreementLanguageIdOk := languageInner.AgreementLanguage.GetIdOk() - agreementLanguageLocale, agreementLanguageLocaleOk := languageInner.AgreementLanguage.GetLocaleOk() + for _, languageInner := range languageInners { + if languageInner.AgreementLanguage != nil { + agreementLocalizationId, agreementLocalizationIdOk := languageInner.AgreementLanguage.GetIdOk() + agreementLocalizationLocale, agreementLocalizationLocaleOk := languageInner.AgreementLanguage.GetLocaleOk() - if agreementLanguageIdOk && agreementLanguageLocaleOk { - agreementLanguageData[*agreementLanguageId] = *agreementLanguageLocale - } + if agreementLocalizationIdOk && agreementLocalizationLocaleOk { + agreementLocalizationData[*agreementLocalizationId] = *agreementLocalizationLocale } } } - return &agreementLanguageData, nil + return agreementLocalizationData, nil } diff --git a/internal/connector/pingone/platform/resources/pingone_agreement_localization_revision.go b/internal/connector/pingone/platform/resources/pingone_agreement_localization_revision.go index b16e83f3..1bcb9ab7 100644 --- a/internal/connector/pingone/platform/resources/pingone_agreement_localization_revision.go +++ b/internal/connector/pingone/platform/resources/pingone_agreement_localization_revision.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,33 +41,33 @@ func (r *PingOneAgreementLocalizationRevisionResource) ExportAll() (*[]connector return nil, err } - for agreementId, agreementName := range *agreementData { - agreementLanguageData, err := r.getAgreementLanguageData(agreementId) + for agreementId, agreementName := range agreementData { + agreementLocalizationData, err := r.getAgreementLanguageData(agreementId) if err != nil { return nil, err } - for agreementLanguageId, agreementLanguageLocale := range *agreementLanguageData { - agreementLanguageRevisionData, err := r.getAgreementLanguageRevisionData(agreementId, agreementLanguageId) + for agreementLocalizationId, agreementLocalizationLocale := range agreementLocalizationData { + agreementLocalizationRevisionData, err := r.getAgreementLocalizationRevisionData(agreementId, agreementLocalizationId) if err != nil { return nil, err } - for _, agreementLanguageRevisionId := range *agreementLanguageRevisionData { + for _, agreementLocalizationRevisionId := range agreementLocalizationRevisionData { commentData := map[string]string{ "Agreement ID": agreementId, - "Agreement Language ID": agreementLanguageId, - "Agreement Language Locale": agreementLanguageLocale, - "Agreement Localization Revision ID": agreementLanguageRevisionId, "Agreement Name": agreementName, + "Agreement Localization ID": agreementLocalizationId, + "Agreement Localization Locale": agreementLocalizationLocale, + "Agreement Localization Revision ID": agreementLocalizationRevisionId, "Export Environment ID": r.clientInfo.ExportEnvironmentID, "Resource Type": r.ResourceType(), } importBlock := connector.ImportBlock{ ResourceType: r.ResourceType(), - ResourceName: fmt.Sprintf("%s_%s_%s", agreementName, agreementLanguageLocale, agreementLanguageRevisionId), - ResourceID: fmt.Sprintf("%s/%s/%s/%s", r.clientInfo.ExportEnvironmentID, agreementId, agreementLanguageId, agreementLanguageRevisionId), + ResourceName: fmt.Sprintf("%s_%s_%s", agreementName, agreementLocalizationLocale, agreementLocalizationRevisionId), + ResourceID: fmt.Sprintf("%s/%s/%s/%s", r.clientInfo.ExportEnvironmentID, agreementId, agreementLocalizationId, agreementLocalizationRevisionId), CommentInformation: common.GenerateCommentInformation(commentData), } @@ -77,102 +79,66 @@ func (r *PingOneAgreementLocalizationRevisionResource) ExportAll() (*[]connector return &importBlocks, nil } -func (r *PingOneAgreementLocalizationRevisionResource) getAgreementData() (*map[string]string, error) { +func (r *PingOneAgreementLocalizationRevisionResource) getAgreementData() (map[string]string, error) { agreementData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.AgreementsResourcesApi.ReadAllAgreements(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + agreements, err := pingone.GetManagementAPIObjectsFromIterator[management.Agreement](iter, "ReadAllAgreements", "GetAgreements", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllAgreements", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, agreement := range embedded.GetAgreements() { - agreementId, agreementIdOk := agreement.GetIdOk() - agreementName, agreementNameOk := agreement.GetNameOk() + for _, agreement := range agreements { + agreementId, agreementIdOk := agreement.GetIdOk() + agreementName, agreementNameOk := agreement.GetNameOk() - if agreementIdOk && agreementNameOk { - agreementData[*agreementId] = *agreementName - } + if agreementIdOk && agreementNameOk { + agreementData[*agreementId] = *agreementName } } - return &agreementData, nil + return agreementData, nil } -func (r *PingOneAgreementLocalizationRevisionResource) getAgreementLanguageData(agreementId string) (*map[string]string, error) { +func (r *PingOneAgreementLocalizationRevisionResource) getAgreementLanguageData(agreementId string) (map[string]string, error) { agreementLanguageData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.AgreementLanguagesResourcesApi.ReadAllAgreementLanguages(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID, agreementId).Execute() + languageInners, err := pingone.GetManagementAPIObjectsFromIterator[management.EntityArrayEmbeddedLanguagesInner](iter, "ReadAllAgreementLanguages", "GetLanguages", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllAgreementLanguages", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, languageInner := range embedded.GetLanguages() { - if languageInner.AgreementLanguage != nil { - agreementLanguageLocale, agreementLanguageLocaleOk := languageInner.AgreementLanguage.GetLocaleOk() - agreementLanguageId, agreementLanguageIdOk := languageInner.AgreementLanguage.GetIdOk() + for _, languageInner := range languageInners { + if languageInner.AgreementLanguage != nil { + agreementLanguageLocale, agreementLanguageLocaleOk := languageInner.AgreementLanguage.GetLocaleOk() + agreementLanguageId, agreementLanguageIdOk := languageInner.AgreementLanguage.GetIdOk() - if agreementLanguageLocaleOk && agreementLanguageIdOk { - agreementLanguageData[*agreementLanguageId] = *agreementLanguageLocale - } + if agreementLanguageLocaleOk && agreementLanguageIdOk { + agreementLanguageData[*agreementLanguageId] = *agreementLanguageLocale } } } - return &agreementLanguageData, nil + return agreementLanguageData, nil } -func (r *PingOneAgreementLocalizationRevisionResource) getAgreementLanguageRevisionData(agreementId, agreementLanguageId string) (*[]string, error) { - agreementLanguageRevisionData := []string{} - - iter := r.clientInfo.ApiClient.ManagementAPIClient.AgreementRevisionsResourcesApi.ReadAllAgreementLanguageRevisions(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID, agreementId, agreementLanguageId).Execute() - - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllAgreementLanguageRevisions", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } +func (r *PingOneAgreementLocalizationRevisionResource) getAgreementLocalizationRevisionData(agreementId, agreementLocalizationId string) ([]string, error) { + agreementLocalizationRevisionData := []string{} - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } + iter := r.clientInfo.ApiClient.ManagementAPIClient.AgreementRevisionsResourcesApi.ReadAllAgreementLanguageRevisions(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID, agreementId, agreementLocalizationId).Execute() + agreementLocalizationRevisions, err := pingone.GetManagementAPIObjectsFromIterator[management.AgreementLanguageRevision](iter, "ReadAllAgreementLanguageRevisions", "GetRevisions", r.ResourceType()) + if err != nil { + return nil, err + } - for _, revision := range embedded.GetRevisions() { - agreementLanguageRevisionId, agreementLanguageRevisionIdOk := revision.GetIdOk() + for _, agreementLocalizationRevision := range agreementLocalizationRevisions { + agreementLocalizationRevisionId, agreementLocalizationRevisionIdOk := agreementLocalizationRevision.GetIdOk() - if agreementLanguageRevisionIdOk { - agreementLanguageRevisionData = append(agreementLanguageRevisionData, *agreementLanguageRevisionId) - } + if agreementLocalizationRevisionIdOk { + agreementLocalizationRevisionData = append(agreementLocalizationRevisionData, *agreementLocalizationRevisionId) } } - return &agreementLanguageRevisionData, nil + return agreementLocalizationRevisionData, nil } diff --git a/internal/connector/pingone/platform/resources/pingone_branding_settings.go b/internal/connector/pingone/platform/resources/pingone_branding_settings.go index 9ae6e031..a66264ec 100644 --- a/internal/connector/pingone/platform/resources/pingone_branding_settings.go +++ b/internal/connector/pingone/platform/resources/pingone_branding_settings.go @@ -3,6 +3,7 @@ package resources import ( "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -32,10 +33,13 @@ func (r *PingOneBrandingSettingsResource) ExportAll() (*[]connector.ImportBlock, importBlocks := []connector.ImportBlock{} - err := r.checkBrandingSettingsData() + ok, err := r.checkBrandingSettingsData() if err != nil { return nil, err } + if !ok { + return &importBlocks, nil + } commentData := map[string]string{ "Resource Type": r.ResourceType(), @@ -54,16 +58,7 @@ func (r *PingOneBrandingSettingsResource) ExportAll() (*[]connector.ImportBlock, return &importBlocks, nil } -func (r *PingOneBrandingSettingsResource) checkBrandingSettingsData() error { +func (r *PingOneBrandingSettingsResource) checkBrandingSettingsData() (bool, error) { _, response, err := r.clientInfo.ApiClient.ManagementAPIClient.BrandingSettingsApi.ReadBrandingSettings(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() - err = common.HandleClientResponse(response, err, "ReadBrandingSettings", r.ResourceType()) - if err != nil { - return err - } - - if response.StatusCode == 204 { - return common.DataNilError(r.ResourceType(), response) - } - - return nil + return pingone.CheckSingletonResource(response, err, "ReadBrandingSettings", r.ResourceType()) } diff --git a/internal/connector/pingone/platform/resources/pingone_branding_theme.go b/internal/connector/pingone/platform/resources/pingone_branding_theme.go index 4d3d7e04..1bab57a9 100644 --- a/internal/connector/pingone/platform/resources/pingone_branding_theme.go +++ b/internal/connector/pingone/platform/resources/pingone_branding_theme.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,7 +41,7 @@ func (r *PingOneBrandingThemeResource) ExportAll() (*[]connector.ImportBlock, er return nil, err } - for brandingThemeId, brandingThemeName := range *brandingThemeData { + for brandingThemeId, brandingThemeName := range brandingThemeData { commentData := map[string]string{ "Branding Theme ID": brandingThemeId, "Branding Theme Name": brandingThemeName, @@ -60,39 +62,27 @@ func (r *PingOneBrandingThemeResource) ExportAll() (*[]connector.ImportBlock, er return &importBlocks, nil } -func (r *PingOneBrandingThemeResource) getBrandingThemeData() (*map[string]string, error) { +func (r *PingOneBrandingThemeResource) getBrandingThemeData() (map[string]string, error) { brandingThemeData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.BrandingThemesApi.ReadBrandingThemes(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + brandingThemes, err := pingone.GetManagementAPIObjectsFromIterator[management.BrandingTheme](iter, "ReadBrandingThemes", "GetThemes", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadBrandingThemes", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, brandingTheme := range embedded.GetThemes() { - brandingThemeId, brandingThemeIdOk := brandingTheme.GetIdOk() - brandingThemeConfiguration, brandingThemeConfigurationOk := brandingTheme.GetConfigurationOk() + for _, brandingTheme := range brandingThemes { + brandingThemeId, brandingThemeIdOk := brandingTheme.GetIdOk() + brandingThemeConfiguration, brandingThemeConfigurationOk := brandingTheme.GetConfigurationOk() - if brandingThemeIdOk && brandingThemeConfigurationOk { - brandingThemeName, brandingThemeNameOk := brandingThemeConfiguration.GetNameOk() + if brandingThemeIdOk && brandingThemeConfigurationOk { + brandingThemeName, brandingThemeNameOk := brandingThemeConfiguration.GetNameOk() - if brandingThemeNameOk { - brandingThemeData[*brandingThemeId] = *brandingThemeName - } + if brandingThemeNameOk { + brandingThemeData[*brandingThemeId] = *brandingThemeName } } } - return &brandingThemeData, nil + return brandingThemeData, nil } diff --git a/internal/connector/pingone/platform/resources/pingone_branding_theme_default.go b/internal/connector/pingone/platform/resources/pingone_branding_theme_default.go index 3264c912..dae07a20 100644 --- a/internal/connector/pingone/platform/resources/pingone_branding_theme_default.go +++ b/internal/connector/pingone/platform/resources/pingone_branding_theme_default.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -38,6 +40,9 @@ func (r *PingOneBrandingThemeDefaultResource) ExportAll() (*[]connector.ImportBl if err != nil { return nil, err } + if defaultBrandingThemeName == nil { + return &importBlocks, nil + } commentData := map[string]string{ "Default Branding Theme Name": *defaultBrandingThemeName, @@ -59,38 +64,27 @@ func (r *PingOneBrandingThemeDefaultResource) ExportAll() (*[]connector.ImportBl func (r *PingOneBrandingThemeDefaultResource) getDefaultBrandingThemeName() (*string, error) { iter := r.clientInfo.ApiClient.ManagementAPIClient.BrandingThemesApi.ReadBrandingThemes(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + brandingThemes, err := pingone.GetManagementAPIObjectsFromIterator[management.BrandingTheme](iter, "ReadBrandingThemes", "GetThemes", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadBrandingThemes", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, brandingTheme := range embedded.GetThemes() { - brandingThemeDefault, brandingThemeDefaultOk := brandingTheme.GetDefaultOk() + for _, brandingTheme := range brandingThemes { + brandingThemeDefault, brandingThemeDefaultOk := brandingTheme.GetDefaultOk() - if brandingThemeDefaultOk && *brandingThemeDefault { - brandingThemeConfiguration, brandingThemeConfigurationOk := brandingTheme.GetConfigurationOk() + if brandingThemeDefaultOk && *brandingThemeDefault { + brandingThemeConfiguration, brandingThemeConfigurationOk := brandingTheme.GetConfigurationOk() - if brandingThemeConfigurationOk { - brandingThemeName, brandingThemeNameOk := brandingThemeConfiguration.GetNameOk() + if brandingThemeConfigurationOk { + brandingThemeName, brandingThemeNameOk := brandingThemeConfiguration.GetNameOk() - if brandingThemeNameOk { - return brandingThemeName, nil - } + if brandingThemeNameOk { + return brandingThemeName, nil } } + } } - return nil, fmt.Errorf("failed to export resource '%s'. No default branding theme found.", r.ResourceType()) + return nil, fmt.Errorf("failed to export resource '%s'. No default branding theme found", r.ResourceType()) } diff --git a/internal/connector/pingone/platform/resources/pingone_certificate.go b/internal/connector/pingone/platform/resources/pingone_certificate.go index b86499ff..9b6fcfc8 100644 --- a/internal/connector/pingone/platform/resources/pingone_certificate.go +++ b/internal/connector/pingone/platform/resources/pingone_certificate.go @@ -39,7 +39,7 @@ func (r *PingOneCertificateResource) ExportAll() (*[]connector.ImportBlock, erro return nil, err } - for certificateId, certificateName := range *certificateData { + for certificateId, certificateName := range certificateData { commentData := map[string]string{ "Certificate ID": certificateId, "Certificate Name": certificateName, @@ -60,15 +60,18 @@ func (r *PingOneCertificateResource) ExportAll() (*[]connector.ImportBlock, erro return &importBlocks, nil } -func (r *PingOneCertificateResource) getCertificateData() (*map[string]string, error) { +func (r *PingOneCertificateResource) getCertificateData() (map[string]string, error) { certificateData := make(map[string]string) // TODO: Implement pagination once supported in the PingOne Go Client SDK entityArray, response, err := r.clientInfo.ApiClient.ManagementAPIClient.CertificateManagementApi.GetCertificates(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() - err = common.HandleClientResponse(response, err, "GetCertificates", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetCertificates", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if entityArray == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -88,5 +91,5 @@ func (r *PingOneCertificateResource) getCertificateData() (*map[string]string, e } } - return &certificateData, nil + return certificateData, nil } diff --git a/internal/connector/pingone/platform/resources/pingone_custom_domain.go b/internal/connector/pingone/platform/resources/pingone_custom_domain.go index 871ddce0..d7d77c11 100644 --- a/internal/connector/pingone/platform/resources/pingone_custom_domain.go +++ b/internal/connector/pingone/platform/resources/pingone_custom_domain.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,7 +41,7 @@ func (r *PingOneCustomDomainResource) ExportAll() (*[]connector.ImportBlock, err return nil, err } - for domainId, domainName := range *domainData { + for domainId, domainName := range domainData { commentData := map[string]string{ "Custom Domain ID": domainId, "Custom Domain Name": domainName, @@ -60,35 +62,23 @@ func (r *PingOneCustomDomainResource) ExportAll() (*[]connector.ImportBlock, err return &importBlocks, nil } -func (r *PingOneCustomDomainResource) getCustomDomainData() (*map[string]string, error) { +func (r *PingOneCustomDomainResource) getCustomDomainData() (map[string]string, error) { domainData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.CustomDomainsApi.ReadAllDomains(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + customDomains, err := pingone.GetManagementAPIObjectsFromIterator[management.CustomDomain](iter, "ReadAllDomains", "GetCustomDomains", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllDomains", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, customDomain := range embedded.GetCustomDomains() { - customDomainName, customDomainNameOk := customDomain.GetDomainNameOk() - customDomainId, customDomainIdOk := customDomain.GetIdOk() + for _, customDomain := range customDomains { + customDomainName, customDomainNameOk := customDomain.GetDomainNameOk() + customDomainId, customDomainIdOk := customDomain.GetIdOk() - if customDomainIdOk && customDomainNameOk { - domainData[*customDomainId] = *customDomainName - } + if customDomainIdOk && customDomainNameOk { + domainData[*customDomainId] = *customDomainName } } - return &domainData, nil + return domainData, nil } diff --git a/internal/connector/pingone/platform/resources/pingone_environment.go b/internal/connector/pingone/platform/resources/pingone_environment.go index f1520170..eb599ede 100644 --- a/internal/connector/pingone/platform/resources/pingone_environment.go +++ b/internal/connector/pingone/platform/resources/pingone_environment.go @@ -3,6 +3,7 @@ package resources import ( "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -32,10 +33,13 @@ func (r *PingOneEnvironmentResource) ExportAll() (*[]connector.ImportBlock, erro importBlocks := []connector.ImportBlock{} - err := r.checkEnvironmentData() + ok, err := r.checkEnvironmentData() if err != nil { return nil, err } + if !ok { + return &importBlocks, nil + } commentData := map[string]string{ "Resource Type": r.ResourceType(), @@ -54,13 +58,7 @@ func (r *PingOneEnvironmentResource) ExportAll() (*[]connector.ImportBlock, erro return &importBlocks, nil } -func (r *PingOneEnvironmentResource) checkEnvironmentData() error { +func (r *PingOneEnvironmentResource) checkEnvironmentData() (bool, error) { _, response, err := r.clientInfo.ApiClient.ManagementAPIClient.EnvironmentsApi.ReadOneEnvironment(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() - - err = common.HandleClientResponse(response, err, "ReadOneEnvironment", r.ResourceType()) - if err != nil { - return err - } - - return nil + return pingone.CheckSingletonResource(response, err, "ReadOneEnvironment", r.ResourceType()) } diff --git a/internal/connector/pingone/platform/resources/pingone_form.go b/internal/connector/pingone/platform/resources/pingone_form.go index 7ac724b1..cf6b0546 100644 --- a/internal/connector/pingone/platform/resources/pingone_form.go +++ b/internal/connector/pingone/platform/resources/pingone_form.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,7 +41,7 @@ func (r *PingOneFormResource) ExportAll() (*[]connector.ImportBlock, error) { return nil, err } - for formId, formName := range *formData { + for formId, formName := range formData { commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, "Form ID": formId, @@ -60,35 +62,23 @@ func (r *PingOneFormResource) ExportAll() (*[]connector.ImportBlock, error) { return &importBlocks, nil } -func (r *PingOneFormResource) getFormData() (*map[string]string, error) { +func (r *PingOneFormResource) getFormData() (map[string]string, error) { formData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.FormManagementApi.ReadAllForms(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + forms, err := pingone.GetManagementAPIObjectsFromIterator[management.Form](iter, "ReadAllForms", "GetForms", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllForms", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, form := range embedded.GetForms() { - formId, formIdOk := form.GetIdOk() - formName, formNameOk := form.GetNameOk() + for _, form := range forms { + formId, formIdOk := form.GetIdOk() + formName, formNameOk := form.GetNameOk() - if formIdOk && formNameOk { - formData[*formId] = *formName - } + if formIdOk && formNameOk { + formData[*formId] = *formName } } - return &formData, nil + return formData, nil } diff --git a/internal/connector/pingone/platform/resources/pingone_forms_recaptcha_v2.go b/internal/connector/pingone/platform/resources/pingone_forms_recaptcha_v2.go index 8e108d81..0e811c94 100644 --- a/internal/connector/pingone/platform/resources/pingone_forms_recaptcha_v2.go +++ b/internal/connector/pingone/platform/resources/pingone_forms_recaptcha_v2.go @@ -3,6 +3,7 @@ package resources import ( "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -36,9 +37,7 @@ func (r *PingOneFormRecaptchaV2Resource) ExportAll() (*[]connector.ImportBlock, if err != nil { return nil, err } - if !ok { - l.Debug().Msgf("No '%s' resources to export. Skipping...", r.ResourceType()) return &importBlocks, nil } @@ -61,14 +60,5 @@ func (r *PingOneFormRecaptchaV2Resource) ExportAll() (*[]connector.ImportBlock, func (r *PingOneFormRecaptchaV2Resource) checkFormRecaptchaV2Data() (bool, error) { _, response, err := r.clientInfo.ApiClient.ManagementAPIClient.RecaptchaConfigurationApi.ReadRecaptchaConfiguration(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() - err = common.HandleClientResponse(response, err, "ReadRecaptchaConfiguration", r.ResourceType()) - if err != nil { - return false, err - } - - if response.StatusCode == 204 { - return false, nil - } - - return true, nil + return pingone.CheckSingletonResource(response, err, "ReadRecaptchaConfiguration", r.ResourceType()) } diff --git a/internal/connector/pingone/platform/resources/pingone_gateway.go b/internal/connector/pingone/platform/resources/pingone_gateway.go index 2eb41423..1fdb0d2f 100644 --- a/internal/connector/pingone/platform/resources/pingone_gateway.go +++ b/internal/connector/pingone/platform/resources/pingone_gateway.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,7 +41,7 @@ func (r *PingOneGatewayResource) ExportAll() (*[]connector.ImportBlock, error) { return nil, err } - for gatewayId, gatewayName := range *gatewayData { + for gatewayId, gatewayName := range gatewayData { commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, "Gateway ID": gatewayId, @@ -60,53 +62,41 @@ func (r *PingOneGatewayResource) ExportAll() (*[]connector.ImportBlock, error) { return &importBlocks, nil } -func (r *PingOneGatewayResource) getGatewayData() (*map[string]string, error) { +func (r *PingOneGatewayResource) getGatewayData() (map[string]string, error) { gatewayData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.GatewaysApi.ReadAllGateways(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + gateways, err := pingone.GetManagementAPIObjectsFromIterator[management.EntityArrayEmbeddedGatewaysInner](iter, "ReadAllGateways", "GetGateways", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllGateways", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) + for _, gatewayInner := range gateways { + var ( + gatewayId *string + gatewayIdOk bool + gatewayName *string + gatewayNameOk bool + ) + + switch { + case gatewayInner.Gateway != nil: + gatewayId, gatewayIdOk = gatewayInner.Gateway.GetIdOk() + gatewayName, gatewayNameOk = gatewayInner.Gateway.GetNameOk() + case gatewayInner.GatewayTypeLDAP != nil: + gatewayId, gatewayIdOk = gatewayInner.GatewayTypeLDAP.GetIdOk() + gatewayName, gatewayNameOk = gatewayInner.GatewayTypeLDAP.GetNameOk() + case gatewayInner.GatewayTypeRADIUS != nil: + gatewayId, gatewayIdOk = gatewayInner.GatewayTypeRADIUS.GetIdOk() + gatewayName, gatewayNameOk = gatewayInner.GatewayTypeRADIUS.GetNameOk() + default: + continue } - for _, gatewayInner := range embedded.GetGateways() { - var ( - gatewayId *string - gatewayName *string - gatewayIdOk bool - gatewayNameOk bool - ) - - switch { - case gatewayInner.Gateway != nil: - gatewayId, gatewayIdOk = gatewayInner.Gateway.GetIdOk() - gatewayName, gatewayNameOk = gatewayInner.Gateway.GetNameOk() - case gatewayInner.GatewayTypeLDAP != nil: - gatewayId, gatewayIdOk = gatewayInner.GatewayTypeLDAP.GetIdOk() - gatewayName, gatewayNameOk = gatewayInner.GatewayTypeLDAP.GetNameOk() - case gatewayInner.GatewayTypeRADIUS != nil: - gatewayId, gatewayIdOk = gatewayInner.GatewayTypeRADIUS.GetIdOk() - gatewayName, gatewayNameOk = gatewayInner.GatewayTypeRADIUS.GetNameOk() - default: - continue - } - - if gatewayIdOk && gatewayNameOk { - gatewayData[*gatewayId] = *gatewayName - } + if gatewayIdOk && gatewayNameOk { + gatewayData[*gatewayId] = *gatewayName } } - return &gatewayData, nil + return gatewayData, nil } diff --git a/internal/connector/pingone/platform/resources/pingone_gateway_credential.go b/internal/connector/pingone/platform/resources/pingone_gateway_credential.go index ca10a779..ef4d93a7 100644 --- a/internal/connector/pingone/platform/resources/pingone_gateway_credential.go +++ b/internal/connector/pingone/platform/resources/pingone_gateway_credential.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,13 +41,13 @@ func (r *PingOneGatewayCredentialResource) ExportAll() (*[]connector.ImportBlock return nil, err } - for gatewayId, gatewayName := range *gatewayData { + for gatewayId, gatewayName := range gatewayData { gatewayCredentialData, err := r.getGatewayCredentialData(gatewayId) if err != nil { return nil, err } - for _, gatewayCredentialId := range *gatewayCredentialData { + for _, gatewayCredentialId := range gatewayCredentialData { commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, "Gateway Credential ID": gatewayCredentialId, @@ -68,85 +70,61 @@ func (r *PingOneGatewayCredentialResource) ExportAll() (*[]connector.ImportBlock return &importBlocks, nil } -func (r *PingOneGatewayCredentialResource) getGatewayData() (*map[string]string, error) { +func (r *PingOneGatewayCredentialResource) getGatewayData() (map[string]string, error) { gatewayData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.GatewaysApi.ReadAllGateways(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + gatewayInners, err := pingone.GetManagementAPIObjectsFromIterator[management.EntityArrayEmbeddedGatewaysInner](iter, "ReadAllGateways", "GetGateways", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllGateways", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) + for _, gatewayInner := range gatewayInners { + var ( + gatewayId *string + gatewayIdOk bool + gatewayName *string + gatewayNameOk bool + ) + + switch { + case gatewayInner.Gateway != nil: + gatewayId, gatewayIdOk = gatewayInner.Gateway.GetIdOk() + gatewayName, gatewayNameOk = gatewayInner.Gateway.GetNameOk() + case gatewayInner.GatewayTypeLDAP != nil: + gatewayId, gatewayIdOk = gatewayInner.GatewayTypeLDAP.GetIdOk() + gatewayName, gatewayNameOk = gatewayInner.GatewayTypeLDAP.GetNameOk() + case gatewayInner.GatewayTypeRADIUS != nil: + gatewayId, gatewayIdOk = gatewayInner.GatewayTypeRADIUS.GetIdOk() + gatewayName, gatewayNameOk = gatewayInner.GatewayTypeRADIUS.GetNameOk() + default: + continue } - for _, gatewayInner := range embedded.GetGateways() { - var ( - gatewayId *string - gatewayIdOk bool - gatewayName *string - gatewayNameOk bool - ) - - switch { - case gatewayInner.Gateway != nil: - gatewayId, gatewayIdOk = gatewayInner.Gateway.GetIdOk() - gatewayName, gatewayNameOk = gatewayInner.Gateway.GetNameOk() - case gatewayInner.GatewayTypeLDAP != nil: - gatewayId, gatewayIdOk = gatewayInner.GatewayTypeLDAP.GetIdOk() - gatewayName, gatewayNameOk = gatewayInner.GatewayTypeLDAP.GetNameOk() - case gatewayInner.GatewayTypeRADIUS != nil: - gatewayId, gatewayIdOk = gatewayInner.GatewayTypeRADIUS.GetIdOk() - gatewayName, gatewayNameOk = gatewayInner.GatewayTypeRADIUS.GetNameOk() - default: - continue - } - - if gatewayIdOk && gatewayNameOk { - gatewayData[*gatewayId] = *gatewayName - } + if gatewayIdOk && gatewayNameOk { + gatewayData[*gatewayId] = *gatewayName } } - return &gatewayData, nil + return gatewayData, nil } -func (r *PingOneGatewayCredentialResource) getGatewayCredentialData(gatewayId string) (*[]string, error) { +func (r *PingOneGatewayCredentialResource) getGatewayCredentialData(gatewayId string) ([]string, error) { gatewayCredentialData := []string{} iter := r.clientInfo.ApiClient.ManagementAPIClient.GatewayCredentialsApi.ReadAllGatewayCredentials(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID, gatewayId).Execute() + gatewayCredentials, err := pingone.GetManagementAPIObjectsFromIterator[management.GatewayCredential](iter, "ReadAllGatewayCredentials", "GetCredentials", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllGatewayCredentials", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, gatewayCredential := range embedded.GetCredentials() { - gatewayCredentialId, gatewayCredentialIdOk := gatewayCredential.GetIdOk() + for _, gatewayCredential := range gatewayCredentials { + gatewayCredentialId, gatewayCredentialIdOk := gatewayCredential.GetIdOk() - if gatewayCredentialIdOk { - gatewayCredentialData = append(gatewayCredentialData, *gatewayCredentialId) - } + if gatewayCredentialIdOk { + gatewayCredentialData = append(gatewayCredentialData, *gatewayCredentialId) } } - return &gatewayCredentialData, nil + return gatewayCredentialData, nil } diff --git a/internal/connector/pingone/platform/resources/pingone_gateway_role_assignment.go b/internal/connector/pingone/platform/resources/pingone_gateway_role_assignment.go index 3b8fac4f..e01a4170 100644 --- a/internal/connector/pingone/platform/resources/pingone_gateway_role_assignment.go +++ b/internal/connector/pingone/platform/resources/pingone_gateway_role_assignment.go @@ -6,6 +6,7 @@ import ( "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -40,17 +41,20 @@ func (r *PingOneGatewayRoleAssignmentResource) ExportAll() (*[]connector.ImportB return nil, err } - for gatewayId, gatewayName := range *gatewayData { + for gatewayId, gatewayName := range gatewayData { gatewayRoleAssignmentData, err := r.getGatewayRoleAssignmentData(gatewayId) if err != nil { return nil, err } - for roleAssignmentId, roleId := range *gatewayRoleAssignmentData { + for roleAssignmentId, roleId := range gatewayRoleAssignmentData { roleName, err := r.getRoleAssignmentRoleName(roleId) if err != nil { return nil, err } + if roleName == nil { + continue + } commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, @@ -75,88 +79,67 @@ func (r *PingOneGatewayRoleAssignmentResource) ExportAll() (*[]connector.ImportB return &importBlocks, nil } -func (r *PingOneGatewayRoleAssignmentResource) getGatewayData() (*map[string]string, error) { +func (r *PingOneGatewayRoleAssignmentResource) getGatewayData() (map[string]string, error) { gatewayData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.GatewaysApi.ReadAllGateways(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + gatewayInners, err := pingone.GetManagementAPIObjectsFromIterator[management.EntityArrayEmbeddedGatewaysInner](iter, "ReadAllGateways", "GetGateways", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllGateways", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, gatewayInner := range embedded.GetGateways() { - // Only PingFederate Connections have role assignments - if gatewayInner.Gateway != nil { - gatewayType, gatewayTypeOk := gatewayInner.Gateway.GetTypeOk() + for _, gatewayInner := range gatewayInners { + // Only PingFederate Connections have role assignments + if gatewayInner.Gateway != nil { + gatewayType, gatewayTypeOk := gatewayInner.Gateway.GetTypeOk() - if gatewayTypeOk && *gatewayType == management.ENUMGATEWAYTYPE_PING_FEDERATE { - gatewayId, gatewayIdOk := gatewayInner.Gateway.GetIdOk() - gatewayName, gatewayNameOk := gatewayInner.Gateway.GetNameOk() + if gatewayTypeOk && *gatewayType == management.ENUMGATEWAYTYPE_PING_FEDERATE { + gatewayId, gatewayIdOk := gatewayInner.Gateway.GetIdOk() + gatewayName, gatewayNameOk := gatewayInner.Gateway.GetNameOk() - if gatewayIdOk && gatewayNameOk { - gatewayData[*gatewayId] = *gatewayName - } + if gatewayIdOk && gatewayNameOk { + gatewayData[*gatewayId] = *gatewayName } } } } - return &gatewayData, nil + return gatewayData, nil } -func (r *PingOneGatewayRoleAssignmentResource) getGatewayRoleAssignmentData(gatewayId string) (*map[string]string, error) { +func (r *PingOneGatewayRoleAssignmentResource) getGatewayRoleAssignmentData(gatewayId string) (map[string]string, error) { gatewayRoleAssignmentData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.GatewayRoleAssignmentsApi.ReadGatewayRoleAssignments(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID, gatewayId).Execute() + gatewayRoleAssignments, err := pingone.GetManagementAPIObjectsFromIterator[management.RoleAssignment](iter, "ReadGatewayRoleAssignments", "GetRoleAssignments", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadGatewayRoleAssignments", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, roleAssignment := range embedded.GetRoleAssignments() { - roleAssignmentId, roleAssignmentIdOk := roleAssignment.GetIdOk() - roleAssignmentRole, roleAssignmentRoleOk := roleAssignment.GetRoleOk() + for _, roleAssignment := range gatewayRoleAssignments { + roleAssignmentId, roleAssignmentIdOk := roleAssignment.GetIdOk() + roleAssignmentRole, roleAssignmentRoleOk := roleAssignment.GetRoleOk() - if roleAssignmentIdOk && roleAssignmentRoleOk { - roleAssignmentRoleId, roleAssignmentRoleIdOk := roleAssignmentRole.GetIdOk() - if roleAssignmentRoleIdOk { - gatewayRoleAssignmentData[*roleAssignmentId] = *roleAssignmentRoleId - } + if roleAssignmentIdOk && roleAssignmentRoleOk { + roleAssignmentRoleId, roleAssignmentRoleIdOk := roleAssignmentRole.GetIdOk() + if roleAssignmentRoleIdOk { + gatewayRoleAssignmentData[*roleAssignmentId] = *roleAssignmentRoleId } } } - return &gatewayRoleAssignmentData, nil + return gatewayRoleAssignmentData, nil } func (r *PingOneGatewayRoleAssignmentResource) getRoleAssignmentRoleName(roleId string) (*management.EnumRoleName, error) { role, resp, err := r.clientInfo.ApiClient.ManagementAPIClient.RolesApi.ReadOneRole(r.clientInfo.Context, roleId).Execute() - err = common.HandleClientResponse(resp, err, "ReadOneRole", r.ResourceType()) + ok, err := pingone.CheckSingletonResource(resp, err, "ReadOneRole", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if role != nil { roleName, roleNameOk := role.GetNameOk() @@ -165,5 +148,5 @@ func (r *PingOneGatewayRoleAssignmentResource) getRoleAssignmentRoleName(roleId } } - return nil, fmt.Errorf("failed to export resource '%s'. No role name found for Role ID '%s'.", r.ResourceType(), roleId) + return nil, fmt.Errorf("failed to export resource '%s'. No role name found for Role ID '%s'", r.ResourceType(), roleId) } diff --git a/internal/connector/pingone/platform/resources/pingone_identity_propagation_plan.go b/internal/connector/pingone/platform/resources/pingone_identity_propagation_plan.go index a711a535..f69c73ba 100644 --- a/internal/connector/pingone/platform/resources/pingone_identity_propagation_plan.go +++ b/internal/connector/pingone/platform/resources/pingone_identity_propagation_plan.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,7 +41,7 @@ func (r *PingOneIdentityPropagationPlanResource) ExportAll() (*[]connector.Impor return nil, err } - for planId, planName := range *planData { + for planId, planName := range planData { commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, "Identity Propagation Plan ID": planId, @@ -60,35 +62,23 @@ func (r *PingOneIdentityPropagationPlanResource) ExportAll() (*[]connector.Impor return &importBlocks, nil } -func (r *PingOneIdentityPropagationPlanResource) getIdentityPropagationPlanData() (*map[string]string, error) { +func (r *PingOneIdentityPropagationPlanResource) getIdentityPropagationPlanData() (map[string]string, error) { identityPropagationPlanData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.IdentityPropagationPlansApi.ReadAllPlans(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + identityPropagationPlans, err := pingone.GetManagementAPIObjectsFromIterator[management.IdentityPropagationPlan](iter, "ReadAllPlans", "GetPlans", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllPlans", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, identityPropagationPlan := range embedded.GetPlans() { - identityPropagationPlanId, identityPropagationPlanIdOk := identityPropagationPlan.GetIdOk() - identityPropagationPlanName, identityPropagationPlanNameOk := identityPropagationPlan.GetNameOk() + for _, identityPropagationPlan := range identityPropagationPlans { + identityPropagationPlanId, identityPropagationPlanIdOk := identityPropagationPlan.GetIdOk() + identityPropagationPlanName, identityPropagationPlanNameOk := identityPropagationPlan.GetNameOk() - if identityPropagationPlanIdOk && identityPropagationPlanNameOk { - identityPropagationPlanData[*identityPropagationPlanId] = *identityPropagationPlanName - } + if identityPropagationPlanIdOk && identityPropagationPlanNameOk { + identityPropagationPlanData[*identityPropagationPlanId] = *identityPropagationPlanName } } - return &identityPropagationPlanData, nil + return identityPropagationPlanData, nil } diff --git a/internal/connector/pingone/platform/resources/pingone_key.go b/internal/connector/pingone/platform/resources/pingone_key.go index 8bc78252..fb204331 100644 --- a/internal/connector/pingone/platform/resources/pingone_key.go +++ b/internal/connector/pingone/platform/resources/pingone_key.go @@ -39,7 +39,7 @@ func (r *PingOneKeyResource) ExportAll() (*[]connector.ImportBlock, error) { return nil, err } - for keyId, keyNameAndType := range *keyData { + for keyId, keyNameAndType := range keyData { keyName := keyNameAndType[0] keyType := keyNameAndType[1] @@ -64,16 +64,19 @@ func (r *PingOneKeyResource) ExportAll() (*[]connector.ImportBlock, error) { return &importBlocks, nil } -func (r *PingOneKeyResource) getKeyData() (*map[string][]string, error) { +func (r *PingOneKeyResource) getKeyData() (map[string][]string, error) { keyData := make(map[string][]string) // TODO: Implement pagination once supported in the PingOne Go Client SDK entityArray, response, err := r.clientInfo.ApiClient.ManagementAPIClient.CertificateManagementApi.GetKeys(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() - err = common.HandleClientResponse(response, err, "GetKeys", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "GetKeys", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if entityArray == nil { return nil, common.DataNilError(r.ResourceType(), response) @@ -94,5 +97,5 @@ func (r *PingOneKeyResource) getKeyData() (*map[string][]string, error) { } } - return &keyData, nil + return keyData, nil } diff --git a/internal/connector/pingone/platform/resources/pingone_key_rotation_policy.go b/internal/connector/pingone/platform/resources/pingone_key_rotation_policy.go index 05272f6e..97328065 100644 --- a/internal/connector/pingone/platform/resources/pingone_key_rotation_policy.go +++ b/internal/connector/pingone/platform/resources/pingone_key_rotation_policy.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,7 +41,7 @@ func (r *PingOneKeyRotationPolicyResource) ExportAll() (*[]connector.ImportBlock return nil, err } - for keyRotationPolicyId, keyRotationPolicyName := range *keyRotationPolicyData { + for keyRotationPolicyId, keyRotationPolicyName := range keyRotationPolicyData { commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, "Key Rotation Policy ID": keyRotationPolicyId, @@ -60,35 +62,23 @@ func (r *PingOneKeyRotationPolicyResource) ExportAll() (*[]connector.ImportBlock return &importBlocks, nil } -func (r *PingOneKeyRotationPolicyResource) getKeyRotationPolicyData() (*map[string]string, error) { +func (r *PingOneKeyRotationPolicyResource) getKeyRotationPolicyData() (map[string]string, error) { keyRotationPolicyData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.KeyRotationPoliciesApi.GetKeyRotationPolicies(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + keyRotationPolicies, err := pingone.GetManagementAPIObjectsFromIterator[management.KeyRotationPolicy](iter, "GetKeyRotationPolicies", "GetKeyRotationPolicies", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "GetKeyRotationPolicies", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, keyRotationPolicy := range embedded.GetKeyRotationPolicies() { - keyRotationPolicyId, keyRotationPolicyIdOk := keyRotationPolicy.GetIdOk() - keyRotationPolicyName, keyRotationPolicyNameOk := keyRotationPolicy.GetNameOk() + for _, keyRotationPolicy := range keyRotationPolicies { + keyRotationPolicyId, keyRotationPolicyIdOk := keyRotationPolicy.GetIdOk() + keyRotationPolicyName, keyRotationPolicyNameOk := keyRotationPolicy.GetNameOk() - if keyRotationPolicyIdOk && keyRotationPolicyNameOk { - keyRotationPolicyData[*keyRotationPolicyId] = *keyRotationPolicyName - } + if keyRotationPolicyIdOk && keyRotationPolicyNameOk { + keyRotationPolicyData[*keyRotationPolicyId] = *keyRotationPolicyName } } - return &keyRotationPolicyData, nil + return keyRotationPolicyData, nil } diff --git a/internal/connector/pingone/platform/resources/pingone_language.go b/internal/connector/pingone/platform/resources/pingone_language.go index a15d90b8..953c6094 100644 --- a/internal/connector/pingone/platform/resources/pingone_language.go +++ b/internal/connector/pingone/platform/resources/pingone_language.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,7 +41,7 @@ func (r *PingOneLanguageResource) ExportAll() (*[]connector.ImportBlock, error) return nil, err } - for languageId, languageName := range *languageData { + for languageId, languageName := range languageData { commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, "Language ID": languageId, @@ -60,43 +62,31 @@ func (r *PingOneLanguageResource) ExportAll() (*[]connector.ImportBlock, error) return &importBlocks, nil } -func (r *PingOneLanguageResource) getLanguageData() (*map[string]string, error) { +func (r *PingOneLanguageResource) getLanguageData() (map[string]string, error) { languageData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.LanguagesApi.ReadLanguages(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + languageInners, err := pingone.GetManagementAPIObjectsFromIterator[management.EntityArrayEmbeddedLanguagesInner](iter, "ReadLanguages", "GetLanguages", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadLanguages", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, languageInner := range embedded.GetLanguages() { - if languageInner.Language != nil { - // If language is not customer added, skip it - languageCustomerAdded, languageCustomerAddedOk := languageInner.Language.GetCustomerAddedOk() - if !languageCustomerAddedOk || !*languageCustomerAdded { - continue - } + for _, languageInner := range languageInners { + if languageInner.Language != nil { + // If language is not customer added, skip it + languageCustomerAdded, languageCustomerAddedOk := languageInner.Language.GetCustomerAddedOk() + if !languageCustomerAddedOk || !*languageCustomerAdded { + continue + } - languageId, languageIdOk := languageInner.Language.GetIdOk() - languageName, languageNameOk := languageInner.Language.GetNameOk() + languageId, languageIdOk := languageInner.Language.GetIdOk() + languageName, languageNameOk := languageInner.Language.GetNameOk() - if languageIdOk && languageNameOk { - languageData[*languageId] = *languageName - } + if languageIdOk && languageNameOk { + languageData[*languageId] = *languageName } } } - return &languageData, nil + return languageData, nil } diff --git a/internal/connector/pingone/platform/resources/pingone_language_update.go b/internal/connector/pingone/platform/resources/pingone_language_update.go index fac44ead..e3673928 100644 --- a/internal/connector/pingone/platform/resources/pingone_language_update.go +++ b/internal/connector/pingone/platform/resources/pingone_language_update.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -34,12 +36,12 @@ func (r *PingOneLanguageUpdateResource) ExportAll() (*[]connector.ImportBlock, e importBlocks := []connector.ImportBlock{} - languageData, err := r.getLanguageData() + languageUpdateData, err := r.getLanguageUpdateData() if err != nil { return nil, err } - for languageId, languageName := range *languageData { + for languageId, languageName := range languageUpdateData { commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, "Language ID": languageId, @@ -60,50 +62,38 @@ func (r *PingOneLanguageUpdateResource) ExportAll() (*[]connector.ImportBlock, e return &importBlocks, nil } -func (r *PingOneLanguageUpdateResource) getLanguageData() (*map[string]string, error) { - languageData := make(map[string]string) +func (r *PingOneLanguageUpdateResource) getLanguageUpdateData() (map[string]string, error) { + languageUpdateData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.LanguagesApi.ReadLanguages(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + languageInners, err := pingone.GetManagementAPIObjectsFromIterator[management.EntityArrayEmbeddedLanguagesInner](iter, "ReadLanguages", "GetLanguages", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadLanguages", r.ResourceType()) - if err != nil { - return nil, err - } + for _, languageInner := range languageInners { + if languageInner.Language != nil { + languageEnabled, languageEnabledOk := languageInner.Language.GetEnabledOk() + languageLocale, languageLocaleOk := languageInner.Language.GetLocaleOk() + languageDefault, languageDefaultOk := languageInner.Language.GetDefaultOk() - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } + if languageEnabledOk && languageLocaleOk && languageDefaultOk { + // Export the language if it meets any of the criteria of the following 3 conditions: + // 1) Any language enabled + // 2) The 'en' language disabled + // 3) If any language other than 'en' is the default - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } + if *languageEnabled || (*languageLocale == "en" && !*languageEnabled) || (*languageLocale != "en" && *languageDefault) { + languageId, languageIdOk := languageInner.Language.GetIdOk() + languageName, languageNameOk := languageInner.Language.GetNameOk() - for _, languageInner := range embedded.GetLanguages() { - if languageInner.Language != nil { - languageEnabled, languageEnabledOk := languageInner.Language.GetEnabledOk() - languageLocale, languageLocaleOk := languageInner.Language.GetLocaleOk() - languageDefault, languageDefaultOk := languageInner.Language.GetDefaultOk() - - if languageEnabledOk && languageLocaleOk && languageDefaultOk { - // Export the language if it meets any of the criteria of the following 3 conditions: - // 1) Any language enabled - // 2) The 'en' language disabled - // 3) If any language other than 'en' is the default - - if *languageEnabled || (*languageLocale == "en" && !*languageEnabled) || (*languageLocale != "en" && *languageDefault) { - languageId, languageIdOk := languageInner.Language.GetIdOk() - languageName, languageNameOk := languageInner.Language.GetNameOk() - - if languageIdOk && languageNameOk { - languageData[*languageId] = *languageName - } + if languageIdOk && languageNameOk { + languageUpdateData[*languageId] = *languageName } } } } } - return &languageData, nil + return languageUpdateData, nil } diff --git a/internal/connector/pingone/platform/resources/pingone_notification_policy.go b/internal/connector/pingone/platform/resources/pingone_notification_policy.go index 08bdb071..976e7819 100644 --- a/internal/connector/pingone/platform/resources/pingone_notification_policy.go +++ b/internal/connector/pingone/platform/resources/pingone_notification_policy.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,7 +41,7 @@ func (r *PingOneNotificationPolicyResource) ExportAll() (*[]connector.ImportBloc return nil, err } - for notificationPolicyId, notificationPolicyName := range *notificationPolicyData { + for notificationPolicyId, notificationPolicyName := range notificationPolicyData { commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, "Notification Policy ID": notificationPolicyId, @@ -60,35 +62,23 @@ func (r *PingOneNotificationPolicyResource) ExportAll() (*[]connector.ImportBloc return &importBlocks, nil } -func (r *PingOneNotificationPolicyResource) getNotificationPolicyData() (*map[string]string, error) { +func (r *PingOneNotificationPolicyResource) getNotificationPolicyData() (map[string]string, error) { notificationPolicyData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.NotificationsPoliciesApi.ReadAllNotificationsPolicies(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + notificationPolicies, err := pingone.GetManagementAPIObjectsFromIterator[management.NotificationsPolicy](iter, "ReadAllNotificationsPolicies", "GetNotificationsPolicies", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllNotificationsPolicies", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, notificationPolicy := range embedded.GetNotificationsPolicies() { - notificationPolicyId, notificationPolicyIdOk := notificationPolicy.GetIdOk() - notificationPolicyName, notificationPolicyNameOk := notificationPolicy.GetNameOk() + for _, notificationPolicy := range notificationPolicies { + notificationPolicyId, notificationPolicyIdOk := notificationPolicy.GetIdOk() + notificationPolicyName, notificationPolicyNameOk := notificationPolicy.GetNameOk() - if notificationPolicyIdOk && notificationPolicyNameOk { - notificationPolicyData[*notificationPolicyId] = *notificationPolicyName - } + if notificationPolicyIdOk && notificationPolicyNameOk { + notificationPolicyData[*notificationPolicyId] = *notificationPolicyName } } - return ¬ificationPolicyData, nil + return notificationPolicyData, nil } diff --git a/internal/connector/pingone/platform/resources/pingone_notification_settings.go b/internal/connector/pingone/platform/resources/pingone_notification_settings.go index 001b8885..fd63d9b6 100644 --- a/internal/connector/pingone/platform/resources/pingone_notification_settings.go +++ b/internal/connector/pingone/platform/resources/pingone_notification_settings.go @@ -3,6 +3,7 @@ package resources import ( "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -32,10 +33,13 @@ func (r *PingOneNotificationSettingsResource) ExportAll() (*[]connector.ImportBl importBlocks := []connector.ImportBlock{} - err := r.checkNotificationSettingsData() + ok, err := r.checkNotificationSettingsData() if err != nil { return nil, err } + if !ok { + return &importBlocks, nil + } commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, @@ -54,16 +58,7 @@ func (r *PingOneNotificationSettingsResource) ExportAll() (*[]connector.ImportBl return &importBlocks, nil } -func (r *PingOneNotificationSettingsResource) checkNotificationSettingsData() error { +func (r *PingOneNotificationSettingsResource) checkNotificationSettingsData() (bool, error) { _, response, err := r.clientInfo.ApiClient.ManagementAPIClient.NotificationsSettingsApi.ReadNotificationsSettings(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() - err = common.HandleClientResponse(response, err, "ReadNotificationsSettings", r.ResourceType()) - if err != nil { - return err - } - - if response.StatusCode == 204 { - return common.DataNilError(r.ResourceType(), response) - } - - return nil + return pingone.CheckSingletonResource(response, err, "ReadNotificationsSettings", r.ResourceType()) } diff --git a/internal/connector/pingone/platform/resources/pingone_notification_settings_email.go b/internal/connector/pingone/platform/resources/pingone_notification_settings_email.go index f1c36b70..b630c860 100644 --- a/internal/connector/pingone/platform/resources/pingone_notification_settings_email.go +++ b/internal/connector/pingone/platform/resources/pingone_notification_settings_email.go @@ -3,6 +3,7 @@ package resources import ( "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -32,10 +33,13 @@ func (r *PingOneNotificationSettingsEmailResource) ExportAll() (*[]connector.Imp importBlocks := []connector.ImportBlock{} - err := r.checkNotificationSettingsEmailData() + ok, err := r.checkNotificationSettingsEmailData() if err != nil { return nil, err } + if !ok { + return &importBlocks, nil + } commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, @@ -54,16 +58,7 @@ func (r *PingOneNotificationSettingsEmailResource) ExportAll() (*[]connector.Imp return &importBlocks, nil } -func (r *PingOneNotificationSettingsEmailResource) checkNotificationSettingsEmailData() error { +func (r *PingOneNotificationSettingsEmailResource) checkNotificationSettingsEmailData() (bool, error) { _, response, err := r.clientInfo.ApiClient.ManagementAPIClient.NotificationsSettingsSMTPApi.ReadEmailNotificationsSettings(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() - err = common.HandleClientResponse(response, err, "ReadEmailNotificationsSettings", r.ResourceType()) - if err != nil { - return err - } - - if response.StatusCode == 204 { - return common.DataNilError(r.ResourceType(), response) - } - - return nil + return pingone.CheckSingletonResource(response, err, "ReadEmailNotificationsSettings", r.ResourceType()) } diff --git a/internal/connector/pingone/platform/resources/pingone_notification_template_content.go b/internal/connector/pingone/platform/resources/pingone_notification_template_content.go index 3a05e4ec..954debb8 100644 --- a/internal/connector/pingone/platform/resources/pingone_notification_template_content.go +++ b/internal/connector/pingone/platform/resources/pingone_notification_template_content.go @@ -8,7 +8,9 @@ import ( "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" + "github.com/pingidentity/pingcli/internal/output" ) type NotificationTemplateContentData struct { @@ -54,20 +56,20 @@ func (r *PingOneNotificationTemplateContentResource) ExportAll() (*[]connector.I return nil, err } - for _, templateName := range *templateNames { + for _, templateName := range templateNames { templateContentData, err := r.getTemplateContentData(templateName) if err != nil { return nil, err } - for _, templateContentInfo := range *templateContentData { + for _, templateContentInfo := range templateContentData { templateContentId := templateContentInfo.TemplateContentId templateContentDeliveryMethod := templateContentInfo.TemplateContentDeliveryMethod templateContentLocale := templateContentInfo.TemplateContentLocale templateContentVariant := templateContentInfo.TemplateContentVariant // Only export template content if the locale is enabled - if (*enabledLocales)[templateContentLocale] { + if enabledLocales[templateContentLocale] { commentData := map[string]string{ "Resource Type": r.ResourceType(), "Template Name": string(templateName), @@ -97,42 +99,30 @@ func (r *PingOneNotificationTemplateContentResource) ExportAll() (*[]connector.I return &importBlocks, nil } -func (r *PingOneNotificationTemplateContentResource) getEnabledLocales() (*map[string]bool, error) { +func (r *PingOneNotificationTemplateContentResource) getEnabledLocales() (map[string]bool, error) { enabledLocales := make(map[string]bool) iter := r.clientInfo.ApiClient.ManagementAPIClient.LanguagesApi.ReadLanguages(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + languageInners, err := pingone.GetManagementAPIObjectsFromIterator[management.EntityArrayEmbeddedLanguagesInner](iter, "ReadLanguages", "GetLanguages", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadLanguages", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, languageInner := range embedded.GetLanguages() { - if languageInner.Language != nil { - languageLocale, languageLocaleOk := languageInner.Language.GetLocaleOk() - languageEnabled, languageEnabledOk := languageInner.Language.GetEnabledOk() + for _, languageInner := range languageInners { + if languageInner.Language != nil { + languageLocale, languageLocaleOk := languageInner.Language.GetLocaleOk() + languageEnabled, languageEnabledOk := languageInner.Language.GetEnabledOk() - if languageLocaleOk && languageEnabledOk && *languageEnabled { - enabledLocales[*languageLocale] = true - } + if languageLocaleOk && languageEnabledOk && *languageEnabled { + enabledLocales[*languageLocale] = true } } } - return &enabledLocales, nil + return enabledLocales, nil } -func (r *PingOneNotificationTemplateContentResource) getTemplateNames() (*[]management.EnumTemplateName, error) { +func (r *PingOneNotificationTemplateContentResource) getTemplateNames() ([]management.EnumTemplateName, error) { templateNames := []management.EnumTemplateName{} for _, templateName := range management.AllowedEnumTemplateNameEnumValues { @@ -153,85 +143,75 @@ func (r *PingOneNotificationTemplateContentResource) getTemplateNames() (*[]mana } // Handle all other errors or bad responses - err = common.HandleClientResponse(response, err, "ReadOneTemplate", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "ReadOneTemplate", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } templateNames = append(templateNames, templateName) } - return &templateNames, nil + return templateNames, nil } -func (r *PingOneNotificationTemplateContentResource) getTemplateContentData(templateName management.EnumTemplateName) (*[]NotificationTemplateContentData, error) { - l := logger.Get() +func (r *PingOneNotificationTemplateContentResource) getTemplateContentData(templateName management.EnumTemplateName) ([]NotificationTemplateContentData, error) { templateContentData := []NotificationTemplateContentData{} iter := r.clientInfo.ApiClient.ManagementAPIClient.NotificationsTemplatesApi.ReadAllTemplateContents(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID, templateName).Execute() + templateContents, err := pingone.GetManagementAPIObjectsFromIterator[management.TemplateContent](iter, "ReadAllTemplateContents", "GetContents", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllTemplateContents", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) + for _, templateContent := range templateContents { + var ( + templateContentId *string + templateContentIdOk bool + templateContentDeliveryMethod *management.EnumTemplateContentDeliveryMethod + templateContentDeliveryMethodOk bool + templateContentLocale *string + templateContentLocaleOk bool + templateContentVariant string + ) + + switch { + case templateContent.TemplateContentPush != nil: + templateContentId, templateContentIdOk = templateContent.TemplateContentPush.GetIdOk() + templateContentDeliveryMethod, templateContentDeliveryMethodOk = templateContent.TemplateContentPush.GetDeliveryMethodOk() + templateContentLocale, templateContentLocaleOk = templateContent.TemplateContentPush.GetLocaleOk() + templateContentVariant = templateContent.TemplateContentPush.GetVariant() + case templateContent.TemplateContentSMS != nil: + templateContentId, templateContentIdOk = templateContent.TemplateContentSMS.GetIdOk() + templateContentDeliveryMethod, templateContentDeliveryMethodOk = templateContent.TemplateContentSMS.GetDeliveryMethodOk() + templateContentLocale, templateContentLocaleOk = templateContent.TemplateContentSMS.GetLocaleOk() + templateContentVariant = templateContent.TemplateContentSMS.GetVariant() + case templateContent.TemplateContentEmail != nil: + templateContentId, templateContentIdOk = templateContent.TemplateContentEmail.GetIdOk() + templateContentDeliveryMethod, templateContentDeliveryMethodOk = templateContent.TemplateContentEmail.GetDeliveryMethodOk() + templateContentLocale, templateContentLocaleOk = templateContent.TemplateContentEmail.GetLocaleOk() + templateContentVariant = templateContent.TemplateContentEmail.GetVariant() + case templateContent.TemplateContentVoice != nil: + templateContentId, templateContentIdOk = templateContent.TemplateContentVoice.GetIdOk() + templateContentDeliveryMethod, templateContentDeliveryMethodOk = templateContent.TemplateContentVoice.GetDeliveryMethodOk() + templateContentLocale, templateContentLocaleOk = templateContent.TemplateContentVoice.GetLocaleOk() + templateContentVariant = templateContent.TemplateContentVoice.GetVariant() + default: + output.Warn(fmt.Sprintf("Template content '%v' for template '%s' is not one of: Push, SMS, Email, or Voice. Skipping export.", templateContent, templateName), nil) + continue } - for _, templateContent := range embedded.GetContents() { - var ( - templateContentId *string - templateContentIdOk bool - templateContentDeliveryMethod *management.EnumTemplateContentDeliveryMethod - templateContentDeliveryMethodOk bool - templateContentLocale *string - templateContentLocaleOk bool - templateContentVariant string - ) - - switch { - case templateContent.TemplateContentPush != nil: - templateContentId, templateContentIdOk = templateContent.TemplateContentPush.GetIdOk() - templateContentDeliveryMethod, templateContentDeliveryMethodOk = templateContent.TemplateContentPush.GetDeliveryMethodOk() - templateContentLocale, templateContentLocaleOk = templateContent.TemplateContentPush.GetLocaleOk() - templateContentVariant = templateContent.TemplateContentPush.GetVariant() - case templateContent.TemplateContentSMS != nil: - templateContentId, templateContentIdOk = templateContent.TemplateContentSMS.GetIdOk() - templateContentDeliveryMethod, templateContentDeliveryMethodOk = templateContent.TemplateContentSMS.GetDeliveryMethodOk() - templateContentLocale, templateContentLocaleOk = templateContent.TemplateContentSMS.GetLocaleOk() - templateContentVariant = templateContent.TemplateContentSMS.GetVariant() - case templateContent.TemplateContentEmail != nil: - templateContentId, templateContentIdOk = templateContent.TemplateContentEmail.GetIdOk() - templateContentDeliveryMethod, templateContentDeliveryMethodOk = templateContent.TemplateContentEmail.GetDeliveryMethodOk() - templateContentLocale, templateContentLocaleOk = templateContent.TemplateContentEmail.GetLocaleOk() - templateContentVariant = templateContent.TemplateContentEmail.GetVariant() - case templateContent.TemplateContentVoice != nil: - templateContentId, templateContentIdOk = templateContent.TemplateContentVoice.GetIdOk() - templateContentDeliveryMethod, templateContentDeliveryMethodOk = templateContent.TemplateContentVoice.GetDeliveryMethodOk() - templateContentLocale, templateContentLocaleOk = templateContent.TemplateContentVoice.GetLocaleOk() - templateContentVariant = templateContent.TemplateContentVoice.GetVariant() - default: - l.Warn().Msgf("Template content '%v' for template '%s' is not one of: Push, SMS, Email, or Voice. Skipping export.", templateContent, templateName) - continue - } - - if templateContentIdOk && templateContentDeliveryMethodOk && templateContentLocaleOk { - templateContentData = append(templateContentData, NotificationTemplateContentData{ - TemplateContentId: *templateContentId, - TemplateContentDeliveryMethod: string(*templateContentDeliveryMethod), - TemplateContentLocale: *templateContentLocale, - TemplateContentVariant: templateContentVariant, - }) - } + if templateContentIdOk && templateContentDeliveryMethodOk && templateContentLocaleOk { + templateContentData = append(templateContentData, NotificationTemplateContentData{ + TemplateContentId: *templateContentId, + TemplateContentDeliveryMethod: string(*templateContentDeliveryMethod), + TemplateContentLocale: *templateContentLocale, + TemplateContentVariant: templateContentVariant, + }) } } - return &templateContentData, nil + return templateContentData, nil } diff --git a/internal/connector/pingone/platform/resources/pingone_phone_delivery_settings.go b/internal/connector/pingone/platform/resources/pingone_phone_delivery_settings.go index f2ee8262..d0cb292e 100644 --- a/internal/connector/pingone/platform/resources/pingone_phone_delivery_settings.go +++ b/internal/connector/pingone/platform/resources/pingone_phone_delivery_settings.go @@ -6,6 +6,7 @@ import ( "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -40,7 +41,7 @@ func (r *PingOnePhoneDeliverySettingsResource) ExportAll() (*[]connector.ImportB return nil, err } - for phoneDeliverySettingsId, phoneDeliverySettingsName := range *phoneDeliverySettingsData { + for phoneDeliverySettingsId, phoneDeliverySettingsName := range phoneDeliverySettingsData { commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, "Phone Delivery Settings ID": phoneDeliverySettingsId, @@ -61,62 +62,50 @@ func (r *PingOnePhoneDeliverySettingsResource) ExportAll() (*[]connector.ImportB return &importBlocks, nil } -func (r *PingOnePhoneDeliverySettingsResource) getPhoneDeliverySettingsData() (*map[string]string, error) { +func (r *PingOnePhoneDeliverySettingsResource) getPhoneDeliverySettingsData() (map[string]string, error) { phoneDeliverySettingsData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.PhoneDeliverySettingsApi.ReadAllPhoneDeliverySettings(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + phoneDeliverySettings, err := pingone.GetManagementAPIObjectsFromIterator[management.NotificationsSettingsPhoneDeliverySettings](iter, "ReadAllPhoneDeliverySettings", "GetPhoneDeliverySettings", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllPhoneDeliverySettings", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, phoneDeliverySettings := range embedded.GetPhoneDeliverySettings() { - var ( - phoneDeliverySettingsId *string - phoneDeliverySettingsIdOk bool - phoneDeliverySettingsName string - phoneDeliverySettingsNameOk bool - ) - - switch { - case phoneDeliverySettings.NotificationsSettingsPhoneDeliverySettingsCustom != nil: - phoneDeliverySettingsId, phoneDeliverySettingsIdOk = phoneDeliverySettings.NotificationsSettingsPhoneDeliverySettingsCustom.GetIdOk() - if phoneDeliverySettingsIdOk { - phoneDeliverySettingsName, phoneDeliverySettingsNameOk = fmt.Sprintf("provider_custom_%s", *phoneDeliverySettingsId), true - } - case phoneDeliverySettings.NotificationsSettingsPhoneDeliverySettingsTwilioSyniverse != nil: - phoneDeliverySettingsId, phoneDeliverySettingsIdOk = phoneDeliverySettings.NotificationsSettingsPhoneDeliverySettingsTwilioSyniverse.GetIdOk() - phoneDeliverySettingsProvider, phoneDeliverySettingProviderOk := phoneDeliverySettings.NotificationsSettingsPhoneDeliverySettingsTwilioSyniverse.GetProviderOk() - if phoneDeliverySettingsIdOk && phoneDeliverySettingProviderOk { - switch *phoneDeliverySettingsProvider { - case management.ENUMNOTIFICATIONSSETTINGSPHONEDELIVERYSETTINGSPROVIDER_TWILIO: - phoneDeliverySettingsName, phoneDeliverySettingsNameOk = fmt.Sprintf("provider_twilio_%s", *phoneDeliverySettingsId), true - case management.ENUMNOTIFICATIONSSETTINGSPHONEDELIVERYSETTINGSPROVIDER_SYNIVERSE: - phoneDeliverySettingsName, phoneDeliverySettingsNameOk = fmt.Sprintf("provider_syniverse_%s", *phoneDeliverySettingsId), true - default: - continue - } + for _, phoneDeliverySettings := range phoneDeliverySettings { + var ( + phoneDeliverySettingsId *string + phoneDeliverySettingsIdOk bool + phoneDeliverySettingsName string + phoneDeliverySettingsNameOk bool + ) + + switch { + case phoneDeliverySettings.NotificationsSettingsPhoneDeliverySettingsCustom != nil: + phoneDeliverySettingsId, phoneDeliverySettingsIdOk = phoneDeliverySettings.NotificationsSettingsPhoneDeliverySettingsCustom.GetIdOk() + if phoneDeliverySettingsIdOk { + phoneDeliverySettingsName, phoneDeliverySettingsNameOk = fmt.Sprintf("provider_custom_%s", *phoneDeliverySettingsId), true + } + case phoneDeliverySettings.NotificationsSettingsPhoneDeliverySettingsTwilioSyniverse != nil: + phoneDeliverySettingsId, phoneDeliverySettingsIdOk = phoneDeliverySettings.NotificationsSettingsPhoneDeliverySettingsTwilioSyniverse.GetIdOk() + phoneDeliverySettingsProvider, phoneDeliverySettingProviderOk := phoneDeliverySettings.NotificationsSettingsPhoneDeliverySettingsTwilioSyniverse.GetProviderOk() + if phoneDeliverySettingsIdOk && phoneDeliverySettingProviderOk { + switch *phoneDeliverySettingsProvider { + case management.ENUMNOTIFICATIONSSETTINGSPHONEDELIVERYSETTINGSPROVIDER_TWILIO: + phoneDeliverySettingsName, phoneDeliverySettingsNameOk = fmt.Sprintf("provider_twilio_%s", *phoneDeliverySettingsId), true + case management.ENUMNOTIFICATIONSSETTINGSPHONEDELIVERYSETTINGSPROVIDER_SYNIVERSE: + phoneDeliverySettingsName, phoneDeliverySettingsNameOk = fmt.Sprintf("provider_syniverse_%s", *phoneDeliverySettingsId), true + default: + continue } - default: - continue } + default: + continue + } - if phoneDeliverySettingsIdOk && phoneDeliverySettingsNameOk { - phoneDeliverySettingsData[*phoneDeliverySettingsId] = phoneDeliverySettingsName - } + if phoneDeliverySettingsIdOk && phoneDeliverySettingsNameOk { + phoneDeliverySettingsData[*phoneDeliverySettingsId] = phoneDeliverySettingsName } } - return &phoneDeliverySettingsData, nil + return phoneDeliverySettingsData, nil } diff --git a/internal/connector/pingone/platform/resources/pingone_system_application.go b/internal/connector/pingone/platform/resources/pingone_system_application.go index a9901a5b..2940630f 100644 --- a/internal/connector/pingone/platform/resources/pingone_system_application.go +++ b/internal/connector/pingone/platform/resources/pingone_system_application.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,7 +41,7 @@ func (r *PingOneSystemApplicationResource) ExportAll() (*[]connector.ImportBlock return nil, err } - for appId, appName := range *applicationData { + for appId, appName := range applicationData { commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, "Resource Type": r.ResourceType(), @@ -60,50 +62,37 @@ func (r *PingOneSystemApplicationResource) ExportAll() (*[]connector.ImportBlock return &importBlocks, nil } -func (r *PingOneSystemApplicationResource) getSystemApplicationData() (*map[string]string, error) { +func (r *PingOneSystemApplicationResource) getSystemApplicationData() (map[string]string, error) { applicationData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.ApplicationsApi.ReadAllApplications(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() - - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllApplications", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) + applications, err := pingone.GetManagementAPIObjectsFromIterator[management.ReadOneApplication200Response](iter, "ReadAllApplications", "GetApplications", r.ResourceType()) + if err != nil { + return nil, err + } + for _, application := range applications { + var ( + applicationId *string + applicationIdOk bool + applicationName *string + applicationNameOk bool + ) + + switch { + case application.ApplicationPingOnePortal != nil: + applicationId, applicationIdOk = application.ApplicationPingOnePortal.GetIdOk() + applicationName, applicationNameOk = application.ApplicationPingOnePortal.GetNameOk() + case application.ApplicationPingOneSelfService != nil: + applicationId, applicationIdOk = application.ApplicationPingOneSelfService.GetIdOk() + applicationName, applicationNameOk = application.ApplicationPingOneSelfService.GetNameOk() + default: + continue } - for _, app := range embedded.GetApplications() { - var ( - appId *string - appIdOk bool - appName *string - appNameOk bool - ) - - switch { - case app.ApplicationPingOnePortal != nil: - appId, appIdOk = app.ApplicationPingOnePortal.GetIdOk() - appName, appNameOk = app.ApplicationPingOnePortal.GetNameOk() - case app.ApplicationPingOneSelfService != nil: - appId, appIdOk = app.ApplicationPingOneSelfService.GetIdOk() - appName, appNameOk = app.ApplicationPingOneSelfService.GetNameOk() - default: - continue - } - - if appIdOk && appNameOk { - applicationData[*appId] = *appName - } + if applicationIdOk && applicationNameOk { + applicationData[*applicationId] = *applicationName } } - return &applicationData, nil + return applicationData, nil } diff --git a/internal/connector/pingone/platform/resources/pingone_trusted_email_address.go b/internal/connector/pingone/platform/resources/pingone_trusted_email_address.go index 0f115b49..a418d891 100644 --- a/internal/connector/pingone/platform/resources/pingone_trusted_email_address.go +++ b/internal/connector/pingone/platform/resources/pingone_trusted_email_address.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,13 +41,13 @@ func (r *PingOneTrustedEmailAddressResource) ExportAll() (*[]connector.ImportBlo return nil, err } - for trustedEmailDomainId, trustedEmailDomainName := range *trustedEmailDomainData { + for trustedEmailDomainId, trustedEmailDomainName := range trustedEmailDomainData { trustedEmailAddressData, err := r.getTrustedEmailAddressData(trustedEmailDomainId) if err != nil { return nil, err } - for trustedEmailId, trustedEmailAddress := range *trustedEmailAddressData { + for trustedEmailId, trustedEmailAddress := range trustedEmailAddressData { commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, "Resource Type": r.ResourceType(), @@ -69,68 +71,44 @@ func (r *PingOneTrustedEmailAddressResource) ExportAll() (*[]connector.ImportBlo return &importBlocks, nil } -func (r *PingOneTrustedEmailAddressResource) getTrustedEmailDomainData() (*map[string]string, error) { +func (r *PingOneTrustedEmailAddressResource) getTrustedEmailDomainData() (map[string]string, error) { trustedEmailDomainData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.TrustedEmailDomainsApi.ReadAllTrustedEmailDomains(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + trustedEmailDomains, err := pingone.GetManagementAPIObjectsFromIterator[management.EmailDomain](iter, "ReadAllTrustedEmailDomains", "GetEmailDomains", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllTrustedEmailDomains", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, trustedEmailDomain := range embedded.GetEmailDomains() { - trustedEmailDomainId, trustedEmailDomainIdOk := trustedEmailDomain.GetIdOk() - trustedEmailDomainName, trustedEmailDomainNameOk := trustedEmailDomain.GetDomainNameOk() + for _, trustedEmailDomain := range trustedEmailDomains { + trustedEmailDomainId, trustedEmailDomainIdOk := trustedEmailDomain.GetIdOk() + trustedEmailDomainName, trustedEmailDomainNameOk := trustedEmailDomain.GetDomainNameOk() - if trustedEmailDomainIdOk && trustedEmailDomainNameOk { - trustedEmailDomainData[*trustedEmailDomainId] = *trustedEmailDomainName - } + if trustedEmailDomainIdOk && trustedEmailDomainNameOk { + trustedEmailDomainData[*trustedEmailDomainId] = *trustedEmailDomainName } } - return &trustedEmailDomainData, nil + return trustedEmailDomainData, nil } -func (r *PingOneTrustedEmailAddressResource) getTrustedEmailAddressData(trustedEmailDomainId string) (*map[string]string, error) { +func (r *PingOneTrustedEmailAddressResource) getTrustedEmailAddressData(trustedEmailDomainId string) (map[string]string, error) { trustedEmailAddressData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.TrustedEmailAddressesApi.ReadAllTrustedEmailAddresses(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID, trustedEmailDomainId).Execute() + trustedEmailAddresses, err := pingone.GetManagementAPIObjectsFromIterator[management.EmailDomainTrustedEmail](iter, "ReadAllTrustedEmailAddresses", "GetTrustedEmails", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllTrustedEmailAddresses", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, trustedEmail := range embedded.GetTrustedEmails() { - trustedEmailAddress, trustedEmailAddressOk := trustedEmail.GetEmailAddressOk() - trustedEmailId, trustedEmailIdOk := trustedEmail.GetIdOk() + for _, trustedEmail := range trustedEmailAddresses { + trustedEmailAddress, trustedEmailAddressOk := trustedEmail.GetEmailAddressOk() + trustedEmailId, trustedEmailIdOk := trustedEmail.GetIdOk() - if trustedEmailAddressOk && trustedEmailIdOk { - trustedEmailAddressData[*trustedEmailId] = *trustedEmailAddress - } + if trustedEmailAddressOk && trustedEmailIdOk { + trustedEmailAddressData[*trustedEmailId] = *trustedEmailAddress } } - return &trustedEmailAddressData, nil + return trustedEmailAddressData, nil } diff --git a/internal/connector/pingone/platform/resources/pingone_trusted_email_domain.go b/internal/connector/pingone/platform/resources/pingone_trusted_email_domain.go index f0debf8b..9ae6df09 100644 --- a/internal/connector/pingone/platform/resources/pingone_trusted_email_domain.go +++ b/internal/connector/pingone/platform/resources/pingone_trusted_email_domain.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,7 +41,7 @@ func (r *PingOneTrustedEmailDomainResource) ExportAll() (*[]connector.ImportBloc return nil, err } - for trustedEmailDomainId, trustedEmailDomainName := range *trustedEmailDomainData { + for trustedEmailDomainId, trustedEmailDomainName := range trustedEmailDomainData { commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, "Resource Type": r.ResourceType(), @@ -60,35 +62,23 @@ func (r *PingOneTrustedEmailDomainResource) ExportAll() (*[]connector.ImportBloc return &importBlocks, nil } -func (r *PingOneTrustedEmailDomainResource) getTrustedEmailDomainData() (*map[string]string, error) { +func (r *PingOneTrustedEmailDomainResource) getTrustedEmailDomainData() (map[string]string, error) { trustedEmailDomainData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.TrustedEmailDomainsApi.ReadAllTrustedEmailDomains(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + trustedEmailDomains, err := pingone.GetManagementAPIObjectsFromIterator[management.EmailDomain](iter, "ReadAllTrustedEmailDomains", "GetEmailDomains", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllTrustedEmailDomains", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, emailDomain := range embedded.GetEmailDomains() { - emailDomainId, emailDomainIdOk := emailDomain.GetIdOk() - emailDomainName, emailDomainNameOk := emailDomain.GetDomainNameOk() + for _, trustedEmailDomain := range trustedEmailDomains { + trustedEmailDomainId, trustedEmailDomainIdOk := trustedEmailDomain.GetIdOk() + trustedEmailDomainName, trustedEmailDomainNameOk := trustedEmailDomain.GetDomainNameOk() - if emailDomainIdOk && emailDomainNameOk { - trustedEmailDomainData[*emailDomainId] = *emailDomainName - } + if trustedEmailDomainIdOk && trustedEmailDomainNameOk { + trustedEmailDomainData[*trustedEmailDomainId] = *trustedEmailDomainName } } - return &trustedEmailDomainData, nil + return trustedEmailDomainData, nil } diff --git a/internal/connector/pingone/platform/resources/pingone_webhook.go b/internal/connector/pingone/platform/resources/pingone_webhook.go index e3b94815..3e9e0f73 100644 --- a/internal/connector/pingone/platform/resources/pingone_webhook.go +++ b/internal/connector/pingone/platform/resources/pingone_webhook.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,7 +41,7 @@ func (r *PingOneWebhookResource) ExportAll() (*[]connector.ImportBlock, error) { return nil, err } - for subscriptionId, subscriptionName := range *subscriptionData { + for subscriptionId, subscriptionName := range subscriptionData { commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, "Resource Type": r.ResourceType(), @@ -60,35 +62,23 @@ func (r *PingOneWebhookResource) ExportAll() (*[]connector.ImportBlock, error) { return &importBlocks, nil } -func (r *PingOneWebhookResource) getSubscriptionData() (*map[string]string, error) { +func (r *PingOneWebhookResource) getSubscriptionData() (map[string]string, error) { subscriptionData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.SubscriptionsWebhooksApi.ReadAllSubscriptions(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + subscriptions, err := pingone.GetManagementAPIObjectsFromIterator[management.Subscription](iter, "ReadAllSubscriptions", "GetSubscriptions", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllSubscriptions", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, subscription := range embedded.GetSubscriptions() { - subscriptionId, subscriptionIdOk := subscription.GetIdOk() - subscriptionName, subscriptionNameOk := subscription.GetNameOk() + for _, subscription := range subscriptions { + subscriptionId, subscriptionIdOk := subscription.GetIdOk() + subscriptionName, subscriptionNameOk := subscription.GetNameOk() - if subscriptionIdOk && subscriptionNameOk { - subscriptionData[*subscriptionId] = *subscriptionName - } + if subscriptionIdOk && subscriptionNameOk { + subscriptionData[*subscriptionId] = *subscriptionName } } - return &subscriptionData, nil + return subscriptionData, nil } diff --git a/internal/connector/pingone/protect/resources/pingone_risk_policy.go b/internal/connector/pingone/protect/resources/pingone_risk_policy.go index 14327882..32ed7fcb 100644 --- a/internal/connector/pingone/protect/resources/pingone_risk_policy.go +++ b/internal/connector/pingone/protect/resources/pingone_risk_policy.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/risk" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -34,12 +36,12 @@ func (r *PingOneRiskPolicyResource) ExportAll() (*[]connector.ImportBlock, error importBlocks := []connector.ImportBlock{} - ristPolicySetData, err := r.getRiskPolicySetData() + riskPolicySetData, err := r.getRiskPolicySetData() if err != nil { return nil, err } - for riskPolicySetId, riskPolicySetName := range *ristPolicySetData { + for riskPolicySetId, riskPolicySetName := range riskPolicySetData { commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, "Resource Type": r.ResourceType(), @@ -60,35 +62,23 @@ func (r *PingOneRiskPolicyResource) ExportAll() (*[]connector.ImportBlock, error return &importBlocks, nil } -func (r *PingOneRiskPolicyResource) getRiskPolicySetData() (*map[string]string, error) { +func (r *PingOneRiskPolicyResource) getRiskPolicySetData() (map[string]string, error) { riskPolicySetData := make(map[string]string) iter := r.clientInfo.ApiClient.RiskAPIClient.RiskPoliciesApi.ReadRiskPolicySets(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + riskPolicySets, err := pingone.GetRiskAPIObjectsFromIterator[risk.RiskPolicySet](iter, "ReadRiskPolicySets", "GetRiskPolicySets", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadRiskPolicySets", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, riskPolicySet := range embedded.GetRiskPolicySets() { - riskPolicySetName, riskPolicySetNameOk := riskPolicySet.GetNameOk() - riskPolicySetId, riskPolicySetIdOk := riskPolicySet.GetIdOk() + for _, riskPolicySet := range riskPolicySets { + riskPolicySetName, riskPolicySetNameOk := riskPolicySet.GetNameOk() + riskPolicySetId, riskPolicySetIdOk := riskPolicySet.GetIdOk() - if riskPolicySetIdOk && riskPolicySetNameOk { - riskPolicySetData[*riskPolicySetId] = *riskPolicySetName - } + if riskPolicySetIdOk && riskPolicySetNameOk { + riskPolicySetData[*riskPolicySetId] = *riskPolicySetName } } - return &riskPolicySetData, nil + return riskPolicySetData, nil } diff --git a/internal/connector/pingone/protect/resources/pingone_risk_predictor.go b/internal/connector/pingone/protect/resources/pingone_risk_predictor.go index 9eb7f85f..c2d1cf54 100644 --- a/internal/connector/pingone/protect/resources/pingone_risk_predictor.go +++ b/internal/connector/pingone/protect/resources/pingone_risk_predictor.go @@ -6,6 +6,7 @@ import ( "github.com/patrickcping/pingone-go-sdk-v2/risk" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -40,7 +41,7 @@ func (r *PingOneRiskPredictorResource) ExportAll() (*[]connector.ImportBlock, er return nil, err } - for riskPredictorId, riskPredictorInfo := range *riskPredictorData { + for riskPredictorId, riskPredictorInfo := range riskPredictorData { riskPredictorName := riskPredictorInfo[0] riskPredictorType := riskPredictorInfo[1] @@ -65,98 +66,86 @@ func (r *PingOneRiskPredictorResource) ExportAll() (*[]connector.ImportBlock, er return &importBlocks, nil } -func (r *PingOneRiskPredictorResource) getRiskPredictorData() (*map[string][]string, error) { +func (r *PingOneRiskPredictorResource) getRiskPredictorData() (map[string][]string, error) { riskPredictorData := make(map[string][]string) iter := r.clientInfo.ApiClient.RiskAPIClient.RiskAdvancedPredictorsApi.ReadAllRiskPredictors(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + riskPredictors, err := pingone.GetRiskAPIObjectsFromIterator[risk.RiskPredictor](iter, "ReadAllRiskPredictors", "GetRiskPredictors", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllRiskPredictors", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) + for _, riskPredictor := range riskPredictors { + var ( + riskPredictorId *string + riskPredictorIdOk bool + riskPredictorName *string + riskPredictorNameOk bool + riskPredictorType *risk.EnumPredictorType + riskPredictorTypeOk bool + ) + + switch { + case riskPredictor.RiskPredictorAdversaryInTheMiddle != nil: + riskPredictorId, riskPredictorIdOk = riskPredictor.RiskPredictorAdversaryInTheMiddle.GetIdOk() + riskPredictorName, riskPredictorNameOk = riskPredictor.RiskPredictorAdversaryInTheMiddle.GetNameOk() + riskPredictorType, riskPredictorTypeOk = riskPredictor.RiskPredictorAdversaryInTheMiddle.GetTypeOk() + case riskPredictor.RiskPredictorAnonymousNetwork != nil: + riskPredictorId, riskPredictorIdOk = riskPredictor.RiskPredictorAnonymousNetwork.GetIdOk() + riskPredictorName, riskPredictorNameOk = riskPredictor.RiskPredictorAnonymousNetwork.GetNameOk() + riskPredictorType, riskPredictorTypeOk = riskPredictor.RiskPredictorAnonymousNetwork.GetTypeOk() + case riskPredictor.RiskPredictorBotDetection != nil: + riskPredictorId, riskPredictorIdOk = riskPredictor.RiskPredictorBotDetection.GetIdOk() + riskPredictorName, riskPredictorNameOk = riskPredictor.RiskPredictorBotDetection.GetNameOk() + riskPredictorType, riskPredictorTypeOk = riskPredictor.RiskPredictorBotDetection.GetTypeOk() + case riskPredictor.RiskPredictorCommon != nil: + riskPredictorId, riskPredictorIdOk = riskPredictor.RiskPredictorCommon.GetIdOk() + riskPredictorName, riskPredictorNameOk = riskPredictor.RiskPredictorCommon.GetNameOk() + riskPredictorType, riskPredictorTypeOk = riskPredictor.RiskPredictorCommon.GetTypeOk() + case riskPredictor.RiskPredictorComposite != nil: + riskPredictorId, riskPredictorIdOk = riskPredictor.RiskPredictorComposite.GetIdOk() + riskPredictorName, riskPredictorNameOk = riskPredictor.RiskPredictorComposite.GetNameOk() + riskPredictorType, riskPredictorTypeOk = riskPredictor.RiskPredictorComposite.GetTypeOk() + case riskPredictor.RiskPredictorCustom != nil: + riskPredictorId, riskPredictorIdOk = riskPredictor.RiskPredictorCustom.GetIdOk() + riskPredictorName, riskPredictorNameOk = riskPredictor.RiskPredictorCustom.GetNameOk() + riskPredictorType, riskPredictorTypeOk = riskPredictor.RiskPredictorCustom.GetTypeOk() + case riskPredictor.RiskPredictorDevice != nil: + riskPredictorId, riskPredictorIdOk = riskPredictor.RiskPredictorDevice.GetIdOk() + riskPredictorName, riskPredictorNameOk = riskPredictor.RiskPredictorDevice.GetNameOk() + riskPredictorType, riskPredictorTypeOk = riskPredictor.RiskPredictorDevice.GetTypeOk() + case riskPredictor.RiskPredictorEmailReputation != nil: + riskPredictorId, riskPredictorIdOk = riskPredictor.RiskPredictorEmailReputation.GetIdOk() + riskPredictorName, riskPredictorNameOk = riskPredictor.RiskPredictorEmailReputation.GetNameOk() + riskPredictorType, riskPredictorTypeOk = riskPredictor.RiskPredictorEmailReputation.GetTypeOk() + case riskPredictor.RiskPredictorGeovelocity != nil: + riskPredictorId, riskPredictorIdOk = riskPredictor.RiskPredictorGeovelocity.GetIdOk() + riskPredictorName, riskPredictorNameOk = riskPredictor.RiskPredictorGeovelocity.GetNameOk() + riskPredictorType, riskPredictorTypeOk = riskPredictor.RiskPredictorGeovelocity.GetTypeOk() + case riskPredictor.RiskPredictorIPReputation != nil: + riskPredictorId, riskPredictorIdOk = riskPredictor.RiskPredictorIPReputation.GetIdOk() + riskPredictorName, riskPredictorNameOk = riskPredictor.RiskPredictorIPReputation.GetNameOk() + riskPredictorType, riskPredictorTypeOk = riskPredictor.RiskPredictorIPReputation.GetTypeOk() + case riskPredictor.RiskPredictorUserLocationAnomaly != nil: + riskPredictorId, riskPredictorIdOk = riskPredictor.RiskPredictorUserLocationAnomaly.GetIdOk() + riskPredictorName, riskPredictorNameOk = riskPredictor.RiskPredictorUserLocationAnomaly.GetNameOk() + riskPredictorType, riskPredictorTypeOk = riskPredictor.RiskPredictorUserLocationAnomaly.GetTypeOk() + case riskPredictor.RiskPredictorUserRiskBehavior != nil: + riskPredictorId, riskPredictorIdOk = riskPredictor.RiskPredictorUserRiskBehavior.GetIdOk() + riskPredictorName, riskPredictorNameOk = riskPredictor.RiskPredictorUserRiskBehavior.GetNameOk() + riskPredictorType, riskPredictorTypeOk = riskPredictor.RiskPredictorUserRiskBehavior.GetTypeOk() + case riskPredictor.RiskPredictorVelocity != nil: + riskPredictorId, riskPredictorIdOk = riskPredictor.RiskPredictorVelocity.GetIdOk() + riskPredictorName, riskPredictorNameOk = riskPredictor.RiskPredictorVelocity.GetNameOk() + riskPredictorType, riskPredictorTypeOk = riskPredictor.RiskPredictorVelocity.GetTypeOk() + default: + continue } - for _, riskPredictor := range embedded.GetRiskPredictors() { - var ( - riskPredictorId *string - riskPredictorIdOk bool - riskPredictorName *string - riskPredictorNameOk bool - riskPredictorType *risk.EnumPredictorType - riskPredictorTypeOk bool - ) - - switch { - case riskPredictor.RiskPredictorAdversaryInTheMiddle != nil: - riskPredictorId, riskPredictorIdOk = riskPredictor.RiskPredictorAdversaryInTheMiddle.GetIdOk() - riskPredictorName, riskPredictorNameOk = riskPredictor.RiskPredictorAdversaryInTheMiddle.GetNameOk() - riskPredictorType, riskPredictorTypeOk = riskPredictor.RiskPredictorAdversaryInTheMiddle.GetTypeOk() - case riskPredictor.RiskPredictorAnonymousNetwork != nil: - riskPredictorId, riskPredictorIdOk = riskPredictor.RiskPredictorAnonymousNetwork.GetIdOk() - riskPredictorName, riskPredictorNameOk = riskPredictor.RiskPredictorAnonymousNetwork.GetNameOk() - riskPredictorType, riskPredictorTypeOk = riskPredictor.RiskPredictorAnonymousNetwork.GetTypeOk() - case riskPredictor.RiskPredictorBotDetection != nil: - riskPredictorId, riskPredictorIdOk = riskPredictor.RiskPredictorBotDetection.GetIdOk() - riskPredictorName, riskPredictorNameOk = riskPredictor.RiskPredictorBotDetection.GetNameOk() - riskPredictorType, riskPredictorTypeOk = riskPredictor.RiskPredictorBotDetection.GetTypeOk() - case riskPredictor.RiskPredictorCommon != nil: - riskPredictorId, riskPredictorIdOk = riskPredictor.RiskPredictorCommon.GetIdOk() - riskPredictorName, riskPredictorNameOk = riskPredictor.RiskPredictorCommon.GetNameOk() - riskPredictorType, riskPredictorTypeOk = riskPredictor.RiskPredictorCommon.GetTypeOk() - case riskPredictor.RiskPredictorComposite != nil: - riskPredictorId, riskPredictorIdOk = riskPredictor.RiskPredictorComposite.GetIdOk() - riskPredictorName, riskPredictorNameOk = riskPredictor.RiskPredictorComposite.GetNameOk() - riskPredictorType, riskPredictorTypeOk = riskPredictor.RiskPredictorComposite.GetTypeOk() - case riskPredictor.RiskPredictorCustom != nil: - riskPredictorId, riskPredictorIdOk = riskPredictor.RiskPredictorCustom.GetIdOk() - riskPredictorName, riskPredictorNameOk = riskPredictor.RiskPredictorCustom.GetNameOk() - riskPredictorType, riskPredictorTypeOk = riskPredictor.RiskPredictorCustom.GetTypeOk() - case riskPredictor.RiskPredictorDevice != nil: - riskPredictorId, riskPredictorIdOk = riskPredictor.RiskPredictorDevice.GetIdOk() - riskPredictorName, riskPredictorNameOk = riskPredictor.RiskPredictorDevice.GetNameOk() - riskPredictorType, riskPredictorTypeOk = riskPredictor.RiskPredictorDevice.GetTypeOk() - case riskPredictor.RiskPredictorEmailReputation != nil: - riskPredictorId, riskPredictorIdOk = riskPredictor.RiskPredictorEmailReputation.GetIdOk() - riskPredictorName, riskPredictorNameOk = riskPredictor.RiskPredictorEmailReputation.GetNameOk() - riskPredictorType, riskPredictorTypeOk = riskPredictor.RiskPredictorEmailReputation.GetTypeOk() - case riskPredictor.RiskPredictorGeovelocity != nil: - riskPredictorId, riskPredictorIdOk = riskPredictor.RiskPredictorGeovelocity.GetIdOk() - riskPredictorName, riskPredictorNameOk = riskPredictor.RiskPredictorGeovelocity.GetNameOk() - riskPredictorType, riskPredictorTypeOk = riskPredictor.RiskPredictorGeovelocity.GetTypeOk() - case riskPredictor.RiskPredictorIPReputation != nil: - riskPredictorId, riskPredictorIdOk = riskPredictor.RiskPredictorIPReputation.GetIdOk() - riskPredictorName, riskPredictorNameOk = riskPredictor.RiskPredictorIPReputation.GetNameOk() - riskPredictorType, riskPredictorTypeOk = riskPredictor.RiskPredictorIPReputation.GetTypeOk() - case riskPredictor.RiskPredictorUserLocationAnomaly != nil: - riskPredictorId, riskPredictorIdOk = riskPredictor.RiskPredictorUserLocationAnomaly.GetIdOk() - riskPredictorName, riskPredictorNameOk = riskPredictor.RiskPredictorUserLocationAnomaly.GetNameOk() - riskPredictorType, riskPredictorTypeOk = riskPredictor.RiskPredictorUserLocationAnomaly.GetTypeOk() - case riskPredictor.RiskPredictorUserRiskBehavior != nil: - riskPredictorId, riskPredictorIdOk = riskPredictor.RiskPredictorUserRiskBehavior.GetIdOk() - riskPredictorName, riskPredictorNameOk = riskPredictor.RiskPredictorUserRiskBehavior.GetNameOk() - riskPredictorType, riskPredictorTypeOk = riskPredictor.RiskPredictorUserRiskBehavior.GetTypeOk() - case riskPredictor.RiskPredictorVelocity != nil: - riskPredictorId, riskPredictorIdOk = riskPredictor.RiskPredictorVelocity.GetIdOk() - riskPredictorName, riskPredictorNameOk = riskPredictor.RiskPredictorVelocity.GetNameOk() - riskPredictorType, riskPredictorTypeOk = riskPredictor.RiskPredictorVelocity.GetTypeOk() - default: - continue - } - - if riskPredictorIdOk && riskPredictorNameOk && riskPredictorTypeOk { - riskPredictorData[*riskPredictorId] = []string{*riskPredictorName, string(*riskPredictorType)} - } + if riskPredictorIdOk && riskPredictorNameOk && riskPredictorTypeOk { + riskPredictorData[*riskPredictorId] = []string{*riskPredictorName, string(*riskPredictorType)} } } - return &riskPredictorData, nil + return riskPredictorData, nil } diff --git a/internal/connector/pingone/sso/resources/pingone_application.go b/internal/connector/pingone/sso/resources/pingone_application.go index 1b94f1e9..91ca6a58 100644 --- a/internal/connector/pingone/sso/resources/pingone_application.go +++ b/internal/connector/pingone/sso/resources/pingone_application.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,7 +41,7 @@ func (r *PingOneApplicationResource) ExportAll() (*[]connector.ImportBlock, erro return nil, err } - for appId, appName := range *applicationData { + for appId, appName := range applicationData { commentData := map[string]string{ "Application ID": appId, "Application Name": appName, @@ -60,53 +62,41 @@ func (r *PingOneApplicationResource) ExportAll() (*[]connector.ImportBlock, erro return &importBlocks, nil } -func (r *PingOneApplicationResource) getApplicationData() (*map[string]string, error) { +func (r *PingOneApplicationResource) getApplicationData() (map[string]string, error) { applicationData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.ApplicationsApi.ReadAllApplications(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + applications, err := pingone.GetManagementAPIObjectsFromIterator[management.ReadOneApplication200Response](iter, "ReadAllApplications", "GetApplications", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllApplications", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) + for _, app := range applications { + var ( + appId *string + appIdOk bool + appName *string + appNameOk bool + ) + + switch { + case app.ApplicationOIDC != nil: + appId, appIdOk = app.ApplicationOIDC.GetIdOk() + appName, appNameOk = app.ApplicationOIDC.GetNameOk() + case app.ApplicationSAML != nil: + appId, appIdOk = app.ApplicationSAML.GetIdOk() + appName, appNameOk = app.ApplicationSAML.GetNameOk() + case app.ApplicationExternalLink != nil: + appId, appIdOk = app.ApplicationExternalLink.GetIdOk() + appName, appNameOk = app.ApplicationExternalLink.GetNameOk() + default: + continue } - for _, app := range embedded.GetApplications() { - var ( - appId *string - appIdOk bool - appName *string - appNameOk bool - ) - - switch { - case app.ApplicationOIDC != nil: - appId, appIdOk = app.ApplicationOIDC.GetIdOk() - appName, appNameOk = app.ApplicationOIDC.GetNameOk() - case app.ApplicationSAML != nil: - appId, appIdOk = app.ApplicationSAML.GetIdOk() - appName, appNameOk = app.ApplicationSAML.GetNameOk() - case app.ApplicationExternalLink != nil: - appId, appIdOk = app.ApplicationExternalLink.GetIdOk() - appName, appNameOk = app.ApplicationExternalLink.GetNameOk() - default: - continue - } - - if appIdOk && appNameOk { - applicationData[*appId] = *appName - } + if appIdOk && appNameOk { + applicationData[*appId] = *appName } } - return &applicationData, nil + return applicationData, nil } diff --git a/internal/connector/pingone/sso/resources/pingone_application_attribute_mapping.go b/internal/connector/pingone/sso/resources/pingone_application_attribute_mapping.go index deb5050b..847109de 100644 --- a/internal/connector/pingone/sso/resources/pingone_application_attribute_mapping.go +++ b/internal/connector/pingone/sso/resources/pingone_application_attribute_mapping.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,13 +41,13 @@ func (r *PingOneApplicationAttributeMappingResource) ExportAll() (*[]connector.I return nil, err } - for appId, appName := range *applicationData { + for appId, appName := range applicationData { applicationAttributeMappingData, err := r.getApplicationAttributeMappingData(appId) if err != nil { return nil, err } - for attributeMappingId, attributeMappingName := range *applicationAttributeMappingData { + for attributeMappingId, attributeMappingName := range applicationAttributeMappingData { commentData := map[string]string{ "Application ID": appId, "Application Name": appName, @@ -69,85 +71,61 @@ func (r *PingOneApplicationAttributeMappingResource) ExportAll() (*[]connector.I return &importBlocks, nil } -func (r *PingOneApplicationAttributeMappingResource) getApplicationData() (*map[string]string, error) { +func (r *PingOneApplicationAttributeMappingResource) getApplicationData() (map[string]string, error) { applicationData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.ApplicationsApi.ReadAllApplications(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + applications, err := pingone.GetManagementAPIObjectsFromIterator[management.ReadOneApplication200Response](iter, "ReadAllApplications", "GetApplications", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllApplications", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) + for _, app := range applications { + var ( + appId *string + appIdOk bool + appName *string + appNameOk bool + ) + + switch { + case app.ApplicationOIDC != nil: + appId, appIdOk = app.ApplicationOIDC.GetIdOk() + appName, appNameOk = app.ApplicationOIDC.GetNameOk() + case app.ApplicationSAML != nil: + appId, appIdOk = app.ApplicationSAML.GetIdOk() + appName, appNameOk = app.ApplicationSAML.GetNameOk() + default: + continue } - for _, app := range embedded.GetApplications() { - var ( - appId *string - appIdOk bool - appName *string - appNameOk bool - ) - - switch { - case app.ApplicationOIDC != nil: - appId, appIdOk = app.ApplicationOIDC.GetIdOk() - appName, appNameOk = app.ApplicationOIDC.GetNameOk() - case app.ApplicationSAML != nil: - appId, appIdOk = app.ApplicationSAML.GetIdOk() - appName, appNameOk = app.ApplicationSAML.GetNameOk() - default: - continue - } - - if appIdOk && appNameOk { - applicationData[*appId] = *appName - } + if appIdOk && appNameOk { + applicationData[*appId] = *appName } } - return &applicationData, nil + return applicationData, nil } -func (r *PingOneApplicationAttributeMappingResource) getApplicationAttributeMappingData(appId string) (*map[string]string, error) { +func (r *PingOneApplicationAttributeMappingResource) getApplicationAttributeMappingData(appId string) (map[string]string, error) { applicationAttributeMappingData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.ApplicationAttributeMappingApi.ReadAllApplicationAttributeMappings(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID, appId).Execute() + attributeMappingInners, err := pingone.GetManagementAPIObjectsFromIterator[management.EntityArrayEmbeddedAttributesInner](iter, "ReadAllApplicationAttributeMappings", "GetAttributes", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllApplicationAttributeMappings", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, attributeMapping := range embedded.GetAttributes() { - if attributeMapping.ApplicationAttributeMapping != nil { - attributeMappingId, attributeMappingIdOk := attributeMapping.ApplicationAttributeMapping.GetIdOk() - attributeMappingName, attributeMappingNameOk := attributeMapping.ApplicationAttributeMapping.GetNameOk() + for _, attributeMappingInner := range attributeMappingInners { + if attributeMappingInner.ApplicationAttributeMapping != nil { + attributeMappingId, attributeMappingIdOk := attributeMappingInner.ApplicationAttributeMapping.GetIdOk() + attributeMappingName, attributeMappingNameOk := attributeMappingInner.ApplicationAttributeMapping.GetNameOk() - if attributeMappingIdOk && attributeMappingNameOk { - applicationAttributeMappingData[*attributeMappingId] = *attributeMappingName - } + if attributeMappingIdOk && attributeMappingNameOk { + applicationAttributeMappingData[*attributeMappingId] = *attributeMappingName } } } - return &applicationAttributeMappingData, nil + return applicationAttributeMappingData, nil } diff --git a/internal/connector/pingone/sso/resources/pingone_application_flow_policy_assignment.go b/internal/connector/pingone/sso/resources/pingone_application_flow_policy_assignment.go index 280dd9f6..96211e7e 100644 --- a/internal/connector/pingone/sso/resources/pingone_application_flow_policy_assignment.go +++ b/internal/connector/pingone/sso/resources/pingone_application_flow_policy_assignment.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,30 +41,33 @@ func (r *PingOneApplicationFlowPolicyAssignmentResource) ExportAll() (*[]connect return nil, err } - for appId, appName := range *applicationData { + for appId, appName := range applicationData { flowPolicyAssignmentData, err := r.getFlowPolicyAssignmentData(appId) if err != nil { return nil, err } - for flowPolicyAssignmentId, flowPolicyId := range *flowPolicyAssignmentData { - flowPolicyName, err := r.getFlowPolicyName(flowPolicyId) + for flowPolicyAssignmentId, flowPolicyId := range flowPolicyAssignmentData { + flowPolicyName, flowPolicyNameOk, err := r.getFlowPolicyName(flowPolicyId) if err != nil { return nil, err } + if !flowPolicyNameOk { + continue + } commentData := map[string]string{ "Application ID": appId, "Application Name": appName, "Export Environment ID": r.clientInfo.ExportEnvironmentID, "Flow Policy Assignment ID": flowPolicyAssignmentId, - "Flow Policy Name": *flowPolicyName, + "Flow Policy Name": flowPolicyName, "Resource Type": r.ResourceType(), } importBlock := connector.ImportBlock{ ResourceType: r.ResourceType(), - ResourceName: fmt.Sprintf("%s_%s", appName, *flowPolicyName), + ResourceName: fmt.Sprintf("%s_%s", appName, flowPolicyName), ResourceID: fmt.Sprintf("%s/%s/%s", r.clientInfo.ExportEnvironmentID, appId, flowPolicyAssignmentId), CommentInformation: common.GenerateCommentInformation(commentData), } @@ -74,109 +79,88 @@ func (r *PingOneApplicationFlowPolicyAssignmentResource) ExportAll() (*[]connect return &importBlocks, nil } -func (r *PingOneApplicationFlowPolicyAssignmentResource) getApplicationData() (*map[string]string, error) { +func (r *PingOneApplicationFlowPolicyAssignmentResource) getApplicationData() (map[string]string, error) { applicationData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.ApplicationsApi.ReadAllApplications(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + applications, err := pingone.GetManagementAPIObjectsFromIterator[management.ReadOneApplication200Response](iter, "ReadAllApplications", "GetApplications", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllApplications", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) + for _, app := range applications { + var ( + appId *string + appIdOk bool + appName *string + appNameOk bool + ) + + switch { + case app.ApplicationOIDC != nil: + appId, appIdOk = app.ApplicationOIDC.GetIdOk() + appName, appNameOk = app.ApplicationOIDC.GetNameOk() + case app.ApplicationSAML != nil: + appId, appIdOk = app.ApplicationSAML.GetIdOk() + appName, appNameOk = app.ApplicationSAML.GetNameOk() + case app.ApplicationExternalLink != nil: + appId, appIdOk = app.ApplicationExternalLink.GetIdOk() + appName, appNameOk = app.ApplicationExternalLink.GetNameOk() + default: + continue } - for _, app := range embedded.GetApplications() { - var ( - appId *string - appIdOk bool - appName *string - appNameOk bool - ) - - switch { - case app.ApplicationOIDC != nil: - appId, appIdOk = app.ApplicationOIDC.GetIdOk() - appName, appNameOk = app.ApplicationOIDC.GetNameOk() - case app.ApplicationSAML != nil: - appId, appIdOk = app.ApplicationSAML.GetIdOk() - appName, appNameOk = app.ApplicationSAML.GetNameOk() - case app.ApplicationExternalLink != nil: - appId, appIdOk = app.ApplicationExternalLink.GetIdOk() - appName, appNameOk = app.ApplicationExternalLink.GetNameOk() - default: - continue - } - - if appIdOk && appNameOk { - applicationData[*appId] = *appName - } + if appIdOk && appNameOk { + applicationData[*appId] = *appName } } - return &applicationData, nil + return applicationData, nil } -func (r *PingOneApplicationFlowPolicyAssignmentResource) getFlowPolicyAssignmentData(appId string) (*map[string]string, error) { +func (r *PingOneApplicationFlowPolicyAssignmentResource) getFlowPolicyAssignmentData(appId string) (map[string]string, error) { flowPolicyAssignmentData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.ApplicationFlowPolicyAssignmentsApi.ReadAllFlowPolicyAssignments(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID, appId).Execute() + flowPolicyAssignments, err := pingone.GetManagementAPIObjectsFromIterator[management.FlowPolicyAssignment](iter, "ReadAllFlowPolicyAssignments", "GetFlowPolicyAssignments", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllFlowPolicyAssignments", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, flowPolicyAssignment := range embedded.GetFlowPolicyAssignments() { - flowPolicyAssignmentId, flowPolicyAssignmentIdOk := flowPolicyAssignment.GetIdOk() - flowPolicyAssignmentFlowPolicy, flowPolicyAssignmentFlowPolicyOk := flowPolicyAssignment.GetFlowPolicyOk() + for _, flowPolicyAssignment := range flowPolicyAssignments { + flowPolicyAssignmentId, flowPolicyAssignmentIdOk := flowPolicyAssignment.GetIdOk() + flowPolicyAssignmentFlowPolicy, flowPolicyAssignmentFlowPolicyOk := flowPolicyAssignment.GetFlowPolicyOk() - if flowPolicyAssignmentIdOk && flowPolicyAssignmentFlowPolicyOk { - flowPolicyId, flowPolicyIdOk := flowPolicyAssignmentFlowPolicy.GetIdOk() + if flowPolicyAssignmentIdOk && flowPolicyAssignmentFlowPolicyOk { + flowPolicyId, flowPolicyIdOk := flowPolicyAssignmentFlowPolicy.GetIdOk() - if flowPolicyIdOk { - flowPolicyAssignmentData[*flowPolicyAssignmentId] = *flowPolicyId - } + if flowPolicyIdOk { + flowPolicyAssignmentData[*flowPolicyAssignmentId] = *flowPolicyId } } } - return &flowPolicyAssignmentData, nil + return flowPolicyAssignmentData, nil } -func (r *PingOneApplicationFlowPolicyAssignmentResource) getFlowPolicyName(flowPolicyId string) (*string, error) { +func (r *PingOneApplicationFlowPolicyAssignmentResource) getFlowPolicyName(flowPolicyId string) (string, bool, error) { flowPolicy, response, err := r.clientInfo.ApiClient.ManagementAPIClient.FlowPoliciesApi.ReadOneFlowPolicy(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID, flowPolicyId).Execute() - err = common.HandleClientResponse(response, err, "ReadOneFlowPolicy", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "ReadOneFlowPolicy", r.ResourceType()) if err != nil { - return nil, err + return "", false, err + } + if !ok { + return "", false, nil } if flowPolicy != nil { flowPolicyName, flowPolicyNameOk := flowPolicy.GetNameOk() if flowPolicyNameOk { - return flowPolicyName, nil + return *flowPolicyName, true, nil } } - return nil, fmt.Errorf("Unable to get Flow Policy Name for Flow Policy ID: %s", flowPolicyId) + return "", false, fmt.Errorf("unable to get Flow Policy Name for Flow Policy ID: %s", flowPolicyId) } diff --git a/internal/connector/pingone/sso/resources/pingone_application_resource_grant.go b/internal/connector/pingone/sso/resources/pingone_application_resource_grant.go index 9a3b77d8..891eb8d7 100644 --- a/internal/connector/pingone/sso/resources/pingone_application_resource_grant.go +++ b/internal/connector/pingone/sso/resources/pingone_application_resource_grant.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,30 +41,33 @@ func (r *PingOneApplicationResourceGrantResource) ExportAll() (*[]connector.Impo return nil, err } - for appId, appName := range *applicationData { + for appId, appName := range applicationData { applicationGrantData, err := r.getApplicationGrantData(appId) if err != nil { return nil, err } - for grantId, grantResourceId := range *applicationGrantData { - resourceName, err := r.getGrantResourceName(grantResourceId) + for grantId, grantResourceId := range applicationGrantData { + resourceName, resourceNameOk, err := r.getGrantResourceName(grantResourceId) if err != nil { return nil, err } + if !resourceNameOk { + continue + } commentData := map[string]string{ "Application ID": appId, "Application Name": appName, "Application Resource Grant ID": grantId, - "Application Resource Name": *resourceName, + "Application Resource Name": resourceName, "Export Environment ID": r.clientInfo.ExportEnvironmentID, "Resource Type": r.ResourceType(), } importBlock := connector.ImportBlock{ ResourceType: r.ResourceType(), - ResourceName: fmt.Sprintf("%s_%s", appName, *resourceName), + ResourceName: fmt.Sprintf("%s_%s", appName, resourceName), ResourceID: fmt.Sprintf("%s/%s/%s", r.clientInfo.ExportEnvironmentID, appId, grantId), CommentInformation: common.GenerateCommentInformation(commentData), } @@ -74,107 +79,86 @@ func (r *PingOneApplicationResourceGrantResource) ExportAll() (*[]connector.Impo return &importBlocks, nil } -func (r *PingOneApplicationResourceGrantResource) getApplicationData() (*map[string]string, error) { +func (r *PingOneApplicationResourceGrantResource) getApplicationData() (map[string]string, error) { applicationData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.ApplicationsApi.ReadAllApplications(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + applications, err := pingone.GetManagementAPIObjectsFromIterator[management.ReadOneApplication200Response](iter, "ReadAllApplications", "GetApplications", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllApplications", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) + for _, app := range applications { + var ( + appId *string + appIdOk bool + appName *string + appNameOk bool + ) + + switch { + case app.ApplicationPingOnePortal != nil: + appId, appIdOk = app.ApplicationPingOnePortal.GetIdOk() + appName, appNameOk = app.ApplicationPingOnePortal.GetNameOk() + case app.ApplicationPingOneSelfService != nil: + appId, appIdOk = app.ApplicationPingOneSelfService.GetIdOk() + appName, appNameOk = app.ApplicationPingOneSelfService.GetNameOk() + case app.ApplicationExternalLink != nil: + appId, appIdOk = app.ApplicationExternalLink.GetIdOk() + appName, appNameOk = app.ApplicationExternalLink.GetNameOk() + default: + continue } - for _, app := range embedded.GetApplications() { - var ( - appId *string - appIdOk bool - appName *string - appNameOk bool - ) - - switch { - case app.ApplicationPingOnePortal != nil: - appId, appIdOk = app.ApplicationPingOnePortal.GetIdOk() - appName, appNameOk = app.ApplicationPingOnePortal.GetNameOk() - case app.ApplicationPingOneSelfService != nil: - appId, appIdOk = app.ApplicationPingOneSelfService.GetIdOk() - appName, appNameOk = app.ApplicationPingOneSelfService.GetNameOk() - case app.ApplicationExternalLink != nil: - appId, appIdOk = app.ApplicationExternalLink.GetIdOk() - appName, appNameOk = app.ApplicationExternalLink.GetNameOk() - default: - continue - } - - if appIdOk && appNameOk { - applicationData[*appId] = *appName - } + if appIdOk && appNameOk { + applicationData[*appId] = *appName } } - return &applicationData, nil + return applicationData, nil } -func (r *PingOneApplicationResourceGrantResource) getApplicationGrantData(appId string) (*map[string]string, error) { +func (r *PingOneApplicationResourceGrantResource) getApplicationGrantData(appId string) (map[string]string, error) { applicationGrantData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.ApplicationResourceGrantsApi.ReadAllApplicationGrants(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID, appId).Execute() + applicationGrants, err := pingone.GetManagementAPIObjectsFromIterator[management.ApplicationResourceGrant](iter, "ReadAllApplicationGrants", "GetGrants", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllApplicationGrants", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, grant := range embedded.GetGrants() { - grantId, grantIdOk := grant.GetIdOk() - grantResource, grantResourceOk := grant.GetResourceOk() + for _, grant := range applicationGrants { + grantId, grantIdOk := grant.GetIdOk() + grantResource, grantResourceOk := grant.GetResourceOk() - if grantIdOk && grantResourceOk { - grantResourceId, grantResourceIdOk := grantResource.GetIdOk() + if grantIdOk && grantResourceOk { + grantResourceId, grantResourceIdOk := grantResource.GetIdOk() - if grantResourceIdOk { - applicationGrantData[*grantId] = *grantResourceId - } + if grantResourceIdOk { + applicationGrantData[*grantId] = *grantResourceId } } } - return &applicationGrantData, nil + return applicationGrantData, nil } -func (r *PingOneApplicationResourceGrantResource) getGrantResourceName(grantResourceId string) (*string, error) { +func (r *PingOneApplicationResourceGrantResource) getGrantResourceName(grantResourceId string) (string, bool, error) { resource, response, err := r.clientInfo.ApiClient.ManagementAPIClient.ResourcesApi.ReadOneResource(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID, grantResourceId).Execute() - err = common.HandleClientResponse(response, err, "ReadOneResource", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "ReadOneResource", r.ResourceType()) if err != nil { - return nil, err + return "", false, err + } + if !ok { + return "", false, nil } if resource != nil { resourceName, resourceNameOk := resource.GetNameOk() if resourceNameOk { - return resourceName, nil + return *resourceName, true, nil } } - return nil, fmt.Errorf("Unable to get resource name for grant resource ID: %s", grantResourceId) + return "", false, fmt.Errorf("unable to get resource name for grant resource ID: %s", grantResourceId) } diff --git a/internal/connector/pingone/sso/resources/pingone_application_role_assignment.go b/internal/connector/pingone/sso/resources/pingone_application_role_assignment.go index 3e6fd0a2..f3ca158a 100644 --- a/internal/connector/pingone/sso/resources/pingone_application_role_assignment.go +++ b/internal/connector/pingone/sso/resources/pingone_application_role_assignment.go @@ -6,6 +6,7 @@ import ( "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -40,30 +41,33 @@ func (r *PingOneApplicationRoleAssignmentResource) ExportAll() (*[]connector.Imp return nil, err } - for appId, appName := range *applicationData { + for appId, appName := range applicationData { applicationRoleAssignmentData, err := r.getApplicationRoleAssignmentData(appId) if err != nil { return nil, err } - for roleAssignmentId, roleId := range *applicationRoleAssignmentData { - roleName, err := r.getRoleName(roleId) + for roleAssignmentId, roleId := range applicationRoleAssignmentData { + roleName, roleNameOk, err := r.getRoleName(roleId) if err != nil { return nil, err } + if !roleNameOk { + continue + } commentData := map[string]string{ "Application ID": appId, "Application Name": appName, "Application Role Assignment ID": roleAssignmentId, - "Application Role Name": string(*roleName), + "Application Role Name": string(roleName), "Export Environment ID": r.clientInfo.ExportEnvironmentID, "Resource Type": r.ResourceType(), } importBlock := connector.ImportBlock{ ResourceType: r.ResourceType(), - ResourceName: fmt.Sprintf("%s_%s_%s", appName, string(*roleName), roleAssignmentId), + ResourceName: fmt.Sprintf("%s_%s_%s", appName, string(roleName), roleAssignmentId), ResourceID: fmt.Sprintf("%s/%s/%s", r.clientInfo.ExportEnvironmentID, appId, roleAssignmentId), CommentInformation: common.GenerateCommentInformation(commentData), } @@ -75,122 +79,101 @@ func (r *PingOneApplicationRoleAssignmentResource) ExportAll() (*[]connector.Imp return &importBlocks, nil } -func (r *PingOneApplicationRoleAssignmentResource) getApplicationData() (*map[string]string, error) { +func (r *PingOneApplicationRoleAssignmentResource) getApplicationData() (map[string]string, error) { applicationData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.ApplicationsApi.ReadAllApplications(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + applications, err := pingone.GetManagementAPIObjectsFromIterator[management.ReadOneApplication200Response](iter, "ReadAllApplications", "GetApplications", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllApplications", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) + for _, app := range applications { + var ( + appId *string + appIdOk bool + appName *string + appNameOk bool + appAccessControlRole *management.ApplicationAccessControlRole + appAccessControlRoleOk bool + ) + + switch { + case app.ApplicationOIDC != nil: + appId, appIdOk = app.ApplicationOIDC.GetIdOk() + appName, appNameOk = app.ApplicationOIDC.GetNameOk() + if app.ApplicationOIDC.AccessControl != nil { + appAccessControlRole, appAccessControlRoleOk = app.ApplicationOIDC.AccessControl.GetRoleOk() + } + case app.ApplicationSAML != nil: + appId, appIdOk = app.ApplicationSAML.GetIdOk() + appName, appNameOk = app.ApplicationSAML.GetNameOk() + if app.ApplicationSAML.AccessControl != nil { + appAccessControlRole, appAccessControlRoleOk = app.ApplicationSAML.AccessControl.GetRoleOk() + } + case app.ApplicationExternalLink != nil: + appId, appIdOk = app.ApplicationExternalLink.GetIdOk() + appName, appNameOk = app.ApplicationExternalLink.GetNameOk() + if app.ApplicationExternalLink.AccessControl != nil { + appAccessControlRole, appAccessControlRoleOk = app.ApplicationExternalLink.AccessControl.GetRoleOk() + } + default: + continue } - for _, app := range embedded.GetApplications() { - var ( - appId *string - appIdOk bool - appName *string - appNameOk bool - appAccessControlRole *management.ApplicationAccessControlRole - appAccessControlRoleOk bool - ) - - switch { - case app.ApplicationOIDC != nil: - appId, appIdOk = app.ApplicationOIDC.GetIdOk() - appName, appNameOk = app.ApplicationOIDC.GetNameOk() - if app.ApplicationOIDC.AccessControl != nil { - appAccessControlRole, appAccessControlRoleOk = app.ApplicationOIDC.AccessControl.GetRoleOk() - } - case app.ApplicationSAML != nil: - appId, appIdOk = app.ApplicationSAML.GetIdOk() - appName, appNameOk = app.ApplicationSAML.GetNameOk() - if app.ApplicationSAML.AccessControl != nil { - appAccessControlRole, appAccessControlRoleOk = app.ApplicationSAML.AccessControl.GetRoleOk() - } - case app.ApplicationExternalLink != nil: - appId, appIdOk = app.ApplicationExternalLink.GetIdOk() - appName, appNameOk = app.ApplicationExternalLink.GetNameOk() - if app.ApplicationExternalLink.AccessControl != nil { - appAccessControlRole, appAccessControlRoleOk = app.ApplicationExternalLink.AccessControl.GetRoleOk() - } - default: + if appIdOk && appNameOk && appAccessControlRoleOk { + if appAccessControlRole.GetType() != management.ENUMAPPLICATIONACCESSCONTROLTYPE_ADMIN_USERS_ONLY { continue } - if appIdOk && appNameOk && appAccessControlRoleOk { - if appAccessControlRole.GetType() != management.ENUMAPPLICATIONACCESSCONTROLTYPE_ADMIN_USERS_ONLY { - continue - } - - applicationData[*appId] = *appName - } + applicationData[*appId] = *appName } } - return &applicationData, nil + return applicationData, nil } -func (r *PingOneApplicationRoleAssignmentResource) getApplicationRoleAssignmentData(appId string) (*map[string]string, error) { +func (r *PingOneApplicationRoleAssignmentResource) getApplicationRoleAssignmentData(appId string) (map[string]string, error) { applicationRoleAssignmentData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.ApplicationRoleAssignmentsApi.ReadApplicationRoleAssignments(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID, appId).Execute() + applicationRoleAssignments, err := pingone.GetManagementAPIObjectsFromIterator[management.RoleAssignment](iter, "ReadApplicationRoleAssignments", "GetRoleAssignments", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadApplicationRoleAssignments", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, roleAssignment := range embedded.GetRoleAssignments() { - roleAssignmentId, roleAssignmentIdOk := roleAssignment.GetIdOk() - roleAssignmentRole, roleAssignmentRoleOk := roleAssignment.GetRoleOk() + for _, roleAssignment := range applicationRoleAssignments { + roleAssignmentId, roleAssignmentIdOk := roleAssignment.GetIdOk() + roleAssignmentRole, roleAssignmentRoleOk := roleAssignment.GetRoleOk() - if roleAssignmentIdOk && roleAssignmentRoleOk { - roleAssignmentRoleId, roleAssignmentRoleIdOk := roleAssignmentRole.GetIdOk() + if roleAssignmentIdOk && roleAssignmentRoleOk { + roleAssignmentRoleId, roleAssignmentRoleIdOk := roleAssignmentRole.GetIdOk() - if roleAssignmentRoleIdOk { - applicationRoleAssignmentData[*roleAssignmentId] = *roleAssignmentRoleId - } + if roleAssignmentRoleIdOk { + applicationRoleAssignmentData[*roleAssignmentId] = *roleAssignmentRoleId } } } - return &applicationRoleAssignmentData, nil + return applicationRoleAssignmentData, nil } -func (r *PingOneApplicationRoleAssignmentResource) getRoleName(roleId string) (*management.EnumRoleName, error) { +func (r *PingOneApplicationRoleAssignmentResource) getRoleName(roleId string) (management.EnumRoleName, bool, error) { apiRole, resp, err := r.clientInfo.ApiClient.ManagementAPIClient.RolesApi.ReadOneRole(r.clientInfo.Context, roleId).Execute() - err = common.HandleClientResponse(resp, err, "ReadOneRole", r.ResourceType()) + ok, err := common.HandleClientResponse(resp, err, "ReadOneRole", r.ResourceType()) if err != nil { - return nil, err + return "", false, err + } + if !ok { + return "", false, nil } if apiRole != nil { apiRoleName, apiRoleNameOk := apiRole.GetNameOk() if apiRoleNameOk { - return apiRoleName, nil + return *apiRoleName, true, nil } } - return nil, fmt.Errorf("Unable to get role name for role ID: %s", roleId) + return "", false, fmt.Errorf("unable to get role name for role ID: %s", roleId) } diff --git a/internal/connector/pingone/sso/resources/pingone_application_secret.go b/internal/connector/pingone/sso/resources/pingone_application_secret.go index 6b7ee911..2dff1ddd 100644 --- a/internal/connector/pingone/sso/resources/pingone_application_secret.go +++ b/internal/connector/pingone/sso/resources/pingone_application_secret.go @@ -3,9 +3,12 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" + "github.com/pingidentity/pingcli/internal/output" ) // Verify that the resource satisfies the exportable resource interface @@ -39,7 +42,7 @@ func (r *PingOneApplicationSecretResource) ExportAll() (*[]connector.ImportBlock return nil, err } - for appId, appName := range *applicationData { + for appId, appName := range applicationData { ok, err := r.checkApplicationSecretData(appId) if err != nil { return nil, err @@ -69,79 +72,70 @@ func (r *PingOneApplicationSecretResource) ExportAll() (*[]connector.ImportBlock return &importBlocks, nil } -func (r *PingOneApplicationSecretResource) getApplicationData() (*map[string]string, error) { +func (r *PingOneApplicationSecretResource) getApplicationData() (map[string]string, error) { applicationData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.ApplicationsApi.ReadAllApplications(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + applications, err := pingone.GetManagementAPIObjectsFromIterator[management.ReadOneApplication200Response](iter, "ReadAllApplications", "GetApplications", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllApplications", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) + for _, app := range applications { + var ( + appId *string + appIdOk bool + appName *string + appNameOk bool + ) + + switch { + case app.ApplicationOIDC != nil: + appId, appIdOk = app.ApplicationOIDC.GetIdOk() + appName, appNameOk = app.ApplicationOIDC.GetNameOk() + case app.ApplicationSAML != nil: + appId, appIdOk = app.ApplicationSAML.GetIdOk() + appName, appNameOk = app.ApplicationSAML.GetNameOk() + case app.ApplicationExternalLink != nil: + appId, appIdOk = app.ApplicationExternalLink.GetIdOk() + appName, appNameOk = app.ApplicationExternalLink.GetNameOk() + default: + continue } - for _, app := range embedded.GetApplications() { - var ( - appId *string - appIdOk bool - appName *string - appNameOk bool - ) - - switch { - case app.ApplicationOIDC != nil: - appId, appIdOk = app.ApplicationOIDC.GetIdOk() - appName, appNameOk = app.ApplicationOIDC.GetNameOk() - case app.ApplicationSAML != nil: - appId, appIdOk = app.ApplicationSAML.GetIdOk() - appName, appNameOk = app.ApplicationSAML.GetNameOk() - case app.ApplicationExternalLink != nil: - appId, appIdOk = app.ApplicationExternalLink.GetIdOk() - appName, appNameOk = app.ApplicationExternalLink.GetNameOk() - default: - continue - } - - if appIdOk && appNameOk { - applicationData[*appId] = *appName - } + if appIdOk && appNameOk { + applicationData[*appId] = *appName } } - return &applicationData, nil + return applicationData, nil } func (r *PingOneApplicationSecretResource) checkApplicationSecretData(appId string) (bool, error) { - l := logger.Get() - // The platform enforces that worker apps cannot read their own secret // Make sure we can read the secret before adding it to the import blocks _, response, err := r.clientInfo.ApiClient.ManagementAPIClient.ApplicationSecretApi.ReadApplicationSecret(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID, appId).Execute() + defer response.Body.Close() // If the appId is the same as the worker ID, make sure the API response is a 403 and ignore the error if appId == *r.clientInfo.ApiClientId { if response.StatusCode == 403 { return false, nil } else { - return false, fmt.Errorf("ReadApplicationSecret: Expected response code 403 - worker apps cannot read their own secret, actual response code: %d", response.StatusCode) + return false, fmt.Errorf("error: Expected 403 Forbidden response - worker apps cannot read their own secret\n%s Response Code: %s\nResponse Body: %s", "ReadApplicationSecret", response.Status, response.Body) } } // Use output package to warn the user of any errors or non-200 response codes // Expected behavior in this case is to skip the resource, and continue exporting the other resources - defer response.Body.Close() - if err != nil || response.StatusCode >= 300 || response.StatusCode < 200 { - l.Warn().Msgf("Failed to read secret for application %s. %s Response Code: %s\nResponse Body: %s", appId, "ReadApplicationSecret", response.Status, response.Body) + output.Warn("Failed to read secret for application", map[string]interface{}{ + "Application ID": appId, + "API Function Name": "ReadApplicationSecret", + "Response Code": response.Status, + "Response Body": response.Body, + }) + return false, nil } return true, nil diff --git a/internal/connector/pingone/sso/resources/pingone_application_sign_on_policy_assignment.go b/internal/connector/pingone/sso/resources/pingone_application_sign_on_policy_assignment.go index aa25d523..8aa47086 100644 --- a/internal/connector/pingone/sso/resources/pingone_application_sign_on_policy_assignment.go +++ b/internal/connector/pingone/sso/resources/pingone_application_sign_on_policy_assignment.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,30 +41,33 @@ func (r *PingOneApplicationSignOnPolicyAssignmentResource) ExportAll() (*[]conne return nil, err } - for appId, appName := range *applicationData { + for appId, appName := range applicationData { signOnPolicyAssignmentData, err := r.getApplicationSignOnPolicyAssignmentData(appId) if err != nil { return nil, err } - for signOnPolicyAssignmentId, signOnPolicyId := range *signOnPolicyAssignmentData { - signOnPolicyName, err := r.getSignOnPolicyName(signOnPolicyId) + for signOnPolicyAssignmentId, signOnPolicyId := range signOnPolicyAssignmentData { + signOnPolicyName, signOnPolicyNameOk, err := r.getSignOnPolicyName(signOnPolicyId) if err != nil { return nil, err } + if !signOnPolicyNameOk { + continue + } commentData := map[string]string{ "Resource Type": r.ResourceType(), "Application ID": appId, "Application Name": appName, "Application Sign-On Policy Assignment ID": signOnPolicyAssignmentId, - "Application Sign-On Policy Name": *signOnPolicyName, + "Application Sign-On Policy Name": signOnPolicyName, "Export Environment ID": r.clientInfo.ExportEnvironmentID, } importBlock := connector.ImportBlock{ ResourceType: r.ResourceType(), - ResourceName: fmt.Sprintf("%s_%s", appName, *signOnPolicyName), + ResourceName: fmt.Sprintf("%s_%s", appName, signOnPolicyName), ResourceID: fmt.Sprintf("%s/%s/%s", r.clientInfo.ExportEnvironmentID, appId, signOnPolicyAssignmentId), CommentInformation: common.GenerateCommentInformation(commentData), } @@ -74,108 +79,87 @@ func (r *PingOneApplicationSignOnPolicyAssignmentResource) ExportAll() (*[]conne return &importBlocks, nil } -func (r *PingOneApplicationSignOnPolicyAssignmentResource) getApplicationData() (*map[string]string, error) { +func (r *PingOneApplicationSignOnPolicyAssignmentResource) getApplicationData() (map[string]string, error) { applicationData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.ApplicationsApi.ReadAllApplications(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + applications, err := pingone.GetManagementAPIObjectsFromIterator[management.ReadOneApplication200Response](iter, "ReadAllApplications", "GetApplications", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllApplications", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) + for _, app := range applications { + var ( + appId *string + appIdOk bool + appName *string + appNameOk bool + ) + + switch { + case app.ApplicationOIDC != nil: + appId, appIdOk = app.ApplicationOIDC.GetIdOk() + appName, appNameOk = app.ApplicationOIDC.GetNameOk() + case app.ApplicationSAML != nil: + appId, appIdOk = app.ApplicationSAML.GetIdOk() + appName, appNameOk = app.ApplicationSAML.GetNameOk() + case app.ApplicationExternalLink != nil: + appId, appIdOk = app.ApplicationExternalLink.GetIdOk() + appName, appNameOk = app.ApplicationExternalLink.GetNameOk() + default: + continue } - for _, app := range embedded.GetApplications() { - var ( - appId *string - appIdOk bool - appName *string - appNameOk bool - ) - - switch { - case app.ApplicationOIDC != nil: - appId, appIdOk = app.ApplicationOIDC.GetIdOk() - appName, appNameOk = app.ApplicationOIDC.GetNameOk() - case app.ApplicationSAML != nil: - appId, appIdOk = app.ApplicationSAML.GetIdOk() - appName, appNameOk = app.ApplicationSAML.GetNameOk() - case app.ApplicationExternalLink != nil: - appId, appIdOk = app.ApplicationExternalLink.GetIdOk() - appName, appNameOk = app.ApplicationExternalLink.GetNameOk() - default: - continue - } - - if appIdOk && appNameOk { - applicationData[*appId] = *appName - } + if appIdOk && appNameOk { + applicationData[*appId] = *appName } } - return &applicationData, nil + return applicationData, nil } -func (r *PingOneApplicationSignOnPolicyAssignmentResource) getApplicationSignOnPolicyAssignmentData(appId string) (*map[string]string, error) { +func (r *PingOneApplicationSignOnPolicyAssignmentResource) getApplicationSignOnPolicyAssignmentData(appId string) (map[string]string, error) { signOnPolicyAssignmentData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.ApplicationSignOnPolicyAssignmentsApi.ReadAllSignOnPolicyAssignments(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID, appId).Execute() + signOnPolicyAssignments, err := pingone.GetManagementAPIObjectsFromIterator[management.SignOnPolicyAssignment](iter, "ReadAllSignOnPolicyAssignments", "GetSignOnPolicyAssignments", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllSignOnPolicyAssignments", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, signOnPolicyAssignment := range embedded.GetSignOnPolicyAssignments() { - signOnPolicyAssignmentId, signOnPolicyAssignmentIdOk := signOnPolicyAssignment.GetIdOk() - signOnPolicyAssignmentSignOnPolicy, signOnPolicyAssignmentSignOnPolicyOk := signOnPolicyAssignment.GetSignOnPolicyOk() + for _, signOnPolicyAssignment := range signOnPolicyAssignments { + signOnPolicyAssignmentId, signOnPolicyAssignmentIdOk := signOnPolicyAssignment.GetIdOk() + signOnPolicyAssignmentSignOnPolicy, signOnPolicyAssignmentSignOnPolicyOk := signOnPolicyAssignment.GetSignOnPolicyOk() - if signOnPolicyAssignmentIdOk && signOnPolicyAssignmentSignOnPolicyOk { - signOnPolicyAssignmentSignOnPolicyId, signOnPolicyAssignmentSignOnPolicyIdOk := signOnPolicyAssignmentSignOnPolicy.GetIdOk() + if signOnPolicyAssignmentIdOk && signOnPolicyAssignmentSignOnPolicyOk { + signOnPolicyAssignmentSignOnPolicyId, signOnPolicyAssignmentSignOnPolicyIdOk := signOnPolicyAssignmentSignOnPolicy.GetIdOk() - if signOnPolicyAssignmentSignOnPolicyIdOk { - signOnPolicyAssignmentData[*signOnPolicyAssignmentId] = *signOnPolicyAssignmentSignOnPolicyId - } + if signOnPolicyAssignmentSignOnPolicyIdOk { + signOnPolicyAssignmentData[*signOnPolicyAssignmentId] = *signOnPolicyAssignmentSignOnPolicyId } } } - return &signOnPolicyAssignmentData, nil + return signOnPolicyAssignmentData, nil } -func (r *PingOneApplicationSignOnPolicyAssignmentResource) getSignOnPolicyName(signOnPolicyId string) (*string, error) { +func (r *PingOneApplicationSignOnPolicyAssignmentResource) getSignOnPolicyName(signOnPolicyId string) (string, bool, error) { signOnPolicy, response, err := r.clientInfo.ApiClient.ManagementAPIClient.SignOnPoliciesApi.ReadOneSignOnPolicy(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID, signOnPolicyId).Execute() - err = common.HandleClientResponse(response, err, "ReadOneSignOnPolicy", r.ResourceType()) + ok, err := common.HandleClientResponse(response, err, "ReadOneSignOnPolicy", r.ResourceType()) if err != nil { - return nil, err + return "", false, err + } + if !ok { + return "", false, nil } if signOnPolicy != nil { signOnPolicyName, signOnPolicyNameOk := signOnPolicy.GetNameOk() if signOnPolicyNameOk { - return signOnPolicyName, nil + return *signOnPolicyName, true, nil } } - return nil, fmt.Errorf("Unable to get sign-on policy name for sign-on policy ID: %s", signOnPolicyId) + return "", false, fmt.Errorf("unable to get sign-on policy name for sign-on policy ID: %s", signOnPolicyId) } diff --git a/internal/connector/pingone/sso/resources/pingone_group.go b/internal/connector/pingone/sso/resources/pingone_group.go index 04fb7527..3d6b9153 100644 --- a/internal/connector/pingone/sso/resources/pingone_group.go +++ b/internal/connector/pingone/sso/resources/pingone_group.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,7 +41,7 @@ func (r *PingOneGroupResource) ExportAll() (*[]connector.ImportBlock, error) { return nil, err } - for groupId, groupName := range *groupData { + for groupId, groupName := range groupData { commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, "Group ID": groupId, @@ -60,35 +62,23 @@ func (r *PingOneGroupResource) ExportAll() (*[]connector.ImportBlock, error) { return &importBlocks, nil } -func (r *PingOneGroupResource) getGroupData() (*map[string]string, error) { +func (r *PingOneGroupResource) getGroupData() (map[string]string, error) { groupData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.GroupsApi.ReadAllGroups(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + groups, err := pingone.GetManagementAPIObjectsFromIterator[management.Group](iter, "ReadAllGroups", "GetGroups", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllGroups", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, group := range embedded.GetGroups() { - groupId, groupIdOk := group.GetIdOk() - groupName, groupNameOk := group.GetNameOk() + for _, group := range groups { + groupId, groupIdOk := group.GetIdOk() + groupName, groupNameOk := group.GetNameOk() - if groupIdOk && groupNameOk { - groupData[*groupId] = *groupName - } + if groupIdOk && groupNameOk { + groupData[*groupId] = *groupName } } - return &groupData, nil + return groupData, nil } diff --git a/internal/connector/pingone/sso/resources/pingone_group_nesting.go b/internal/connector/pingone/sso/resources/pingone_group_nesting.go index 97d463ab..3958b257 100644 --- a/internal/connector/pingone/sso/resources/pingone_group_nesting.go +++ b/internal/connector/pingone/sso/resources/pingone_group_nesting.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,13 +41,13 @@ func (r *PingOneGroupNestingResource) ExportAll() (*[]connector.ImportBlock, err return nil, err } - for parentGroupId, parentGroupName := range *groupData { + for parentGroupId, parentGroupName := range groupData { groupNestingData, err := r.getGroupNestingData(parentGroupId) if err != nil { return nil, err } - for nestedGroupId, nestedGroupName := range *groupNestingData { + for nestedGroupId, nestedGroupName := range groupNestingData { commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, "Nested Group ID": nestedGroupId, @@ -69,68 +71,44 @@ func (r *PingOneGroupNestingResource) ExportAll() (*[]connector.ImportBlock, err return &importBlocks, nil } -func (r *PingOneGroupNestingResource) getGroupData() (*map[string]string, error) { +func (r *PingOneGroupNestingResource) getGroupData() (map[string]string, error) { groupData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.GroupsApi.ReadAllGroups(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + groups, err := pingone.GetManagementAPIObjectsFromIterator[management.Group](iter, "ReadAllGroups", "GetGroups", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllGroups", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, parentGroup := range embedded.GetGroups() { - parentGroupId, parentGroupIdOk := parentGroup.GetIdOk() - parentGroupName, parentGroupNameOk := parentGroup.GetNameOk() + for _, parentGroup := range groups { + parentGroupId, parentGroupIdOk := parentGroup.GetIdOk() + parentGroupName, parentGroupNameOk := parentGroup.GetNameOk() - if parentGroupIdOk && parentGroupNameOk { - groupData[*parentGroupId] = *parentGroupName - } + if parentGroupIdOk && parentGroupNameOk { + groupData[*parentGroupId] = *parentGroupName } } - return &groupData, nil + return groupData, nil } -func (r *PingOneGroupNestingResource) getGroupNestingData(parentGroupId string) (*map[string]string, error) { +func (r *PingOneGroupNestingResource) getGroupNestingData(parentGroupId string) (map[string]string, error) { groupNestingData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.GroupsApi.ReadGroupNesting(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID, parentGroupId).Execute() + groupNestings, err := pingone.GetManagementAPIObjectsFromIterator[management.GroupMembership](iter, "ReadGroupNesting", "GetGroupMemberships", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadGroupNesting", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, nestedGroup := range embedded.GetGroupMemberships() { - nestedGroupId, nestedGroupIdOk := nestedGroup.GetIdOk() - nestedGroupName, nestedGroupNameOk := nestedGroup.GetNameOk() + for _, nestedGroup := range groupNestings { + nestedGroupId, nestedGroupIdOk := nestedGroup.GetIdOk() + nestedGroupName, nestedGroupNameOk := nestedGroup.GetNameOk() - if nestedGroupIdOk && nestedGroupNameOk { - groupNestingData[*nestedGroupId] = *nestedGroupName - } + if nestedGroupIdOk && nestedGroupNameOk { + groupNestingData[*nestedGroupId] = *nestedGroupName } } - return &groupNestingData, nil + return groupNestingData, nil } diff --git a/internal/connector/pingone/sso/resources/pingone_group_role_assignment.go b/internal/connector/pingone/sso/resources/pingone_group_role_assignment.go index c51b1475..6951abff 100644 --- a/internal/connector/pingone/sso/resources/pingone_group_role_assignment.go +++ b/internal/connector/pingone/sso/resources/pingone_group_role_assignment.go @@ -6,6 +6,7 @@ import ( "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -40,17 +41,20 @@ func (r *PingOneGroupRoleAssignmentResource) ExportAll() (*[]connector.ImportBlo return nil, err } - for groupId, groupName := range *groupData { + for groupId, groupName := range groupData { groupRoleAssignmentData, err := r.getGroupRoleAssignmentData(groupId) if err != nil { return nil, err } - for groupRoleAssignmentId, roleId := range *groupRoleAssignmentData { + for groupRoleAssignmentId, roleId := range groupRoleAssignmentData { roleName, err := r.getRoleName(roleId) if err != nil { return nil, err } + if roleName == nil { + continue + } commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, @@ -75,82 +79,61 @@ func (r *PingOneGroupRoleAssignmentResource) ExportAll() (*[]connector.ImportBlo return &importBlocks, nil } -func (r *PingOneGroupRoleAssignmentResource) getGroupData() (*map[string]string, error) { +func (r *PingOneGroupRoleAssignmentResource) getGroupData() (map[string]string, error) { groupData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.GroupsApi.ReadAllGroups(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + groups, err := pingone.GetManagementAPIObjectsFromIterator[management.Group](iter, "ReadAllGroups", "GetGroups", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllGroups", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, group := range embedded.GetGroups() { - groupId, groupIdOk := group.GetIdOk() - groupName, groupNameOk := group.GetNameOk() + for _, group := range groups { + groupId, groupIdOk := group.GetIdOk() + groupName, groupNameOk := group.GetNameOk() - if groupIdOk && groupNameOk { - groupData[*groupId] = *groupName - } + if groupIdOk && groupNameOk { + groupData[*groupId] = *groupName } } - return &groupData, nil + return groupData, nil } -func (r *PingOneGroupRoleAssignmentResource) getGroupRoleAssignmentData(groupId string) (*map[string]string, error) { +func (r *PingOneGroupRoleAssignmentResource) getGroupRoleAssignmentData(groupId string) (map[string]string, error) { groupRoleAssignmentData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.GroupRoleAssignmentsApi.ReadGroupRoleAssignments(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID, groupId).Execute() + roleAssignments, err := pingone.GetManagementAPIObjectsFromIterator[management.RoleAssignment](iter, "ReadGroupRoleAssignments", "GetRoleAssignments", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadGroupRoleAssignments", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, groupRoleAssignment := range embedded.GetRoleAssignments() { - groupRoleAssignmentId, groupRoleAssignmentIdOk := groupRoleAssignment.GetIdOk() - groupRoleAssignmentRole, groupRoleAssignmentRoleOk := groupRoleAssignment.GetRoleOk() + for _, groupRoleAssignment := range roleAssignments { + groupRoleAssignmentId, groupRoleAssignmentIdOk := groupRoleAssignment.GetIdOk() + groupRoleAssignmentRole, groupRoleAssignmentRoleOk := groupRoleAssignment.GetRoleOk() - if groupRoleAssignmentIdOk && groupRoleAssignmentRoleOk { - groupRoleAssignmentRoleId, groupRoleAssignmentRoleIdOk := groupRoleAssignmentRole.GetIdOk() + if groupRoleAssignmentIdOk && groupRoleAssignmentRoleOk { + groupRoleAssignmentRoleId, groupRoleAssignmentRoleIdOk := groupRoleAssignmentRole.GetIdOk() - if groupRoleAssignmentRoleIdOk { - groupRoleAssignmentData[*groupRoleAssignmentId] = *groupRoleAssignmentRoleId - } + if groupRoleAssignmentRoleIdOk { + groupRoleAssignmentData[*groupRoleAssignmentId] = *groupRoleAssignmentRoleId } } } - return &groupRoleAssignmentData, nil + return groupRoleAssignmentData, nil } func (r *PingOneGroupRoleAssignmentResource) getRoleName(roleId string) (*management.EnumRoleName, error) { apiRole, resp, err := r.clientInfo.ApiClient.ManagementAPIClient.RolesApi.ReadOneRole(r.clientInfo.Context, roleId).Execute() - err = common.HandleClientResponse(resp, err, "ReadOneRole", r.ResourceType()) + ok, err := common.HandleClientResponse(resp, err, "ReadOneRole", r.ResourceType()) if err != nil { return nil, err } + if !ok { + return nil, nil + } if apiRole != nil { apiRoleName, apiRoleNameOk := apiRole.GetNameOk() diff --git a/internal/connector/pingone/sso/resources/pingone_identity_provider.go b/internal/connector/pingone/sso/resources/pingone_identity_provider.go index 0bbe0782..c8bab690 100644 --- a/internal/connector/pingone/sso/resources/pingone_identity_provider.go +++ b/internal/connector/pingone/sso/resources/pingone_identity_provider.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,7 +41,7 @@ func (r *PingOneIdentityProviderResource) ExportAll() (*[]connector.ImportBlock, return nil, err } - for idpId, idpName := range *identityProviderData { + for idpId, idpName := range identityProviderData { commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, "Identity Provider ID": idpId, @@ -60,62 +62,50 @@ func (r *PingOneIdentityProviderResource) ExportAll() (*[]connector.ImportBlock, return &importBlocks, nil } -func (r *PingOneIdentityProviderResource) getIdentityProviderData() (*map[string]string, error) { +func (r *PingOneIdentityProviderResource) getIdentityProviderData() (map[string]string, error) { identityProviderData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.IdentityProvidersApi.ReadAllIdentityProviders(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + identityProviders, err := pingone.GetManagementAPIObjectsFromIterator[management.IdentityProvider](iter, "ReadAllIdentityProviders", "GetIdentityProviders", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllIdentityProviders", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) + for _, idp := range identityProviders { + var ( + idpId *string + idpIdOk bool + idpName *string + idpNameOk bool + ) + + switch { + case idp.IdentityProviderApple != nil: + idpId, idpIdOk = idp.IdentityProviderApple.GetIdOk() + idpName, idpNameOk = idp.IdentityProviderApple.GetNameOk() + case idp.IdentityProviderClientIDClientSecret != nil: + idpId, idpIdOk = idp.IdentityProviderClientIDClientSecret.GetIdOk() + idpName, idpNameOk = idp.IdentityProviderClientIDClientSecret.GetNameOk() + case idp.IdentityProviderFacebook != nil: + idpId, idpIdOk = idp.IdentityProviderFacebook.GetIdOk() + idpName, idpNameOk = idp.IdentityProviderFacebook.GetNameOk() + case idp.IdentityProviderOIDC != nil: + idpId, idpIdOk = idp.IdentityProviderOIDC.GetIdOk() + idpName, idpNameOk = idp.IdentityProviderOIDC.GetNameOk() + case idp.IdentityProviderPaypal != nil: + idpId, idpIdOk = idp.IdentityProviderPaypal.GetIdOk() + idpName, idpNameOk = idp.IdentityProviderPaypal.GetNameOk() + case idp.IdentityProviderSAML != nil: + idpId, idpIdOk = idp.IdentityProviderSAML.GetIdOk() + idpName, idpNameOk = idp.IdentityProviderSAML.GetNameOk() + default: + continue } - for _, idp := range embedded.GetIdentityProviders() { - var ( - idpId *string - idpIdOk bool - idpName *string - idpNameOk bool - ) - - switch { - case idp.IdentityProviderApple != nil: - idpId, idpIdOk = idp.IdentityProviderApple.GetIdOk() - idpName, idpNameOk = idp.IdentityProviderApple.GetNameOk() - case idp.IdentityProviderClientIDClientSecret != nil: - idpId, idpIdOk = idp.IdentityProviderClientIDClientSecret.GetIdOk() - idpName, idpNameOk = idp.IdentityProviderClientIDClientSecret.GetNameOk() - case idp.IdentityProviderFacebook != nil: - idpId, idpIdOk = idp.IdentityProviderFacebook.GetIdOk() - idpName, idpNameOk = idp.IdentityProviderFacebook.GetNameOk() - case idp.IdentityProviderOIDC != nil: - idpId, idpIdOk = idp.IdentityProviderOIDC.GetIdOk() - idpName, idpNameOk = idp.IdentityProviderOIDC.GetNameOk() - case idp.IdentityProviderPaypal != nil: - idpId, idpIdOk = idp.IdentityProviderPaypal.GetIdOk() - idpName, idpNameOk = idp.IdentityProviderPaypal.GetNameOk() - case idp.IdentityProviderSAML != nil: - idpId, idpIdOk = idp.IdentityProviderSAML.GetIdOk() - idpName, idpNameOk = idp.IdentityProviderSAML.GetNameOk() - default: - continue - } - - if idpIdOk && idpNameOk { - identityProviderData[*idpId] = *idpName - } + if idpIdOk && idpNameOk { + identityProviderData[*idpId] = *idpName } } - return &identityProviderData, nil + return identityProviderData, nil } diff --git a/internal/connector/pingone/sso/resources/pingone_identity_provider_attribute.go b/internal/connector/pingone/sso/resources/pingone_identity_provider_attribute.go index 92f6342a..34912a9c 100644 --- a/internal/connector/pingone/sso/resources/pingone_identity_provider_attribute.go +++ b/internal/connector/pingone/sso/resources/pingone_identity_provider_attribute.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,13 +41,13 @@ func (r *PingOneIdentityProviderAttributeResource) ExportAll() (*[]connector.Imp return nil, err } - for idpId, idpName := range *identityProviderData { + for idpId, idpName := range identityProviderData { identityProviderAttributeData, err := r.getIdentityProviderAttributeData(idpId) if err != nil { return nil, err } - for idpAttributeId, idpAttributeName := range *identityProviderAttributeData { + for idpAttributeId, idpAttributeName := range identityProviderAttributeData { commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, "Identity Provider Attribute ID": idpAttributeId, @@ -69,89 +71,67 @@ func (r *PingOneIdentityProviderAttributeResource) ExportAll() (*[]connector.Imp return &importBlocks, nil } -func (r *PingOneIdentityProviderAttributeResource) getIdentityProviderData() (*map[string]string, error) { +func (r *PingOneIdentityProviderAttributeResource) getIdentityProviderData() (map[string]string, error) { identityProviderData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.IdentityProvidersApi.ReadAllIdentityProviders(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + identityProviders, err := pingone.GetManagementAPIObjectsFromIterator[management.IdentityProvider](iter, "ReadAllIdentityProviders", "GetIdentityProviders", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllIdentityProviders", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) + for _, idp := range identityProviders { + var ( + idpId *string + idpIdOk bool + idpName *string + idpNameOk bool + ) + + switch { + case idp.IdentityProviderApple != nil: + idpId, idpIdOk = idp.IdentityProviderApple.GetIdOk() + idpName, idpNameOk = idp.IdentityProviderApple.GetNameOk() + case idp.IdentityProviderClientIDClientSecret != nil: + idpId, idpIdOk = idp.IdentityProviderClientIDClientSecret.GetIdOk() + idpName, idpNameOk = idp.IdentityProviderClientIDClientSecret.GetNameOk() + case idp.IdentityProviderFacebook != nil: + idpId, idpIdOk = idp.IdentityProviderFacebook.GetIdOk() + idpName, idpNameOk = idp.IdentityProviderFacebook.GetNameOk() + case idp.IdentityProviderOIDC != nil: + idpId, idpIdOk = idp.IdentityProviderOIDC.GetIdOk() + idpName, idpNameOk = idp.IdentityProviderOIDC.GetNameOk() + case idp.IdentityProviderPaypal != nil: + idpId, idpIdOk = idp.IdentityProviderPaypal.GetIdOk() + idpName, idpNameOk = idp.IdentityProviderPaypal.GetNameOk() + case idp.IdentityProviderSAML != nil: + idpId, idpIdOk = idp.IdentityProviderSAML.GetIdOk() + idpName, idpNameOk = idp.IdentityProviderSAML.GetNameOk() + default: + continue } - for _, idp := range embedded.GetIdentityProviders() { - var ( - idpId *string - idpIdOk bool - idpName *string - idpNameOk bool - ) - - switch { - case idp.IdentityProviderApple != nil: - idpId, idpIdOk = idp.IdentityProviderApple.GetIdOk() - idpName, idpNameOk = idp.IdentityProviderApple.GetNameOk() - case idp.IdentityProviderClientIDClientSecret != nil: - idpId, idpIdOk = idp.IdentityProviderClientIDClientSecret.GetIdOk() - idpName, idpNameOk = idp.IdentityProviderClientIDClientSecret.GetNameOk() - case idp.IdentityProviderFacebook != nil: - idpId, idpIdOk = idp.IdentityProviderFacebook.GetIdOk() - idpName, idpNameOk = idp.IdentityProviderFacebook.GetNameOk() - case idp.IdentityProviderOIDC != nil: - idpId, idpIdOk = idp.IdentityProviderOIDC.GetIdOk() - idpName, idpNameOk = idp.IdentityProviderOIDC.GetNameOk() - case idp.IdentityProviderPaypal != nil: - idpId, idpIdOk = idp.IdentityProviderPaypal.GetIdOk() - idpName, idpNameOk = idp.IdentityProviderPaypal.GetNameOk() - case idp.IdentityProviderSAML != nil: - idpId, idpIdOk = idp.IdentityProviderSAML.GetIdOk() - idpName, idpNameOk = idp.IdentityProviderSAML.GetNameOk() - default: - continue - } - - if idpIdOk && idpNameOk { - identityProviderData[*idpId] = *idpName - } + if idpIdOk && idpNameOk { + identityProviderData[*idpId] = *idpName } } - return &identityProviderData, nil + return identityProviderData, nil } -func (r *PingOneIdentityProviderAttributeResource) getIdentityProviderAttributeData(idpId string) (*map[string]string, error) { +func (r *PingOneIdentityProviderAttributeResource) getIdentityProviderAttributeData(idpId string) (map[string]string, error) { identityProviderAttributeData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.IdentityProviderAttributesApi.ReadAllIdentityProviderAttributes(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID, idpId).Execute() + attributeInners, err := pingone.GetManagementAPIObjectsFromIterator[management.EntityArrayEmbeddedAttributesInner](iter, "ReadAllIdentityProviderAttributes", "GetAttributes", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllIdentityProviderAttributes", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, idpAttribute := range embedded.GetAttributes() { - idpAttributeId, idpAttributeIdOk := idpAttribute.IdentityProviderAttribute.GetIdOk() - idpAttributeName, idpAttributeNameOk := idpAttribute.IdentityProviderAttribute.GetNameOk() + for _, attributeInners := range attributeInners { + if attributeInners.IdentityProviderAttribute != nil { + idpAttributeId, idpAttributeIdOk := attributeInners.IdentityProviderAttribute.GetIdOk() + idpAttributeName, idpAttributeNameOk := attributeInners.IdentityProviderAttribute.GetNameOk() if idpAttributeIdOk && idpAttributeNameOk { identityProviderAttributeData[*idpAttributeId] = *idpAttributeName @@ -159,5 +139,5 @@ func (r *PingOneIdentityProviderAttributeResource) getIdentityProviderAttributeD } } - return &identityProviderAttributeData, nil + return identityProviderAttributeData, nil } diff --git a/internal/connector/pingone/sso/resources/pingone_password_policy.go b/internal/connector/pingone/sso/resources/pingone_password_policy.go index 7cb74291..4c3dd4af 100644 --- a/internal/connector/pingone/sso/resources/pingone_password_policy.go +++ b/internal/connector/pingone/sso/resources/pingone_password_policy.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,7 +41,7 @@ func (r *PingOnePasswordPolicyResource) ExportAll() (*[]connector.ImportBlock, e return nil, err } - for passwordPolicyId, passwordPolicyName := range *passwordPolicyData { + for passwordPolicyId, passwordPolicyName := range passwordPolicyData { commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, "Password Policy ID": passwordPolicyId, @@ -60,35 +62,23 @@ func (r *PingOnePasswordPolicyResource) ExportAll() (*[]connector.ImportBlock, e return &importBlocks, nil } -func (r *PingOnePasswordPolicyResource) getPasswordPolicyData() (*map[string]string, error) { +func (r *PingOnePasswordPolicyResource) getPasswordPolicyData() (map[string]string, error) { passwordPolicyData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.PasswordPoliciesApi.ReadAllPasswordPolicies(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + passwordPolicies, err := pingone.GetManagementAPIObjectsFromIterator[management.PasswordPolicy](iter, "ReadAllPasswordPolicies", "GetPasswordPolicies", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllPasswordPolicies", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, passwordPolicy := range embedded.GetPasswordPolicies() { - passwordPolicyId, passwordPolicyIdOk := passwordPolicy.GetIdOk() - passwordPolicyName, passwordPolicyNameOk := passwordPolicy.GetNameOk() + for _, passwordPolicy := range passwordPolicies { + passwordPolicyId, passwordPolicyIdOk := passwordPolicy.GetIdOk() + passwordPolicyName, passwordPolicyNameOk := passwordPolicy.GetNameOk() - if passwordPolicyIdOk && passwordPolicyNameOk { - passwordPolicyData[*passwordPolicyId] = *passwordPolicyName - } + if passwordPolicyIdOk && passwordPolicyNameOk { + passwordPolicyData[*passwordPolicyId] = *passwordPolicyName } } - return &passwordPolicyData, nil + return passwordPolicyData, nil } diff --git a/internal/connector/pingone/sso/resources/pingone_population.go b/internal/connector/pingone/sso/resources/pingone_population.go index ce8f5728..cd83c8a3 100644 --- a/internal/connector/pingone/sso/resources/pingone_population.go +++ b/internal/connector/pingone/sso/resources/pingone_population.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,7 +41,7 @@ func (r *PingOnePopulationResource) ExportAll() (*[]connector.ImportBlock, error return nil, err } - for populationId, populationName := range *populationData { + for populationId, populationName := range populationData { commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, "Population ID": populationId, @@ -60,35 +62,23 @@ func (r *PingOnePopulationResource) ExportAll() (*[]connector.ImportBlock, error return &importBlocks, nil } -func (r *PingOnePopulationResource) getPopulationData() (*map[string]string, error) { +func (r *PingOnePopulationResource) getPopulationData() (map[string]string, error) { populationData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.PopulationsApi.ReadAllPopulations(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + populations, err := pingone.GetManagementAPIObjectsFromIterator[management.Population](iter, "ReadAllPopulations", "GetPopulations", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllPopulations", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, population := range embedded.GetPopulations() { - populationId, populationIdOk := population.GetIdOk() - populationName, populationNameOk := population.GetNameOk() + for _, population := range populations { + populationId, populationIdOk := population.GetIdOk() + populationName, populationNameOk := population.GetNameOk() - if populationIdOk && populationNameOk { - populationData[*populationId] = *populationName - } + if populationIdOk && populationNameOk { + populationData[*populationId] = *populationName } } - return &populationData, nil + return populationData, nil } diff --git a/internal/connector/pingone/sso/resources/pingone_population_default.go b/internal/connector/pingone/sso/resources/pingone_population_default.go index d995637b..bd8319aa 100644 --- a/internal/connector/pingone/sso/resources/pingone_population_default.go +++ b/internal/connector/pingone/sso/resources/pingone_population_default.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -59,34 +61,22 @@ func (r *PingOnePopulationDefaultResource) ExportAll() (*[]connector.ImportBlock func (r *PingOnePopulationDefaultResource) getDefaultPopulationName() (*string, error) { iter := r.clientInfo.ApiClient.ManagementAPIClient.PopulationsApi.ReadAllPopulations(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + populations, err := pingone.GetManagementAPIObjectsFromIterator[management.Population](iter, "ReadAllPopulations", "GetPopulations", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllPopulations", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, population := range embedded.GetPopulations() { - populationDefault, populationDefaultOk := population.GetDefaultOk() + for _, population := range populations { + populationDefault, populationDefaultOk := population.GetDefaultOk() - if populationDefaultOk && *populationDefault { - populationName, populationNameOk := population.GetNameOk() + if populationDefaultOk && *populationDefault { + populationName, populationNameOk := population.GetNameOk() - if populationNameOk { - return populationName, nil - } + if populationNameOk { + return populationName, nil } } } - return nil, fmt.Errorf("Unable to find the name of the default population") + return nil, fmt.Errorf("unable to find the name of the default population") } diff --git a/internal/connector/pingone/sso/resources/pingone_resource.go b/internal/connector/pingone/sso/resources/pingone_resource.go index 6ea34150..ccd51362 100644 --- a/internal/connector/pingone/sso/resources/pingone_resource.go +++ b/internal/connector/pingone/sso/resources/pingone_resource.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,7 +41,7 @@ func (r *PingOneResourceResource) ExportAll() (*[]connector.ImportBlock, error) return nil, err } - for resourceId, resourceName := range *resourceData { + for resourceId, resourceName := range resourceData { commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, "Resource ID": resourceId, @@ -60,37 +62,25 @@ func (r *PingOneResourceResource) ExportAll() (*[]connector.ImportBlock, error) return &importBlocks, nil } -func (r *PingOneResourceResource) getResourceData() (*map[string]string, error) { +func (r *PingOneResourceResource) getResourceData() (map[string]string, error) { resourceData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.ResourcesApi.ReadAllResources(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + resourceInners, err := pingone.GetManagementAPIObjectsFromIterator[management.EntityArrayEmbeddedResourcesInner](iter, "ReadAllResources", "GetResources", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllResources", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, resourceInner := range embedded.GetResources() { - if resourceInner.Resource != nil { - resourceId, resourceIdOk := resourceInner.Resource.GetIdOk() - resourceName, resourceNameOk := resourceInner.Resource.GetNameOk() + for _, resourceInner := range resourceInners { + if resourceInner.Resource != nil { + resourceId, resourceIdOk := resourceInner.Resource.GetIdOk() + resourceName, resourceNameOk := resourceInner.Resource.GetNameOk() - if resourceIdOk && resourceNameOk { - resourceData[*resourceId] = *resourceName - } + if resourceIdOk && resourceNameOk { + resourceData[*resourceId] = *resourceName } } } - return &resourceData, nil + return resourceData, nil } diff --git a/internal/connector/pingone/sso/resources/pingone_resource_attribute.go b/internal/connector/pingone/sso/resources/pingone_resource_attribute.go index c0d29da3..39dba1b2 100644 --- a/internal/connector/pingone/sso/resources/pingone_resource_attribute.go +++ b/internal/connector/pingone/sso/resources/pingone_resource_attribute.go @@ -6,6 +6,7 @@ import ( "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -40,7 +41,7 @@ func (r *PingOneResourceAttributeResource) ExportAll() (*[]connector.ImportBlock return nil, err } - for resourceId, resourceNameAndType := range *resourceData { + for resourceId, resourceNameAndType := range resourceData { resourceName := resourceNameAndType[0] resourceType := resourceNameAndType[1] @@ -49,7 +50,7 @@ func (r *PingOneResourceAttributeResource) ExportAll() (*[]connector.ImportBlock return nil, err } - for resourceAttributeId, resourceAttributeName := range *resourceAttributeData { + for resourceAttributeId, resourceAttributeName := range resourceAttributeData { commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, "Resource Attribute ID": resourceAttributeId, @@ -73,89 +74,65 @@ func (r *PingOneResourceAttributeResource) ExportAll() (*[]connector.ImportBlock return &importBlocks, nil } -func (r *PingOneResourceAttributeResource) getResourceData() (*map[string][]string, error) { +func (r *PingOneResourceAttributeResource) getResourceData() (map[string][]string, error) { resourceData := make(map[string][]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.ResourcesApi.ReadAllResources(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + resourceInners, err := pingone.GetManagementAPIObjectsFromIterator[management.EntityArrayEmbeddedResourcesInner](iter, "ReadAllResources", "GetResources", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllResources", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, resourceInner := range embedded.GetResources() { - if resourceInner.Resource != nil { - resourceId, resourceIdOk := resourceInner.Resource.GetIdOk() - resourceName, resourceNameOk := resourceInner.Resource.GetNameOk() - resourceType, resourceTypeOk := resourceInner.Resource.GetTypeOk() + for _, resourceInner := range resourceInners { + if resourceInner.Resource != nil { + resourceId, resourceIdOk := resourceInner.Resource.GetIdOk() + resourceName, resourceNameOk := resourceInner.Resource.GetNameOk() + resourceType, resourceTypeOk := resourceInner.Resource.GetTypeOk() - if resourceIdOk && resourceNameOk && resourceTypeOk { - resourceData[*resourceId] = []string{*resourceName, string(*resourceType)} - } + if resourceIdOk && resourceNameOk && resourceTypeOk { + resourceData[*resourceId] = []string{*resourceName, string(*resourceType)} } } } - return &resourceData, nil + return resourceData, nil } -func (r *PingOneResourceAttributeResource) getResourceAttributeData(resourceId string, resourceType string) (*map[string]string, error) { +func (r *PingOneResourceAttributeResource) getResourceAttributeData(resourceId string, resourceType string) (map[string]string, error) { resourceAttributeData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.ResourceAttributesApi.ReadAllResourceAttributes(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID, resourceId).Execute() + attributeInners, err := pingone.GetManagementAPIObjectsFromIterator[management.EntityArrayEmbeddedAttributesInner](iter, "ReadAllResourceAttributes", "GetAttributes", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllResourceAttributes", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, attributeInner := range embedded.GetAttributes() { - if attributeInner.ResourceAttribute != nil { - resourceAttributeId, resourceAttributeIdOk := attributeInner.ResourceAttribute.GetIdOk() - resourceAttributeName, resourceAttributeNameOk := attributeInner.ResourceAttribute.GetNameOk() - resourceAttributeType, resourceAttributeTypeOk := attributeInner.ResourceAttribute.GetTypeOk() - - if resourceAttributeIdOk && resourceAttributeNameOk && resourceAttributeTypeOk { - // Any CORE attribute is required and cannot be overridden - // Do not export CORE attributes - // There is one exception where a CUSTOM resource can override the sub CORE attribute - if *resourceAttributeType == management.ENUMRESOURCEATTRIBUTETYPE_CORE { - if resourceType == string(management.ENUMRESOURCETYPE_CUSTOM) { - // Skip export of all CORE attributes except for the sub attribute for CUSTOM resources - if *resourceAttributeName != "sub" { - continue - } - } else { - // Skip export of all CORE attributes for non-CUSTOM resources + for _, attributeInner := range attributeInners { + if attributeInner.ResourceAttribute != nil { + resourceAttributeId, resourceAttributeIdOk := attributeInner.ResourceAttribute.GetIdOk() + resourceAttributeName, resourceAttributeNameOk := attributeInner.ResourceAttribute.GetNameOk() + resourceAttributeType, resourceAttributeTypeOk := attributeInner.ResourceAttribute.GetTypeOk() + + if resourceAttributeIdOk && resourceAttributeNameOk && resourceAttributeTypeOk { + // Any CORE attribute is required and cannot be overridden + // Do not export CORE attributes + // There is one exception where a CUSTOM resource can override the sub CORE attribute + if *resourceAttributeType == management.ENUMRESOURCEATTRIBUTETYPE_CORE { + if resourceType == string(management.ENUMRESOURCETYPE_CUSTOM) { + // Skip export of all CORE attributes except for the sub attribute for CUSTOM resources + if *resourceAttributeName != "sub" { continue } + } else { + // Skip export of all CORE attributes for non-CUSTOM resources + continue } - - resourceAttributeData[*resourceAttributeId] = *resourceAttributeName } + + resourceAttributeData[*resourceAttributeId] = *resourceAttributeName } } } - return &resourceAttributeData, nil + return resourceAttributeData, nil } diff --git a/internal/connector/pingone/sso/resources/pingone_resource_scope.go b/internal/connector/pingone/sso/resources/pingone_resource_scope.go index d9753841..33a50eb5 100644 --- a/internal/connector/pingone/sso/resources/pingone_resource_scope.go +++ b/internal/connector/pingone/sso/resources/pingone_resource_scope.go @@ -6,6 +6,7 @@ import ( "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -40,13 +41,13 @@ func (r *PingOneResourceScopeResource) ExportAll() (*[]connector.ImportBlock, er return nil, err } - for resourceId, resourceName := range *resourceData { + for resourceId, resourceName := range resourceData { resourceScopeData, err := r.getResourceScopeData(resourceId) if err != nil { return nil, err } - for resourceScopeId, resourceScopeName := range *resourceScopeData { + for resourceScopeId, resourceScopeName := range resourceScopeData { commentData := map[string]string{ "Custom Resource ID": resourceId, "Custom Resource Name": resourceName, @@ -70,70 +71,46 @@ func (r *PingOneResourceScopeResource) ExportAll() (*[]connector.ImportBlock, er return &importBlocks, nil } -func (r *PingOneResourceScopeResource) getResourceData() (*map[string]string, error) { +func (r *PingOneResourceScopeResource) getResourceData() (map[string]string, error) { resourceData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.ResourcesApi.ReadAllResources(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + resourceInners, err := pingone.GetManagementAPIObjectsFromIterator[management.EntityArrayEmbeddedResourcesInner](iter, "ReadAllResources", "GetResources", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllResources", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, resourceInner := range embedded.GetResources() { - if resourceInner.Resource != nil { - resourceId, resourceIdOk := resourceInner.Resource.GetIdOk() - resourceName, resourceNameOk := resourceInner.Resource.GetNameOk() - resourceType, resourceTypeOk := resourceInner.Resource.GetTypeOk() + for _, resourceInner := range resourceInners { + if resourceInner.Resource != nil { + resourceId, resourceIdOk := resourceInner.Resource.GetIdOk() + resourceName, resourceNameOk := resourceInner.Resource.GetNameOk() + resourceType, resourceTypeOk := resourceInner.Resource.GetTypeOk() - if resourceIdOk && resourceNameOk && resourceTypeOk && *resourceType == management.ENUMRESOURCETYPE_CUSTOM { - resourceData[*resourceId] = *resourceName - } + if resourceIdOk && resourceNameOk && resourceTypeOk && *resourceType == management.ENUMRESOURCETYPE_CUSTOM { + resourceData[*resourceId] = *resourceName } } } - return &resourceData, nil + return resourceData, nil } -func (r *PingOneResourceScopeResource) getResourceScopeData(resourceId string) (*map[string]string, error) { +func (r *PingOneResourceScopeResource) getResourceScopeData(resourceId string) (map[string]string, error) { resourceScopeData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.ResourceScopesApi.ReadAllResourceScopes(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID, resourceId).Execute() + resourceScopes, err := pingone.GetManagementAPIObjectsFromIterator[management.ResourceScope](iter, "ReadAllResourceScopes", "GetScopes", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllResourceScopes", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, scope := range embedded.GetScopes() { - scopeId, scopeIdOk := scope.GetIdOk() - scopeName, scopeNameOk := scope.GetNameOk() - if scopeIdOk && scopeNameOk { - resourceScopeData[*scopeId] = *scopeName - } + for _, scope := range resourceScopes { + scopeId, scopeIdOk := scope.GetIdOk() + scopeName, scopeNameOk := scope.GetNameOk() + if scopeIdOk && scopeNameOk { + resourceScopeData[*scopeId] = *scopeName } } - return &resourceScopeData, nil + return resourceScopeData, nil } diff --git a/internal/connector/pingone/sso/resources/pingone_resource_scope_openid.go b/internal/connector/pingone/sso/resources/pingone_resource_scope_openid.go index ff04507a..bfc5663e 100644 --- a/internal/connector/pingone/sso/resources/pingone_resource_scope_openid.go +++ b/internal/connector/pingone/sso/resources/pingone_resource_scope_openid.go @@ -6,6 +6,7 @@ import ( "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -40,13 +41,13 @@ func (r *PingOneResourceScopeOpenIdResource) ExportAll() (*[]connector.ImportBlo return nil, err } - for resourceId, resourceName := range *resourceData { + for resourceId, resourceName := range resourceData { resourceScopeData, err := r.getResourceScopeData(resourceId) if err != nil { return nil, err } - for resourceScopeId, resourceScopeName := range *resourceScopeData { + for resourceScopeId, resourceScopeName := range resourceScopeData { commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, "OpenID Connect Resource Name": resourceName, @@ -69,71 +70,47 @@ func (r *PingOneResourceScopeOpenIdResource) ExportAll() (*[]connector.ImportBlo return &importBlocks, nil } -func (r *PingOneResourceScopeOpenIdResource) getResourceData() (*map[string]string, error) { +func (r *PingOneResourceScopeOpenIdResource) getResourceData() (map[string]string, error) { resourceData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.ResourcesApi.ReadAllResources(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + resourceInners, err := pingone.GetManagementAPIObjectsFromIterator[management.EntityArrayEmbeddedResourcesInner](iter, "ReadAllResources", "GetResources", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllResources", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, resourceInner := range embedded.GetResources() { - if resourceInner.Resource != nil { - resourceId, resourceIdOk := resourceInner.Resource.GetIdOk() - resourceName, resourceNameOk := resourceInner.Resource.GetNameOk() - resourceType, resourceTypeOk := resourceInner.Resource.GetTypeOk() + for _, resourceInner := range resourceInners { + if resourceInner.Resource != nil { + resourceId, resourceIdOk := resourceInner.Resource.GetIdOk() + resourceName, resourceNameOk := resourceInner.Resource.GetNameOk() + resourceType, resourceTypeOk := resourceInner.Resource.GetTypeOk() - if resourceIdOk && resourceNameOk && resourceTypeOk && *resourceType == management.ENUMRESOURCETYPE_OPENID_CONNECT { - resourceData[*resourceId] = *resourceName - } + if resourceIdOk && resourceNameOk && resourceTypeOk && *resourceType == management.ENUMRESOURCETYPE_OPENID_CONNECT { + resourceData[*resourceId] = *resourceName } } } - return &resourceData, nil + return resourceData, nil } -func (r *PingOneResourceScopeOpenIdResource) getResourceScopeData(resourceId string) (*map[string]string, error) { +func (r *PingOneResourceScopeOpenIdResource) getResourceScopeData(resourceId string) (map[string]string, error) { resourceScopeData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.ResourceScopesApi.ReadAllResourceScopes(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID, resourceId).Execute() + resourceScopes, err := pingone.GetManagementAPIObjectsFromIterator[management.ResourceScope](iter, "ReadAllResourceScopes", "GetScopes", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllResourceScopes", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, scopeOpenId := range embedded.GetScopes() { - scopeOpenIdId, scopeOpenIdIdOk := scopeOpenId.GetIdOk() - scopeOpenIdName, scopeOpenIdNameOk := scopeOpenId.GetNameOk() + for _, scopeOpenId := range resourceScopes { + scopeOpenIdId, scopeOpenIdIdOk := scopeOpenId.GetIdOk() + scopeOpenIdName, scopeOpenIdNameOk := scopeOpenId.GetNameOk() - if scopeOpenIdIdOk && scopeOpenIdNameOk { - resourceScopeData[*scopeOpenIdId] = *scopeOpenIdName - } + if scopeOpenIdIdOk && scopeOpenIdNameOk { + resourceScopeData[*scopeOpenIdId] = *scopeOpenIdName } } - return &resourceScopeData, nil + return resourceScopeData, nil } diff --git a/internal/connector/pingone/sso/resources/pingone_resource_scope_pingone_api.go b/internal/connector/pingone/sso/resources/pingone_resource_scope_pingone_api.go index 8226a7fa..9f356be3 100644 --- a/internal/connector/pingone/sso/resources/pingone_resource_scope_pingone_api.go +++ b/internal/connector/pingone/sso/resources/pingone_resource_scope_pingone_api.go @@ -7,6 +7,7 @@ import ( "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -41,13 +42,13 @@ func (r *PingOneResourceScopePingOneApiResource) ExportAll() (*[]connector.Impor return nil, err } - for resourceId, resourceName := range *resourceData { + for resourceId, resourceName := range resourceData { resourceScopeData, err := r.getResourceScopeData(resourceId) if err != nil { return nil, err } - for resourceScopeId, resourceScopeName := range *resourceScopeData { + for resourceScopeId, resourceScopeName := range resourceScopeData { commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, "PingOne API Resource Name": resourceName, @@ -70,78 +71,54 @@ func (r *PingOneResourceScopePingOneApiResource) ExportAll() (*[]connector.Impor return &importBlocks, nil } -func (r *PingOneResourceScopePingOneApiResource) getResourceData() (*map[string]string, error) { +func (r *PingOneResourceScopePingOneApiResource) getResourceData() (map[string]string, error) { resourceData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.ResourcesApi.ReadAllResources(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + resourceInners, err := pingone.GetManagementAPIObjectsFromIterator[management.EntityArrayEmbeddedResourcesInner](iter, "ReadAllResources", "GetResources", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllResources", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, resourceInner := range embedded.GetResources() { - if resourceInner.Resource != nil { - resourceId, resourceIdOk := resourceInner.Resource.GetIdOk() - resourceName, resourceNameOk := resourceInner.Resource.GetNameOk() - resourceType, resourceTypeOk := resourceInner.Resource.GetTypeOk() + for _, resourceInner := range resourceInners { + if resourceInner.Resource != nil { + resourceId, resourceIdOk := resourceInner.Resource.GetIdOk() + resourceName, resourceNameOk := resourceInner.Resource.GetNameOk() + resourceType, resourceTypeOk := resourceInner.Resource.GetTypeOk() - if resourceIdOk && resourceNameOk && resourceTypeOk && *resourceType == management.ENUMRESOURCETYPE_PINGONE_API { - resourceData[*resourceId] = *resourceName - } + if resourceIdOk && resourceNameOk && resourceTypeOk && *resourceType == management.ENUMRESOURCETYPE_PINGONE_API { + resourceData[*resourceId] = *resourceName } } } - return &resourceData, nil + return resourceData, nil } -func (r *PingOneResourceScopePingOneApiResource) getResourceScopeData(resourceId string) (*map[string]string, error) { +func (r *PingOneResourceScopePingOneApiResource) getResourceScopeData(resourceId string) (map[string]string, error) { resourceScopeData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.ResourceScopesApi.ReadAllResourceScopes(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID, resourceId).Execute() + resourceScopes, err := pingone.GetManagementAPIObjectsFromIterator[management.ResourceScope](iter, "ReadAllResourceScopes", "GetScopes", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllResourceScopes", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, scopePingOneApi := range embedded.GetScopes() { - scopePingOneApiId, scopePingOneApiIdOk := scopePingOneApi.GetIdOk() - scopePingOneApiName, scopePingOneApiNameOk := scopePingOneApi.GetNameOk() + for _, scopePingOneApi := range resourceScopes { + scopePingOneApiId, scopePingOneApiIdOk := scopePingOneApi.GetIdOk() + scopePingOneApiName, scopePingOneApiNameOk := scopePingOneApi.GetNameOk() - if scopePingOneApiIdOk && scopePingOneApiNameOk { - // Make sure the scope name is in the form of one of the following four patterns - // p1:read:user, p1:update:user, p1:read:user:{suffix}, or p1:update:user:{suffix} - // as supported by https://registry.terraform.io/providers/pingidentity/pingone/latest/docs/resources/resource_scope_pingone_api - re := regexp.MustCompile(`^p1:(read|update):user(|:.+)$`) + if scopePingOneApiIdOk && scopePingOneApiNameOk { + // Make sure the scope name is in the form of one of the following four patterns + // p1:read:user, p1:update:user, p1:read:user:{suffix}, or p1:update:user:{suffix} + // as supported by https://registry.terraform.io/providers/pingidentity/pingone/latest/docs/resources/resource_scope_pingone_api + re := regexp.MustCompile(`^p1:(read|update):user(|:.+)$`) - if re.MatchString(*scopePingOneApiName) { - resourceScopeData[*scopePingOneApiId] = *scopePingOneApiName - } + if re.MatchString(*scopePingOneApiName) { + resourceScopeData[*scopePingOneApiId] = *scopePingOneApiName } } } - return &resourceScopeData, nil + return resourceScopeData, nil } diff --git a/internal/connector/pingone/sso/resources/pingone_schema_attribute.go b/internal/connector/pingone/sso/resources/pingone_schema_attribute.go index 9c7de31a..2cb67f13 100644 --- a/internal/connector/pingone/sso/resources/pingone_schema_attribute.go +++ b/internal/connector/pingone/sso/resources/pingone_schema_attribute.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,13 +41,13 @@ func (r *PingOneSchemaAttributeResource) ExportAll() (*[]connector.ImportBlock, return nil, err } - for schemaId, schemaName := range *schemaData { + for schemaId, schemaName := range schemaData { schemaAttributeData, err := r.getSchemaAttributeData(schemaId) if err != nil { return nil, err } - for schemaAttributeId, schemaAttributeName := range *schemaAttributeData { + for schemaAttributeId, schemaAttributeName := range schemaAttributeData { commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, "Resource Type": r.ResourceType(), @@ -69,66 +71,44 @@ func (r *PingOneSchemaAttributeResource) ExportAll() (*[]connector.ImportBlock, return &importBlocks, nil } -func (r *PingOneSchemaAttributeResource) getSchemaData() (*map[string]string, error) { +func (r *PingOneSchemaAttributeResource) getSchemaData() (map[string]string, error) { schemaData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.SchemasApi.ReadAllSchemas(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + schemas, err := pingone.GetManagementAPIObjectsFromIterator[management.Schema](iter, "ReadAllSchemas", "GetSchemas", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllSchemas", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, schema := range embedded.GetSchemas() { - schemaId, schemaIdOk := schema.GetIdOk() - schemaName, schemaNameOk := schema.GetNameOk() - if schemaIdOk && schemaNameOk { - schemaData[*schemaId] = *schemaName - } + for _, schema := range schemas { + schemaId, schemaIdOk := schema.GetIdOk() + schemaName, schemaNameOk := schema.GetNameOk() + if schemaIdOk && schemaNameOk { + schemaData[*schemaId] = *schemaName } } - return &schemaData, nil + return schemaData, nil } -func (r *PingOneSchemaAttributeResource) getSchemaAttributeData(schemaId string) (*map[string]string, error) { +func (r *PingOneSchemaAttributeResource) getSchemaAttributeData(schemaId string) (map[string]string, error) { schemaAttributeData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.SchemasApi.ReadAllSchemaAttributes(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID, schemaId).Execute() + attributeInners, err := pingone.GetManagementAPIObjectsFromIterator[management.EntityArrayEmbeddedAttributesInner](iter, "ReadAllSchemaAttributes", "GetAttributes", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllSchemaAttributes", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, schemaAttribute := range embedded.GetAttributes() { - schemaAttributeId, schemaAttributeIdOk := schemaAttribute.SchemaAttribute.GetIdOk() - schemaAttributeName, schemaAttributeNameOk := schemaAttribute.SchemaAttribute.GetNameOk() + for _, attributeInner := range attributeInners { + if attributeInner.SchemaAttribute != nil { + schemaAttributeId, schemaAttributeIdOk := attributeInner.SchemaAttribute.GetIdOk() + schemaAttributeName, schemaAttributeNameOk := attributeInner.SchemaAttribute.GetNameOk() if schemaAttributeIdOk && schemaAttributeNameOk { schemaAttributeData[*schemaAttributeId] = *schemaAttributeName } } } - return &schemaAttributeData, nil + return schemaAttributeData, nil } diff --git a/internal/connector/pingone/sso/resources/pingone_sign_on_policy.go b/internal/connector/pingone/sso/resources/pingone_sign_on_policy.go index eaa7e9e0..8af1bd60 100644 --- a/internal/connector/pingone/sso/resources/pingone_sign_on_policy.go +++ b/internal/connector/pingone/sso/resources/pingone_sign_on_policy.go @@ -3,8 +3,10 @@ package resources import ( "fmt" + "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -39,7 +41,7 @@ func (r *PingOneSignOnPolicyResource) ExportAll() (*[]connector.ImportBlock, err return nil, err } - for signOnPolicyId, signOnPolicyName := range *signOnPolicyData { + for signOnPolicyId, signOnPolicyName := range signOnPolicyData { commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, "Resource Type": r.ResourceType(), @@ -60,35 +62,23 @@ func (r *PingOneSignOnPolicyResource) ExportAll() (*[]connector.ImportBlock, err return &importBlocks, nil } -func (r *PingOneSignOnPolicyResource) getSignOnPolicyData() (*map[string]string, error) { +func (r *PingOneSignOnPolicyResource) getSignOnPolicyData() (map[string]string, error) { signOnPolicyData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.SignOnPoliciesApi.ReadAllSignOnPolicies(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + signOnPolicies, err := pingone.GetManagementAPIObjectsFromIterator[management.SignOnPolicy](iter, "ReadAllSignOnPolicies", "GetSignOnPolicies", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllSignOnPolicies", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, signOnPolicy := range embedded.GetSignOnPolicies() { - signOnPolicyId, signOnPolicyIdOk := signOnPolicy.GetIdOk() - signOnPolicyName, signOnPolicyNameOk := signOnPolicy.GetNameOk() + for _, signOnPolicy := range signOnPolicies { + signOnPolicyId, signOnPolicyIdOk := signOnPolicy.GetIdOk() + signOnPolicyName, signOnPolicyNameOk := signOnPolicy.GetNameOk() - if signOnPolicyIdOk && signOnPolicyNameOk { - signOnPolicyData[*signOnPolicyId] = *signOnPolicyName - } + if signOnPolicyIdOk && signOnPolicyNameOk { + signOnPolicyData[*signOnPolicyId] = *signOnPolicyName } } - return &signOnPolicyData, nil + return signOnPolicyData, nil } diff --git a/internal/connector/pingone/sso/resources/pingone_sign_on_policy_action.go b/internal/connector/pingone/sso/resources/pingone_sign_on_policy_action.go index 82cbffb7..f8943054 100644 --- a/internal/connector/pingone/sso/resources/pingone_sign_on_policy_action.go +++ b/internal/connector/pingone/sso/resources/pingone_sign_on_policy_action.go @@ -6,6 +6,7 @@ import ( "github.com/patrickcping/pingone-go-sdk-v2/management" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" + "github.com/pingidentity/pingcli/internal/connector/pingone" "github.com/pingidentity/pingcli/internal/logger" ) @@ -40,13 +41,13 @@ func (r *PingOneSignOnPolicyActionResource) ExportAll() (*[]connector.ImportBloc return nil, err } - for signOnPolicyId, signOnPolicyName := range *signOnPolicyData { + for signOnPolicyId, signOnPolicyName := range signOnPolicyData { signOnPolicyActionData, err := r.getSignOnPolicyActionData(signOnPolicyId) if err != nil { return nil, err } - for actionId, actionType := range *signOnPolicyActionData { + for actionId, actionType := range signOnPolicyActionData { commentData := map[string]string{ "Export Environment ID": r.clientInfo.ExportEnvironmentID, "Resource Type": r.ResourceType(), @@ -70,98 +71,74 @@ func (r *PingOneSignOnPolicyActionResource) ExportAll() (*[]connector.ImportBloc return &importBlocks, nil } -func (r *PingOneSignOnPolicyActionResource) getSignOnPolicyData() (*map[string]string, error) { +func (r *PingOneSignOnPolicyActionResource) getSignOnPolicyData() (map[string]string, error) { signOnPolicyData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.SignOnPoliciesApi.ReadAllSignOnPolicies(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID).Execute() + signOnPolicies, err := pingone.GetManagementAPIObjectsFromIterator[management.SignOnPolicy](iter, "ReadAllSignOnPolicies", "GetSignOnPolicies", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllSignOnPolicies", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - for _, signOnPolicy := range embedded.GetSignOnPolicies() { - signOnPolicyId, signOnPolicyIdOk := signOnPolicy.GetIdOk() - signOnPolicyName, signOnPolicyNameOk := signOnPolicy.GetNameOk() + for _, signOnPolicy := range signOnPolicies { + signOnPolicyId, signOnPolicyIdOk := signOnPolicy.GetIdOk() + signOnPolicyName, signOnPolicyNameOk := signOnPolicy.GetNameOk() - if signOnPolicyIdOk && signOnPolicyNameOk { - signOnPolicyData[*signOnPolicyId] = *signOnPolicyName - } + if signOnPolicyIdOk && signOnPolicyNameOk { + signOnPolicyData[*signOnPolicyId] = *signOnPolicyName } } - return &signOnPolicyData, nil + return signOnPolicyData, nil } -func (r *PingOneSignOnPolicyActionResource) getSignOnPolicyActionData(signOnPolicyId string) (*map[string]string, error) { +func (r *PingOneSignOnPolicyActionResource) getSignOnPolicyActionData(signOnPolicyId string) (map[string]string, error) { signOnPolicyActionData := make(map[string]string) iter := r.clientInfo.ApiClient.ManagementAPIClient.SignOnPolicyActionsApi.ReadAllSignOnPolicyActions(r.clientInfo.Context, r.clientInfo.ExportEnvironmentID, signOnPolicyId).Execute() + signOnPolicyActions, err := pingone.GetManagementAPIObjectsFromIterator[management.SignOnPolicyAction](iter, "ReadAllSignOnPolicyActions", "GetActions", r.ResourceType()) + if err != nil { + return nil, err + } - for cursor, err := range iter { - err = common.HandleClientResponse(cursor.HTTPResponse, err, "ReadAllSignOnPolicyActions", r.ResourceType()) - if err != nil { - return nil, err - } - - if cursor.EntityArray == nil { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) - } - - embedded, embeddedOk := cursor.EntityArray.GetEmbeddedOk() - if !embeddedOk { - return nil, common.DataNilError(r.ResourceType(), cursor.HTTPResponse) + for _, action := range signOnPolicyActions { + var ( + actionId *string + actionIdOk bool + actionType *management.EnumSignOnPolicyType + actionTypeOk bool + ) + + switch { + case action.SignOnPolicyActionAgreement != nil: + actionId, actionIdOk = action.SignOnPolicyActionAgreement.GetIdOk() + actionType, actionTypeOk = action.SignOnPolicyActionAgreement.GetTypeOk() + case action.SignOnPolicyActionCommon != nil: + actionId, actionIdOk = action.SignOnPolicyActionCommon.GetIdOk() + actionType, actionTypeOk = action.SignOnPolicyActionCommon.GetTypeOk() + case action.SignOnPolicyActionIDFirst != nil: + actionId, actionIdOk = action.SignOnPolicyActionIDFirst.GetIdOk() + actionType, actionTypeOk = action.SignOnPolicyActionIDFirst.GetTypeOk() + case action.SignOnPolicyActionIDP != nil: + actionId, actionIdOk = action.SignOnPolicyActionIDP.GetIdOk() + actionType, actionTypeOk = action.SignOnPolicyActionIDP.GetTypeOk() + case action.SignOnPolicyActionLogin != nil: + actionId, actionIdOk = action.SignOnPolicyActionLogin.GetIdOk() + actionType, actionTypeOk = action.SignOnPolicyActionLogin.GetTypeOk() + case action.SignOnPolicyActionMFA != nil: + actionId, actionIdOk = action.SignOnPolicyActionMFA.GetIdOk() + actionType, actionTypeOk = action.SignOnPolicyActionMFA.GetTypeOk() + case action.SignOnPolicyActionPingIDWinLoginPasswordless != nil: + actionId, actionIdOk = action.SignOnPolicyActionPingIDWinLoginPasswordless.GetIdOk() + actionType, actionTypeOk = action.SignOnPolicyActionPingIDWinLoginPasswordless.GetTypeOk() + default: + continue } - for _, action := range embedded.GetActions() { - var ( - actionId *string - actionIdOk bool - actionType *management.EnumSignOnPolicyType - actionTypeOk bool - ) - - switch { - case action.SignOnPolicyActionAgreement != nil: - actionId, actionIdOk = action.SignOnPolicyActionAgreement.GetIdOk() - actionType, actionTypeOk = action.SignOnPolicyActionAgreement.GetTypeOk() - case action.SignOnPolicyActionCommon != nil: - actionId, actionIdOk = action.SignOnPolicyActionCommon.GetIdOk() - actionType, actionTypeOk = action.SignOnPolicyActionCommon.GetTypeOk() - case action.SignOnPolicyActionIDFirst != nil: - actionId, actionIdOk = action.SignOnPolicyActionIDFirst.GetIdOk() - actionType, actionTypeOk = action.SignOnPolicyActionIDFirst.GetTypeOk() - case action.SignOnPolicyActionIDP != nil: - actionId, actionIdOk = action.SignOnPolicyActionIDP.GetIdOk() - actionType, actionTypeOk = action.SignOnPolicyActionIDP.GetTypeOk() - case action.SignOnPolicyActionLogin != nil: - actionId, actionIdOk = action.SignOnPolicyActionLogin.GetIdOk() - actionType, actionTypeOk = action.SignOnPolicyActionLogin.GetTypeOk() - case action.SignOnPolicyActionMFA != nil: - actionId, actionIdOk = action.SignOnPolicyActionMFA.GetIdOk() - actionType, actionTypeOk = action.SignOnPolicyActionMFA.GetTypeOk() - case action.SignOnPolicyActionPingIDWinLoginPasswordless != nil: - actionId, actionIdOk = action.SignOnPolicyActionPingIDWinLoginPasswordless.GetIdOk() - actionType, actionTypeOk = action.SignOnPolicyActionPingIDWinLoginPasswordless.GetTypeOk() - default: - continue - } - - if actionIdOk && actionTypeOk { - signOnPolicyActionData[*actionId] = string(*actionType) - } + if actionIdOk && actionTypeOk { + signOnPolicyActionData[*actionId] = string(*actionType) } } - return &signOnPolicyActionData, nil + return signOnPolicyActionData, nil } diff --git a/internal/output/output.go b/internal/output/output.go index 78b54f57..80430690 100644 --- a/internal/output/output.go +++ b/internal/output/output.go @@ -119,10 +119,10 @@ func printText(message string, fields map[string]interface{}, colorFunc func(for switch typedValue := v.(type) { // If the value is a json.RawMessage, print it as a string case json.RawMessage: - fmt.Println(cyan("%s: \n%s", k, typedValue)) + fmt.Println(cyan("%s: %s", k, typedValue)) l.Info().Msg(cyan("%s: %s", k, typedValue)) default: - fmt.Println(cyan("%s: \n%v", k, v)) + fmt.Println(cyan("%s: %v", k, v)) l.Info().Msg(cyan("%s: %v", k, v)) } } diff --git a/internal/testing/testutils_terraform/terraform_utils.go b/internal/testing/testutils_terraform/terraform_utils.go index 4010a5db..6eaf7433 100644 --- a/internal/testing/testutils_terraform/terraform_utils.go +++ b/internal/testing/testutils_terraform/terraform_utils.go @@ -11,6 +11,7 @@ import ( "strings" "testing" + "github.com/pingidentity/pingcli/internal/configuration/options" "github.com/pingidentity/pingcli/internal/connector" "github.com/pingidentity/pingcli/internal/connector/common" "github.com/pingidentity/pingcli/internal/customtypes" @@ -199,23 +200,20 @@ func InitPingFederateTerraform(t *testing.T) { } provider "pingfederate" { - client_id = "%s" - client_secret = "%s" - scopes = ["%s"] - token_url = "%s" - https_host = "%s" - admin_api_path = "%s" + username = "%s" + password = "%s" + https_host = "%s" + admin_api_path = "%s" product_version = "12.2" insecure_trust_all_tls = true x_bypass_external_validation_header = true } -`, os.Getenv("PINGCLI_PINGFEDERATE_PROVIDER_VERSION"), - os.Getenv("PINGCLI_PINGFEDERATE_CLIENT_ID"), - os.Getenv("PINGCLI_PINGFEDERATE_CLIENT_SECRET"), - os.Getenv("PINGCLI_PINGFEDERATE_SCOPES"), - os.Getenv("PINGCLI_PINGFEDERATE_TOKEN_URL"), - os.Getenv("PINGCLI_PINGFEDERATE_HTTPS_HOST"), - os.Getenv("PINGCLI_PINGFEDERATE_ADMIN_API_PATH")) +`, + os.Getenv("PINGCLI_PINGFEDERATE_PROVIDER_VERSION"), + os.Getenv(options.PingFederateBasicAuthUsernameOption.EnvVar), + os.Getenv(options.PingFederateBasicAuthPasswordOption.EnvVar), + os.Getenv(options.PingFederateHTTPSHostOption.EnvVar), + os.Getenv(options.PingFederateAdminAPIPathOption.EnvVar)) // Write main.tf to testing directory mainTFFilepath := filepath.Join(exportDir, "main.tf") diff --git a/server-profiles/12.2/data.json b/server-profiles/12.2/data.json new file mode 100644 index 00000000..d7a3e129 --- /dev/null +++ b/server-profiles/12.2/data.json @@ -0,0 +1,4748 @@ +{ + "metadata": { + "pfVersion": "12.2.0.4" + }, + "operations": [ + { + "resourceType": "/configStore", + "operationType": "SAVE", + "subResource": "cert-time-tracking", + "items": [ + { + "id": "9vgmnd36wykte1l2nm8s8uead", + "type": "STRING", + "stringValue": "1735851845" + }, + { + "id": "sslservercert", + "type": "STRING", + "stringValue": "1735840761" + }, + { + "id": "tiq4n26axjircjk30oz5zf6k3", + "type": "STRING", + "stringValue": "1735851641" + } + ] + }, + { + "resourceType": "/configStore", + "operationType": "SAVE", + "subResource": "org.sourceid.oauth20.domain.ClientManagerXmlFileImpl", + "items": [ + { + "id": "MigrationComplete8.4", + "type": "STRING", + "stringValue": "true" + } + ] + }, + { + "resourceType": "/configStore", + "operationType": "SAVE", + "subResource": "org.sourceid.saml20.domain.LoggingMode", + "items": [ + { + "id": "IdPOverrideOn", + "type": "STRING", + "stringValue": "false" + }, + { + "id": "SPOverrideOn", + "type": "STRING", + "stringValue": "false" + } + ] + }, + { + "resourceType": "/configStore", + "operationType": "SAVE", + "subResource": "org.sourceid.saml20.domain.mgmt.AdminUserManager", + "items": [ + { + "id": "isDcRoleUpdated", + "type": "STRING", + "stringValue": "true" + }, + { + "id": "isEaRoleUpdated", + "type": "STRING", + "stringValue": "true" + } + ] + }, + { + "resourceType": "/configStore", + "operationType": "SAVE", + "subResource": "org.sourceid.saml20.domain.mgmt.impl.PartnerCertMigrator", + "items": [ + { + "id": "partner.cert.migration.complete", + "type": "STRING", + "stringValue": "true" + } + ] + }, + { + "resourceType": "/configStore", + "operationType": "SAVE", + "subResource": "org.sourceid.saml20.metadata.partner.impl.MetadataDirectoryHybridDbImpl", + "items": [ + { + "id": "MigrationComplete8.4", + "type": "STRING", + "stringValue": "true" + } + ] + }, + { + "resourceType": "/license/agreement", + "operationType": "SAVE", + "items": [ + { + "licenseAgreementUrl": "https://localhost:9999/pf-admin-api/license-agreement", + "accepted": true + } + ] + }, + { + "resourceType": "/certificates/ca", + "operationType": "SAVE", + "items": [ + { + "id": "sslservercert", + "fileData": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURVekNDQWoyZ0F3SUJBZ0lRSFJOTEZ3a0RRTHc3WGZ6NVZKTlJnekFMQmdrcWhraUc5dzBCQVFzd1N6RU9NQXdHQTFVRUNBd0YKVkVWWVFWTXhEekFOQmdOVkJBY01Ca0ZWVTFSSlRqRU5NQXNHQTFVRUN3d0VVRWxPUnpFTU1Bb0dBMVVFQ2d3RFEwUlNNUXN3Q1FZRApWUVFHREFKVlV6QWVGdzB5TkRBNE1USXhPVFEzTVRkYUZ3MDBOREE0TURjeE9UUTNNVGRhTUVzeERqQU1CZ05WQkFnTUJWUkZXRUZUCk1ROHdEUVlEVlFRSERBWkJWVk5VU1U0eERUQUxCZ05WQkFzTUJGQkpUa2N4RERBS0JnTlZCQW9NQTBORVVqRUxNQWtHQTFVRUJnd0MKVlZNd2dnRWlNQTBHQ1NxR1NJYjNEUUVCQVFVQUE0SUJEd0F3Z2dFS0FvSUJBUUNodTE3Z1FiYnZNdnBsbkJ0YnBLOTNVVTMvYjRUZApKamJ5dXJNRDRQOFMrakNWeER4cDF4ZGxUeGJxbFphcVRuaE8yOG1GRHdFRFlhdVgyZHdENmUwTUxkNEV5aWQ3eUp5T2ViZmdQUzRMClJrc3ZVb3RlUlUxV2RoZ1I4NDdyRFNOZnFha3JQUkRaVWZJOUpmY0pqMG4rWElJT2hobEhQZXB4bE56aDRyK0xUY3ZqcXIvTWgxMEgKNzhteG1xZUhvUWlZYmhydExpaGgxN2N2cGVJWlhPT3dVU0JvV1pDWkcreXlYVXNGd2RHU3VoV1l0clNPbE1TZnZlTm5rbk41amh5aApVZWJRQ05vVUhTdEs1cW9YeTFVVU1HRE5IcEFHSDNWNHJpWmhCNkxhTkszZ3gwbmF5d3RvcDF0WkpaNXg0ZllJMFQvVTVreTlGZWxlCkE2SEMzZmR4QWdNQkFBR2pOekExTUIwR0ExVWREZ1FXQkJSWVBlRkVtTkxHcURGQ2pOcWhBUVc3NThZT3FqQVVCZ05WSFJFRURUQUwKZ2dsc2IyTmhiR2h2YzNRd0N3WUpLb1pJaHZjTkFRRUxBNElCQVFBVVBRM1hKSmtJZ3JNSU5xVjJPdnB4bUR2c0JsVEVjQmE4Z2JRcwpTMXZuQUdDNFRsKzV2QWpwa0Z4VFhUbnBHaWtJU25POVp3SWJRYTJ1RlZRMjZFbkNKazF3Z3JMWFRkY0FXQjRLQmZRYWRKUTdVQzltCmE3RTZYaW5FSjBUWGd5UXNSc3R4cldVNldLWGV1d3lYZEFidGE1ZWhzRjZZUDNPYzNZZTBqR201L1FtaWZhVmwzWUJNQ3JxOUVGdkwKUzQ1MUVTcVJMaDA4QUZjZ3RaWlc4RGo1MHNyUGlWbDZidVVQOWd3YWxqamhYV01FTDBNVWtKMlgweHlVMHlGMytNV2lMMU9oaThURwpNeEw5YzliN3JScUQyWk9mU2xXVGN1Sm83OXM1ZkNFOG1leDU3VGdlSEh5eC9GVEIrUzhpMWYvT1J5WTl0ZlErbjJvQk1obnRzN2pkCi0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K" + } + ] + }, + { + "resourceType": "/keyPairs/sslServer", + "operationType": "SAVE", + "items": [ + { + "id": "sslservercert", + "fileData": "MIIKgAIBAzCCCioGCSqGSIb3DQEHAaCCChsEggoXMIIKEzCCBaoGCSqGSIb3DQEHAaCCBZsEggWXMIIFkzCCBY8GCyqGSIb3DQEMCgECoIIFQDCCBTwwZgYJKoZIhvcNAQUNMFkwOAYJKoZIhvcNAQUMMCsEFNJjFcCjl6Zj86enQwnfa5Dhaed9AgInEAIBIDAMBggqhkiG9w0CCQUAMB0GCWCGSAFlAwQBKgQQL4FBvarelURw_mtJCbortQSCBNBoO3Ra2M6piPUds4H-QJ3j7zS_EqAieZ4Xib0xV-tlARdKibyq1iLzjJKQe_nZhYBOAkGtIqLvFiXFuOsdo2mpMvE8hx1MGB-UioPQMCzRndSSFHFJavziLrRrvbIHNnV-ZXUCr--vw9w_0hGrY6HxQf2sNY2TInT4-SBtP2o2Y6x4Y252Us4F-CqBFtS7JxoOKC7pVLIojWVW5y7DoqilrD7nB7NVUkl4n6S8lOE67hkWKKMxPuMi_uWVUwltzFrlfh7AD7W4-FXU7tglxcXc-e-GoznYQnKKhGrewTG-7kpjitpZjI_3nbVk5jfDrCDUgfsbRi1S3trbdg_PPNkcrFpdyibex83BQ8Fu-VMkCf4WljqzdyG8MRPnHWmK_XakHOUuuycY6qlCxTMWPgHGJ_gLEx6kqjjdqnB-AM_EuvklctwjiWQ-9_JsN54bJwKj8q1uV2rrVKgIhKJ9KtpiXN4mwPWnKLNqkmtqT9GYkIn2vRRs9ANa26zWahXZm4LpkEOgqwfLrrAqpX2w9tsQdlPouWW6tAVM17ZRUQlD8owIvjDzQkgzPM1o-o3va3QwKUiEXix5spDlzcOr8BKo6JhheBDtoqjbQ2oRKolgm8wlmQ5gm1qpz8rBfI9joKmZl8AV9wf1BthNMieNPhQGUmv2owk2SLyZSMb-zzDG0Nb3swGG8YPS2sGSa1SQlmVNTcrj5zWA3ur8JTEIpGBY8DJbCKLpSkCE2VGRctJMinBpASl3WUCsI691n7yMQo1E84Wb7ng3QFrEClkxE9cJuhEhTgPcAwSAM-uushoXT0_okUILLUQFU9vzRMSifH1toSEhobaNB053znjWYdrJtupgegFcwU0EvDyhxGuvM-bZtL_2ZQGUcGtUlSs1PWRwWOXs3LX74xVWcNGLg972Q0n8JsDw-sNDJQV9KnOYeVCjCZBa5Zc3D66VydEsN2wSFlB1SYrH1C3EMbXcSQYtYw9kv-hoD-kIcgwXE7e9C_3S8bE9ivCdVN8c0EG-qxt_CcnhPxUGYrEGl3SV1N9tZVOEYG0DyOeMkLDCXn8hRt7_Gn1GSgrtaF4_ZUJgv8i9A2TUgkIzqgm4TiEI57BlWkKNlttajANgfWn1W387WLvGG27AV0fLrqDlHpuFGCDseWq9J2rWiAdH4n20TLPoYxJxC8h9pqsOyxDMlT6j8geC8ckYXcoabH2u7HLhZlyhT4CKo1Yj7w2vgp68wOJk40jDo7c9AnrWixliZLfe0XUznS7GDQqlX8PFoCFn8vihalXSIh1vDf-DWebtB5XbHC3vkwh9IlHJ0wqSANzkWRCxCxQkLGxnMUBwjSM1cFUBr_i1D-Iqj8Dftc_7fkntf12D2W9WykGJaTBsFLyBM5Sihh2zQg_o2iCRX9b_WIGt4axS2sg4yILqDSf6EOxFZNbuWo8u6oYzRRTRSQvFzt4ujEGA1BolY9gvrGpG-PrzKVr_f-BTanQ9sTm3BqWI7Ayy3KXFhsf46303NuZDa2doZLnqvUZmXWdpBcFcnkcSlJ9D6iKpalZYU2dAlg1tAI6-ky5agyBaoOjvZGQgMiQh2_jBcgLbxqhvL0z880JDDJ6MqFSBt7ZC0WFT2j6YFYQupRV42dpXfCEeRei_8jE8MBcGCSqGSIb3DQEJFDEKHggAcABpAG4AZzAhBgkqhkiG9w0BCRUxFAQSVGltZSAxNzM4MzYyNzc3ODU3MIIEYQYJKoZIhvcNAQcGoIIEUjCCBE4CAQAwggRHBgkqhkiG9w0BBwEwZgYJKoZIhvcNAQUNMFkwOAYJKoZIhvcNAQUMMCsEFLWihKD1yvXe_U3wbIF4DQihO9JqAgInEAIBIDAMBggqhkiG9w0CCQUAMB0GCWCGSAFlAwQBKgQQ5m2yLlmCbkq1ITkP4Sf2lICCA9Ck1EuI9vUQ0dVQTsuLhHEQ2g8tNb0XvPDcpFvTqDEd5nJM3C2V7R_4Add2j7H9L312xg7WKOdWHuvsMTOcRSLIuT66D43aG4qvmWg0j_MsLJXmfYuHDcXaM7QCaPlP6AnFv4YWjqrfCdOcPe1GhjYShe3GZ7agihonM3nNq4ztzWUz7TrNRbBvEgQlebOWoO3xvC9CCCBNWeoceepDsk5QBU01JDBUG5lgA8OXfu1vOyamHnjEmJm23V3bmx5iPOWucOUTFwUuXO3q6QV5Gm9ehbP8IazHrvGJHdJF6Jxrohx93bmopGmQfV8rUuy5PQvu9LR8BPhfMsttSYwKHSy-wsMlhWk_zBMSDurgzvEmD64qHhFArAY1A4ZxXmW2KHwWt0VavGVsfOOTUZuH9kC5xrAEBkPOYjeWO3Cp3Se7o7VRbfTC7kweXc1fFY0R-gIReFr1J7us2PBajDQdFXBfxVukUHOjITtpkBVTxPWW6uJwrnUuLN6IVnbEl7CFYrm9U5vw_3K_S2ZpZg7A_T_MdXxt1oOka4eRlUENw-d5LfH25NBbeTW78ySoSZGmI0lelBuZRZsjyBdJz2l3cuS-OgEB-Mxt2eHuMdr-2aUt_6_uPNyfpBB3GkX0xvW1sY34KAuPVtB2roclJnvtzuza_3-HezWkd9ivy_b2-kDYsGrVhNg-qj_aG4OmE4MgVGYfRxHUsvM2dDnMB6iVl4xka8dUCR9yWlB47sJz8Q8M1Ct5uad8cJVhfGAJJ2_o0Bs_oBmToYuJqbI0cZqPm6Evf4GzQFr6hSv9jjJC0dNTnr8Nss5tAhdARuR1u7gEjS6Wl7L1hOnuj6bWB6WSJYFS50uHkc64AmPPvbGxhuT5sHiHyoFm16zLgOrc_AWiADvAfcJkGXGWl_x1cxSUkC7aj0CiI4TCGqu02B8SJ_ow4qVdaiDTECLodPA5Ko1asCadQTb3ztaN92g2NBBlmau6foJsExw-uiPU5GdBiJjxMiSPhvcTl_x3AEjsFXZR2Vb4czciY8pm3Le1vzS7nyA8XSPAIhgfcbr5EnDUFfzRp1_ypubs_jyJkIo1XebJQBpBtQHsC1L88WuvpHXiBZuJeZYqhWCNZpXqVdjJZZ8JhgvjW7eeh1Ez1DoNXvR-w8mFmF9hfN82er9qWIoYEgQULZncEO68NzdM3dY3g3VAWEQe-9Y_5tUOdb_v2oiL0QKr6ftsVVkFLBbNfercUMfzcsDIbHWp5GbDkEkezHULOFgWdDWpOywUKiVU22r5MK11N4WJnijbGc2MBj9qYJswME0wMTANBglghkgBZQMEAgEFAAQgrr2WgyTN6lz9Fid8P0NKmQOuO-uZNvf0EGgt3KuNEacEFE7isjyhDWcthECVtprKcnSQlk-kAgInEA==", + "format": "PKCS12", + "encryptedPassword": "eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2Iiwia2lkIjoiUWVzOVR5eTV5WiIsInZlcnNpb24iOiIxMi4yLjAuNCJ9..e3UIFPccb6Jp7bU0HRfmlQ.UAdZ0HlBqmKXjZgyZScUjYcq51rmu2SWCIVVB0gmeT8.nkrx4RFZrT07wr1DMLirFA" + } + ] + }, + { + "resourceType": "/keyPairs/sslServer/settings", + "operationType": "SAVE", + "items": [ + { + "runtimeServerCertRef": { + "id": "sslservercert", + "location": "https://localhost:9999/pf-admin-api/v1/keyPairs/sslServer/sslservercert" + }, + "adminConsoleCertRef": { + "id": "sslservercert", + "location": "https://localhost:9999/pf-admin-api/v1/keyPairs/sslServer/sslservercert" + }, + "activeRuntimeServerCerts": [ + { + "id": "sslservercert", + "location": "https://localhost:9999/pf-admin-api/v1/keyPairs/sslServer/sslservercert" + } + ], + "activeAdminConsoleCerts": [ + { + "id": "sslservercert", + "location": "https://localhost:9999/pf-admin-api/v1/keyPairs/sslServer/sslservercert" + } + ] + } + ] + }, + { + "resourceType": "/keyPairs/signing", + "operationType": "SAVE", + "items": [ + { + "id": "9vgmnd36wykte1l2nm8s8uead", + "fileData": "MIIKYAIBAzCCCgoGCSqGSIb3DQEHAaCCCfsEggn3MIIJ8zCCBaoGCSqGSIb3DQEHAaCCBZsEggWXMIIFkzCCBY8GCyqGSIb3DQEMCgECoIIFQDCCBTwwZgYJKoZIhvcNAQUNMFkwOAYJKoZIhvcNAQUMMCsEFGE1eouos0ogOnWNc6FlD_t_Lq3UAgInEAIBIDAMBggqhkiG9w0CCQUAMB0GCWCGSAFlAwQBKgQQIypkDlv39a_TEUt3GdyjbQSCBNB1iYlhzaVOv82x1xTAlmHUhWUaDBBVmnC_rntb3atP5_jx3GGsrHMiXQpe06ashkgrZ1G5zQbch4zu0NKG7OZ18qnd3G9sWp9aW_Q1dvniv6Qppi1jf1xMV2VgPkCUk2di4EAOTpSUeau6E6OWwSkxwpqy1uEGEemph2YG082Yu-C28WjTr_XViMQ6gs3lIw4dHKC6ViyP2Ti-zPLUl1bTnU7k9yebQZabTl4PAcK3DiTsKOHnGkWs_Rfa0ZsEaivlR7UcMbkUsFmOby9PpDK81frg4Sf-yqsTzulmNVfiwOOEGl_O3Cymd6oacHwhbBZp_BUFyjah5ZIQc3Q7jnkpK0nog3OOeBmjJHkLX38k6q3I4aDip-op6MmcbYip6h4vOJQT8nl8Xsg1oi4Yjjx-xv-TjXSQ-ChRuLE60TquhIl7QD9uyWjqzIWmZJ7Xi8SchTHRwJa3JbxxZlnxnseJtVcoeKhc_BIkcqJu3MeuhsHzWu1Lyap_v_0OLvAfaj4IfqP5lHuw7Q8iQ9S1vGcmH03mI879-Y9pfzhjKpn94JfCg_VNu8vRScy_m7r7W_yxxr7TZfdQEUVMd1r02mWCKMuVa0esVhms_aOo2VGGfMA1dNLMOdvspNvbLPCKPGFofHyNDL9Xbq6ANYrWRgXCOC-vKyMCxz73vbD-LuXkaV7Fk_qbGZZ7DnIuTjeXN2LNVDrjKZK1156dHBE0kLvstla_GiV-LZalN1nwCKxg4Oec9mh0uaXQXw5YT5lo-LiY1fM7aoUZOIy4OLykhWSyN3O9gu-C4LlchXO4If8lKSRLieTh4DV8F7dq91NOmbwPySRrQxzRg6IUs5CWT7rdm58v14SUYLr7ER2uhKm8Pcc3BtiJ39F2Mvk_PhTNPj5ELm-dXXDoT07YIqg-3UV-vF7UVdVfFfDGwylTMMmmtOeBv5-z_tWHqjoJDx7f7sl4LPdENhfO-hXkX74N2TbogvljkIRSGQKd-d8TNR1XzYo5oZAY2_L_oP7MIDGGK1rHZ1kjpiXguyOwJNaQsbpRbhAucwjbWKGCwaU_EMeS2Wu9tkqR49ww-Q_HUosga_zdeMzrpsIdhN0mH4dqYkX0zSa0a661pKlbfHKTUFlOyFkxu7j7df5vGqUJlQXekGXKHiiNYHXIXynHDfrdmJiIYO4TFqvmyVjIogJ92UOMfHShCOv08Z2vWXG55bmiD5cl-KuY8mfdr2-E4HJMukSgBrA-iEuhqvA3YaScpeabHxzpn-vBFGmVc_8ovbCX9VBJoBQxpu7zIK834m1hoDvZcodI7vGNBZlWjK5o7uoAcP5uk7c4U5EdOco3PQs-w10L-aQt8LsOnDv3jrg1Xu6IB0YOsG0XY24xK6Wh73yvsZcZepMkU1ZAWzZxu2s1z0lU3Ih2aHDGvrmz6BXuSG-lYVX5oRIMoyFa6dSTU86F7RkmBz-nx_ZalEGJMU64JAcUeW5V2A8QmywDFhsEYZUbNGKij0CEaBwBXzXAbwEGiUgee4y4yYQr6cTC2-VnJ6hJZafAQl5RDPYdKNQVi1OrjdrTHFo67ieHlmEnGZ50ruXEzEPGymM3nVawS5iQh9EKpnu7SwCFU53XVX4MSlO_gzXg0752TPQ-cNCnWsftIDE8MBcGCSqGSIb3DQEJFDEKHggAcABpAG4AZzAhBgkqhkiG9w0BCRUxFAQSVGltZSAxNzM4MzYyNzc3ODk4MIIEQQYJKoZIhvcNAQcGoIIEMjCCBC4CAQAwggQnBgkqhkiG9w0BBwEwZgYJKoZIhvcNAQUNMFkwOAYJKoZIhvcNAQUMMCsEFDowzdgMEzuCIw3Y9t_PTzXDX648AgInEAIBIDAMBggqhkiG9w0CCQUAMB0GCWCGSAFlAwQBKgQQi48YGZqK7dbYho_BunhoLICCA7Dg9qWc5rLprVyg1yi6MIXUL1J5uZjy5p6YcykUQxCdtQ1dSCtXnyPHPDh_M4pNlYaZhnZaHBEJUGrf_DtOXWIx4DTfHQx51ekMuLmXMrXcoe2cHIap0r1ZkC5Pec8sXAtlV9NXpItDBDzPDUowJSuiOyX_JZ4xyfKI0zy-RCYwT7AP7e-roRt1Kcx1mJ58GHgc8ni57UhUBDAyUS9EAS8-5pyImBC_jFuIAnzL7h4_7v0_906Dt-f-B_0oQLHWlyrIw1ZANnkt1BPsyzgIvaaa_He-dyel2-ZafThiLhfYGWqw-oy3Euwbeij2957U8dV7VNjzNT17f6UJlMM7tZ8L-gEnSAGTrF-E6AZRMybia5dFAZHSpRoBms9IXaOIMUXkqLZJVs0Lcq59iTIt_1KPnTxUpWYzmeVoL273NgVjLmk_Ms7CMjCl6a_D0Cnil_Pij_GR1jxVkl7gf8-x2r78Wapltpc1ckjNZjRZdxiLETN-1AV99vDClDZbHjcCDwqbuxgPfcT58JsYeNtTU8-FKdCyapyDZltjbm72lQtdeFkWmc5Duqz1Om2dZQ7R6voNFFjZwHK_w0_6Spn542mOUPVOonHMy0ryWJAQk1kXtNVY2FsJjyrs30drMduWDTk9zZYTmzMqhPIldNfT3EGt_cYsa-i5pP5OcCjyOSQJT4uutk8xi638O3vHcerNhwQGUgsC_mPPceSK46FtOdCP8NJbgRYmq38oQtvd04J2eLWGz5YW3A0g08INZSX9NCq2UK9LVbLy4QmK9E_B_Kev0At-bUuQuARuNCSW4o5K338NjwVWxEJqHYFzQV0dLk6L8sw5xs7dDmoSw85Umk_6Tgc3zowOYH4itkkbOVXpupWLjBitUdxKqGNyA06khtxPxpIjY0Gs4RQdD-kFrxkIVHQRdhOEauRtp5JPjBLaWqfWhHM1FkXC_HMZGHVCQdAl6rOVoTOJmitO_3V9ge5OUy3yE-e-M5hOws0tp2TrNAn6CHOB-haUBbzuMknTuFy5tls1lomIhiBz4t4rP3NN0bnlBdKA0uuYM1jyrWDtbmJbIsSRlJKgLswOzP-q_CrEl46gac_bUVnIeKPOdRdXcmybgczK0DSkkdWZCHV8zXUlq3VCJFWJuICg3dP52DdmadWJkqzCf9TBY-I_rfRfhersW6O4q6jpUPPfJxVMr1fKpC_AAzToXtZBcPJKWwrMgl12a67hvaIEw5bRdsx1nTnL-eXXvQMCj0EcDUFB7zBNMDEwDQYJYIZIAWUDBAIBBQAEIFg2gaa_X-B6s-HT3bVLHh9khDb50NP5eyyz79-bA90ABBTevhK8eADgl1aq9JJTH9dcOeMesAICJxA=", + "format": "PKCS12", + "encryptedPassword": "eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2Iiwia2lkIjoiUWVzOVR5eTV5WiIsInZlcnNpb24iOiIxMi4yLjAuNCJ9..h7BMDiugph9XZtAF6dmR0Q.a8qB8DAG-p_IA1CTjPkH7lKPKi0e0AFvIBGtYWWDHf0.G7dcXNLpAOlNVjpY6UGkXQ" + }, + { + "id": "tiq4n26axjircjk30oz5zf6k3", + "fileData": "MIIKUAIBAzCCCfoGCSqGSIb3DQEHAaCCCesEggnnMIIJ4zCCBaoGCSqGSIb3DQEHAaCCBZsEggWXMIIFkzCCBY8GCyqGSIb3DQEMCgECoIIFQDCCBTwwZgYJKoZIhvcNAQUNMFkwOAYJKoZIhvcNAQUMMCsEFGuOOanUm8DAZylSj_vArT9nIy7GAgInEAIBIDAMBggqhkiG9w0CCQUAMB0GCWCGSAFlAwQBKgQQwpKllSJdf-uLTHA2IjUCiwSCBNC6XTUwZKnUEfLCTc8Utk-JgksT37eNN81ZaK10BrkQkUNPNHxWXAN2Fb6iYQZh4StFnelFl0SOOnmtf557VA-midwuq5vifB7cS-YGt6P9UQUL3rEKuo3-pkGKQPHbhrhPwrllTXKOD4E0y6_yNV9qaGByF6eT4Sk-owCXb5aFMdUNMqnjoPPXSibIUfxu4TdKmXGCNHFQWytKOvG10KLJ3CuerSrr2AZKaw4vq1l-n4dvcf5GqUTswOnbw8EkF9ZhWtWf4udJN2_CkbcWD4bzwFJHWK_NWSrHiAr9bDV0suZ8l59SOYnui5-nhgcECraKxXhCjoPhaR6jtINVOPo6_Yx-BPw9JmCTK1PI7ZxxBudmoTInw_JAsZYuQevQvlrx5jjlc5iGq9b1h9xLWJj_3g-Mvt-auMQUg0vVuRbD2eHFxLX8uB9wDB_XoDa55d7P-6KRRPYQtwBeYYN6UNhLrnSBCQJsKKhkN957reH936z21ONfjxzeQh8jYdhl8deKqnL3Nead5QjiY7mErMr35LDqozmDysiDr1GHIJya2eYCxqYKTjKzNyGGxKZ1AfPTAXw_PNOpxl_AmzLVCbgMz6fpqVuFo6z1TUbmZhvxi5JUWp4WuH6gtBByNdTyoUCu9PGGYx3Ctsh3rjTjLi4MKBPilfhpx63XBVLkio1CZMhnBmJBs1aod992aQlF_oSWI9hNBPrHngEIpEt3AO1UP7lcblgFoym9EIjZB61l3q1hCcOHqz-HMlu2jfUwOpN9-poqQqyOtODsEgdWtCVpu85iVoh_YgANa-UKtBZL99yqDNqTpHykxCiXFJiToprDtVruX7veKnE3LhtdmmNg10Netwvh0xdzsAR642V_2oYxW2ARJkZ4TWchRicT4m6UfiRTTjnhDei-4JJp-7pEyukQcWPh5inkGVirH6tbBwxDn9cOx_h3aLOykDhWnCPAQHMRtIANtxmVEiCOcmqxgVMl5ogPZ6l9udhVdHkbAPlh7q3hEwskVOzBsnwdzrKZ9wyN3q1kM2BX6g7EeHhnD6SPHAvBnlihQwX-HIR7-04buenq7ZuC8kJ7yybsm5-_LoOm0JuHrTevsjc_uMsNlzDo8R3nfm_Y9cf53sUe2C9AZG8110A4gvEOJxwjAPgrANnapIXKd0i50ZUaUBP00SUxMyQKFC6bo_E5PFr2Xk6PY_EtQK_wELawaoTblzQfdgkZGltyqn1oTO1Ohodi_pPMcqhNd2LGt2qs20yxGMBUsVMdgZxaf1zbTajcDMaNfre70zhxjnla0Hf8ceyne9bBll3pJBEYxiFI0Stcln4aztEmqYJdWuAty7QKqVIA-QSchP3-rzSExri8vDLCnF2O-W9iuAJgbztJ8PTXMbNhNR5Pi5GhhBGJppjdsRUVf7oORatotwFBDdDljiGSmKtSpCV4-OD59DWSNrh9iJ3m4x9VKqhYcJDImFKhGzaWSVSnLoMKWUKnnSuilPoS4iMCYnrcPZeFDtCSo2mjwJeu80ex9la0oFdmQ7VCcPGZq9AzyMTUa4jiZIRQklb0Elua8ic4LAptJUwd9PWOcUMQHzfg_UlWPuRuTWrhfTBxR-sLNmvtsp5i0EPA5-4vrSF5Bhxcmh0oUUWhx2efzDE8MBcGCSqGSIb3DQEJFDEKHggAcABpAG4AZzAhBgkqhkiG9w0BCRUxFAQSVGltZSAxNzM4MzYyNzc3OTMxMIIEMQYJKoZIhvcNAQcGoIIEIjCCBB4CAQAwggQXBgkqhkiG9w0BBwEwZgYJKoZIhvcNAQUNMFkwOAYJKoZIhvcNAQUMMCsEFAvVF_i5GyLqTXVcJquxRb1Oj8p1AgInEAIBIDAMBggqhkiG9w0CCQUAMB0GCWCGSAFlAwQBKgQQhHSet9X7FtMBKCSk0pNjoICCA6BAqo1uUYK6yfxiLwRKR2ufTtUg5do1ruz4vbYAN3jn2l0dqyVo5KkeSwqFGD3GFsOfaNUSeArjB6fRM0O4wc-vLFXQAZ2qN_RIHBeEceF7tdbhgY-HcPp1tvRwqpXMQxBpXqO2JmGhMJOazHJei3Vn4-GN-sEbCNjbruMuXT_UeESzqEerXIuxLfDGnwA4T5vKcA80geRTea2lp8ikSDAuOhRqiprxoJRstahq07tvFQjXcx7QoNqJzkUXCX75l-mL5hmePGkOYbaFWeKWFgLCDlu8QCa4XzofLXQgy_A5ePNCe1npv0jXTq_ai7B4za9nD7qGTwUtknTNW4KQoIjhxoFQg4zMSfZukyDwCjhN4EXxRZirvp-MfvwRImz3Xat7OtAOjGLf1mFfNGe7RaXFTv40PLOUzE6QZqw4Ow7Cw2sqF597yOVOcDfh5JRZoeeBNtQkQkgyZqvOvvE2-3F9vtmXa-Jy2mq6zXUzXzHVNp9uRYS5tIAq5s-larLxE-af4kmB9iod3AlMyR-NEa3C1qe7sNli4Sy7Woelw_IgmPEqD2CVl5RD7u8GT2Hl2lcx4K2m-SLRpl4uRJ1J-3BDYUTfFCsi5wRTZq0XVUquPeAiZ6l6T7110aA3ii2kaA9LCXdahKJ6TXhlVU4dnHG9dKQ1ha8GGSo0YLb95Pjpq2435wz3l4pkcoycIq_K-hwiemCB9mdeaOanVFc1VGznAxJSeijoWZcgkNdyzze-6MWGXsk5DgZHt3TL_w22y84ujCOte3jOxOHYgnzFTKTOlJ3jVf8gbBZZH3nyfyqZ2DJBUT0xZDa0I3V0jtLvTPDUUXsxDaYdCgc2w8VKAQciasH1ephgnk7co6-CPoQfqVXgzzL34_TFZujRKMD8s-nD7RA6r8SzOk03HZDNxq26f_o2_TXo_PWes2SB8G0lDIvfMlZMPU-MopapbwjVMsxYR-5P49Fl4liXjiO5E703gQuW1Jt7iXvZ8RW5evrC-AjNF3nkSGDu_x2fUTmkmiZjn5aWGzbr0cPYS-oumtnczOfx9CDwVMZKRA67LPkF4HvBge_U55eZrmbUv0CJ4KRiAYX9UuNgDxcCSUC76lkEb4d4qOyVinSPQkjXviMd0E6gNifhWEpASyfp2t5Hc3hB9rDZZ367bkdxuIovAHlsdXh9yeB2ICM2v9CQAtoN7F4TDvPrBhybPITpY0jAX71eg0rdsyQnmeKgKP47E8B0ME0wMTANBglghkgBZQMEAgEFAAQgkbCJWiLDEwnrJgpojDldYI53FioUQrTir0QGk4OElaQEFEDuQVfguSwEz_oUv7rRAjgWwX_TAgInEA==", + "format": "PKCS12", + "encryptedPassword": "eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2Iiwia2lkIjoiUWVzOVR5eTV5WiIsInZlcnNpb24iOiIxMi4yLjAuNCJ9..1I3czs6vz28qZOTDxxkoIQ.F4Ep-IwVdgCVWZ6ydpSrxBEVkOWtngLnyWR_DZbrdbo.hFrSPzu2NLxiDtmz2bk9EQ" + } + ] + }, + { + "resourceType": "/keyPairs/signing/rotationSettings", + "operationType": "SAVE", + "items": [ + { + "id": "9vgmnd36wykte1l2nm8s8uead", + "validDays": 36500, + "keySize": 2048, + "signatureAlgorithm": "SHA256withRSA", + "creationBufferDays": 9125, + "activationBufferDays": 3650, + "keyAlgorithm": "RSA" + } + ] + }, + { + "resourceType": "/keyPairs/oauthOpenIdConnect", + "operationType": "SAVE", + "items": [ + { + "staticJwksEnabled": false + } + ] + }, + { + "resourceType": "/certificates/groups", + "operationType": "SAVE", + "subResource": "STS Settings Mutual SSL Authentication Certs", + "items": [ + { + "id": "ycrgw3j4ckw91gxdmd479qftb", + "fileData": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURuVENDQW9XZ0F3SUJBZ0lVUzJUQkNkUnpwSzRaemUrSERLakI5RVFTSHFZd0RRWUpLb1pJaHZjTkFRRUxCUUF3WGpFTE1Ba0cKQTFVRUJoTUNWVk14Q3pBSkJnTlZCQWdNQWtOUE1ROHdEUVlEVlFRSERBWkVaVzUyWlhJeElqQWdCZ05WQkFvTUdWQnBibWNnU1dSbApiblJwZEhrZ1EyOXljRzl5WVhScGIyNHhEVEFMQmdOVkJBTU1CSFJsYzNRd0hoY05NalF4TWpFeU1qTXlPREkwV2hjTk1qY3dPVEE0Ck1qTXlPREkwV2pCZU1Rc3dDUVlEVlFRR0V3SlZVekVMTUFrR0ExVUVDQXdDUTA4eER6QU5CZ05WQkFjTUJrUmxiblpsY2pFaU1DQUcKQTFVRUNnd1pVR2x1WnlCSlpHVnVkR2wwZVNCRGIzSndiM0poZEdsdmJqRU5NQXNHQTFVRUF3d0VkR1Z6ZERDQ0FTSXdEUVlKS29aSQpodmNOQVFFQkJRQURnZ0VQQURDQ0FRb0NnZ0VCQUpkb0d1cmdEdlNSQkwyY0llVWFDWTNwbzVZRFpuVjFleXVPUVR4UWM2T1QySlMwCis0MGdKYkptZk5yYmNPU3QrMURieHpQK0l4YmxrY3o1NjlWT0M1bGJST24zOHllYU1VMzJYYy80REdTcDFIQ1kvSmZTeWd6LytxcjgKOFlUcU1hSTIxQWJabkFpWTV4MFJ3NTZJRG1KZ2xYYVhlVmJDVUp5N29QVHlBb1lZVDkzREpEazQxWmU1MVVjVG1Vc1RLTjRLM2d2dgpTYVJ1eXE1K2c2RVhCcTdBa2VPbmJQMGJTSHliTjFLRVY1QlhOTnBnazloMEp3M1BFK3FrbS81bllSenhCZjRSQS9BZ2Z2OWVzRzlOCnozWGdEb3dBR0JteHIrclUvbmE3cHdFRXVkTWg2NjhERURlUlZ3aDFaYXBZcEJ0VmN4TUhtZEpQZ0ZKckJsbzZtTUVDQXdFQUFhTlQKTUZFd0hRWURWUjBPQkJZRUZHSmMzWjBqOWtYUHNUbW1iZ0FzWS9QSzJjdXBNQjhHQTFVZEl3UVlNQmFBRkdKYzNaMGo5a1hQc1RtbQpiZ0FzWS9QSzJjdXBNQThHQTFVZEV3RUIvd1FGTUFNQkFmOHdEUVlKS29aSWh2Y05BUUVMQlFBRGdnRUJBSlZCdmNIaGgrMDBnelEwCnBuWkt0Ukp4dkVnK3BHaCtCOUUrNWkyUHNOR3lJQXZBWHc0bWRCY1FaS3hmaVhNMzFaRTJnZTFtUCs0ZGkxMStQS1lOSDJFOTczUEwKSit3R0hlUVoxRVRERzVmbzc5dDBNRzFSekh0R29pclpXN3Y0Qk5VSTZaTTJGakVhQ090WmcxclVoa2RJZnFEeDRDZU5qemIwcmhYSQp6WE5UUzRZNlZseFdBclFud0FncVB0YjVwb0pHM01tLzNmNnVRZy9sMExJS1RZL0dSNnlRc05Da3pUWlFocklwWGo0UnBxblgzUWdECjFJV1RvTW9uN250cDRnQVAvbEFTTTUveG01SnpiNmRtRitob04wNzNnMDJVZVYyVERMemU4MCtLK1hyMUdaZWVVTHVYTnJoT0VYRFIKeXR2dWJlOE9YUFBZNi96Q3BoVmIyMWc9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K" + } + ] + }, + { + "resourceType": "/secretManagers", + "operationType": "SAVE", + "items": [ + { + "id": "testSecretManager", + "name": "Test Secret Manager", + "pluginDescriptorRef": { + "id": "com.pingidentity.pf.secretmanagers.cyberark.CyberArkCredentialProvider", + "location": "https://localhost:9999/pf-admin-api/v1/secretManagers/descriptors/com.pingidentity.pf.secretmanagers.cyberark.CyberArkCredentialProvider" + }, + "configuration": { + "tables": [], + "fields": [ + { + "name": "APP ID", + "value": "testAppId" + }, + { + "name": "Connection Port", + "value": "18923" + }, + { + "name": "Connection Timeout (sec)", + "value": "30" + }, + { + "name": "Username Retrieval Property Name", + "value": "username" + } + ] + }, + "lastModified": "2025-01-31T22:32:14.755Z" + } + ] + }, + { + "resourceType": "/pingOneConnections", + "operationType": "SAVE", + "items": [ + { + "id": "noeOvj5ltBnf4rcmtZAKdJ", + "name": "internal_brassteam_893438732", + "active": true, + "encryptedCredential": "eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2Iiwia2lkIjoiUWVzOVR5eTV5WiIsInZlcnNpb24iOiIxMi4yLjAuNCJ9..9kOSOKSt93i8OBPktHZM9g.ZLpaS52b3jpfvAYFwnYtSqX8WF3fajMAVBXDQKLpevqjxgvJtT-L09h9JMjtRU4N70QCqSRvm9jlOg_n57Pt1tu5Gk5-QKVUxgbo0llQJlKsU_rboxh50z_rC9Q6aJwa5pa-pAjTKdhXsTte0yQCnMeRyqV0tVrX7_66fHXCE7QxkreazomjIaHDPeb-nT29g2e_bFOjEjZkFIIYS6fn7BwwRp89FUGC1_ZISVgBtNfDa3EgdPOdN4CznzSK3lIreq4uuAHlnQvvHTGziUUzuhftq_KdkFOBCFZrFUUy9Pe1EOgeV10x1hwOYl84AKz4wy7jLjFDWKKIMltBXwB_XVFHV3okz1sZ8BYarbB37mmE8vjdNrq9jyezqOnVwyHgMPD6ti_cfKyIpGS3MOGsJePIVAtPdeWMBKB7m8M5Fp2BUcQFHi9kS2CpZkVePfZElsIH9Ltw4Z9Afih2hyBvFG5Y_0k2zS730rt4VMZW4EIVkUNUYfiw3CMYyqr4SVePWbfN5lO1fh3u3j5VSi30izT8QxUMlNm9BS83zBcliGMQP8PUjLWXj0KfAKIg82VpDYVD4A0IHPkw0qv7vmvZ5O54x5QmghPRqObpcTNNMFBVevXCyvp2H0MQYsLT2SSv2LnmhBakeXcaV2Uoem7VglbL82hQeZMV2WqbVfyugPnnE3cZ07bDa0iZd0XAPoN_K9KiwWp5Vm_SMLmc3_-hxBqGpYOqbRfeehf2yggtkcEQlEDyZs9MYU1ykkCwqsk2Q1oEJH8I5B16Y7uY5kIX8ym9i5h4qDQm9q7uj32Gtxq7IDP8EuEBfPE_WBMHbJC4qeItQptiyuUxtcGHQp1m98lBXV4rqK0_zzt4k2k0H3IT1XaA4T8gFyVSCkMJeJmLmN9tseKzdr_VyQwjItmQxScm7zVsuzcR-Jiagmv_fJYQKIJRVNa-m8UgBQl0VI1GO1l2TAryC1BhSJN04EFup2hRi-o3ddn7Gkrm7s1BA3RwuBLDzw6rh2vcJjrNNxWtsIZZhnU6DQR-Iukq3Jg4IJdQxkL0jijRcRTBkKNYmKJBZrrvWAvo9R4NMXRhLoOahy1OM_ndyh1OEu3_AbCbBrx38QVK_vPWjwys1XxsR7-5HNzmRep-OQRn2dXBaSO1oCHgGSsPZRbDb8165fEOORhzYstpOS34dlZX7t3pP8_B2erq1n32vToR3TOz7bLXS-J44Av32HFt4jBGZcmPRBWVqzS8yqMmeInkqxYTASgxCsj7WByvum7WrgSoHphlsSt5iI1QO-FWgemakahgIvKQiV21kXDBcfG-gGjFDtTEG9lPK7mGJ-vEX6qy8SJKFAHJIUHXPpy0fnTLALZt9_IN-XLPW59WBfe_yThSizFBegSL9We_7J9Vni8nu4JZJ9DmRblExLMWwtt31YVTELIgQLSFrplI1UHRCyHCF6MNcN3WrHJzxYZXlemZYPJyxXaV1aExut_a35UiOQWNJ9RKNawKML4wZ875sCZa02bkvyeDEuck3HumM7v825oNxEUTVU1DQ9a_Bgb-4MovlXWDZP3_HSTd657hxBccDlAcFtYr8oHmIYjYgGzcRi6uDYVVG33zVgE0ceZDGuGrmh88nqzBIbcX4I91AAWIBNJjzMyiXvOK1eKO7X_qYEsf4iDzYej8UlMeRpxJ5DsIVBtizvL5qJYrOHEFs9Kxih3sOrFwIOsb0JN275730cjJdsWzD-T245ADxzycwGQYNw.bvBBwx7JaS8a5OIdcKarmA", + "creationDate": "2025-01-31T22:32:14.801Z", + "credentialId": "971b5d20-0955-4030-b49b-7e349b3b9b1e", + "pingOneConnectionId": "554257ac-76ca-447a-a210-722343328312", + "environmentId": "f5901536-2b60-4d4a-a987-3d56aadad46d", + "organizationName": "internal_brassteam_893438732", + "region": "North America", + "pingOneManagementApiEndpoint": "https://api.pingone.com", + "pingOneAuthenticationApiEndpoint": "https://auth.pingone.com" + } + ] + }, + { + "resourceType": "/dataStores", + "operationType": "SAVE", + "items": [ + { + "type": "LDAP", + "id": "LDAP-PingDirectory", + "maskAttributeValues": false, + "hostnames": [ + "localhost:1389" + ], + "ldapType": "PING_DIRECTORY", + "bindAnonymously": false, + "userDN": "cn=pingfederate", + "encryptedPassword": "eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2Iiwia2lkIjoiUWVzOVR5eTV5WiIsInZlcnNpb24iOiIxMi4yLjAuNCJ9..64nlOkXuYGL4PoJX2FUx5A.qWhVq-Jjhh4uwYAZMX9A5g.3haZjzMXPBcs4ssG6OlBLw", + "useSsl": false, + "useDnsSrvRecords": false, + "name": "PingDirectory", + "hostnamesTags": [ + { + "hostnames": [ + "localhost:1389" + ], + "defaultSource": true + } + ], + "lastModified": "2025-01-31T22:32:14.916Z", + "retryFailedOperations": false, + "testOnBorrow": false, + "testOnReturn": false, + "createIfNecessary": true, + "verifyHost": true, + "minConnections": 10, + "maxConnections": 100, + "maxWait": -1, + "timeBetweenEvictions": 0, + "readTimeout": 0, + "connectionTimeout": 0, + "binaryAttributes": [], + "dnsTtl": 0, + "ldapDnsSrvPrefix": "_ldap._tcp", + "ldapsDnsSrvPrefix": "_ldaps._tcp", + "useStartTLS": false + }, + { + "type": "JDBC", + "id": "ProvisionerDS", + "maskAttributeValues": false, + "connectionUrl": "jdbc:hsqldb:${pf.server.data.dir}${/}hypersonic${/}ProvisionerDefaultDB;hsqldb.lock_file=false", + "driverClass": "org.hsqldb.jdbcDriver", + "userName": "sa", + "encryptedPassword": "eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2Iiwia2lkIjoiUWVzOVR5eTV5WiIsInZlcnNpb24iOiIxMi4yLjAuNCJ9..wiFBgJnmvSMp-pdNCcWxRA.wSWWVdwfp1ccq3JjbS3Msw.SsKTVuYcIpnx4GTaBp3ixA", + "allowMultiValueAttributes": false, + "name": "ProvisionerDS (sa)", + "connectionUrlTags": [ + { + "connectionUrl": "jdbc:hsqldb:${pf.server.data.dir}${/}hypersonic${/}ProvisionerDefaultDB;hsqldb.lock_file=false", + "defaultSource": true + } + ], + "lastModified": "2025-01-31T22:32:14.931Z", + "minPoolSize": 10, + "maxPoolSize": 100, + "blockingTimeout": 5000, + "idleTimeout": 5 + }, + { + "type": "LDAP", + "id": "pingdirectory", + "maskAttributeValues": false, + "hostnames": [ + "pingdirectory:1389" + ], + "ldapType": "PING_DIRECTORY", + "bindAnonymously": false, + "userDN": "cn=pingfederate", + "encryptedPassword": "eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2Iiwia2lkIjoiUWVzOVR5eTV5WiIsInZlcnNpb24iOiIxMi4yLjAuNCJ9..NpyVixL-cYvYcKhd7VuWXQ.hPBXeyuXN4-FoAR8zlt3Uw.LnxX4-w3XqQxPFDQhV0skQ", + "useSsl": false, + "useDnsSrvRecords": false, + "name": "pingdirectory", + "hostnamesTags": [ + { + "hostnames": [ + "pingdirectory:1389" + ], + "defaultSource": true + } + ], + "lastModified": "2025-01-31T22:32:14.941Z", + "retryFailedOperations": false, + "testOnBorrow": false, + "testOnReturn": false, + "createIfNecessary": true, + "verifyHost": true, + "minConnections": 10, + "maxConnections": 100, + "maxWait": -1, + "timeBetweenEvictions": 60000, + "readTimeout": 3000, + "connectionTimeout": 3000, + "binaryAttributes": [], + "dnsTtl": 60000, + "ldapDnsSrvPrefix": "_ldap._tcp", + "ldapsDnsSrvPrefix": "_ldaps._tcp", + "useStartTLS": false + } + ] + }, + { + "resourceType": "/notificationPublishers", + "operationType": "SAVE", + "items": [ + { + "id": "exampleSmtpPublisher", + "name": "exampleSmtpPublisher", + "pluginDescriptorRef": { + "id": "com.pingidentity.email.SmtpNotificationPlugin", + "location": "https://localhost:9999/pf-admin-api/v1/notificationPublishers/descriptors/com.pingidentity.email.SmtpNotificationPlugin" + }, + "configuration": { + "tables": [], + "fields": [ + { + "name": "From Address", + "value": "example@pingidentity.com" + }, + { + "name": "Email Server", + "value": "example.com" + }, + { + "name": "Sender Name", + "value": "" + }, + { + "name": "SMTP Port", + "value": "25" + }, + { + "name": "Encryption Method", + "value": "NONE" + }, + { + "name": "SMTPS Port", + "value": "465" + }, + { + "name": "Verify Hostname", + "value": "true" + }, + { + "name": "UTF-8 Message Header Support", + "value": "false" + }, + { + "name": "Username", + "value": "" + }, + { + "name": "Password", + "value": "" + }, + { + "name": "Test Address", + "value": "" + }, + { + "name": "Connection Timeout", + "value": "30" + }, + { + "name": "Enable SMTP Debugging Messages", + "value": "false" + } + ] + }, + "lastModified": "2025-01-31T22:32:14.992Z" + }, + { + "id": "exampleSmtpPublisher2", + "name": "exampleSmtpPublisher2", + "pluginDescriptorRef": { + "id": "com.pingidentity.email.SmtpNotificationPlugin", + "location": "https://localhost:9999/pf-admin-api/v1/notificationPublishers/descriptors/com.pingidentity.email.SmtpNotificationPlugin" + }, + "configuration": { + "tables": [], + "fields": [ + { + "name": "From Address", + "value": "example@pingdemo.example" + }, + { + "name": "Email Server", + "value": "pingdemo.example" + }, + { + "name": "Sender Name", + "value": "" + }, + { + "name": "SMTP Port", + "value": "25" + }, + { + "name": "Encryption Method", + "value": "NONE" + }, + { + "name": "SMTPS Port", + "value": "465" + }, + { + "name": "Verify Hostname", + "value": "true" + }, + { + "name": "UTF-8 Message Header Support", + "value": "false" + }, + { + "name": "Username", + "value": "" + }, + { + "name": "Password", + "value": "" + }, + { + "name": "Test Address", + "value": "" + }, + { + "name": "Connection Timeout", + "value": "30" + }, + { + "name": "Enable SMTP Debugging Messages", + "value": "false" + } + ] + }, + "lastModified": "2025-01-31T22:32:14.974Z" + } + ] + }, + { + "resourceType": "/notificationPublishers/settings", + "operationType": "SAVE", + "items": [ + { + "defaultNotificationPublisherRef": { + "id": "exampleSmtpPublisher", + "location": "https://localhost:9999/pf-admin-api/v1/notificationPublishers/exampleSmtpPublisher" + } + } + ] + }, + { + "resourceType": "/captchaProviders", + "operationType": "SAVE", + "items": [ + { + "id": "exampleCaptchaProvider", + "name": "exampleCaptchaProvider", + "pluginDescriptorRef": { + "id": "com.pingidentity.captcha.recaptchaV3.ReCaptchaV3Plugin", + "location": "https://localhost:9999/pf-admin-api/v1/captchaProviders/descriptors/com.pingidentity.captcha.recaptchaV3.ReCaptchaV3Plugin" + }, + "configuration": { + "tables": [], + "fields": [ + { + "name": "Site Key", + "value": "asdf" + }, + { + "name": "Secret Key", + "encryptedValue": "OBF:JWE:eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2Iiwia2lkIjoiUWVzOVR5eTV5WiIsInZlcnNpb24iOiIxMi4yLjAuNCJ9..LEHbXKxxq0izxaHGeMAMAA.5gWiH8Z9IZCNJ5XTilpWYw.YCG2pILn3QiJertJcDMVpA" + }, + { + "name": "Pass Score Threshold", + "value": "1" + }, + { + "name": "JavaScript File Name", + "value": "recaptcha-v3.js" + } + ] + }, + "lastModified": "2025-01-31T22:32:15.038Z" + }, + { + "id": "exampleCaptchaProviderV2", + "name": "exampleCaptchaProviderV2", + "pluginDescriptorRef": { + "id": "com.pingidentity.captcha.ReCaptchaV2InvisiblePlugin", + "location": "https://localhost:9999/pf-admin-api/v1/captchaProviders/descriptors/com.pingidentity.captcha.ReCaptchaV2InvisiblePlugin" + }, + "configuration": { + "tables": [], + "fields": [ + { + "name": "Site Key", + "value": "exampleCaptchaProviderV2" + }, + { + "name": "Secret Key", + "encryptedValue": "OBF:JWE:eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2Iiwia2lkIjoiUWVzOVR5eTV5WiIsInZlcnNpb24iOiIxMi4yLjAuNCJ9..D1Sppt9g51GeGAKZjrBdhg.4QDUIu63Od67tRn1nTFMcA.FtwqtuMxlkE5j0Z9U7Xa2A" + }, + { + "name": "JavaScript File Name", + "value": "recaptcha-v2-invisible.js" + } + ] + }, + "lastModified": "2025-01-31T22:32:15.069Z" + } + ] + }, + { + "resourceType": "/captchaProviders/settings", + "operationType": "SAVE", + "items": [ + { + "defaultCaptchaProviderRef": { + "id": "exampleCaptchaProviderV2", + "location": "https://localhost:9999/pf-admin-api/v1/captchaProviders/exampleCaptchaProviderV2" + } + } + ] + }, + { + "resourceType": "/serverSettings", + "operationType": "SAVE", + "items": [ + { + "contactInfo": {}, + "rolesAndProtocols": { + "oauthRole": { + "enableOauth": true, + "enableOpenIdConnect": true + }, + "idpRole": { + "enable": true, + "enableSaml11": true, + "enableSaml10": true, + "enableWsFed": true, + "enableWsTrust": true, + "saml20Profile": { + "enable": true + }, + "enableOutboundProvisioning": true + }, + "spRole": { + "enable": true, + "enableSaml11": true, + "enableSaml10": true, + "enableWsFed": true, + "enableWsTrust": true, + "saml20Profile": { + "enable": true, + "enableXASP": true + }, + "enableInboundProvisioning": true, + "enableOpenIDConnect": true + }, + "enableIdpDiscovery": true + }, + "federationInfo": { + "baseUrl": "https://localhost:9031", + "saml2EntityId": "samlEntityId", + "saml1xIssuerId": "", + "saml1xSourceId": "", + "wsfedRealm": "" + }, + "notifications": { + "notifyAdminUserPasswordChanges": false, + "expiringCertificateAdministrativeConsoleWarningDays": 14, + "expiredCertificateAdministrativeConsoleWarningDays": 14, + "threadPoolExhaustionNotificationSettings": { + "emailAddress": "", + "threadDumpEnabled": true, + "notificationMode": "LOGGING_ONLY" + } + } + } + ] + }, + { + "resourceType": "/serverSettings/systemKeys", + "operationType": "SAVE", + "items": [ + { + "current": { + "creationDate": "2025-01-02T17:59:19.959Z", + "encryptedKeyData": "eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2Iiwia2lkIjoiUWVzOVR5eTV5WiIsInZlcnNpb24iOiIxMi4xLjQuMCIsInppcCI6IkRFRiJ9..mBwXJBuBBcBb1iuF7_J_oQ.aD0ENEXvfHwWh_wJBCV6_uj98eJ8hFuLpstFj19YSB6kFScALLsDk_6r4oSzepix.dj8Utcj8m66bpfazwNsw8A" + }, + "pending": { + "creationDate": "2025-01-02T17:59:19.960Z", + "encryptedKeyData": "eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2Iiwia2lkIjoiUWVzOVR5eTV5WiIsInZlcnNpb24iOiIxMi4xLjQuMCIsInppcCI6IkRFRiJ9..lTUXjpewvJW85TygS2XTtw.tn7hmeI-KHBTvmRmev2pvqN8R2qeW5PHhMBTUa761u6vbJ7wH70SJyU-RoZ3mYX0.XLC2NhA4WJ4mmmE-RtRyQw" + } + } + ] + }, + { + "resourceType": "/serverSettings/outboundProvisioning", + "operationType": "SAVE", + "items": [ + { + "dataStoreRef": { + "id": "ProvisionerDS", + "location": "https://localhost:9999/pf-admin-api/v1/dataStores/ProvisionerDS" + }, + "synchronizationFrequency": 60 + } + ] + }, + { + "resourceType": "/serverSettings/wsTrustStsSettings", + "operationType": "SAVE", + "items": [ + { + "basicAuthnEnabled": true, + "clientCertAuthnEnabled": true, + "restrictBySubjectDn": true, + "restrictByIssuerCert": true, + "subjectDns": [ + "CN=test, O=Ping Identity Corporation, L=Denver, ST=CO, C=US" + ], + "users": [ + { + "username": "testUser", + "encryptedPassword": "lPkeLavAtN0Qb4eY579HVgd5Uk3vdODyatGvGAV-tVQ.odLwjB--.2" + } + ], + "issuerCerts": [ + { + "id": "ycrgw3j4ckw91gxdmd479qftb", + "location": "https://localhost:9999/pf-admin-api/v1/serverSettings/wsTrustStsSettings/ycrgw3j4ckw91gxdmd479qftb" + } + ] + } + ] + }, + { + "resourceType": "/serverSettings/wsTrustStsSettings/issuerCertificates", + "operationType": "SAVE", + "items": [ + { + "id": "ycrgw3j4ckw91gxdmd479qftb", + "fileData": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURuVENDQW9XZ0F3SUJBZ0lVUzJUQkNkUnpwSzRaemUrSERLakI5RVFTSHFZd0RRWUpLb1pJaHZjTkFRRUxCUUF3WGpFTE1Ba0cKQTFVRUJoTUNWVk14Q3pBSkJnTlZCQWdNQWtOUE1ROHdEUVlEVlFRSERBWkVaVzUyWlhJeElqQWdCZ05WQkFvTUdWQnBibWNnU1dSbApiblJwZEhrZ1EyOXljRzl5WVhScGIyNHhEVEFMQmdOVkJBTU1CSFJsYzNRd0hoY05NalF4TWpFeU1qTXlPREkwV2hjTk1qY3dPVEE0Ck1qTXlPREkwV2pCZU1Rc3dDUVlEVlFRR0V3SlZVekVMTUFrR0ExVUVDQXdDUTA4eER6QU5CZ05WQkFjTUJrUmxiblpsY2pFaU1DQUcKQTFVRUNnd1pVR2x1WnlCSlpHVnVkR2wwZVNCRGIzSndiM0poZEdsdmJqRU5NQXNHQTFVRUF3d0VkR1Z6ZERDQ0FTSXdEUVlKS29aSQpodmNOQVFFQkJRQURnZ0VQQURDQ0FRb0NnZ0VCQUpkb0d1cmdEdlNSQkwyY0llVWFDWTNwbzVZRFpuVjFleXVPUVR4UWM2T1QySlMwCis0MGdKYkptZk5yYmNPU3QrMURieHpQK0l4YmxrY3o1NjlWT0M1bGJST24zOHllYU1VMzJYYy80REdTcDFIQ1kvSmZTeWd6LytxcjgKOFlUcU1hSTIxQWJabkFpWTV4MFJ3NTZJRG1KZ2xYYVhlVmJDVUp5N29QVHlBb1lZVDkzREpEazQxWmU1MVVjVG1Vc1RLTjRLM2d2dgpTYVJ1eXE1K2c2RVhCcTdBa2VPbmJQMGJTSHliTjFLRVY1QlhOTnBnazloMEp3M1BFK3FrbS81bllSenhCZjRSQS9BZ2Z2OWVzRzlOCnozWGdEb3dBR0JteHIrclUvbmE3cHdFRXVkTWg2NjhERURlUlZ3aDFaYXBZcEJ0VmN4TUhtZEpQZ0ZKckJsbzZtTUVDQXdFQUFhTlQKTUZFd0hRWURWUjBPQkJZRUZHSmMzWjBqOWtYUHNUbW1iZ0FzWS9QSzJjdXBNQjhHQTFVZEl3UVlNQmFBRkdKYzNaMGo5a1hQc1RtbQpiZ0FzWS9QSzJjdXBNQThHQTFVZEV3RUIvd1FGTUFNQkFmOHdEUVlKS29aSWh2Y05BUUVMQlFBRGdnRUJBSlZCdmNIaGgrMDBnelEwCnBuWkt0Ukp4dkVnK3BHaCtCOUUrNWkyUHNOR3lJQXZBWHc0bWRCY1FaS3hmaVhNMzFaRTJnZTFtUCs0ZGkxMStQS1lOSDJFOTczUEwKSit3R0hlUVoxRVRERzVmbzc5dDBNRzFSekh0R29pclpXN3Y0Qk5VSTZaTTJGakVhQ090WmcxclVoa2RJZnFEeDRDZU5qemIwcmhYSQp6WE5UUzRZNlZseFdBclFud0FncVB0YjVwb0pHM01tLzNmNnVRZy9sMExJS1RZL0dSNnlRc05Da3pUWlFocklwWGo0UnBxblgzUWdECjFJV1RvTW9uN250cDRnQVAvbEFTTTUveG01SnpiNmRtRitob04wNzNnMDJVZVYyVERMemU4MCtLK1hyMUdaZWVVTHVYTnJoT0VYRFIKeXR2dWJlOE9YUFBZNi96Q3BoVmIyMWc9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K" + } + ] + }, + { + "resourceType": "/serverSettings/generalSettings", + "operationType": "SAVE", + "items": [ + { + "disableAutomaticConnectionValidation": false, + "idpConnectionTransactionLoggingOverride": "DONT_OVERRIDE", + "spConnectionTransactionLoggingOverride": "DONT_OVERRIDE", + "datastoreValidationIntervalSecs": 300, + "requestHeaderForCorrelationId": "" + } + ] + }, + { + "resourceType": "/serverSettings/logSettings", + "operationType": "SAVE", + "items": [ + { + "logCategories": [ + { + "id": "core", + "name": "Core", + "description": "Debug logging for core components.", + "enabled": false + }, + { + "id": "protocolrequestresponse", + "name": "Protocol Requests and Responses", + "description": "Log protocol request and response messages.", + "enabled": false + }, + { + "id": "policytree", + "name": "Policy Tree", + "description": "Policy tree debug logging.", + "enabled": false + }, + { + "id": "dsresponsetime", + "name": "Data Store Response Times", + "description": "Log response times for data store requests.", + "enabled": false + }, + { + "id": "trustedcas", + "name": "Trusted CAs", + "description": "Log PingFederate and JRE trusted CAs when they are loaded.", + "enabled": false + }, + { + "id": "xmlsig", + "name": "XML Signatures", + "description": "Debug logging for XML signature operations.", + "enabled": false + }, + { + "id": "requestheaders", + "name": "HTTP Request Headers", + "description": "Log HTTP request headers. Sensitive information, such as passwords, may be logged when this category is enabled.", + "enabled": false + }, + { + "id": "requestparams", + "name": "HTTP Request Parameters", + "description": "Log HTTP GET request parameters. Sensitive information, such as passwords, may be logged when this category is enabled.", + "enabled": false + }, + { + "id": "restdatastore", + "name": "REST Data Store Requests and Responses", + "description": "Log REST datastore requests and responses. Sensitive information, such as passwords, may be logged when this category is enabled.", + "enabled": false + } + ] + } + ] + }, + { + "resourceType": "/administrativeAccounts", + "operationType": "SAVE", + "items": [ + { + "username": "Administrator", + "encryptedPassword": "OBF:JWE:eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2Iiwia2lkIjoiUWVzOVR5eTV5WiIsInZlcnNpb24iOiIxMi4yLjAuNCJ9..kXCR48-wTysghVHlJnW7gw.13D06DlCeQZMfG1ZzeLtV47R7hhfqXsTeHJk89yIciHWqTyzaHoaoUeKP0NvQV73MaNwwFLy-6xXiJb_M18wew.rzhaAzkb9Nikklu0r_wNgA", + "description": "Initial administrator user.", + "auditor": false, + "active": true, + "roles": [ + "ADMINISTRATOR", + "USER_ADMINISTRATOR", + "CRYPTO_ADMINISTRATOR", + "EXPRESSION_ADMINISTRATOR", + "DATA_COLLECTION_ADMINISTRATOR" + ] + } + ] + }, + { + "resourceType": "/certificates/revocation/ocspCertificates", + "operationType": "SAVE", + "items": [ + { + "id": "opcey20sf9djwvk8snv1actzq", + "fileData": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURuVENDQW9XZ0F3SUJBZ0lVUzJUQkNkUnpwSzRaemUrSERLakI5RVFTSHFZd0RRWUpLb1pJaHZjTkFRRUxCUUF3WGpFTE1Ba0cKQTFVRUJoTUNWVk14Q3pBSkJnTlZCQWdNQWtOUE1ROHdEUVlEVlFRSERBWkVaVzUyWlhJeElqQWdCZ05WQkFvTUdWQnBibWNnU1dSbApiblJwZEhrZ1EyOXljRzl5WVhScGIyNHhEVEFMQmdOVkJBTU1CSFJsYzNRd0hoY05NalF4TWpFeU1qTXlPREkwV2hjTk1qY3dPVEE0Ck1qTXlPREkwV2pCZU1Rc3dDUVlEVlFRR0V3SlZVekVMTUFrR0ExVUVDQXdDUTA4eER6QU5CZ05WQkFjTUJrUmxiblpsY2pFaU1DQUcKQTFVRUNnd1pVR2x1WnlCSlpHVnVkR2wwZVNCRGIzSndiM0poZEdsdmJqRU5NQXNHQTFVRUF3d0VkR1Z6ZERDQ0FTSXdEUVlKS29aSQpodmNOQVFFQkJRQURnZ0VQQURDQ0FRb0NnZ0VCQUpkb0d1cmdEdlNSQkwyY0llVWFDWTNwbzVZRFpuVjFleXVPUVR4UWM2T1QySlMwCis0MGdKYkptZk5yYmNPU3QrMURieHpQK0l4YmxrY3o1NjlWT0M1bGJST24zOHllYU1VMzJYYy80REdTcDFIQ1kvSmZTeWd6LytxcjgKOFlUcU1hSTIxQWJabkFpWTV4MFJ3NTZJRG1KZ2xYYVhlVmJDVUp5N29QVHlBb1lZVDkzREpEazQxWmU1MVVjVG1Vc1RLTjRLM2d2dgpTYVJ1eXE1K2c2RVhCcTdBa2VPbmJQMGJTSHliTjFLRVY1QlhOTnBnazloMEp3M1BFK3FrbS81bllSenhCZjRSQS9BZ2Z2OWVzRzlOCnozWGdEb3dBR0JteHIrclUvbmE3cHdFRXVkTWg2NjhERURlUlZ3aDFaYXBZcEJ0VmN4TUhtZEpQZ0ZKckJsbzZtTUVDQXdFQUFhTlQKTUZFd0hRWURWUjBPQkJZRUZHSmMzWjBqOWtYUHNUbW1iZ0FzWS9QSzJjdXBNQjhHQTFVZEl3UVlNQmFBRkdKYzNaMGo5a1hQc1RtbQpiZ0FzWS9QSzJjdXBNQThHQTFVZEV3RUIvd1FGTUFNQkFmOHdEUVlKS29aSWh2Y05BUUVMQlFBRGdnRUJBSlZCdmNIaGgrMDBnelEwCnBuWkt0Ukp4dkVnK3BHaCtCOUUrNWkyUHNOR3lJQXZBWHc0bWRCY1FaS3hmaVhNMzFaRTJnZTFtUCs0ZGkxMStQS1lOSDJFOTczUEwKSit3R0hlUVoxRVRERzVmbzc5dDBNRzFSekh0R29pclpXN3Y0Qk5VSTZaTTJGakVhQ090WmcxclVoa2RJZnFEeDRDZU5qemIwcmhYSQp6WE5UUzRZNlZseFdBclFud0FncVB0YjVwb0pHM01tLzNmNnVRZy9sMExJS1RZL0dSNnlRc05Da3pUWlFocklwWGo0UnBxblgzUWdECjFJV1RvTW9uN250cDRnQVAvbEFTTTUveG01SnpiNmRtRitob04wNzNnMDJVZVYyVERMemU4MCtLK1hyMUdaZWVVTHVYTnJoT0VYRFIKeXR2dWJlOE9YUFBZNi96Q3BoVmIyMWc9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K" + } + ] + }, + { + "resourceType": "/certificates/revocation/settings", + "operationType": "SAVE", + "items": [ + { + "ocspSettings": { + "requesterAddNonce": false, + "actionOnResponderUnavailable": "CONTINUE", + "actionOnStatusUnknown": "FAIL", + "actionOnUnsuccessfulResponse": "FAIL", + "currentUpdateGracePeriod": 5, + "nextUpdateGracePeriod": 5, + "responseCachePeriod": 48, + "responderTimeout": 5, + "responderCertReference": { + "id": "opcey20sf9djwvk8snv1actzq", + "location": "https://localhost:9999/pf-admin-api/v1/certificates/revocation/ocspCertificates/opcey20sf9djwvk8snv1actzq" + } + } + } + ] + }, + { + "resourceType": "/virtualHostNames", + "operationType": "SAVE", + "items": [ + { + "virtualHostNames": [] + } + ] + }, + { + "resourceType": "/redirectValidation", + "operationType": "SAVE", + "items": [ + { + "redirectValidationLocalSettings": { + "enableTargetResourceValidationForSSO": false, + "enableTargetResourceValidationForSLO": false, + "enableTargetResourceValidationForIdpDiscovery": false, + "enableInErrorResourceValidation": false, + "whiteList": [], + "uriAllowList": [] + }, + "redirectValidationPartnerSettings": { + "enableWreplyValidationSLO": false + } + } + ] + }, + { + "resourceType": "/incomingProxySettings", + "operationType": "SAVE", + "items": [ + { + "enableClientCertHeaderAuth": false, + "clientCertHeaderEncodingFormat": "APACHE_MOD_SSL", + "proxyTerminatesHttpsConns": false + } + ] + }, + { + "resourceType": "/protocolMetadata/lifetimeSettings", + "operationType": "SAVE", + "items": [ + { + "cacheDuration": 1440, + "reloadDelay": 1440 + } + ] + }, + { + "resourceType": "/protocolMetadata/signingSettings", + "operationType": "SAVE", + "items": [ + {} + ] + }, + { + "resourceType": "/serviceAuthentication", + "operationType": "SAVE", + "items": [ + {} + ] + }, + { + "resourceType": "/extendedProperties", + "operationType": "SAVE", + "items": [ + { + "name": "authNexp", + "description": "Authentication Experience [Single_Factor | Internal | ID-First | Multi_Factor]", + "multiValued": false + }, + { + "name": "useAuthnApi", + "description": "Use the AuthN API", + "multiValued": false + } + ] + }, + { + "resourceType": "/authenticationPolicyContracts", + "operationType": "SAVE", + "items": [ + { + "id": "DkhZxRcZchsed90U", + "name": "Fragment - Subject", + "coreAttributes": [ + { + "name": "subject" + } + ], + "extendedAttributes": [], + "lastModified": "2025-01-31T22:32:15.606Z" + }, + { + "id": "QGxlec5CX693lBQL", + "name": "apc", + "coreAttributes": [ + { + "name": "subject" + } + ], + "extendedAttributes": [], + "lastModified": "2025-01-31T22:32:15.617Z" + }, + { + "id": "default", + "name": "Default", + "coreAttributes": [ + { + "name": "subject" + } + ], + "extendedAttributes": [ + { + "name": "firstName" + }, + { + "name": "lastName" + }, + { + "name": "ImmutableID" + }, + { + "name": "mail" + }, + { + "name": "SAML_AUTHN_CTX" + } + ], + "lastModified": "2025-01-31T22:32:15.619Z" + }, + { + "id": "samplePolicyContract", + "name": "Sample Policy Contract", + "coreAttributes": [ + { + "name": "subject" + } + ], + "extendedAttributes": [ + { + "name": "firstName" + }, + { + "name": "lastName" + }, + { + "name": "ImmutableID" + }, + { + "name": "mail" + }, + { + "name": "SAML_AUTHN_CTX" + } + ], + "lastModified": "2025-01-31T22:32:15.627Z" + }, + { + "id": "wIdHhK789PmadmMS", + "name": "Fragment - Form", + "coreAttributes": [ + { + "name": "subject" + } + ], + "extendedAttributes": [ + { + "name": "entryUUID" + }, + { + "name": "uid" + }, + { + "name": "mail" + } + ], + "lastModified": "2025-01-31T22:32:15.632Z" + } + ] + }, + { + "resourceType": "/passwordCredentialValidators", + "operationType": "SAVE", + "items": [ + { + "id": "PDPCV", + "name": "PD PCV", + "pluginDescriptorRef": { + "id": "org.sourceid.saml20.domain.LDAPUsernamePasswordCredentialValidator", + "location": "https://localhost:9999/pf-admin-api/v1/passwordCredentialValidators/descriptors/org.sourceid.saml20.domain.LDAPUsernamePasswordCredentialValidator" + }, + "configuration": { + "tables": [ + { + "name": "Authentication Error Overrides", + "rows": [] + } + ], + "fields": [ + { + "name": "LDAP Datastore", + "value": "LDAP-PingDirectory" + }, + { + "name": "Search Base", + "value": "dc=example,dc=com" + }, + { + "name": "Search Filter", + "value": "(|(uid=${username})(mail=${username}))" + }, + { + "name": "Scope of Search", + "value": "Subtree" + }, + { + "name": "Case-Sensitive Matching", + "value": "true" + }, + { + "name": "Display Name Attribute", + "value": "displayName" + }, + { + "name": "Mail Attribute", + "value": "mail" + }, + { + "name": "SMS Attribute", + "value": "" + }, + { + "name": "PingID Username Attribute", + "value": "uid" + }, + { + "name": "Mail Search Filter", + "value": "mail=${mail}" + }, + { + "name": "Username Attribute", + "value": "uid" + }, + { + "name": "Trim Username Spaces For Search", + "value": "true" + }, + { + "name": "Mail Verified Attribute", + "value": "" + }, + { + "name": "Account Disabled Attribute", + "value": "" + }, + { + "name": "Enable PingDirectory Detailed Password Policy Requirement Messaging", + "value": "false" + }, + { + "name": "Expect Password Expired Control", + "value": "false" + } + ] + }, + "lastModified": "2025-01-31T22:32:15.886Z", + "attributeContract": { + "coreAttributes": [ + { + "name": "mail" + }, + { + "name": "givenName" + }, + { + "name": "DN" + }, + { + "name": "username" + } + ], + "extendedAttributes": [ + { + "name": "entryUUID" + }, + { + "name": "uid" + }, + { + "name": "sn" + } + ] + } + }, + { + "id": "pingdirectory", + "name": "pingdirectory", + "pluginDescriptorRef": { + "id": "org.sourceid.saml20.domain.LDAPUsernamePasswordCredentialValidator", + "location": "https://localhost:9999/pf-admin-api/v1/passwordCredentialValidators/descriptors/org.sourceid.saml20.domain.LDAPUsernamePasswordCredentialValidator" + }, + "configuration": { + "tables": [ + { + "name": "Authentication Error Overrides", + "rows": [] + } + ], + "fields": [ + { + "name": "LDAP Datastore", + "value": "pingdirectory" + }, + { + "name": "Search Base", + "value": "dc=example,dc=com" + }, + { + "name": "Search Filter", + "value": "(&(objectClass=person)(|(mail=${username})(cn=${username})(uid=${username})))" + }, + { + "name": "Scope of Search", + "value": "Subtree" + }, + { + "name": "Case-Sensitive Matching", + "value": "false" + }, + { + "name": "Display Name Attribute", + "value": "displayName" + }, + { + "name": "Mail Attribute", + "value": "mail" + }, + { + "name": "SMS Attribute", + "value": "" + }, + { + "name": "PingID Username Attribute", + "value": "" + }, + { + "name": "Mail Search Filter", + "value": "" + }, + { + "name": "Username Attribute", + "value": "" + }, + { + "name": "Mail Verified Attribute", + "value": "" + }, + { + "name": "Trim Username Spaces For Search", + "value": "false" + }, + { + "name": "Account Disabled Attribute", + "value": "" + }, + { + "name": "Enable PingDirectory Detailed Password Policy Requirement Messaging", + "value": "false" + }, + { + "name": "Expect Password Expired Control", + "value": "false" + } + ] + }, + "lastModified": "2025-01-31T22:32:15.900Z", + "attributeContract": { + "coreAttributes": [ + { + "name": "mail" + }, + { + "name": "givenName" + }, + { + "name": "DN" + }, + { + "name": "username" + } + ], + "extendedAttributes": [ + { + "name": "entryUUID" + } + ] + } + }, + { + "id": "simple", + "name": "simple", + "pluginDescriptorRef": { + "id": "org.sourceid.saml20.domain.SimpleUsernamePasswordCredentialValidator", + "location": "https://localhost:9999/pf-admin-api/v1/passwordCredentialValidators/descriptors/org.sourceid.saml20.domain.SimpleUsernamePasswordCredentialValidator" + }, + "configuration": { + "tables": [ + { + "name": "Users", + "rows": [ + { + "fields": [ + { + "name": "Username", + "value": "joe" + }, + { + "name": "Password", + "encryptedValue": "OBF:JWE:eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2Iiwia2lkIjoiUWVzOVR5eTV5WiIsInZlcnNpb24iOiIxMi4yLjAuNCJ9..C5TQiZmuxKBmrRBjQEvEiA.KkyfPDp6zBRdvl0hs3jXna4vGYw_86Zyn4fxnqKCpOtkEuSZX0kUu7JFGX6dBW94UsArefoiHQ6SQwLxdo5GYg.kJA3CHPnu16GGqovGVkFHw" + }, + { + "name": "Confirm Password", + "encryptedValue": "OBF:JWE:eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2Iiwia2lkIjoiUWVzOVR5eTV5WiIsInZlcnNpb24iOiIxMi4yLjAuNCJ9.._zgTvi1nWLsYZU-NQkcAxQ.kAXpw1Zso7vvZkVkOzT_twZnNELDBVCEEyxpbgXOdgZ1MgepmZwl3c7zmTJzxmcD5B2YlOVAaWzw-fIXEAwLhA.eEWHDXFzUhiSVYnnazTswg" + }, + { + "name": "Relax Password Requirements", + "value": "true" + } + ], + "defaultRow": false + } + ] + } + ], + "fields": [] + }, + "lastModified": "2025-01-31T22:32:15.917Z", + "attributeContract": { + "coreAttributes": [ + { + "name": "username" + } + ] + } + } + ] + }, + { + "resourceType": "/localIdentity/identityProfiles", + "operationType": "SAVE", + "items": [ + { + "id": "adminIdentityProfile", + "name": "Admin Identity Profile", + "apcId": { + "id": "default", + "location": "https://localhost:9999/pf-admin-api/v1/authenticationPolicyContracts/default" + }, + "authSources": [ + { + "source": "SecurityKey", + "id": "SecurityKey" + }, + { + "source": "FIDO", + "id": "FIDO" + } + ], + "authSourceUpdatePolicy": { + "storeAttributes": false, + "retainAttributes": false, + "updateAttributes": false, + "updateInterval": 0 + }, + "fieldConfig": { + "fields": [ + { + "type": "TEXT", + "id": "fullName", + "label": "Full Name", + "registrationPageField": false, + "profilePageField": true, + "attributes": { + "Read-Only": false, + "Required": false, + "Unique ID Field": false, + "Mask Log Values": false + }, + "defaultValue": "" + }, + { + "type": "TEXT", + "id": "firstName", + "label": "First Name", + "registrationPageField": false, + "profilePageField": true, + "attributes": { + "Read-Only": false, + "Required": false, + "Unique ID Field": false, + "Mask Log Values": false + }, + "defaultValue": "" + }, + { + "type": "TEXT", + "id": "lastName", + "label": "Last Name", + "registrationPageField": false, + "profilePageField": true, + "attributes": { + "Read-Only": false, + "Required": false, + "Unique ID Field": false, + "Mask Log Values": false + }, + "defaultValue": "" + }, + { + "type": "EMAIL", + "id": "email", + "label": "Email Address", + "registrationPageField": false, + "profilePageField": true, + "attributes": { + "Read-Only": false, + "Required": true, + "Unique ID Field": false, + "Mask Log Values": false + } + }, + { + "type": "PHONE", + "id": "phoneNumber", + "label": "Phone Number", + "registrationPageField": false, + "profilePageField": true, + "attributes": { + "Read-Only": false, + "Required": false, + "Unique ID Field": false, + "Mask Log Values": false + } + }, + { + "type": "TEXT", + "id": "username", + "label": "Username", + "registrationPageField": false, + "profilePageField": true, + "attributes": { + "Read-Only": false, + "Required": true, + "Unique ID Field": true, + "Mask Log Values": false + }, + "defaultValue": "" + } + ], + "stripSpaceFromUniqueField": true + }, + "emailVerificationConfig": { + "emailVerificationEnabled": false + }, + "dataStoreConfig": { + "type": "LDAP", + "dataStoreRef": { + "id": "LDAP-PingDirectory", + "location": "https://localhost:9999/pf-admin-api/v1/dataStores/LDAP-PingDirectory" + }, + "baseDn": "ou=Administrators,dc=example,dc=com", + "createPattern": "", + "objectClass": "", + "dataStoreMapping": { + "firstName": { + "type": "LDAP", + "name": "givenName", + "metadata": {} + }, + "lastName": { + "type": "LDAP", + "name": "sn", + "metadata": {} + }, + "phoneNumber": { + "type": "LDAP", + "name": "mobile", + "metadata": {} + }, + "fullName": { + "type": "LDAP", + "name": "cn", + "metadata": {} + }, + "email": { + "type": "LDAP", + "name": "mail", + "metadata": {} + }, + "username": { + "type": "LDAP", + "name": "uid", + "metadata": {} + } + } + }, + "profileConfig": { + "deleteIdentityEnabled": false, + "templateName": "local.identity.profile.html" + }, + "registrationEnabled": false, + "profileEnabled": true + }, + { + "id": "regIdentityProfile", + "name": "Registration Identity Profile", + "apcId": { + "id": "samplePolicyContract", + "location": "https://localhost:9999/pf-admin-api/v1/authenticationPolicyContracts/samplePolicyContract" + }, + "authSources": [], + "authSourceUpdatePolicy": { + "storeAttributes": false, + "retainAttributes": false, + "updateAttributes": false, + "updateInterval": 0 + }, + "registrationConfig": { + "captchaEnabled": false, + "templateName": "local.identity.registration.html", + "createAuthnSessionAfterRegistration": true, + "usernameField": "username", + "thisIsMyDeviceEnabled": false + }, + "fieldConfig": { + "fields": [ + { + "type": "TEXT", + "id": "firstName", + "label": "First Name", + "registrationPageField": true, + "profilePageField": true, + "attributes": { + "Read-Only": false, + "Required": false, + "Unique ID Field": false, + "Mask Log Values": false + }, + "defaultValue": "" + }, + { + "type": "TEXT", + "id": "lastName", + "label": "Last Name", + "registrationPageField": true, + "profilePageField": true, + "attributes": { + "Read-Only": false, + "Required": false, + "Unique ID Field": false, + "Mask Log Values": false + }, + "defaultValue": "" + }, + { + "type": "TEXT", + "id": "fullName", + "label": "Full Name", + "registrationPageField": true, + "profilePageField": true, + "attributes": { + "Read-Only": false, + "Required": false, + "Unique ID Field": false, + "Mask Log Values": false + }, + "defaultValue": "" + }, + { + "type": "EMAIL", + "id": "email", + "label": "Email Address", + "registrationPageField": true, + "profilePageField": true, + "attributes": { + "Read-Only": false, + "Required": true, + "Unique ID Field": false, + "Mask Log Values": false + } + }, + { + "type": "PHONE", + "id": "phoneNumber", + "label": "Phone Number", + "registrationPageField": true, + "profilePageField": true, + "attributes": { + "Read-Only": false, + "Required": false, + "Unique ID Field": false, + "Mask Log Values": false + } + }, + { + "type": "TEXT", + "id": "username", + "label": "Username", + "registrationPageField": true, + "profilePageField": true, + "attributes": { + "Read-Only": false, + "Required": true, + "Unique ID Field": true, + "Mask Log Values": false + }, + "defaultValue": "" + }, + { + "type": "HIDDEN", + "id": "ImmutableID", + "label": "ImmutableID", + "registrationPageField": true, + "profilePageField": true, + "attributes": { + "Unique ID Field": false, + "Mask Log Values": false + } + }, + { + "type": "HIDDEN", + "id": "accountVerified", + "label": "Account Verified", + "registrationPageField": false, + "profilePageField": true, + "attributes": { + "Unique ID Field": false, + "Mask Log Values": false + } + } + ], + "stripSpaceFromUniqueField": false + }, + "emailVerificationConfig": { + "emailVerificationEnabled": false + }, + "dataStoreConfig": { + "type": "LDAP", + "dataStoreRef": { + "id": "LDAP-PingDirectory", + "location": "https://localhost:9999/pf-admin-api/v1/dataStores/LDAP-PingDirectory" + }, + "baseDn": "ou=People,dc=example,dc=com", + "createPattern": "uid=${username}", + "objectClass": "inetOrgPerson", + "auxiliaryObjectClasses": [ + "pf-connected-identities", + "ubidPersonAux" + ], + "dataStoreMapping": { + "firstName": { + "type": "LDAP", + "name": "givenName", + "metadata": {} + }, + "lastName": { + "type": "LDAP", + "name": "sn", + "metadata": {} + }, + "phoneNumber": { + "type": "LDAP", + "name": "mobile", + "metadata": {} + }, + "ImmutableID": { + "type": "LDAP", + "name": "entryUUID", + "metadata": {} + }, + "fullName": { + "type": "LDAP", + "name": "cn", + "metadata": {} + }, + "accountVerified": { + "type": "LDAP", + "name": "ubidAccountVerified", + "metadata": {} + }, + "email": { + "type": "LDAP", + "name": "mail", + "metadata": {} + }, + "username": { + "type": "LDAP", + "name": "uid", + "metadata": {} + } + } + }, + "profileConfig": { + "deleteIdentityEnabled": false, + "templateName": "local.identity.profile.html" + }, + "registrationEnabled": true, + "profileEnabled": true + } + ] + }, + { + "resourceType": "/oauth/accessTokenManagers", + "operationType": "SAVE", + "items": [ + { + "id": "jwt", + "name": "JSON Web Tokens", + "pluginDescriptorRef": { + "id": "com.pingidentity.pf.access.token.management.plugins.JwtBearerAccessTokenManagementPlugin", + "location": "https://localhost:9999/pf-admin-api/v1/oauth/accessTokenManagers/descriptors/com.pingidentity.pf.access.token.management.plugins.JwtBearerAccessTokenManagementPlugin" + }, + "configuration": { + "tables": [ + { + "name": "Symmetric Keys", + "rows": [] + }, + { + "name": "Certificates", + "rows": [ + { + "fields": [ + { + "name": "Key ID", + "value": "k1" + }, + { + "name": "Certificate", + "value": "tiq4n26axjircjk30oz5zf6k3" + } + ], + "defaultRow": false + } + ] + } + ], + "fields": [ + { + "name": "Token Lifetime", + "value": "120" + }, + { + "name": "Use Centralized Signing Key", + "value": "false" + }, + { + "name": "JWS Algorithm", + "value": "RS256" + }, + { + "name": "Active Symmetric Key ID", + "value": "" + }, + { + "name": "Active Signing Certificate Key ID", + "value": "k1" + }, + { + "name": "JWE Algorithm", + "value": "" + }, + { + "name": "JWE Content Encryption Algorithm", + "value": "" + }, + { + "name": "Active Symmetric Encryption Key ID", + "value": "" + }, + { + "name": "Asymmetric Encryption Key", + "value": "" + }, + { + "name": "Asymmetric Encryption JWKS URL", + "value": "" + }, + { + "name": "Enable Token Revocation", + "value": "false" + }, + { + "name": "Include Key ID Header Parameter", + "value": "true" + }, + { + "name": "Include X.509 Thumbprint Header Parameter", + "value": "false" + }, + { + "name": "Default JWKS URL Cache Duration", + "value": "720" + }, + { + "name": "Include JWE Key ID Header Parameter", + "value": "true" + }, + { + "name": "Include JWE X.509 Thumbprint Header Parameter", + "value": "false" + }, + { + "name": "Client ID Claim Name", + "value": "client_id_name" + }, + { + "name": "Scope Claim Name", + "value": "scope" + }, + { + "name": "Space Delimit Scope Values", + "value": "false" + }, + { + "name": "Authorization Details Claim Name", + "value": "authorization_details" + }, + { + "name": "Issuer Claim Value", + "value": "" + }, + { + "name": "Audience Claim Value", + "value": "" + }, + { + "name": "Not Before Claim Offset", + "value": "" + }, + { + "name": "Include Issued At Claim", + "value": "false" + }, + { + "name": "JWT ID Claim Length", + "value": "22" + }, + { + "name": "Access Grant GUID Claim Name", + "value": "agid" + }, + { + "name": "Publish Keys to the PingFederate JWKS Endpoint", + "value": "false" + }, + { + "name": "JWKS Endpoint Path", + "value": "" + }, + { + "name": "JWKS Endpoint Cache Duration", + "value": "720" + }, + { + "name": "Publish Key ID X.509 URL", + "value": "false" + }, + { + "name": "Publish Thumbprint X.509 URL", + "value": "false" + }, + { + "name": "Expand Scope Groups", + "value": "false" + }, + { + "name": "Type Header Value", + "value": "" + } + ] + }, + "lastModified": "2025-01-31T22:32:16.143Z", + "attributeContract": { + "coreAttributes": [], + "extendedAttributes": [ + { + "name": "Username", + "multiValued": false + }, + { + "name": "OrgName", + "multiValued": false + } + ], + "defaultSubjectAttribute": "OrgName" + }, + "tokenEndpointAttributeContract": { + "attributes": [], + "inherited": false + }, + "selectionSettings": { + "resourceUris": [] + }, + "accessControlSettings": { + "restrictClients": false, + "allowedClients": [] + }, + "sessionValidationSettings": { + "checkValidAuthnSession": false, + "checkSessionRevocationStatus": false, + "updateAuthnSessionActivity": false, + "includeSessionId": false + }, + "sequenceNumber": 2 + } + ] + }, + { + "resourceType": "/oauth/accessTokenManagers/settings", + "operationType": "SAVE", + "items": [ + { + "defaultAccessTokenManagerRef": { + "id": "jwt", + "location": "https://localhost:9999/pf-admin-api/v1/oauth/accessTokenManagers/jwt" + } + } + ] + }, + { + "resourceType": "/kerberos/realms", + "operationType": "SAVE", + "items": [ + { + "id": "testKerberosRealm", + "kerberosRealmName": "Test Kerberos Realm", + "keyDistributionCenters": [ + "distCenterTest" + ], + "kerberosUsername": "user", + "kerberosEncryptedPassword": "eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2Iiwia2lkIjoiUWVzOVR5eTV5WiIsInZlcnNpb24iOiIxMi4yLjAuNCJ9..BXkYp-spJltD07g9ftFx7g.K9Z8nFyksI2dQWaTU1Wabg.2lCuOsObXEYPHTJVafj62A", + "retainPreviousKeysOnPasswordChange": true, + "suppressDomainNameConcatenation": true, + "connectionType": "DIRECT" + } + ] + }, + { + "resourceType": "/kerberos/realms/settings", + "operationType": "SAVE", + "items": [ + { + "forceTcp": false, + "kdcTimeout": "3", + "debugLogOutput": false, + "kdcRetries": "3", + "keySetRetentionPeriodMins": 610 + } + ] + }, + { + "resourceType": "/idp/adapters", + "operationType": "SAVE", + "items": [ + { + "id": "IDFirst", + "name": "Identifier-First", + "pluginDescriptorRef": { + "id": "com.pingidentity.adapters.identifierfirst.idp.IdentifierFirstAdapter", + "location": "https://localhost:9999/pf-admin-api/v1/idp/adapters/descriptors/com.pingidentity.adapters.identifierfirst.idp.IdentifierFirstAdapter" + }, + "configuration": { + "tables": [], + "fields": [ + { + "name": "Identifier Cookie Lifetime", + "value": "30" + }, + { + "name": "Allow Cancelling Identifier Selection", + "value": "false" + }, + { + "name": "Maximum Identifiers Count", + "value": "5" + }, + { + "name": "Identifier Selection Template", + "value": "identifier.first.template.html" + }, + { + "name": "Enable Risk Provider", + "value": "false" + }, + { + "name": "Risk Provider", + "value": "" + } + ] + }, + "lastModified": "2025-01-31T22:32:16.317Z", + "attributeContract": { + "coreAttributes": [ + { + "name": "subject", + "masked": false, + "pseudonym": true + }, + { + "name": "domain", + "masked": false, + "pseudonym": false + } + ], + "extendedAttributes": [ + { + "name": "entryUUID", + "masked": false, + "pseudonym": false + }, + { + "name": "uid", + "masked": false, + "pseudonym": false + }, + { + "name": "mail", + "masked": false, + "pseudonym": false + } + ], + "maskOgnlValues": false + }, + "attributeMapping": { + "attributeSources": [ + { + "type": "LDAP", + "dataStoreRef": { + "id": "LDAP-PingDirectory", + "location": "https://localhost:9999/pf-admin-api/v1/dataStores/LDAP-PingDirectory" + }, + "id": "PD", + "description": "PD", + "baseDn": "dc=example,dc=com", + "searchScope": "SUBTREE", + "searchFilter": "(|(uid=${subject} )(mail=${subject}))", + "binaryAttributeSettings": {}, + "memberOfNestedGroup": false + } + ], + "attributeContractFulfillment": { + "entryUUID": { + "source": { + "type": "LDAP_DATA_STORE", + "id": "PD" + }, + "value": "entryUUID" + }, + "uid": { + "source": { + "type": "LDAP_DATA_STORE", + "id": "PD" + }, + "value": "uid" + }, + "mail": { + "source": { + "type": "LDAP_DATA_STORE", + "id": "PD" + }, + "value": "mail" + }, + "subject": { + "source": { + "type": "ADAPTER" + }, + "value": "subject" + }, + "domain": { + "source": { + "type": "ADAPTER" + }, + "value": "domain" + } + }, + "issuanceCriteria": { + "conditionalCriteria": [] + } + } + }, + { + "id": "OTIdPJava", + "name": "OTIdPJava", + "pluginDescriptorRef": { + "id": "com.pingidentity.adapters.opentoken.IdpAuthnAdapter", + "location": "https://localhost:9999/pf-admin-api/v1/idp/adapters/descriptors/com.pingidentity.adapters.opentoken.IdpAuthnAdapter" + }, + "configuration": { + "tables": [], + "fields": [ + { + "name": "Password", + "encryptedValue": "OBF:JWE:eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2Iiwia2lkIjoiUWVzOVR5eTV5WiIsInZlcnNpb24iOiIxMi4yLjAuNCJ9..VLkmV_SoOHMwCh-llliQUQ.g5LMasmJxSpgbIdpI7peiQ.rW1xpTvC9ydsiPQySRRRTw" + }, + { + "name": "Confirm Password", + "encryptedValue": "OBF:JWE:eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2Iiwia2lkIjoiUWVzOVR5eTV5WiIsInZlcnNpb24iOiIxMi4yLjAuNCJ9..Z12sPCihIExIXMzOuyFEnQ.pXEcsDlQK49qw01n62qF2w.9SAqaq3hnQWriZ-id2Xd0Q" + }, + { + "name": "Authentication Service", + "value": "https://localhost:9031/IdpSample/?cmd=sso" + }, + { + "name": "Transport Mode", + "value": "1" + }, + { + "name": "Token Name", + "value": "idpopentoken" + }, + { + "name": "Cipher Suite", + "value": "2" + }, + { + "name": "Logout Service", + "value": "https://localhost:9031/IdpSample/?cmd=slo" + }, + { + "name": "Cookie Domain", + "value": "" + }, + { + "name": "Cookie Path", + "value": "/" + }, + { + "name": "Token Lifetime", + "value": "300" + }, + { + "name": "Session Lifetime", + "value": "43200" + }, + { + "name": "Not Before Tolerance", + "value": "0" + }, + { + "name": "Force SunJCE Provider", + "value": "false" + }, + { + "name": "Use Verbose Error Messages", + "value": "false" + }, + { + "name": "Obfuscate Password", + "value": "true" + }, + { + "name": "Session Cookie", + "value": "false" + }, + { + "name": "Secure Cookie", + "value": "false" + }, + { + "name": "Delete Cookie", + "value": "false" + }, + { + "name": "Replay Prevention", + "value": "false" + }, + { + "name": "Skip Malformed Attribute Detection", + "value": "false" + }, + { + "name": "SameSite Cookie", + "value": "3" + }, + { + "name": "HTTP Only Flag", + "value": "true" + }, + { + "name": "Track Authentication Time", + "value": "true" + } + ] + }, + "lastModified": "2025-01-31T22:32:16.377Z", + "attributeContract": { + "coreAttributes": [ + { + "name": "subject", + "masked": false, + "pseudonym": true + } + ], + "extendedAttributes": [], + "maskOgnlValues": false + }, + "attributeMapping": { + "attributeSources": [], + "attributeContractFulfillment": { + "subject": { + "source": { + "type": "ADAPTER" + }, + "value": "subject" + } + }, + "issuanceCriteria": { + "conditionalCriteria": [] + } + } + }, + { + "id": "ciamHtmlForm", + "name": "Customer HTML Form (PF)", + "pluginDescriptorRef": { + "id": "com.pingidentity.adapters.htmlform.idp.HtmlFormIdpAuthnAdapter", + "location": "https://localhost:9999/pf-admin-api/v1/idp/adapters/descriptors/com.pingidentity.adapters.htmlform.idp.HtmlFormIdpAuthnAdapter" + }, + "configuration": { + "tables": [ + { + "name": "Credential Validators", + "rows": [ + { + "fields": [ + { + "name": "Password Credential Validator Instance", + "value": "PDPCV" + } + ], + "defaultRow": false + } + ] + } + ], + "fields": [ + { + "name": "Challenge Retries", + "value": "3" + }, + { + "name": "Session State", + "value": "None" + }, + { + "name": "Session Timeout", + "value": "60" + }, + { + "name": "Session Max Timeout", + "value": "480" + }, + { + "name": "Allow Password Changes", + "value": "true" + }, + { + "name": "Password Management System", + "value": "" + }, + { + "name": "Enable 'Remember My Username'", + "value": "true" + }, + { + "name": "Enable 'This is My Device'", + "value": "false" + }, + { + "name": "Change Password Policy Contract", + "value": "" + }, + { + "name": "Change Password Email Notification", + "value": "false" + }, + { + "name": "Show Password Expiring Warning", + "value": "false" + }, + { + "name": "Password Reset Type", + "value": "NONE" + }, + { + "name": "Password Reset Policy Contract", + "value": "" + }, + { + "name": "Revoke Sessions After Password Change Or Reset", + "value": "false" + }, + { + "name": "Account Unlock", + "value": "false" + }, + { + "name": "Local Identity Profile", + "value": "regIdentityProfile" + }, + { + "name": "Notification Publisher", + "value": "" + }, + { + "name": "Enable Username Recovery", + "value": "false" + }, + { + "name": "Login Template", + "value": "html.form.login.template.html" + }, + { + "name": "Logout Path", + "value": "" + }, + { + "name": "Logout Redirect", + "value": "" + }, + { + "name": "Logout Template", + "value": "idp.logout.success.page.template.html" + }, + { + "name": "Change Password Template", + "value": "html.form.change.password.template.html" + }, + { + "name": "Change Password Message Template", + "value": "html.form.message.template.html" + }, + { + "name": "Password Management System Message Template", + "value": "html.form.message.template.html" + }, + { + "name": "Change Password Email Template", + "value": "message-template-end-user-password-change.html" + }, + { + "name": "Expiring Password Warning Template", + "value": "html.form.password.expiring.notification.template.html" + }, + { + "name": "Threshold for Expiring Password Warning", + "value": "7" + }, + { + "name": "Snooze Interval for Expiring Password Warning", + "value": "24" + }, + { + "name": "Login Challenge Template", + "value": "html.form.login.challenge.template.html" + }, + { + "name": "'Remember My Username' Lifetime", + "value": "30" + }, + { + "name": "'This is My Device' Lifetime", + "value": "30" + }, + { + "name": "Allow Username Edits During Chaining", + "value": "false" + }, + { + "name": "Track Authentication Time", + "value": "true" + }, + { + "name": "Post-Password Change Re-Authentication Delay", + "value": "0" + }, + { + "name": "Password Reset Username Template", + "value": "forgot-password.html" + }, + { + "name": "Password Reset Code Template", + "value": "forgot-password-resume.html" + }, + { + "name": "Password Reset Template", + "value": "forgot-password-change.html" + }, + { + "name": "Password Reset Error Template", + "value": "forgot-password-error.html" + }, + { + "name": "Password Reset Success Template", + "value": "forgot-password-success.html" + }, + { + "name": "Account Unlock Template", + "value": "account-unlock.html" + }, + { + "name": "OTP Length", + "value": "8" + }, + { + "name": "OTP Time to Live", + "value": "10" + }, + { + "name": "PingID Properties", + "value": "" + }, + { + "name": "Require Verified Email", + "value": "false" + }, + { + "name": "Username Recovery Template", + "value": "username.recovery.template.html" + }, + { + "name": "Username Recovery Info Template", + "value": "username.recovery.info.template.html" + }, + { + "name": "Username Recovery Email Template", + "value": "message-template-username-recovery.html" + }, + { + "name": "CAPTCHA for Authentication", + "value": "false" + }, + { + "name": "CAPTCHA for Password change", + "value": "false" + }, + { + "name": "CAPTCHA for Password Reset", + "value": "false" + }, + { + "name": "CAPTCHA for Username recovery", + "value": "false" + }, + { + "name": "Password Update Timeout", + "value": "30" + }, + { + "name": "Require Re-Authentication For Expiring Password Flow", + "value": "false" + }, + { + "name": "Require Re-Authentication for Change Password Flow", + "value": "true" + }, + { + "name": "Require Re-Authentication for Password Reset Flow", + "value": "true" + }, + { + "name": "Password Reset One-Time Link Email Template", + "value": "message-template-forgot-password-link.html" + }, + { + "name": "Password Reset One-Time Password Email Template", + "value": "message-template-forgot-password-code.html" + }, + { + "name": "Account Disabled Email Template", + "value": "message-template-account-disabled.html" + }, + { + "name": "Password Reset Complete Email Template", + "value": "message-template-forgot-password-complete.html" + }, + { + "name": "Password Reset Failed Email Template", + "value": "message-template-forgot-password-failed.html" + }, + { + "name": "Account Unlock Email Template", + "value": "message-template-account-unlock-complete.html" + }, + { + "name": "Allowed OTP Character Set", + "value": "23456789BCDFGHJKMNPQRSTVWXZbcdfghjkmnpqrstvwxz" + }, + { + "name": "CAPTCHA Provider", + "value": "" + }, + { + "name": "Fail Authentication on Account Lockout", + "value": "true" + } + ] + }, + "lastModified": "2025-01-31T22:32:16.454Z", + "attributeContract": { + "coreAttributes": [ + { + "name": "policy.action", + "masked": false, + "pseudonym": false + }, + { + "name": "username", + "masked": false, + "pseudonym": true + } + ], + "extendedAttributes": [ + { + "name": "entryUUID", + "masked": false, + "pseudonym": false + }, + { + "name": "uid", + "masked": false, + "pseudonym": false + }, + { + "name": "mail", + "masked": false, + "pseudonym": false + }, + { + "name": "givenName", + "masked": false, + "pseudonym": false + }, + { + "name": "sn", + "masked": false, + "pseudonym": false + } + ], + "maskOgnlValues": false + }, + "attributeMapping": { + "attributeSources": [], + "attributeContractFulfillment": { + "entryUUID": { + "source": { + "type": "ADAPTER" + }, + "value": "entryUUID" + }, + "uid": { + "source": { + "type": "ADAPTER" + }, + "value": "uid" + }, + "mail": { + "source": { + "type": "ADAPTER" + }, + "value": "mail" + }, + "policy.action": { + "source": { + "type": "ADAPTER" + }, + "value": "policy.action" + }, + "givenName": { + "source": { + "type": "ADAPTER" + }, + "value": "givenName" + }, + "sn": { + "source": { + "type": "ADAPTER" + }, + "value": "sn" + }, + "username": { + "source": { + "type": "ADAPTER" + }, + "value": "username" + } + }, + "issuanceCriteria": { + "conditionalCriteria": [] + } + } + }, + { + "id": "htmlForm", + "name": "Employee HTML Form", + "pluginDescriptorRef": { + "id": "com.pingidentity.adapters.htmlform.idp.HtmlFormIdpAuthnAdapter", + "location": "https://localhost:9999/pf-admin-api/v1/idp/adapters/descriptors/com.pingidentity.adapters.htmlform.idp.HtmlFormIdpAuthnAdapter" + }, + "configuration": { + "tables": [ + { + "name": "Credential Validators", + "rows": [ + { + "fields": [ + { + "name": "Password Credential Validator Instance", + "value": "PDPCV" + } + ], + "defaultRow": false + } + ] + } + ], + "fields": [ + { + "name": "Challenge Retries", + "value": "3" + }, + { + "name": "Session State", + "value": "None" + }, + { + "name": "Session Timeout", + "value": "60" + }, + { + "name": "Session Max Timeout", + "value": "480" + }, + { + "name": "Allow Password Changes", + "value": "false" + }, + { + "name": "Password Management System", + "value": "" + }, + { + "name": "Enable 'Remember My Username'", + "value": "false" + }, + { + "name": "Enable 'This is My Device'", + "value": "false" + }, + { + "name": "Change Password Email Notification", + "value": "false" + }, + { + "name": "Show Password Expiring Warning", + "value": "false" + }, + { + "name": "Password Reset Type", + "value": "NONE" + }, + { + "name": "Password Reset Policy Contract", + "value": "" + }, + { + "name": "Account Unlock", + "value": "false" + }, + { + "name": "Local Identity Profile", + "value": "adminIdentityProfile" + }, + { + "name": "Notification Publisher", + "value": "" + }, + { + "name": "Enable Username Recovery", + "value": "false" + }, + { + "name": "Change Password Policy Contract", + "value": "" + }, + { + "name": "Revoke Sessions After Password Change Or Reset", + "value": "false" + }, + { + "name": "Login Template", + "value": "html.form.login.template.html" + }, + { + "name": "Logout Path", + "value": "" + }, + { + "name": "Logout Redirect", + "value": "" + }, + { + "name": "Logout Template", + "value": "idp.logout.success.page.template.html" + }, + { + "name": "Change Password Template", + "value": "html.form.change.password.template.html" + }, + { + "name": "Change Password Message Template", + "value": "html.form.message.template.html" + }, + { + "name": "Password Management System Message Template", + "value": "html.form.message.template.html" + }, + { + "name": "Change Password Email Template", + "value": "message-template-end-user-password-change.html" + }, + { + "name": "Expiring Password Warning Template", + "value": "html.form.password.expiring.notification.template.html" + }, + { + "name": "Threshold for Expiring Password Warning", + "value": "7" + }, + { + "name": "Snooze Interval for Expiring Password Warning", + "value": "24" + }, + { + "name": "Login Challenge Template", + "value": "html.form.login.challenge.template.html" + }, + { + "name": "'Remember My Username' Lifetime", + "value": "30" + }, + { + "name": "'This is My Device' Lifetime", + "value": "30" + }, + { + "name": "Allow Username Edits During Chaining", + "value": "false" + }, + { + "name": "Track Authentication Time", + "value": "true" + }, + { + "name": "Post-Password Change Re-Authentication Delay", + "value": "0" + }, + { + "name": "Password Reset Username Template", + "value": "forgot-password.html" + }, + { + "name": "Password Reset Code Template", + "value": "forgot-password-resume.html" + }, + { + "name": "Password Reset Template", + "value": "forgot-password-change.html" + }, + { + "name": "Password Reset Error Template", + "value": "forgot-password-error.html" + }, + { + "name": "Password Reset Success Template", + "value": "forgot-password-success.html" + }, + { + "name": "Account Unlock Template", + "value": "account-unlock.html" + }, + { + "name": "OTP Length", + "value": "8" + }, + { + "name": "OTP Time to Live", + "value": "10" + }, + { + "name": "PingID Properties", + "value": "" + }, + { + "name": "Require Verified Email", + "value": "false" + }, + { + "name": "Username Recovery Template", + "value": "username.recovery.template.html" + }, + { + "name": "Username Recovery Info Template", + "value": "username.recovery.info.template.html" + }, + { + "name": "Username Recovery Email Template", + "value": "message-template-username-recovery.html" + }, + { + "name": "CAPTCHA for Authentication", + "value": "false" + }, + { + "name": "CAPTCHA for Password change", + "value": "false" + }, + { + "name": "CAPTCHA for Password Reset", + "value": "false" + }, + { + "name": "CAPTCHA for Username recovery", + "value": "false" + }, + { + "name": "Password Update Timeout", + "value": "30" + }, + { + "name": "Require Re-Authentication For Expiring Password Flow", + "value": "false" + }, + { + "name": "Require Re-Authentication for Change Password Flow", + "value": "true" + }, + { + "name": "Require Re-Authentication for Password Reset Flow", + "value": "true" + }, + { + "name": "Password Reset One-Time Link Email Template", + "value": "message-template-forgot-password-link.html" + }, + { + "name": "Password Reset One-Time Password Email Template", + "value": "message-template-forgot-password-code.html" + }, + { + "name": "Account Disabled Email Template", + "value": "message-template-account-disabled.html" + }, + { + "name": "Password Reset Complete Email Template", + "value": "message-template-forgot-password-complete.html" + }, + { + "name": "Password Reset Failed Email Template", + "value": "message-template-forgot-password-failed.html" + }, + { + "name": "Account Unlock Email Template", + "value": "message-template-account-unlock-complete.html" + }, + { + "name": "Allowed OTP Character Set", + "value": "23456789BCDFGHJKMNPQRSTVWXZbcdfghjkmnpqrstvwxz" + }, + { + "name": "CAPTCHA Provider", + "value": "" + }, + { + "name": "Fail Authentication on Account Lockout", + "value": "true" + } + ] + }, + "lastModified": "2025-01-31T22:32:16.563Z", + "attributeContract": { + "coreAttributes": [ + { + "name": "policy.action", + "masked": false, + "pseudonym": false + }, + { + "name": "username", + "masked": false, + "pseudonym": true + } + ], + "extendedAttributes": [ + { + "name": "entryUUID", + "masked": false, + "pseudonym": false + }, + { + "name": "uid", + "masked": false, + "pseudonym": false + }, + { + "name": "mail", + "masked": false, + "pseudonym": false + }, + { + "name": "givenName", + "masked": false, + "pseudonym": false + }, + { + "name": "cn", + "masked": false, + "pseudonym": false + }, + { + "name": "sn", + "masked": false, + "pseudonym": false + } + ], + "maskOgnlValues": false + }, + "attributeMapping": { + "attributeSources": [], + "attributeContractFulfillment": { + "entryUUID": { + "source": { + "type": "ADAPTER" + }, + "value": "entryUUID" + }, + "uid": { + "source": { + "type": "ADAPTER" + }, + "value": "uid" + }, + "mail": { + "source": { + "type": "ADAPTER" + }, + "value": "mail" + }, + "policy.action": { + "source": { + "type": "ADAPTER" + }, + "value": "policy.action" + }, + "givenName": { + "source": { + "type": "ADAPTER" + }, + "value": "givenName" + }, + "cn": { + "source": { + "type": "ADAPTER" + }, + "value": "cn" + }, + "sn": { + "source": { + "type": "ADAPTER" + }, + "value": "sn" + }, + "username": { + "source": { + "type": "ADAPTER" + }, + "value": "username" + } + }, + "issuanceCriteria": { + "conditionalCriteria": [] + } + } + } + ] + }, + { + "resourceType": "/sp/adapters", + "operationType": "SAVE", + "items": [ + { + "id": "spadapter", + "name": "SpAdapter", + "pluginDescriptorRef": { + "id": "com.pingidentity.adapters.opentoken.SpAuthnAdapter", + "location": "https://localhost:9999/pf-admin-api/v1/sp/adapters/descriptors/com.pingidentity.adapters.opentoken.SpAuthnAdapter" + }, + "configuration": { + "tables": [], + "fields": [ + { + "name": "Password", + "encryptedValue": "OBF:JWE:eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2Iiwia2lkIjoiUWVzOVR5eTV5WiIsInZlcnNpb24iOiIxMi4yLjAuNCJ9..u0YFl7URp7YzeIiI7BpTtg.o-pxKG_Hwv1Vc-OW2w42mQ.RcQEIMOebPYPZnmnqfhUEg" + }, + { + "name": "Confirm Password", + "encryptedValue": "OBF:JWE:eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2Iiwia2lkIjoiUWVzOVR5eTV5WiIsInZlcnNpb24iOiIxMi4yLjAuNCJ9..2fgwEHpx9lUiApM7XUHSXg.QEOl-gVWyzEzQUYNc-z2Bw.c53SlFrALoPQ9Fb4875OyA" + }, + { + "name": "Transport Mode", + "value": "2" + }, + { + "name": "Token Name", + "value": "opentoken" + }, + { + "name": "Cipher Suite", + "value": "2" + }, + { + "name": "Authentication Service", + "value": "" + }, + { + "name": "Account Link Service", + "value": "" + }, + { + "name": "Logout Service", + "value": "" + }, + { + "name": "SameSite Cookie", + "value": "3" + }, + { + "name": "Cookie Domain", + "value": "" + }, + { + "name": "Cookie Path", + "value": "/" + }, + { + "name": "Token Lifetime", + "value": "300" + }, + { + "name": "Session Lifetime", + "value": "43200" + }, + { + "name": "Not Before Tolerance", + "value": "0" + }, + { + "name": "Force SunJCE Provider", + "value": "false" + }, + { + "name": "Use Verbose Error Messages", + "value": "false" + }, + { + "name": "Obfuscate Password", + "value": "true" + }, + { + "name": "Session Cookie", + "value": "false" + }, + { + "name": "Secure Cookie", + "value": "true" + }, + { + "name": "HTTP Only Flag", + "value": "true" + }, + { + "name": "Send Subject as Query Parameter", + "value": "false" + }, + { + "name": "Subject Query Parameter ", + "value": "" + }, + { + "name": "Send Extended Attributes", + "value": "" + }, + { + "name": "Skip Trimming of Trailing Backslashes", + "value": "false" + }, + { + "name": "URL Encode Cookie Values", + "value": "true" + } + ] + }, + "lastModified": "2025-01-31T22:32:16.608Z", + "attributeContract": { + "coreAttributes": [ + { + "name": "subject" + } + ], + "extendedAttributes": [] + }, + "targetApplicationInfo": { + "applicationName": "test", + "applicationIconUrl": "https://test.com" + } + } + ] + }, + { + "resourceType": "/idpToSpAdapterMapping", + "operationType": "SAVE", + "items": [ + { + "attributeSources": [], + "attributeContractFulfillment": { + "subject": { + "source": { + "type": "ADAPTER" + }, + "value": "entryUUID" + } + }, + "issuanceCriteria": { + "conditionalCriteria": [] + }, + "id": "ciamHtmlForm|spadapter", + "sourceId": "ciamHtmlForm", + "targetId": "spadapter" + } + ] + }, + { + "resourceType": "/sp/authenticationPolicyContractMappings", + "operationType": "SAVE", + "items": [ + { + "attributeSources": [], + "attributeContractFulfillment": { + "subject": { + "source": { + "type": "NO_MAPPING" + } + } + }, + "issuanceCriteria": { + "conditionalCriteria": [] + }, + "id": "wIdHhK789PmadmMS|spadapter", + "sourceId": "wIdHhK789PmadmMS", + "targetId": "spadapter" + } + ] + }, + { + "resourceType": "/identityStoreProvisioners", + "operationType": "SAVE", + "items": [ + { + "id": "ISPTestID", + "name": "ISP TestName", + "pluginDescriptorRef": { + "id": "com.pingidentity.identitystoreprovisioners.sample.SampleIdentityStoreProvisioner", + "location": "https://localhost:9999/pf-admin-api/v1/identityStoreProvisioners/descriptors/com.pingidentity.identitystoreprovisioners.sample.SampleIdentityStoreProvisioner" + }, + "configuration": { + "tables": [], + "fields": [ + { + "name": "Delete user behavior", + "value": "Disable User" + } + ] + }, + "lastModified": "2025-01-31T22:32:16.707Z", + "attributeContract": { + "coreAttributes": [ + { + "name": "username" + } + ], + "inherited": false + }, + "groupAttributeContract": { + "coreAttributes": [ + { + "name": "groupname" + } + ], + "inherited": false + } + } + ] + }, + { + "resourceType": "/idp/tokenProcessors", + "operationType": "SAVE", + "items": [ + { + "id": "UsernameTokenProcessor", + "name": "UsernameTokenProcessor", + "pluginDescriptorRef": { + "id": "com.pingidentity.pf.tokenprocessors.username.UsernameTokenProcessor", + "location": "https://localhost:9999/pf-admin-api/v1/idp/tokenProcessors/descriptors/com.pingidentity.pf.tokenprocessors.username.UsernameTokenProcessor" + }, + "configuration": { + "tables": [ + { + "name": "Credential Validators", + "rows": [ + { + "fields": [ + { + "name": "Password Credential Validator Instance", + "value": "pingdirectory" + } + ], + "defaultRow": false + }, + { + "fields": [ + { + "name": "Password Credential Validator Instance", + "value": "simple" + } + ], + "defaultRow": false + } + ] + } + ], + "fields": [ + { + "name": "Authentication Attempts", + "value": "3" + } + ] + }, + "lastModified": "2025-01-31T22:32:16.727Z", + "attributeContract": { + "coreAttributes": [ + { + "name": "username", + "masked": false + } + ], + "extendedAttributes": [], + "maskOgnlValues": false + } + }, + { + "id": "tokenprocessor", + "name": "token processor", + "pluginDescriptorRef": { + "id": "org.sourceid.wstrust.processor.saml.Saml20TokenProcessor", + "location": "https://localhost:9999/pf-admin-api/v1/idp/tokenProcessors/descriptors/org.sourceid.wstrust.processor.saml.Saml20TokenProcessor" + }, + "configuration": { + "tables": [ + { + "name": "Valid Certificate Issuer DNs", + "rows": [] + }, + { + "name": "Valid Certificate Subject DNs", + "rows": [] + } + ], + "fields": [ + { + "name": "Audience", + "value": "audience" + } + ] + }, + "lastModified": "2025-01-31T22:32:16.744Z", + "attributeContract": { + "coreAttributes": [ + { + "name": "SAML_SUBJECT", + "masked": false + } + ], + "extendedAttributes": [], + "maskOgnlValues": false + } + } + ] + }, + { + "resourceType": "/sp/tokenGenerators", + "operationType": "SAVE", + "items": [ + { + "id": "tokengenerator", + "name": "token generator", + "pluginDescriptorRef": { + "id": "org.sourceid.wstrust.generator.saml.Saml20TokenGenerator", + "location": "https://localhost:9999/pf-admin-api/v1/sp/tokenGenerators/descriptors/org.sourceid.wstrust.generator.saml.Saml20TokenGenerator" + }, + "configuration": { + "tables": [], + "fields": [ + { + "name": "Minutes Before", + "value": "60" + }, + { + "name": "Minutes After", + "value": "60" + }, + { + "name": "Issuer", + "value": "issuer" + }, + { + "name": "Signing Certificate", + "value": "tiq4n26axjircjk30oz5zf6k3" + }, + { + "name": "Signing Algorithm", + "value": "SHA1" + }, + { + "name": "Include Certificate in KeyInfo", + "value": "false" + }, + { + "name": "Include Raw Key in KeyValue", + "value": "false" + }, + { + "name": "Audience", + "value": "audience" + }, + { + "name": "Confirmation Method", + "value": "urn:oasis:names:tc:SAML:2.0:cm:sender-vouches" + }, + { + "name": "Encryption Certificate", + "value": "" + }, + { + "name": "Message Customization Expression", + "value": "" + } + ] + }, + "lastModified": "2025-01-31T22:32:16.762Z", + "attributeContract": { + "coreAttributes": [ + { + "name": "SAML_SUBJECT" + } + ], + "extendedAttributes": [] + } + } + ] + }, + { + "resourceType": "/tokenProcessorToTokenGeneratorMappings", + "operationType": "SAVE", + "items": [ + { + "attributeSources": [], + "attributeContractFulfillment": { + "SAML_SUBJECT": { + "source": { + "type": "CONTEXT" + }, + "value": "ClientIp" + } + }, + "issuanceCriteria": { + "conditionalCriteria": [] + }, + "id": "tokenprocessor|tokengenerator", + "sourceId": "tokenprocessor", + "targetId": "tokengenerator" + } + ] + }, + { + "resourceType": "/idp/defaultUrls", + "operationType": "SAVE", + "items": [ + { + "confirmIdpSlo": false, + "idpErrorMsg": "errorDetail.idpSsoFailure" + } + ] + }, + { + "resourceType": "/sp/defaultUrls", + "operationType": "SAVE", + "items": [ + { + "confirmSlo": false + } + ] + }, + { + "resourceType": "/idp/stsRequestParametersContracts", + "operationType": "SAVE", + "items": [ + { + "id": "STSTestID", + "name": "STS TestName", + "parameters": [ + "test" + ], + "lastModified": "2025-01-31T22:32:16.838Z" + } + ] + }, + { + "resourceType": "/metadataUrls", + "operationType": "SAVE", + "items": [ + { + "id": "i8uUHFDebYX7Z7gSfyhZ9yKUA", + "name": "Test Metadata URL", + "url": "https://www.example.com", + "validateSignature": false + } + ] + }, + { + "resourceType": "/oauth/authServerSettings", + "operationType": "SAVE", + "items": [ + { + "defaultScopeDescription": "", + "scopes": [ + { + "name": "email", + "description": "email scope", + "dynamic": false + } + ], + "scopeGroups": [], + "exclusiveScopes": [], + "exclusiveScopeGroups": [], + "authorizationCodeTimeout": 60, + "authorizationCodeEntropy": 30, + "disallowPlainPKCE": false, + "includeIssuerInAuthorizationResponse": false, + "persistentGrantLifetime": -1, + "persistentGrantLifetimeUnit": "DAYS", + "persistentGrantIdleTimeout": 30, + "persistentGrantIdleTimeoutTimeUnit": "DAYS", + "refreshTokenLength": 42, + "rollRefreshTokenValues": false, + "refreshTokenRollingGracePeriod": 60, + "refreshRollingInterval": 0, + "refreshRollingIntervalTimeUnit": "HOURS", + "persistentGrantReuseGrantTypes": [ + "IMPLICIT" + ], + "persistentGrantContract": { + "extendedAttributes": [], + "coreAttributes": [ + { + "name": "USER_KEY" + }, + { + "name": "USER_NAME" + } + ] + }, + "bypassAuthorizationForApprovedGrants": false, + "allowUnidentifiedClientROCreds": false, + "allowUnidentifiedClientExtensionGrants": false, + "tokenEndpointBaseUrl": "", + "requireOfflineAccessScopeToIssueRefreshTokens": false, + "offlineAccessRequireConsentPrompt": false, + "userAuthorizationUrl": "", + "registeredAuthorizationPath": "", + "pendingAuthorizationTimeout": 600, + "bypassActivationCodeConfirmation": false, + "devicePollingInterval": 5, + "activationCodeCheckMode": "AFTER_AUTHENTICATION", + "enableCookielessUserAuthorizationAuthenticationApi": false, + "returnIdTokenOnOpenIdWithDeviceAuthzGrant": false, + "userAuthorizationConsentPageSetting": "INTERNAL", + "atmIdForOAuthGrantManagement": "jwt", + "scopeForOAuthGrantManagement": "email", + "allowedOrigins": [], + "trackUserSessionsForLogout": false, + "parReferenceTimeout": 60, + "parReferenceLength": 24, + "parStatus": "ENABLED", + "clientSecretRetentionPeriod": 0, + "jwtSecuredAuthorizationResponseModeLifetime": 600, + "dpopProofRequireNonce": false, + "dpopProofLifetimeSeconds": 120, + "dpopProofEnforceReplayPrevention": false, + "bypassAuthorizationForApprovedConsents": false, + "consentLifetimeDays": -1 + } + ] + }, + { + "resourceType": "/sp/idpConnections", + "operationType": "SAVE", + "items": [ + { + "type": "IDP", + "id": "n26SCl49a8lB_ifAaLF_MyUbquv", + "name": "testConnection", + "entityId": "testPartnerId", + "active": true, + "contactInfo": {}, + "loggingMode": "STANDARD", + "virtualEntityIds": [], + "credentials": { + "certs": [ + { + "primaryVerificationCert": true, + "secondaryVerificationCert": false, + "certView": { + "id": "gpmlavn03e4mknkyml4m2ak9q", + "serialNumber": "430421198347763948001683365009287878912609754790", + "subjectDN": "CN=test, O=Ping Identity Corporation, L=Denver, ST=CO, C=US", + "subjectAlternativeNames": [], + "issuerDN": "CN=test, O=Ping Identity Corporation, L=Denver, ST=CO, C=US", + "validFrom": "2024-12-12T23:28:24.000Z", + "expires": "2027-09-08T23:28:24.000Z", + "keyAlgorithm": "RSA", + "keySize": 2048, + "signatureAlgorithm": "SHA256withRSA", + "version": 3, + "sha1Fingerprint": "B1B57BC2A8733287A1A9B65EB60BFFD01EFECEBA", + "sha256Fingerprint": "AA40F0AA0B7A438F15C49FA2A2EBE3B28AAB34A846781211BD170E8D7B06D291", + "status": "VALID" + }, + "x509File": { + "id": "gpmlavn03e4mknkyml4m2ak9q", + "fileData": "-----BEGIN CERTIFICATE-----\nMIIDnTCCAoWgAwIBAgIUS2TBCdRzpK4Zze+HDKjB9EQSHqYwDQYJKoZIhvcNAQELBQAwXjELMAkG\nA1UEBhMCVVMxCzAJBgNVBAgMAkNPMQ8wDQYDVQQHDAZEZW52ZXIxIjAgBgNVBAoMGVBpbmcgSWRl\nbnRpdHkgQ29ycG9yYXRpb24xDTALBgNVBAMMBHRlc3QwHhcNMjQxMjEyMjMyODI0WhcNMjcwOTA4\nMjMyODI0WjBeMQswCQYDVQQGEwJVUzELMAkGA1UECAwCQ08xDzANBgNVBAcMBkRlbnZlcjEiMCAG\nA1UECgwZUGluZyBJZGVudGl0eSBDb3Jwb3JhdGlvbjENMAsGA1UEAwwEdGVzdDCCASIwDQYJKoZI\nhvcNAQEBBQADggEPADCCAQoCggEBAJdoGurgDvSRBL2cIeUaCY3po5YDZnV1eyuOQTxQc6OT2JS0\n+40gJbJmfNrbcOSt+1DbxzP+Ixblkcz569VOC5lbROn38yeaMU32Xc/4DGSp1HCY/JfSygz/+qr8\n8YTqMaI21AbZnAiY5x0Rw56IDmJglXaXeVbCUJy7oPTyAoYYT93DJDk41Ze51UcTmUsTKN4K3gvv\nSaRuyq5+g6EXBq7AkeOnbP0bSHybN1KEV5BXNNpgk9h0Jw3PE+qkm/5nYRzxBf4RA/Agfv9esG9N\nz3XgDowAGBmxr+rU/na7pwEEudMh668DEDeRVwh1ZapYpBtVcxMHmdJPgFJrBlo6mMECAwEAAaNT\nMFEwHQYDVR0OBBYEFGJc3Z0j9kXPsTmmbgAsY/PK2cupMB8GA1UdIwQYMBaAFGJc3Z0j9kXPsTmm\nbgAsY/PK2cupMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAJVBvcHhh+00gzQ0\npnZKtRJxvEg+pGh+B9E+5i2PsNGyIAvAXw4mdBcQZKxfiXM31ZE2ge1mP+4di11+PKYNH2E973PL\nJ+wGHeQZ1ETDG5fo79t0MG1RzHtGoirZW7v4BNUI6ZM2FjEaCOtZg1rUhkdIfqDx4CeNjzb0rhXI\nzXNTS4Y6VlxWArQnwAgqPtb5poJG3Mm/3f6uQg/l0LIKTY/GR6yQsNCkzTZQhrIpXj4RpqnX3QgD\n1IWToMon7ntp4gAP/lASM5/xm5Jzb6dmF+hoN073g02UeV2TDLze80+K+Xr1GZeeULuXNrhOEXDR\nytvube8OXPPY6/zCphVb21g=\n-----END CERTIFICATE-----\n" + }, + "activeVerificationCert": true, + "encryptionCert": false + } + ] + }, + "modificationDate": "2025-01-31T22:32:17.051Z", + "creationDate": "2025-01-31T22:32:17.050Z", + "wsTrust": { + "attributeContract": { + "coreAttributes": [ + { + "name": "TOKEN_SUBJECT", + "masked": false + } + ], + "extendedAttributes": [] + }, + "tokenGeneratorMappings": [], + "generateLocalToken": false + } + } + ] + }, + { + "resourceType": "/idp/spConnections", + "operationType": "SAVE", + "items": [ + { + "type": "SP", + "id": "iIoQK.-GWcXI5kLp4KDNxQqAhDF", + "name": "test", + "entityId": "test", + "active": true, + "contactInfo": {}, + "loggingMode": "STANDARD", + "virtualEntityIds": [], + "credentials": { + "certs": [], + "signingSettings": { + "signingKeyPairRef": { + "id": "tiq4n26axjircjk30oz5zf6k3", + "location": "https://localhost:9999/pf-admin-api/v1/keyPairs/signing/tiq4n26axjircjk30oz5zf6k3" + }, + "algorithm": "SHA256withRSA", + "includeCertInSignature": false, + "includeRawKeyInSignature": false + } + }, + "modificationDate": "2025-01-31T22:32:17.901Z", + "creationDate": "2025-01-31T22:32:17.901Z", + "wsTrust": { + "partnerServiceIds": [ + "test" + ], + "oAuthAssertionProfiles": false, + "defaultTokenType": "SAML20", + "generateKey": false, + "encryptSaml2Assertion": false, + "minutesBefore": 5, + "minutesAfter": 30, + "attributeContract": { + "coreAttributes": [ + { + "name": "TOKEN_SUBJECT" + } + ], + "extendedAttributes": [] + }, + "tokenProcessorMappings": [ + { + "attributeSources": [], + "attributeContractFulfillment": { + "TOKEN_SUBJECT": { + "source": { + "type": "NO_MAPPING" + } + } + }, + "issuanceCriteria": { + "conditionalCriteria": [] + }, + "idpTokenProcessorRef": { + "id": "tokenprocessor", + "location": "https://localhost:9999/pf-admin-api/v1/idp/tokenProcessors/tokenprocessor" + }, + "restrictedVirtualEntityIds": [] + } + ] + }, + "connectionTargetType": "STANDARD" + } + ] + }, + { + "resourceType": "/session/settings", + "operationType": "SAVE", + "items": [ + { + "trackAdapterSessionsForLogout": false, + "revokeUserSessionOnLogout": true, + "sessionRevocationLifetime": 490 + } + ] + }, + { + "resourceType": "/session/applicationSessionPolicy", + "operationType": "SAVE", + "items": [ + { + "idleTimeoutMins": 60, + "maxTimeoutMins": 480 + } + ] + }, + { + "resourceType": "/session/authenticationSessionPolicies/global", + "operationType": "SAVE", + "items": [ + { + "enableSessions": false, + "persistentSessions": false, + "hashUniqueUserKeyAttribute": false, + "idleTimeoutMins": 60, + "idleTimeoutDisplayUnit": "MINUTES", + "maxTimeoutMins": 480, + "maxTimeoutDisplayUnit": "MINUTES" + } + ] + }, + { + "resourceType": "/session/authenticationSessionPolicies", + "operationType": "SAVE", + "items": [ + { + "id": "UfdnqYjWycSeo2vZZgSYB3gpw", + "authenticationSource": { + "type": "IDP_ADAPTER", + "sourceRef": { + "id": "OTIdPJava", + "location": "https://localhost:9999/pf-admin-api/v1/idp/adapters/OTIdPJava" + } + }, + "enableSessions": false, + "userDeviceType": "PRIVATE", + "persistent": false, + "timeoutDisplayUnit": "MINUTES", + "authnContextSensitive": false + } + ] + }, + { + "resourceType": "/oauth/issuers", + "operationType": "SAVE", + "items": [ + { + "id": "BmoJwEmyzs4RSNMzVUlCs8qTPC", + "name": "Test Issuer", + "description": "test issuer", + "host": "localhost", + "path": "" + } + ] + }, + { + "resourceType": "/additionalKeySets", + "operationType": "SAVE", + "items": [ + { + "id": "testID", + "name": "testName", + "description": "testDescription", + "signingKeys": { + "rsaActiveCertRef": { + "id": "tiq4n26axjircjk30oz5zf6k3", + "location": "https://localhost:9999/pf-admin-api/v1/keyPairs/signing/tiq4n26axjircjk30oz5zf6k3" + }, + "rsaPublishX5cParameter": true + }, + "issuers": [ + { + "id": "BmoJwEmyzs4RSNMzVUlCs8qTPC", + "location": "https://localhost:9999/pf-admin-api/v1/oauth/issuers/BmoJwEmyzs4RSNMzVUlCs8qTPC" + } + ] + } + ] + }, + { + "resourceType": "/oauth/idpAdapterMappings", + "operationType": "SAVE", + "items": [ + { + "attributeSources": [], + "attributeContractFulfillment": { + "USER_NAME": { + "source": { + "type": "CONTEXT" + }, + "value": "OAuthScopes" + }, + "USER_KEY": { + "source": { + "type": "ADAPTER" + }, + "value": "subject" + } + }, + "issuanceCriteria": { + "conditionalCriteria": [] + }, + "id": "OTIdPJava", + "idpAdapterRef": { + "id": "OTIdPJava", + "location": "https://localhost:9999/pf-admin-api/v1/idp/adapters/OTIdPJava" + } + } + ] + }, + { + "resourceType": "/oauth/authenticationPolicyContractMappings", + "operationType": "SAVE", + "items": [ + { + "attributeSources": [], + "attributeContractFulfillment": { + "USER_NAME": { + "source": { + "type": "CONTEXT" + }, + "value": "OAuthScopes" + }, + "USER_KEY": { + "source": { + "type": "AUTHENTICATION_POLICY_CONTRACT" + }, + "value": "subject" + } + }, + "issuanceCriteria": { + "conditionalCriteria": [] + }, + "id": "QGxlec5CX693lBQL", + "authenticationPolicyContractRef": { + "id": "QGxlec5CX693lBQL", + "location": "https://localhost:9999/pf-admin-api/v1/authenticationPolicyContracts/QGxlec5CX693lBQL" + } + } + ] + }, + { + "resourceType": "/oauth/outOfBandAuthPlugins", + "operationType": "SAVE", + "items": [ + { + "id": "exampleCibaAuthenticator", + "name": "exampleCibaAuthenticator", + "pluginDescriptorRef": { + "id": "com.pingidentity.oobauth.pingone.mfa.PingOneMfaCibaAuthenticator", + "location": "https://localhost:9999/pf-admin-api/v1/oauth/outOfBandAuthPlugins/descriptors/com.pingidentity.oobauth.pingone.mfa.PingOneMfaCibaAuthenticator" + }, + "configuration": { + "tables": [ + { + "name": "PingOne Template Variables", + "rows": [] + } + ], + "fields": [ + { + "name": "PingOne Environment", + "value": "noeOvj5ltBnf4rcmtZAKdJ|f5901536-2b60-4d4a-a987-3d56aadad46d" + }, + { + "name": "Application", + "value": "2a7c1b5d-415b-4fb5-a6c0-1e290f776785" + }, + { + "name": "PingOne Authentication Policy", + "value": "" + }, + { + "name": "Test Username", + "value": "" + }, + { + "name": "PingOne Template Name", + "value": "transaction" + }, + { + "name": "PingOne Template Variant", + "value": "" + }, + { + "name": "Client Context", + "value": "#*\nDefine additional key/value pairs to be received at the mobile application.\nThe following variables are available by default:\n\n$oobAuthRequestContext - Context for the out-of-band authentication/authorization request\n$languagePackMessages - The language-pack file configured for this authenticator\n$subject - The user's PingOne username or user ID.\n$JSONValue - A JSON utility class that can be used to escape text and convert objects to JSON.\n Methods:\n escape(String s) - Escape quotes, \\, /, \\r, \\n, \\b, \\f, \\t and other control characters (U+0000 through U+001F).\n toJSONString(Object value) - Convert an object to JSON text.\n\nAdditionally, any Extended Contract attributes are also available using the $name syntax.\n\nExample:\n\n{\n \"requestingApplicationName\": \"$JSONValue.escape($oobAuthRequestContext.requestingApplication.name)\",\n \"requestedScope\": $JSONValue.toJSONString($oobAuthRequestContext.requestedScope.values()),\n \"amount\": \"$JSONValue.escape($amount)\",\n \"alert.color\": \"red\"\n}\n*#" + }, + { + "name": "Messages Files", + "value": "pingone-mfa-messages" + }, + { + "name": "API Request Timeout", + "value": "12000" + }, + { + "name": "Proxy Settings", + "value": "System Defaults" + }, + { + "name": "Custom Proxy Host", + "value": "" + }, + { + "name": "Custom Proxy Port", + "value": "" + } + ] + }, + "lastModified": "2025-01-31T22:32:19.734Z", + "attributeContract": { + "coreAttributes": [ + { + "name": "subject" + } + ], + "extendedAttributes": [] + } + } + ] + }, + { + "resourceType": "/oauth/cibaServerPolicy/requestPolicies", + "operationType": "SAVE", + "items": [ + { + "id": "exampleCibaReqPolicy", + "name": "exampleCibaReqPolicy", + "authenticatorRef": { + "id": "exampleCibaAuthenticator", + "location": "https://localhost:9999/pf-admin-api/v1/oauth/outOfBandAuthPlugins/exampleCibaAuthenticator" + }, + "transactionLifetime": 120, + "allowUnsignedLoginHintToken": false, + "requireTokenForIdentityHint": false, + "alternativeLoginHintTokenIssuers": [], + "identityHintContract": { + "coreAttributes": [ + { + "name": "IDENTITY_HINT_SUBJECT" + } + ], + "extendedAttributes": [] + }, + "identityHintContractFulfillment": { + "attributeSources": [], + "attributeContractFulfillment": { + "IDENTITY_HINT_SUBJECT": { + "source": { + "type": "REQUEST" + }, + "value": "IDENTITY_HINT_SUBJECT" + } + }, + "issuanceCriteria": { + "conditionalCriteria": [] + } + }, + "identityHintMapping": { + "attributeSources": [], + "attributeContractFulfillment": { + "subject": { + "source": { + "type": "NO_MAPPING" + } + }, + "USER_KEY": { + "source": { + "type": "NO_MAPPING" + } + } + }, + "issuanceCriteria": { + "conditionalCriteria": [] + } + }, + "lastModified": "2025-01-31T22:32:19.764Z" + } + ] + }, + { + "resourceType": "/oauth/cibaServerPolicy/settings", + "operationType": "SAVE", + "items": [ + { + "defaultRequestPolicyRef": { + "id": "exampleCibaReqPolicy", + "location": "https://localhost:9999/pf-admin-api/v1/oauth/cibaServerPolicy/requestPolicies/exampleCibaReqPolicy" + } + } + ] + }, + { + "resourceType": "/oauth/openIdConnect/policies", + "operationType": "SAVE", + "items": [ + { + "id": "test-openid-connect-policy", + "name": "Test OpenID Connect Policy", + "idTokenLifetime": 5, + "attributeContract": { + "coreAttributes": [ + { + "name": "sub", + "multiValued": false + } + ], + "extendedAttributes": [] + }, + "attributeMapping": { + "attributeSources": [], + "attributeContractFulfillment": { + "sub": { + "source": { + "type": "TOKEN" + }, + "value": "OrgName" + } + }, + "issuanceCriteria": { + "conditionalCriteria": [] + } + }, + "includeSriInIdToken": false, + "includeUserInfoInIdToken": false, + "includeSHashInIdToken": false, + "includeX5tInIdToken": false, + "idTokenTypHeaderValue": "", + "returnIdTokenOnRefreshGrant": false, + "returnIdTokenOnTokenExchangeGrant": false, + "reissueIdTokenInHybridFlow": false, + "accessTokenManagerRef": { + "id": "jwt", + "location": "https://localhost:9999/pf-admin-api/v1/oauth/accessTokenManagers/jwt" + }, + "scopeAttributeMappings": {}, + "lastModified": "2025-01-31T22:32:19.793Z" + } + ] + }, + { + "resourceType": "/oauth/openIdConnect/settings", + "operationType": "SAVE", + "items": [ + { + "defaultPolicyRef": { + "id": "test-openid-connect-policy", + "location": "https://localhost:9999/pf-admin-api/v1/oauth/openIdConnect/policies/test-openid-connect-policy" + }, + "sessionSettings": { + "trackUserSessionsForLogout": false, + "revokeUserSessionOnLogout": true, + "sessionRevocationLifetime": 490 + } + } + ] + }, + { + "resourceType": "/oauth/tokenExchange/processor/policies", + "operationType": "SAVE", + "items": [ + { + "id": "tokenexchangeprocessorpolicy", + "name": "tokenexchangeprocessorpolicy", + "actorTokenRequired": false, + "attributeContract": { + "coreAttributes": [ + { + "name": "subject" + } + ], + "extendedAttributes": [] + }, + "processorMappings": [ + { + "attributeSources": [], + "attributeContractFulfillment": { + "subject": { + "source": { + "type": "TEXT" + }, + "value": "value" + } + }, + "issuanceCriteria": { + "conditionalCriteria": [ + { + "errorResult": "error", + "source": { + "type": "CONTEXT" + }, + "attributeName": "ClientIp", + "condition": "EQUALS", + "value": "value" + } + ] + }, + "subjectTokenType": "urn:ietf:params:oauth:token-type:saml2", + "subjectTokenProcessor": { + "id": "tokenprocessor", + "location": "https://localhost:9999/pf-admin-api/v1/idp/tokenProcessors/tokenprocessor" + }, + "actorTokenType": "", + "actorTokenProcessor": {} + } + ] + } + ] + }, + { + "resourceType": "/oauth/tokenExchange/processor/settings", + "operationType": "SAVE", + "items": [ + { + "defaultProcessorPolicyRef": { + "id": "tokenexchangeprocessorpolicy", + "location": "https://localhost:9999/pf-admin-api/v1/oauth/tokenExchange/processor/policies/tokenexchangeprocessorpolicy" + } + } + ] + }, + { + "resourceType": "/oauth/tokenExchange/generator/groups", + "operationType": "SAVE", + "items": [ + { + "id": "exampleGeneratorGroup", + "name": "exampleGeneratorGroup", + "resourceUris": [], + "generatorMappings": [ + { + "requestedTokenType": "urn:ietf:params:oauth:token-type:saml2", + "tokenGenerator": { + "id": "tokengenerator", + "location": "https://localhost:9999/pf-admin-api/v1/sp/tokenGenerators/tokengenerator" + }, + "defaultMapping": true + } + ] + }, + { + "id": "exampleGeneratorGroup2", + "name": "exampleGeneratorGroup2", + "resourceUris": [], + "generatorMappings": [ + { + "requestedTokenType": "urn:ietf:params:oauth:token-type:saml2", + "tokenGenerator": { + "id": "tokengenerator", + "location": "https://localhost:9999/pf-admin-api/v1/sp/tokenGenerators/tokengenerator" + }, + "defaultMapping": true + } + ] + } + ] + }, + { + "resourceType": "/oauth/tokenExchange/generator/settings", + "operationType": "SAVE", + "items": [ + { + "defaultGeneratorGroupRef": { + "id": "exampleGeneratorGroup", + "location": "https://localhost:9999/pf-admin-api/v1/oauth/tokenExchange/generator/groups/exampleGeneratorGroup" + } + } + ] + }, + { + "resourceType": "/oauth/tokenExchange/tokenGeneratorMappings", + "operationType": "SAVE", + "items": [ + { + "attributeSources": [], + "attributeContractFulfillment": { + "SAML_SUBJECT": { + "source": { + "type": "CONTEXT" + }, + "value": "OAuthScopes" + } + }, + "issuanceCriteria": { + "conditionalCriteria": [] + }, + "id": "tokenexchangeprocessorpolicy|tokengenerator", + "sourceId": "tokenexchangeprocessorpolicy", + "targetId": "tokengenerator" + } + ] + }, + { + "resourceType": "/oauth/clients", + "operationType": "SAVE", + "items": [ + { + "clientId": "test", + "enabled": true, + "redirectUris": [], + "grantTypes": [ + "CLIENT_CREDENTIALS", + "ACCESS_TOKEN_VALIDATION" + ], + "name": "test", + "modificationDate": "2025-01-31T22:32:19.927Z", + "creationDate": "2025-01-31T22:32:19.927Z", + "refreshRolling": "SERVER_DEFAULT", + "refreshTokenRollingIntervalType": "SERVER_DEFAULT", + "persistentGrantExpirationType": "SERVER_DEFAULT", + "persistentGrantExpirationTime": 0, + "persistentGrantExpirationTimeUnit": "DAYS", + "persistentGrantIdleTimeoutType": "SERVER_DEFAULT", + "persistentGrantIdleTimeout": 0, + "persistentGrantIdleTimeoutTimeUnit": "DAYS", + "persistentGrantReuseType": "SERVER_DEFAULT", + "allowAuthenticationApiInit": false, + "enableCookielessAuthenticationApi": false, + "bypassApprovalPage": false, + "restrictScopes": false, + "requirePushedAuthorizationRequests": false, + "requireJwtSecuredAuthorizationResponseMode": false, + "restrictedScopes": [], + "exclusiveScopes": [], + "restrictedResponseTypes": [], + "authorizationDetailTypes": [], + "defaultAccessTokenManagerRef": { + "id": "jwt", + "location": "https://localhost:9999/pf-admin-api/v1/oauth/accessTokenManagers/jwt" + }, + "restrictToDefaultAccessTokenManager": false, + "validateUsingAllEligibleAtms": false, + "oidcPolicy": { + "grantAccessSessionRevocationApi": false, + "grantAccessSessionSessionManagementApi": false, + "logoutMode": "NONE", + "pingAccessLogoutCapable": false, + "pairwiseIdentifierUserType": false + }, + "clientAuth": { + "type": "SECRET", + "encryptedSecret": "OBF:JWE:eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2Iiwia2lkIjoiUWVzOVR5eTV5WiIsInZlcnNpb24iOiIxMi4yLjAuNCJ9..ek9f1RsTFzvZAr2zYUAKUg.oF0lexeGQn1HT68sDwGGMJWkl9WmrTz5ThtJq-E0dsb13biwdjYQOvJCmonsjXZkuGaPPV0dfADekdPIod9zV5nGplpqH75FrnWhtr06_6I.yenJNLd7e8YH3mleNSxAMQ", + "secondarySecrets": [] + }, + "deviceFlowSettingType": "SERVER_DEFAULT", + "requireProofKeyForCodeExchange": false, + "refreshTokenRollingGracePeriodType": "SERVER_DEFAULT", + "clientSecretRetentionPeriodType": "SERVER_DEFAULT", + "requireDpop": false, + "requireOfflineAccessScopeToIssueRefreshTokens": "SERVER_DEFAULT", + "offlineAccessRequireConsentPrompt": "SERVER_DEFAULT", + "lockoutMaxMaliciousActionsType": "SERVER_DEFAULT", + "requireSignedRequests": false + } + ] + }, + { + "resourceType": "/oauth/clientRegistrationPolicies", + "operationType": "SAVE", + "items": [ + { + "id": "testRegistrationPolicy", + "name": "Test Registration Policy", + "pluginDescriptorRef": { + "id": "com.pingidentity.pf.client.registration.ResponseTypesConstraintsPlugin", + "location": "https://localhost:9999/pf-admin-api/v1/oauth/clientRegistrationPolicies/descriptors/com.pingidentity.pf.client.registration.ResponseTypesConstraintsPlugin" + }, + "configuration": { + "tables": [], + "fields": [ + { + "name": "code", + "value": "true" + }, + { + "name": "code id_token", + "value": "true" + }, + { + "name": "code id_token token", + "value": "true" + }, + { + "name": "code token", + "value": "true" + }, + { + "name": "id_token", + "value": "true" + }, + { + "name": "id_token token", + "value": "true" + }, + { + "name": "token", + "value": "true" + } + ] + }, + "lastModified": "2025-01-31T22:32:19.959Z" + } + ] + }, + { + "resourceType": "/oauth/clientSettings", + "operationType": "SAVE", + "items": [ + { + "clientMetadata": [ + { + "parameter": "authNexp", + "description": "Authentication Experience [Single_Factor | Internal | ID-First | Multi_Factor]", + "multiValued": false + }, + { + "parameter": "useAuthnApi", + "description": "Use the AuthN API", + "multiValued": false + } + ] + } + ] + }, + { + "resourceType": "/oauth/accessTokenMappings", + "operationType": "SAVE", + "items": [ + { + "attributeSources": [], + "attributeContractFulfillment": { + "Username": { + "source": { + "type": "TEXT" + }, + "value": "Administrator" + }, + "OrgName": { + "source": { + "type": "TEXT" + }, + "value": "Ping" + } + }, + "issuanceCriteria": { + "conditionalCriteria": [] + }, + "id": "client_credentials|jwt", + "context": { + "type": "CLIENT_CREDENTIALS" + }, + "accessTokenManagerRef": { + "id": "jwt", + "location": "https://localhost:9999/pf-admin-api/v1/oauth/accessTokenManagers/jwt" + } + }, + { + "attributeSources": [], + "attributeContractFulfillment": { + "Username": { + "source": { + "type": "TEXT" + }, + "value": "Administrator" + }, + "OrgName": { + "source": { + "type": "TEXT" + }, + "value": "Ping" + } + }, + "issuanceCriteria": { + "conditionalCriteria": [] + }, + "id": "default|jwt", + "context": { + "type": "DEFAULT" + }, + "accessTokenManagerRef": { + "id": "jwt", + "location": "https://localhost:9999/pf-admin-api/v1/oauth/accessTokenManagers/jwt" + } + } + ] + }, + { + "resourceType": "/authenticationSelectors", + "operationType": "SAVE", + "items": [ + { + "id": "authnExp", + "name": "AuthN Experiences", + "pluginDescriptorRef": { + "id": "com.pingidentity.pf.selectors.ExtendedPropertyAuthnSelector", + "location": "https://localhost:9999/pf-admin-api/v1/authenticationSelectors/descriptors/com.pingidentity.pf.selectors.ExtendedPropertyAuthnSelector" + }, + "configuration": { + "tables": [], + "fields": [ + { + "name": "Extended Property", + "value": "authNexp" + }, + { + "name": "Case-Sensitive Matching", + "value": "true" + }, + { + "name": "Enable 'No Match' Result Value", + "value": "false" + } + ] + }, + "lastModified": "2025-01-31T22:32:20.047Z", + "attributeContract": { + "extendedAttributes": [ + { + "name": "Single_Factor" + }, + { + "name": "Internal" + } + ] + } + } + ] + }, + { + "resourceType": "/authenticationApi", + "operationType": "SAVE", + "items": [ + { + "id": "myauthenticationapiapplication", + "url": "https://example.com", + "description": "example", + "additionalAllowedOrigins": [], + "name": "myauthenticationapiapplication" + } + ] + }, + { + "resourceType": "/authenticationApi/settings", + "operationType": "SAVE", + "items": [ + { + "apiEnabled": false, + "enableApiDescriptions": true, + "restrictAccessToRedirectlessMode": true, + "includeRequestContext": false + } + ] + }, + { + "resourceType": "/authenticationPolicies/fragments", + "operationType": "SAVE", + "items": [ + { + "id": "FirstFactor", + "name": "First_Factor", + "description": "Used for Customer First Factor", + "rootNode": { + "action": { + "type": "AUTHN_SOURCE", + "authenticationSource": { + "type": "IDP_ADAPTER", + "sourceRef": { + "id": "ciamHtmlForm", + "location": "https://localhost:9999/pf-admin-api/v1/idp/adapters/ciamHtmlForm" + } + }, + "attributeRules": { + "items": [ + { + "attributeSource": { + "type": "ADAPTER", + "id": "ciamHtmlForm" + }, + "attributeName": "policy.action", + "condition": "EQUALS_CASE_INSENSITIVE", + "expectedValue": "identity.registration", + "result": "Register" + } + ], + "fallbackToSuccess": true + } + }, + "children": [ + { + "action": { + "type": "DONE", + "context": "Fail" + } + }, + { + "action": { + "type": "LOCAL_IDENTITY_MAPPING", + "context": "Register", + "localIdentityRef": { + "id": "regIdentityProfile", + "location": "https://localhost:9999/pf-admin-api/v1/localIdentity/identityProfiles/regIdentityProfile" + }, + "inboundMapping": { + "attributeSources": [], + "attributeContractFulfillment": {}, + "issuanceCriteria": { + "conditionalCriteria": [] + } + }, + "outboundAttributeMapping": { + "attributeSources": [], + "attributeContractFulfillment": { + "firstName": { + "source": { + "type": "LOCAL_IDENTITY_PROFILE", + "id": "regIdentityProfile" + }, + "value": "firstName" + }, + "lastName": { + "source": { + "type": "LOCAL_IDENTITY_PROFILE", + "id": "regIdentityProfile" + }, + "value": "lastName" + }, + "ImmutableID": { + "source": { + "type": "LOCAL_IDENTITY_PROFILE", + "id": "regIdentityProfile" + }, + "value": "ImmutableID" + }, + "mail": { + "source": { + "type": "LOCAL_IDENTITY_PROFILE", + "id": "regIdentityProfile" + }, + "value": "email" + }, + "subject": { + "source": { + "type": "LOCAL_IDENTITY_PROFILE", + "id": "regIdentityProfile" + }, + "value": "username" + }, + "SAML_AUTHN_CTX": { + "source": { + "type": "TEXT" + }, + "value": "registered" + } + }, + "issuanceCriteria": { + "conditionalCriteria": [] + } + } + } + }, + { + "action": { + "type": "LOCAL_IDENTITY_MAPPING", + "context": "Success", + "localIdentityRef": { + "id": "regIdentityProfile", + "location": "https://localhost:9999/pf-admin-api/v1/localIdentity/identityProfiles/regIdentityProfile" + }, + "inboundMapping": { + "attributeSources": [], + "attributeContractFulfillment": { + "pf.local.identity.unique.id": { + "source": { + "type": "ADAPTER", + "id": "ciamHtmlForm" + }, + "value": "uid" + } + }, + "issuanceCriteria": { + "conditionalCriteria": [] + } + }, + "outboundAttributeMapping": { + "attributeSources": [], + "attributeContractFulfillment": { + "firstName": { + "source": { + "type": "LOCAL_IDENTITY_PROFILE", + "id": "regIdentityProfile" + }, + "value": "firstName" + }, + "lastName": { + "source": { + "type": "LOCAL_IDENTITY_PROFILE", + "id": "regIdentityProfile" + }, + "value": "lastName" + }, + "ImmutableID": { + "source": { + "type": "LOCAL_IDENTITY_PROFILE", + "id": "regIdentityProfile" + }, + "value": "ImmutableID" + }, + "mail": { + "source": { + "type": "LOCAL_IDENTITY_PROFILE", + "id": "regIdentityProfile" + }, + "value": "email" + }, + "subject": { + "source": { + "type": "ADAPTER", + "id": "ciamHtmlForm" + }, + "value": "username" + }, + "SAML_AUTHN_CTX": { + "source": { + "type": "TEXT" + }, + "value": "single_factor" + } + }, + "issuanceCriteria": { + "conditionalCriteria": [] + } + } + } + } + ] + }, + "inputs": { + "id": "DkhZxRcZchsed90U", + "location": "https://localhost:9999/pf-admin-api/v1/authenticationPolicyContracts/DkhZxRcZchsed90U" + }, + "outputs": { + "id": "samplePolicyContract", + "location": "https://localhost:9999/pf-admin-api/v1/authenticationPolicyContracts/samplePolicyContract" + } + }, + { + "id": "Identify_First", + "name": "Identify_First", + "description": "Used for First Factors that just use the User Identifier", + "rootNode": { + "action": { + "type": "AUTHN_SOURCE", + "authenticationSource": { + "type": "IDP_ADAPTER", + "sourceRef": { + "id": "IDFirst", + "location": "https://localhost:9999/pf-admin-api/v1/idp/adapters/IDFirst" + } + }, + "inputUserIdMapping": { + "source": { + "type": "INPUTS", + "id": "Inputs" + }, + "value": "subject" + }, + "userIdAuthenticated": false + }, + "children": [ + { + "action": { + "type": "DONE", + "context": "Fail" + } + }, + { + "action": { + "type": "APC_MAPPING", + "context": "Success", + "authenticationPolicyContractRef": { + "id": "DkhZxRcZchsed90U", + "location": "https://localhost:9999/pf-admin-api/v1/authenticationPolicyContracts/DkhZxRcZchsed90U" + }, + "attributeMapping": { + "attributeSources": [], + "attributeContractFulfillment": { + "subject": { + "source": { + "type": "ADAPTER", + "id": "IDFirst" + }, + "value": "uid" + } + }, + "issuanceCriteria": { + "conditionalCriteria": [] + } + } + } + } + ] + }, + "inputs": { + "id": "DkhZxRcZchsed90U", + "location": "https://localhost:9999/pf-admin-api/v1/authenticationPolicyContracts/DkhZxRcZchsed90U" + }, + "outputs": { + "id": "DkhZxRcZchsed90U", + "location": "https://localhost:9999/pf-admin-api/v1/authenticationPolicyContracts/DkhZxRcZchsed90U" + } + }, + { + "id": "InternalAuthN", + "name": "Internal AuthN", + "description": "Used for Internal Authentication", + "rootNode": { + "action": { + "type": "AUTHN_SOURCE", + "authenticationSource": { + "type": "IDP_ADAPTER", + "sourceRef": { + "id": "htmlForm", + "location": "https://localhost:9999/pf-admin-api/v1/idp/adapters/htmlForm" + } + } + }, + "children": [ + { + "action": { + "type": "DONE", + "context": "Fail" + } + }, + { + "action": { + "type": "APC_MAPPING", + "context": "Success", + "authenticationPolicyContractRef": { + "id": "default", + "location": "https://localhost:9999/pf-admin-api/v1/authenticationPolicyContracts/default" + }, + "attributeMapping": { + "attributeSources": [], + "attributeContractFulfillment": { + "firstName": { + "source": { + "type": "NO_MAPPING" + } + }, + "lastName": { + "source": { + "type": "NO_MAPPING" + } + }, + "ImmutableID": { + "source": { + "type": "ADAPTER", + "id": "htmlForm" + }, + "value": "entryUUID" + }, + "mail": { + "source": { + "type": "ADAPTER", + "id": "htmlForm" + }, + "value": "mail" + }, + "subject": { + "source": { + "type": "ADAPTER", + "id": "htmlForm" + }, + "value": "uid" + }, + "SAML_AUTHN_CTX": { + "source": { + "type": "TEXT" + }, + "value": "internal" + } + }, + "issuanceCriteria": { + "conditionalCriteria": [] + } + } + } + } + ] + }, + "inputs": { + "id": "DkhZxRcZchsed90U", + "location": "https://localhost:9999/pf-admin-api/v1/authenticationPolicyContracts/DkhZxRcZchsed90U" + }, + "outputs": { + "id": "default", + "location": "https://localhost:9999/pf-admin-api/v1/authenticationPolicyContracts/default" + } + } + ] + }, + { + "resourceType": "/authenticationPolicies/default", + "operationType": "SAVE", + "items": [ + { + "failIfNoSelection": false, + "authnSelectionTrees": [], + "defaultAuthenticationSources": [], + "trackedHttpParameters": [] + } + ] + }, + { + "resourceType": "/authenticationPolicies/settings", + "operationType": "SAVE", + "items": [ + { + "enableIdpAuthnSelection": false, + "enableSpAuthnSelection": false + } + ] + } + ] +}