Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Management --> Application Authentication Script Management API | Update Applica
Management --> Claim Management API | Create Claim, Update Claim, Delete Claim, View Claim
Management --> Identity Provider Management API | Create Identity Provider, Update Identity Provider, Delete Identity Provider, View Identity Provider
Management --> Userstore Management API | Create Userstore, Update Userstore, Delete Userstore, View Userstore
Management --> OIDC Scope Management API | Create OIDC Scopes, Update OIDC Scopes, Delete OIDC Scopes, View OIDC Scopes
6. Take note of the client ID and client secret of this application.
Expand Down Expand Up @@ -84,6 +85,7 @@ The supported resource types to transfer resources between root organizations ar
* Identity Providers
* Claims
* User Stores
* OIDC Scopes
The supported resource types to transfer resources between sub organizations are:
* Applications
Expand Down
10 changes: 7 additions & 3 deletions docs/cli-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Currently, the supported resource types are:
* Identity Providers
* Claims
* User Stores
* OIDC Scopes

## Run the tool in CLI mode
To run the tool in CLI mode, follow the steps given below.
Expand Down Expand Up @@ -158,7 +159,7 @@ Example configuration file:
```
{
"ALLOW_DELETE" : true,
"EXCLUDE" : ["Claims"]
"EXCLUDE" : ["Claims"],
"APPLICATIONS" : {
"EXCLUDE" : ["App1", "App2"]
},
Expand All @@ -167,11 +168,14 @@ Example configuration file:
"EXCLUDE_SECRETS" : false
},
"USERSTORES" : {
"EXCLUDE" : ["US1", "US2"],
"EXCLUDE" : ["US1", "US2"]
},
"CLAIMS" : {
"INCLUDE_ONLY" : ["local"],
"INCLUDE_ONLY" : ["local"]
},
"OIDC_SCOPES" : {
"EXCLUDE" : ["Scope1"]
}
}
```
The following properties can be configured through the tool configs to manage your resources.
Expand Down
24 changes: 18 additions & 6 deletions iamctl/cmd/cli/exportAll.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ import (
"github.com/wso2-extensions/identity-tools-cli/iamctl/pkg/applications"
claims "github.com/wso2-extensions/identity-tools-cli/iamctl/pkg/claims"
identityproviders "github.com/wso2-extensions/identity-tools-cli/iamctl/pkg/identityProviders"
oidcScopes "github.com/wso2-extensions/identity-tools-cli/iamctl/pkg/oidcScopes"
roles "github.com/wso2-extensions/identity-tools-cli/iamctl/pkg/roles"
userstores "github.com/wso2-extensions/identity-tools-cli/iamctl/pkg/userStores"
"github.com/wso2-extensions/identity-tools-cli/iamctl/pkg/utils"
)

