diff --git a/.ci-mgmt.yaml b/.ci-mgmt.yaml index c7b5b3cf..bc6b7aa0 100644 --- a/.ci-mgmt.yaml +++ b/.ci-mgmt.yaml @@ -20,4 +20,7 @@ actions: run: make upstream - name: Setup local Keycloak run: make -C upstream local + - name: Run provider tests + run: | + cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt pulumiConvert: 1 diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 1e9d3982..28811a92 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -471,6 +471,9 @@ jobs: run: make upstream - name: Setup local Keycloak run: make -C upstream local + - name: Run provider tests + run: | + cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - name: Run tests run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt diff --git a/.github/workflows/prerelease.yml b/.github/workflows/prerelease.yml index f387bf36..1ccc7fd3 100644 --- a/.github/workflows/prerelease.yml +++ b/.github/workflows/prerelease.yml @@ -436,6 +436,9 @@ jobs: run: make upstream - name: Setup local Keycloak run: make -C upstream local + - name: Run provider tests + run: | + cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - name: Run tests run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 298f0629..6a8121cd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -467,6 +467,9 @@ jobs: run: make upstream - name: Setup local Keycloak run: make -C upstream local + - name: Run provider tests + run: | + cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - name: Run tests run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt diff --git a/.github/workflows/run-acceptance-tests.yml b/.github/workflows/run-acceptance-tests.yml index a58e687f..d663ad1d 100644 --- a/.github/workflows/run-acceptance-tests.yml +++ b/.github/workflows/run-acceptance-tests.yml @@ -400,6 +400,9 @@ jobs: run: make upstream - name: Setup local Keycloak run: make -C upstream local + - name: Run provider tests + run: | + cd provider && go test -v -json -count=1 -cover -timeout 2h -tags=${{ matrix.language }} -parallel 4 . 2>&1 | tee /tmp/gotest.log | gotestfmt - name: Run tests if: matrix.testTarget == 'local' run: cd examples && go test -v -json -count=1 -cover -timeout 2h -tags=${{ diff --git a/provider/go.mod b/provider/go.mod index 7afea0d8..2f0413ed 100644 --- a/provider/go.mod +++ b/provider/go.mod @@ -10,8 +10,10 @@ replace ( require ( github.com/mrparkers/terraform-provider-keycloak v0.0.0-00010101000000-000000000000 + github.com/pulumi/providertest v0.0.11 github.com/pulumi/pulumi-terraform-bridge/v3 v3.84.0 github.com/pulumi/pulumi/sdk/v3 v3.118.0 + github.com/stretchr/testify v1.9.0 ) require ( @@ -78,6 +80,7 @@ require ( github.com/ettle/strcase v0.1.1 // indirect github.com/fatih/color v1.16.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect + github.com/fsnotify/fsnotify v1.7.0 // indirect github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813 // indirect github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect github.com/go-git/go-billy/v5 v5.5.0 // indirect @@ -162,6 +165,7 @@ require ( github.com/muesli/reflow v0.3.0 // indirect github.com/muesli/termenv v0.15.2 // indirect github.com/natefinch/atomic v1.0.1 // indirect + github.com/nxadm/tail v1.4.11 // indirect github.com/oklog/run v1.1.0 // indirect github.com/opentracing/basictracer-go v1.1.0 // indirect github.com/opentracing/opentracing-go v1.2.0 // indirect @@ -196,7 +200,6 @@ require ( github.com/spf13/cast v1.5.0 // indirect github.com/spf13/cobra v1.8.0 // indirect github.com/spf13/pflag v1.0.5 // indirect - github.com/stretchr/testify v1.9.0 // indirect github.com/texttheater/golang-levenshtein v1.0.1 // indirect github.com/tweekmonster/luser v0.0.0-20161003172636-3fa38070dbd7 // indirect github.com/uber/jaeger-client-go v2.30.0+incompatible // indirect @@ -238,6 +241,7 @@ require ( google.golang.org/genproto/googleapis/rpc v0.0.0-20240311173647-c811ad7063a7 // indirect google.golang.org/grpc v1.63.2 // indirect google.golang.org/protobuf v1.34.0 // indirect + gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect gopkg.in/warnings.v0 v0.1.2 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect lukechampine.com/frand v1.4.2 // indirect diff --git a/provider/go.sum b/provider/go.sum index 0931f880..61dfe08b 100644 --- a/provider/go.sum +++ b/provider/go.sum @@ -1385,9 +1385,18 @@ github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3 github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= +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/gedex/inflector v0.0.0-20170307190818-16278e9db813 h1:Uc+IZ7gYqAf/rSGFplbWBSHaGolEQlNLgMgSE3ccnIQ= github.com/gedex/inflector v0.0.0-20170307190818-16278e9db813/go.mod h1:P+oSoE9yhSRvsmYyZsshflcR6ePWYLql6UU1amW13IM= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gkampitakis/ciinfo v0.3.0 h1:gWZlOC2+RYYttL0hBqcoQhM7h1qNkVqvRCV1fOvpAv8= +github.com/gkampitakis/ciinfo v0.3.0/go.mod h1:1NIwaOcFChN4fa/B0hEBdAb6npDlFL8Bwx4dfRLRqAo= +github.com/gkampitakis/go-diff v1.3.2 h1:Qyn0J9XJSDTgnsgHRdz9Zp24RaJeKMUHg2+PDZZdC4M= +github.com/gkampitakis/go-diff v1.3.2/go.mod h1:LLgOrpqleQe26cte8s36HTWcTmMEur6OPYerdAAS9tk= +github.com/gkampitakis/go-snaps v0.4.9 h1:x6+GEQeYWC+cnLNsHK5uXXgEQADmlH/1EqMrjfXjzk8= +github.com/gkampitakis/go-snaps v0.4.9/go.mod h1:8HW4KX3JKV8M0GSw69CvT+Jqhd1AlBPMPpBfjBI3bdY= github.com/gliderlabs/ssh v0.3.5/go.mod h1:8XB4KraRrX39qHhT6yxPsHedjA08I/uBVwj4xC+/+z4= github.com/gliderlabs/ssh v0.3.7 h1:iV3Bqi942d9huXnzEF2Mt+CY9gLu8DNM4Obd+8bODRE= github.com/gliderlabs/ssh v0.3.7/go.mod h1:zpHEXBstFnQYtGnB8k8kQLol82umzn/2/snG7alWVD8= @@ -1825,6 +1834,8 @@ github.com/nightlyone/lockfile v1.0.0 h1:RHep2cFKK4PonZJDdEl4GmkabuhbsRMgk/k3uAm github.com/nightlyone/lockfile v1.0.0/go.mod h1:rywoIealpdNse2r832aiD9jRk8ErCatROs6LzC841CI= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/nxadm/tail v1.4.11 h1:8feyoE3OzPrcshW5/MJ4sGESc5cqmGkGCWlco4l0bqY= +github.com/nxadm/tail v1.4.11/go.mod h1:OTaG3NK980DZzxbRq6lEuzgU+mug70nY11sMd4JXXHc= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= @@ -2002,6 +2013,14 @@ github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsT github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/texttheater/golang-levenshtein v1.0.1 h1:+cRNoVrfiwufQPhoMzB6N0Yf/Mqajr6t1lOv8GyGE2U= github.com/texttheater/golang-levenshtein v1.0.1/go.mod h1:PYAKrbF5sAiq9wd+H82hs7gNaen0CplQ9uvm6+enD/8= +github.com/tidwall/gjson v1.17.0 h1:/Jocvlh98kcTfpN2+JzGQWQcqrPQwDrVEMApx/M5ZwM= +github.com/tidwall/gjson v1.17.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= +github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= +github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4= +github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= +github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= +github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= github.com/tweekmonster/luser v0.0.0-20161003172636-3fa38070dbd7 h1:X9dsIWPuuEJlPX//UmRKophhOKCGXc46RVIGuttks68= github.com/tweekmonster/luser v0.0.0-20161003172636-3fa38070dbd7/go.mod h1:UxoP3EypF8JfGEjAII8jx1q8rQyDnX8qdTCs/UQBVIE= github.com/uber/jaeger-client-go v2.30.0+incompatible h1:D6wyKGCecFaSRUpo8lCVbaOOb6ThwMmTEbhRwtKR97o= @@ -2412,6 +2431,7 @@ golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220825204002-c680a09ffe64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220829200755-d48e67d00261/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= @@ -2931,6 +2951,7 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EV gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= diff --git a/provider/provider_program_test.go b/provider/provider_program_test.go new file mode 100644 index 00000000..9108bc0f --- /dev/null +++ b/provider/provider_program_test.go @@ -0,0 +1,125 @@ +//go:build !go && !nodejs && !python && !dotnet +// +build !go,!nodejs,!python,!dotnet + +package keycloak + +import ( + "os" + "path/filepath" + "testing" + + "github.com/stretchr/testify/require" + + "github.com/pulumi/providertest" + "github.com/pulumi/providertest/optproviderupgrade" + "github.com/pulumi/providertest/pulumitest" + "github.com/pulumi/providertest/pulumitest/assertpreview" + "github.com/pulumi/providertest/pulumitest/opttest" + "github.com/pulumi/pulumi/sdk/v3/go/auto" +) + +const providerName = "keycloak" +const defaultBaselineVersion = "5.3.1" + +var programs = []string{ + "test-programs/index_grouproles", + "test-programs/index_role", + "test-programs/index_user", + "test-programs/authentication_executionconfig", + "test-programs/index_realmevents", + "test-programs/index_group", + "test-programs/authentication_execution", + "test-programs/index_realm", +} + +func TestUpgradeCoverage(t *testing.T) { + providertest.ReportUpgradeCoverage(t) +} + +type UpgradeTestOpts struct { + baselineVersion string + assertFunc func(*testing.T, auto.PreviewResult) + config map[string]string +} + +func WithBaselineVersion(baselineVersion string) func(opts *UpgradeTestOpts) { + return func(opts *UpgradeTestOpts) { + opts.baselineVersion = baselineVersion + } +} + +func WithAssertFunc(assertFunc func(*testing.T, auto.PreviewResult)) func(opts *UpgradeTestOpts) { + return func(opts *UpgradeTestOpts) { + opts.assertFunc = assertFunc + } +} + +func WithConfig(config map[string]string) func(opts *UpgradeTestOpts) { + return func(opts *UpgradeTestOpts) { + opts.config = config + } +} +func testProviderUpgrade(t *testing.T, dir string, opts ...func(*UpgradeTestOpts)) { + options := &UpgradeTestOpts{} + for _, o := range opts { + o(options) + } + testProviderUpgradeWithOpts(t, dir, options.baselineVersion, options.config, options.assertFunc) +} + +func testProviderUpgradeWithOpts( + t *testing.T, dir, baselineVersion string, config map[string]string, + assertFunction func(*testing.T, auto.PreviewResult), +) { + if testing.Short() { + t.Skipf("Skipping in testing.Short() mode, assuming this is a CI run without credentials") + } + cwd, err := os.Getwd() + require.NoError(t, err) + if baselineVersion == "" { + baselineVersion = defaultBaselineVersion + } + test := pulumitest.NewPulumiTest(t, dir, + opttest.DownloadProviderVersion(providerName, baselineVersion), + opttest.LocalProviderPath(providerName, filepath.Join(cwd, "..", "bin")), + ) + for k, v := range config { + test.SetConfig(k, v) + } + result := providertest.PreviewProviderUpgrade(test, providerName, baselineVersion, optproviderupgrade.DisableAttach()) + if assertFunction != nil { + assertFunction(t, result) + } else { + assertpreview.HasNoReplacements(t, result) + } +} + +func testProgram(t *testing.T, dir string) { + if testing.Short() { + t.Skipf("Skipping in testing.Short() mode, assuming this is a CI run without credentials") + } + cwd, err := os.Getwd() + require.NoError(t, err) + test := pulumitest.NewPulumiTest(t, dir, + opttest.LocalProviderPath(providerName, filepath.Join(cwd, "..", "bin")), + opttest.SkipInstall(), + ) + test.Up() +} + +func TestPrograms(t *testing.T) { + for _, p := range programs { + t.Run(p, func(t *testing.T) { + testProgram(t, p) + }) + } +} + +func TestProgramsUpgrade(t *testing.T) { + t.Skipf("skip upgrade tests for now as we have not recorded them.") + for _, p := range programs { + t.Run(p, func(t *testing.T) { + testProviderUpgrade(t, p) + }) + } +} diff --git a/provider/test-programs/authentication_execution/.gitignore b/provider/test-programs/authentication_execution/.gitignore new file mode 100644 index 00000000..a745864f --- /dev/null +++ b/provider/test-programs/authentication_execution/.gitignore @@ -0,0 +1,2 @@ + +/Pulumi.*.yaml diff --git a/provider/test-programs/authentication_execution/Pulumi.yaml b/provider/test-programs/authentication_execution/Pulumi.yaml new file mode 100644 index 00000000..6b3fae2b --- /dev/null +++ b/provider/test-programs/authentication_execution/Pulumi.yaml @@ -0,0 +1,26 @@ +name: authentication_executionh1UGP0Fkk0eT +runtime: yaml +description: "" +config: + pulumi:tags: + value: + pulumi:template: https://www.pulumi.com/ai/api/project/78b9933c-6dd9-4b72-946e-68edc38eae64.zip +resources: + keycloakAuthExecution: + properties: + authenticator: auth-cookie + parentFlowAlias: ${keycloakAuthFlow.alias} + realmId: ${keycloakRealm.realm} + requirement: REQUIRED + type: keycloak:authentication:Execution + keycloakAuthFlow: + properties: + alias: custom-auth-flow + description: A custom authentication flow + realmId: ${keycloakRealm.realm} + type: keycloak:authentication:Flow + keycloakRealm: + properties: + enabled: true + realm: example-realm + type: keycloak:Realm diff --git a/provider/test-programs/authentication_executionconfig/.gitignore b/provider/test-programs/authentication_executionconfig/.gitignore new file mode 100644 index 00000000..a745864f --- /dev/null +++ b/provider/test-programs/authentication_executionconfig/.gitignore @@ -0,0 +1,2 @@ + +/Pulumi.*.yaml diff --git a/provider/test-programs/authentication_executionconfig/Pulumi.yaml b/provider/test-programs/authentication_executionconfig/Pulumi.yaml new file mode 100644 index 00000000..4ba327fa --- /dev/null +++ b/provider/test-programs/authentication_executionconfig/Pulumi.yaml @@ -0,0 +1,35 @@ +name: authentication_executionconfige7oBrvJ1p51V +runtime: yaml +description: "" +config: + pulumi:tags: + value: + pulumi:template: https://www.pulumi.com/ai/api/project/f5185d25-5cc4-482d-b8f9-9b7f0db546e5.zip +resources: + keycloakAuthenticationExecution: + properties: + authenticator: auth-cookie + parentFlowAlias: ${keycloakAuthenticationFlow.alias} + realmId: ${keycloakRealm.realm} + type: keycloak:authentication:Execution + keycloakAuthenticationExecutionConfig: + properties: + alias: execution-config + config: + user_attribute: username + executionId: ${keycloakAuthenticationExecution.id} + realmId: ${keycloakRealm.realm} + type: keycloak:authentication:ExecutionConfig + keycloakAuthenticationFlow: + properties: + alias: myflow + description: My Authentication Flow + providerId: basic-flow + realmId: ${keycloakRealm.realm} + type: keycloak:authentication:Flow + keycloakRealm: + properties: + displayName: My Realm + enabled: true + realm: myrealm + type: keycloak:Realm diff --git a/provider/test-programs/index_group/.gitignore b/provider/test-programs/index_group/.gitignore new file mode 100644 index 00000000..a745864f --- /dev/null +++ b/provider/test-programs/index_group/.gitignore @@ -0,0 +1,2 @@ + +/Pulumi.*.yaml diff --git a/provider/test-programs/index_group/Pulumi.yaml b/provider/test-programs/index_group/Pulumi.yaml new file mode 100644 index 00000000..779452ae --- /dev/null +++ b/provider/test-programs/index_group/Pulumi.yaml @@ -0,0 +1,18 @@ +name: index_groupcghckcNmry6y +runtime: yaml +description: A minimal Pulumi program that creates a Keycloak group with its dependencies +config: + pulumi:tags: + value: + pulumi:template: https://www.pulumi.com/ai/api/project/19fcc853-1bd3-4b46-b9fd-d1969fb095dc.zip +resources: + keycloakGroup: + properties: + + realmId: ${keycloakRealm.id} + type: keycloak:Group + keycloakRealm: + properties: + enabled: true + realm: example-realm + type: keycloak:Realm diff --git a/provider/test-programs/index_grouproles/.gitignore b/provider/test-programs/index_grouproles/.gitignore new file mode 100644 index 00000000..a745864f --- /dev/null +++ b/provider/test-programs/index_grouproles/.gitignore @@ -0,0 +1,2 @@ + +/Pulumi.*.yaml diff --git a/provider/test-programs/index_grouproles/Pulumi.yaml b/provider/test-programs/index_grouproles/Pulumi.yaml new file mode 100644 index 00000000..4ac728e2 --- /dev/null +++ b/provider/test-programs/index_grouproles/Pulumi.yaml @@ -0,0 +1,35 @@ +name: index_grouproles9ZgN15cMJUxj +runtime: yaml +description: A minimal Pulumi YAML program that creates a Keycloak Group, Group Roles, Realm, and assigns roles to the group. +config: + pulumi:tags: + value: + pulumi:template: https://www.pulumi.com/ai/api/project/6e37f222-3261-4103-a576-f44e40aef84e.zip +outputs: + groupId: ${exampleGroup.id} + realmId: ${exampleRealm.id} + roleIds: + - ${exampleRole.id} +resources: + exampleGroup: + properties: + + realmId: ${exampleRealm.id} + type: keycloak:Group + exampleGroupRoles: + properties: + groupId: ${exampleGroup.id} + realmId: ${exampleRealm.id} + roleIds: + - ${exampleRole.id} + type: keycloak:GroupRoles + exampleRealm: + properties: + enabled: true + realm: example-realm + type: keycloak:Realm + exampleRole: + properties: + + realmId: ${exampleRealm.id} + type: keycloak:Role diff --git a/provider/test-programs/index_realm/.gitignore b/provider/test-programs/index_realm/.gitignore new file mode 100644 index 00000000..a745864f --- /dev/null +++ b/provider/test-programs/index_realm/.gitignore @@ -0,0 +1,2 @@ + +/Pulumi.*.yaml diff --git a/provider/test-programs/index_realm/Pulumi.yaml b/provider/test-programs/index_realm/Pulumi.yaml new file mode 100644 index 00000000..f0f1bf89 --- /dev/null +++ b/provider/test-programs/index_realm/Pulumi.yaml @@ -0,0 +1,13 @@ +name: index_realmBhv8NwUTBL6H +runtime: yaml +description: "" +config: + pulumi:tags: + value: + pulumi:template: https://www.pulumi.com/ai/api/project/549cbd81-6b60-4857-922b-6a3a4ed2b0a3.zip +resources: + my_keycloak_realm: + properties: + enabled: true + realm: my-test-realm + type: keycloak:Realm diff --git a/provider/test-programs/index_realmevents/.gitignore b/provider/test-programs/index_realmevents/.gitignore new file mode 100644 index 00000000..a745864f --- /dev/null +++ b/provider/test-programs/index_realmevents/.gitignore @@ -0,0 +1,2 @@ + +/Pulumi.*.yaml diff --git a/provider/test-programs/index_realmevents/Pulumi.yaml b/provider/test-programs/index_realmevents/Pulumi.yaml new file mode 100644 index 00000000..c081b7bb --- /dev/null +++ b/provider/test-programs/index_realmevents/Pulumi.yaml @@ -0,0 +1,26 @@ +name: index_realmeventsYyMO1eEl68Os +runtime: yaml +description: A minimal Pulumi program to enable Keycloak realm events +config: + pulumi:tags: + value: + pulumi:template: https://www.pulumi.com/ai/api/project/1bc4a2d0-59f6-4cac-8b1b-29fed5aabb3c.zip +outputs: + realmEventsId: ${myRealmEvents.id} + realmId: ${myRealm.id} +resources: + myRealm: + properties: + displayName: My Keycloak Realm + enabled: true + realm: my-realm + type: keycloak:Realm + myRealmEvents: + properties: + adminEventsDetailsEnabled: true + adminEventsEnabled: true + eventsEnabled: true + eventsListeners: + - jboss-logging + realmId: ${myRealm.id} + type: keycloak:RealmEvents diff --git a/provider/test-programs/index_role/.gitignore b/provider/test-programs/index_role/.gitignore new file mode 100644 index 00000000..a745864f --- /dev/null +++ b/provider/test-programs/index_role/.gitignore @@ -0,0 +1,2 @@ + +/Pulumi.*.yaml diff --git a/provider/test-programs/index_role/Pulumi.yaml b/provider/test-programs/index_role/Pulumi.yaml new file mode 100644 index 00000000..2f943a07 --- /dev/null +++ b/provider/test-programs/index_role/Pulumi.yaml @@ -0,0 +1,18 @@ +name: index_roleYSrXc8ghkf2h +runtime: yaml +description: A minimal Pulumi program to create a Keycloak role +config: + pulumi:tags: + value: + pulumi:template: https://www.pulumi.com/ai/api/project/c018ddd7-4f68-44ed-a9a2-3bc72bdf55c4.zip +resources: + keycloak-realm: + properties: + enabled: true + realm: my-realm + type: keycloak:Realm + keycloak-role: + properties: + + realmId: ${keycloak-realm.id} + type: keycloak:Role diff --git a/provider/test-programs/index_user/.gitignore b/provider/test-programs/index_user/.gitignore new file mode 100644 index 00000000..a745864f --- /dev/null +++ b/provider/test-programs/index_user/.gitignore @@ -0,0 +1,2 @@ + +/Pulumi.*.yaml diff --git a/provider/test-programs/index_user/Pulumi.yaml b/provider/test-programs/index_user/Pulumi.yaml new file mode 100644 index 00000000..df579df7 --- /dev/null +++ b/provider/test-programs/index_user/Pulumi.yaml @@ -0,0 +1,23 @@ +name: index_userZmP6yKgUssXA +runtime: yaml +description: "" +config: + pulumi:tags: + value: + pulumi:template: https://www.pulumi.com/ai/api/project/2df07b7d-92ce-4f88-ba24-f6c4c21783f2.zip +resources: + keycloak-user: + properties: + email: testuser@example.com + emailVerified: true + enabled: true + firstName: Test + lastName: User + realmId: ${my-realm.realm} + username: testuser + type: keycloak:User + my-realm: + properties: + enabled: true + realm: my-realm + type: keycloak:Realm