var exportAllCmd = &cobra.Command{
Use: "exportAll",
Short: "Export all applications",
Long: `You can export all applications available in the target environment`,
Short: "Export all resources",
Long: `You can export all resources available in the target environment`,
Run: func(cmd *cobra.Command, args []string) {
outputDirPath, _ := cmd.Flags().GetString("outputDir")
format, _ := cmd.Flags().GetString("format")
Expand All @@ -42,10 +44,20 @@ var exportAllCmd = &cobra.Command{
outputDirPath = baseDir
}

claims.ExportAll(outputDirPath, format)
identityproviders.ExportAll(outputDirPath, format)
applications.ExportAll(outputDirPath, format)
userstores.ExportAll(outputDirPath, format)
exportFunctions := map[utils.ResourceType]func(string, string){
utils.CLAIMS: claims.ExportAll,
utils.IDENTITY_PROVIDERS: identityproviders.ExportAll,
utils.APPLICATIONS: applications.ExportAll,
utils.USERSTORES: userstores.ExportAll,
utils.OIDC_SCOPES: oidcScopes.ExportAll,
utils.ROLES: roles.ExportAll,
}

for _, resourceType := range utils.ResourceOrder {
if exportFunc, exists := exportFunctions[resourceType]; exists {
exportFunc(outputDirPath, format)
}
}

utils.PrintSummary(utils.EXPORT)
},
Expand Down
24 changes: 18 additions & 6 deletions iamctl/cmd/cli/importAll.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,16 @@ import (
"github.com/wso2-extensions/identity-tools-cli/iamctl/pkg/applications"
claims "github.com/wso2-extensions/identity-tools-cli/iamctl/pkg/claims"
identityproviders "github.com/wso2-extensions/identity-tools-cli/iamctl/pkg/identityProviders"
oidcScopes "github.com/wso2-extensions/identity-tools-cli/iamctl/pkg/oidcScopes"
roles "github.com/wso2-extensions/identity-tools-cli/iamctl/pkg/roles"
userstores "github.com/wso2-extensions/identity-tools-cli/iamctl/pkg/userStores"
"github.com/wso2-extensions/identity-tools-cli/iamctl/pkg/utils"
)

var importAllCmd = &cobra.Command{
Use: "importAll",
Short: "Import all applications",
Long: `You can import all applications to the target environment`,
Short: "Import all resources",
Long: `You can import all resources to the target environment`,
Run: func(cmd *cobra.Command, args []string) {
inputDirPath, _ := cmd.Flags().GetString("inputDir")
configFile, _ := cmd.Flags().GetString("config")
Expand All @@ -41,10 +43,20 @@ var importAllCmd = &cobra.Command{
inputDirPath = baseDir
}

claims.ImportAll(inputDirPath)
identityproviders.ImportAll(inputDirPath)
applications.ImportAll(inputDirPath)
userstores.ImportAll(inputDirPath)
importFunctions := map[utils.ResourceType]func(string){
utils.CLAIMS: claims.ImportAll,
utils.IDENTITY_PROVIDERS: identityproviders.ImportAll,
utils.APPLICATIONS: applications.ImportAll,
utils.USERSTORES: userstores.ImportAll,
utils.OIDC_SCOPES: oidcScopes.ImportAll,
utils.ROLES: roles.ImportAll,
}

for _, resourceType := range utils.ResourceOrder {
if importFunc, exists := importFunctions[resourceType]; exists {
importFunc(inputDirPath)
}
}

utils.PrintSummary(utils.IMPORT)
},
Expand Down
5 changes: 2 additions & 3 deletions iamctl/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ go 1.13

require (
github.com/AlecAivazis/survey/v2 v2.0.5
github.com/kabukky/httpscerts v0.0.0-20150320125433-617593d7dcb3
github.com/karalabe/xgo v0.0.0-20191115072854-c5ccff8648a7 // indirect
github.com/clbanning/mxj/v2 v2.7.0
github.com/mbndr/figlet4go v0.0.0-20190224160619-d6cef5b186ea
github.com/mitchellh/go-homedir v1.1.0
github.com/pelletier/go-toml v1.6.0 // indirect
Expand All @@ -18,5 +17,5 @@ require (
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 // indirect
golang.org/x/sys v0.0.0-20191210023423-ac6580df4449 // indirect
golang.org/x/text v0.3.2 // indirect
gopkg.in/yaml.v2 v2.2.7 // indirect
gopkg.in/yaml.v3 v3.0.1
)
24 changes: 6 additions & 18 deletions iamctl/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5
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/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc=
github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME=
github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk=
github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE=
Expand Down Expand Up @@ -40,6 +42,7 @@ github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfb
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/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/go-cmp v0.2.0 h1:+dTQ8DZQJz0Mb/HjFlkptS1FeQ4cWSnN941F8aEG4SQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1 h1:EGx4pi6eqNxGaHF6qqu48+N2wcFQ5qg5FXgOdqsJ5d8=
github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY=
Expand All @@ -57,10 +60,6 @@ github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22
github.com/jtolds/gls v4.20.0+incompatible h1:xdiiI2gbIgH/gLH7ADydsJ1uDOEzR8yvV7C0MuV77Wo=
github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU=
github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
github.com/kabukky/httpscerts v0.0.0-20150320125433-617593d7dcb3 h1:Iy7Ifq2ysilWU4QlCx/97OoI4xT1IV7i8byT/EyIT/M=
github.com/kabukky/httpscerts v0.0.0-20150320125433-617593d7dcb3/go.mod h1:BYpt4ufZiIGv2nXn4gMxnfKV306n3mWXgNu/d2TqdTU=
github.com/karalabe/xgo v0.0.0-20191115072854-c5ccff8648a7 h1:AYzjK/SHz6m6mg5iuFwkrAhCc14jvCpW9d6frC9iDPE=
github.com/karalabe/xgo v0.0.0-20191115072854-c5ccff8648a7/go.mod h1:iYGcTYIPUvEWhFo6aKUuLchs+AV4ssYdyuBbQJZGcBk=
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 h1:Z9n2FFNUXsshfwJMBgNA0RU6/i7WVaAegv3PtuIHPMs=
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q=
Expand All @@ -74,7 +73,6 @@ github.com/kr/pty v1.1.4 h1:5Myjjh3JY/NaAi4IsUbHADytDyl1VE1Y9PXDlL+P/VQ=
github.com/kr/pty v1.1.4/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/magiconair/properties v1.8.0 h1:LLgXmsheXeRoUOBOjtwPQCWIYqM/LU1ayDtDePerRcY=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/magiconair/properties v1.8.1 h1:ZC2Vc7/ZFkGmsVC9KvOjumD+G5lXy2RtTKyzRKO2BQ4=
github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
Expand All @@ -93,7 +91,6 @@ github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQz
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
github.com/pelletier/go-toml v1.6.0 h1:aetoXYr0Tv7xRU/V4B4IZJ2QcbtMUFoNb3ORp7TzIK4=
github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys=
Expand All @@ -118,31 +115,25 @@ github.com/smartystreets/goconvey v1.6.4 h1:fv0U8FUIMPNf1L9lnHLvLhgicrIVChEkdzIK
github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA=
github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM=
github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA=
github.com/spf13/afero v1.1.2 h1:m8/z1t7/fwjysjQRYbP0RD+bUIF/8tJwPdEZsI83ACI=
github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ=
github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc=
github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk=
github.com/spf13/cast v1.3.0 h1:oget//CVOEoFewqQxwr0Ej5yjygnqGkvggSE/gB35Q8=
github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cobra v0.0.5 h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s=
github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU=
github.com/spf13/jwalterweatherman v1.0.0 h1:XHEdyB+EcvlqZamSM4ZOMGlc93t6AcsBEu9Gc1vn7yk=
github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo=
github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk=
github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo=
github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg=
github.com/spf13/viper v1.3.2 h1:VUFqw5KcqRf7i70GOzW7N+Q7+gxVBkSSqiXB12+JQ4M=
github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s=
github.com/spf13/viper v1.6.1 h1:VPZzIkznI1YhVMRi6vNFLHSwhnhReBfgTxIPccpfdZk=
github.com/spf13/viper v1.6.1/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
Expand All @@ -160,7 +151,6 @@ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/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-20190530122614-20be4c3c3ed5 h1:8dUaAV7K4uHsF56JQWkprecIQKdPHtR9jCHF5nB8uzc=
golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 h1:HuIa8hRrWRSrqYzx1qI49NNxhdi2PrY7gxVSq1JjLDc=
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
Expand All @@ -180,15 +170,13 @@ golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5h
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/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-20181205085412-a5c9d58dba9a h1:1n5lsVfiQW3yfsRGu98756EH1YthsFqr/5mxHduZW2A=
golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/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-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190530182044-ad28b68e88f1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191210023423-ac6580df4449 h1:gSbV7h1NRL2G1xTg/owz62CST1oJBmxy4QpMMregXVQ=
golang.org/x/sys v0.0.0-20191210023423-ac6580df4449/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
Expand All @@ -211,9 +199,9 @@ gopkg.in/ini.v1 v1.51.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo=
gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74=
gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.7 h1:VUgggvou5XRW9mHwD/yXxIYSMtY0zoKQf/v226p2nyo=
gopkg.in/yaml.v2 v2.2.7/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
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=
6 changes: 3 additions & 3 deletions iamctl/pkg/applications/applicationUtils.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"text/tabwriter"

"github.com/wso2-extensions/identity-tools-cli/iamctl/pkg/utils"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)

type Application struct {
Expand Down Expand Up @@ -120,12 +120,12 @@ func getTotalAppCount() (count int, err error) {
if statusCode == 200 {
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return -1, fmt.Errorf("error when reading the retrived app list. %w", err)
return -1, fmt.Errorf("error when reading the retrieved app list. %w", err)
}

err = json.Unmarshal(body, &list)
if err != nil {
return -1, fmt.Errorf("error when unmarshalling the retrived app list. %w", err)
return -1, fmt.Errorf("error when unmarshalling the retrieved app list. %w", err)
}
resp.Body.Close()

Expand Down
2 changes: 1 addition & 1 deletion iamctl/pkg/applications/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func ExportAll(exportFilePath string, format string) {

// Export all applications to the Applications folder.
log.Println("Exporting applications...")
exportFilePath = filepath.Join(exportFilePath, utils.APPLICATIONS)
exportFilePath = filepath.Join(exportFilePath, utils.APPLICATIONS.String())

if utils.IsResourceTypeExcluded(utils.APPLICATIONS) {
return
Expand Down
4 changes: 2 additions & 2 deletions iamctl/pkg/applications/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ import (
"strings"

"github.com/wso2-extensions/identity-tools-cli/iamctl/pkg/utils"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)

func ImportAll(inputDirPath string) {

log.Println("Importing applications...")
importFilePath := filepath.Join(inputDirPath, utils.APPLICATIONS)
importFilePath := filepath.Join(inputDirPath, utils.APPLICATIONS.String())

if utils.IsResourceTypeExcluded(utils.APPLICATIONS) {
return
Expand Down
6 changes: 3 additions & 3 deletions iamctl/pkg/claims/claimUtils.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"regexp"

"github.com/wso2-extensions/identity-tools-cli/iamctl/pkg/utils"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)

type claimDialect struct {
Expand All @@ -51,12 +51,12 @@ func getClaimDialectsList() ([]claimDialect, error) {
if statusCode == 200 {
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
return nil, fmt.Errorf("error when reading the retrived claim dialect list. %w", err)
return nil, fmt.Errorf("error when reading the retrieved claim dialect list. %w", err)
}

err = json.Unmarshal(body, &list)
if err != nil {
return nil, fmt.Errorf("error when unmarshalling the retrived claim dialect list. %w", err)
return nil, fmt.Errorf("error when unmarshalling the retrieved claim dialect list. %w", err)
}
resp.Body.Close()

Expand Down
2 changes: 1 addition & 1 deletion iamctl/pkg/claims/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func ExportAll(exportFilePath string, format string) {
log.Println("Exporting claims for sub organization not supported.")
return
}
exportFilePath = filepath.Join(exportFilePath, utils.CLAIMS)
exportFilePath = filepath.Join(exportFilePath, utils.CLAIMS.String())

if utils.IsResourceTypeExcluded(utils.CLAIMS) {
return
Expand Down
4 changes: 2 additions & 2 deletions iamctl/pkg/claims/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"strings"

"github.com/wso2-extensions/identity-tools-cli/iamctl/pkg/utils"
"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"
)

func ImportAll(inputDirPath string) {
Expand All @@ -37,7 +37,7 @@ func ImportAll(inputDirPath string) {
log.Println("Importing claims for sub organization not supported.")
return
}
importFilePath := filepath.Join(inputDirPath, utils.CLAIMS)
importFilePath := filepath.Join(inputDirPath, utils.CLAIMS.String())

if utils.IsResourceTypeExcluded(utils.CLAIMS) {
return
Expand Down
Loading