Skip to content

Commit

Permalink
Replaced references to mrparkers with keycloak (#1017)
Browse files Browse the repository at this point in the history
Updated goreleaser config

Replace outdated goreleaser --rm-dist config

Added release permissions

Adapted example to work with bitnami/openldap

Signed-off-by: Sebastian Schuster <sebastian.schuster@bosch.io>
  • Loading branch information
sschu authored Nov 20, 2024
1 parent 9d2d817 commit 1211823
Show file tree
Hide file tree
Showing 226 changed files with 258 additions and 256 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
status: steps.wait.outputs.status

release:
permissions: write-all
needs:
- wait
runs-on: ubuntu-latest
Expand Down Expand Up @@ -52,15 +53,14 @@ jobs:
releaseDate=$(date '+%B-%-d-%Y' | tr '[:upper:]' '[:lower:]')
releaseVersion=$(echo ${{ steps.get_tag_name.outputs.TAG }} | tr -d '.')
tmp=$(mktemp -d)
echo "[Release Notes](https://github.com/mrparkers/terraform-provider-keycloak/blob/master/CHANGELOG.md#${releaseVersion}-${releaseDate})" > ${tmp}/release-notes.md
echo "[Release Notes](https://github.com/keycloak/terraform-provider-keycloak/blob/master/CHANGELOG.md#${releaseVersion}-${releaseDate})" > ${tmp}/release-notes.md
cat ${tmp}/release-notes.md
echo ::set-output name=NOTES::${tmp}/release-notes.md
- name: GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v6
with:
version: v0.179.0
args: release --rm-dist --release-notes=${{ steps.build-release-notes.outputs.NOTES }}
args: release --clean --release-notes=${{ steps.build-release-notes.outputs.NOTES }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Terraform provider for [Keycloak](https://www.keycloak.org/).
## Docs

All documentation for this provider can now be found on the Terraform Registry: https://registry.terraform.io/providers/mrparkers/keycloak/latest/docs
All documentation for this provider can now be found on the Terraform Registry: https://registry.terraform.io/providers/keycloak/keycloak/latest/docs

## Installation

Expand All @@ -16,7 +16,7 @@ This provider can be installed automatically using Terraform >=0.13 by using the
terraform {
required_providers {
keycloak = {
source = "mrparkers/keycloak"
source = "keycloak/keycloak"
version = ">= 4.0.0"
}
}
Expand Down Expand Up @@ -50,14 +50,14 @@ The following versions are used when running acceptance tests in CI:
## Releases

This provider uses [GoReleaser](https://goreleaser.com/) to build and publish releases. Each release published to GitHub
contains binary files for Linux, macOS (darwin), and Windows, as configured within the [`.goreleaser.yml`](https://github.com/mrparkers/terraform-provider-keycloak/blob/master/.goreleaser.yml)
contains binary files for Linux, macOS (darwin), and Windows, as configured within the [`.goreleaser.yml`](https://github.com/keycloak/terraform-provider-keycloak/blob/master/.goreleaser.yml)
file.

Each release also contains a `terraform-provider-keycloak_${RELEASE_VERSION}_SHA256SUMS` file, accompanied by a signature
created by a PGP key with the fingerprint `C508 6791 5E11 6CD2`. This key can be found on my Keybase account at https://keybase.io/mrparkers.

You can find the list of releases [here](https://github.com/mrparkers/terraform-provider-keycloak/releases).
You can find the changelog for each version [here](https://github.com/mrparkers/terraform-provider-keycloak/blob/master/CHANGELOG.md).
You can find the list of releases [here](https://github.com/keycloak/terraform-provider-keycloak/releases).
You can find the changelog for each version [here](https://github.com/keycloak/terraform-provider-keycloak/blob/master/CHANGELOG.md).

Note: Prior to v2.0.0, a statically linked build for use within Alpine linux was included with each release. This is no longer
done due to [GoReleaser not supporting CGO](https://goreleaser.com/limitations/cgo/). Instead of using a statically linked,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.mrparkers.keycloak
package com.github.keycloak

import org.keycloak.events.Event
import org.keycloak.events.EventListenerProvider
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.mrparkers.keycloak
package com.github.keycloak

import org.keycloak.Config
import org.keycloak.events.EventListenerProvider
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.mrparkers.keycloak
package com.github.keycloak

import org.keycloak.broker.oidc.OIDCIdentityProvider
import org.keycloak.models.KeycloakSession
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.mrparkers.keycloak
package com.github.keycloak

import org.keycloak.broker.oidc.OIDCIdentityProviderConfig
import org.keycloak.models.IdentityProviderModel
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.mrparkers.keycloak
package com.github.keycloak

import org.keycloak.broker.oidc.OIDCIdentityProviderConfig
import org.keycloak.broker.provider.AbstractIdentityProviderFactory
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.mrparkers.keycloak
package com.github.keycloak

import org.keycloak.component.ComponentModel
import org.keycloak.credential.CredentialInput
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.github.mrparkers.keycloak
package com.github.keycloak

import org.keycloak.component.ComponentModel
import org.keycloak.models.KeycloakSession
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
com.github.mrparkers.keycloak.CustomIdentityProviderFactory
com.github.keycloak.CustomIdentityProviderFactory
Original file line number Diff line number Diff line change
@@ -1 +1 @@
com.github.mrparkers.keycloak.CustomEventListenerProviderFactory
com.github.keycloak.CustomEventListenerProviderFactory
Original file line number Diff line number Diff line change
@@ -1 +1 @@
com.github.mrparkers.keycloak.CustomUserStorageProviderFactory
com.github.keycloak.CustomUserStorageProviderFactory
6 changes: 2 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ services:
- POSTGRES_USER=keycloak
- POSTGRES_PASSWORD=password
image: postgres:16
ports:
- 5432:5432
volumes:
- postgres:/var/lib/postgresql
openldap:
image: bitnami/openldap:2.6
ports:
- 8389:389
environment:
LDAP_PORT_NUMBER: 389
keycloak:
image: quay.io/keycloak/keycloak:21.0.1
command: --verbose start-dev --features=preview
Expand Down
4 changes: 2 additions & 2 deletions docs/data-sources/client_description_converter.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@ The exported attributes for this data source are a combination of the attributes
and [`keycloak_saml_client`][3] resources. You can also refer to the [ClientRepresentation][4] Javadocs for more details.

[1]: https://www.keycloak.org/docs-api/6.0/javadocs/org/keycloak/exportimport/ClientDescriptionConverter.html
[2]: providers/mrparkers/keycloak/latest/docs/resources/openid_client
[3]: providers/mrparkers/keycloak/latest/docs/resources/saml_client
[2]: providers/keycloak/keycloak/latest/docs/resources/openid_client
[3]: providers/keycloak/keycloak/latest/docs/resources/saml_client
[4]: https://www.keycloak.org/docs-api/6.0/javadocs/org/keycloak/representations/idm/ClientRepresentation.html
2 changes: 1 addition & 1 deletion docs/data-sources/realm.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ resource "keycloak_role" "group" {

## Attributes Reference

See the docs for the [`keycloak_realm` resource](https://registry.terraform.io/providers/mrparkers/keycloak/latest/docs/resources/realm) for details on the exported attributes.
See the docs for the [`keycloak_realm` resource](https://registry.terraform.io/providers/keycloak/keycloak/latest/docs/resources/realm) for details on the exported attributes.
2 changes: 1 addition & 1 deletion docs/resources/custom_user_federation.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ page_title: "keycloak_custom_user_federation Resource"
Allows for creating and managing custom user federation providers within Keycloak.

A custom user federation provider is an implementation of Keycloak's [User Storage SPI](https://www.keycloak.org/docs/4.2/server_development/index.html#_user-storage-spi).
An example of this implementation can be found [here](https://github.com/mrparkers/terraform-provider-keycloak/tree/master/custom-user-federation-example).
An example of this implementation can be found [here](https://github.com/keycloak/terraform-provider-keycloak/tree/master/custom-user-federation-example).

## Example Usage

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/group_memberships.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@ resource "keycloak_group_memberships" "group_members" {
This resource does not support import. Instead of importing, feel free to create this resource
as if it did not already exist on the server.

[1]: providers/mrparkers/keycloak/latest/docs/resources/group_memberships
[1]: providers/keycloak/keycloak/latest/docs/resources/group_memberships
2 changes: 1 addition & 1 deletion docs/resources/group_permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Allows you to manage all group Scope Based Permissions https://www.keycloak.org/

This is part of a preview Keycloak feature: `admin_fine_grained_authz` (see https://www.keycloak.org/docs/latest/server_admin/#_fine_grain_permissions).
This feature can be enabled with the Keycloak option `-Dkeycloak.profile.feature.admin_fine_grained_authz=enabled`. See the
example [`docker-compose.yml`](https://github.com/mrparkers/terraform-provider-keycloak/blob/898094df6b3e01c3404981ce7ca268142d6ff0e5/docker-compose.yml#L21) file for an example.
example [`docker-compose.yml`](https://github.com/keycloak/terraform-provider-keycloak/blob/898094df6b3e01c3404981ce7ca268142d6ff0e5/docker-compose.yml#L21) file for an example.

When enabling Roles Permissions, Keycloak does several things automatically:
1. Enable Authorization on built-in `realm-management` client (if not already enabled).
Expand Down
4 changes: 2 additions & 2 deletions docs/resources/user.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ resource "keycloak_user" "user_with_initial_password" {
- `first_name` - (Optional) The user's first name.
- `last_name` - (Optional) The user's last name.
- `attributes` - (Optional) A map representing attributes for the user. In order to add multivalue attributes, use `##` to seperate the values. Max length for each value is 255 chars
- `required_actions` - (Optional) A list of required user actions.
- `federated_identity` - (Optional) When specified, the user will be linked to a federated identity provider. Refer to the [federated user example](https://github.com/mrparkers/terraform-provider-keycloak/blob/master/example/federated_user_example.tf) for more details.
- `required_actions` - (Optional) A list of required user actions.
- `federated_identity` - (Optional) When specified, the user will be linked to a federated identity provider. Refer to the [federated user example](https://github.com/keycloak/terraform-provider-keycloak/blob/master/example/federated_user_example.tf) for more details.
- `identity_provider` - (Required) The name of the identity provider
- `user_id` - (Required) The ID of the user defined in the identity provider
- `user_name` - (Required) The user name of the user defined in the identity provider
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/users_permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Allows you to manage fine-grained permissions for all users in a realm: https://

This is part of a preview Keycloak feature: `admin_fine_grained_authz` (see https://www.keycloak.org/docs/latest/server_admin/#_fine_grain_permissions).
This feature can be enabled with the Keycloak option `-Dkeycloak.profile.feature.admin_fine_grained_authz=enabled`. See the
example [`docker-compose.yml`](https://github.com/mrparkers/terraform-provider-keycloak/blob/898094df6b3e01c3404981ce7ca268142d6ff0e5/docker-compose.yml#L21) file for an example.
example [`docker-compose.yml`](https://github.com/keycloak/terraform-provider-keycloak/blob/898094df6b3e01c3404981ce7ca268142d6ff0e5/docker-compose.yml#L21) file for an example.

When enabling fine-grained permissions for users, Keycloak does several things automatically:
1. Enable Authorization on built-in `realm-management` client (if not already enabled).
Expand Down
4 changes: 4 additions & 0 deletions example/client_authorization_policys.tf
Original file line number Diff line number Diff line change
Expand Up @@ -191,4 +191,8 @@ resource "keycloak_openid_client_permissions" "my_permission" {
description = "my description"
decision_strategy = "UNANIMOUS"
}
//needed because otherwise there is a conflict/race condition with the other permission
depends_on = [
keycloak_users_permissions.my_permission
]
}
8 changes: 4 additions & 4 deletions example/main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
keycloak = {
source = "terraform.local/mrparkers/keycloak"
source = "terraform.local/keycloak/keycloak"
version = ">= 4.0.0"
}
}
Expand Down Expand Up @@ -103,7 +103,7 @@ resource "keycloak_realm" "test" {

resource "keycloak_required_action" "custom-terms-and-conditions" {
realm_id = keycloak_realm.test.realm
alias = "terms_and_conditions"
alias = "TERMS_AND_CONDITIONS"
default_action = true
enabled = true
name = "Custom Terms and Conditions"
Expand Down Expand Up @@ -290,7 +290,7 @@ resource "keycloak_ldap_user_federation" "openldap" {
connection_url = "ldap://openldap"
users_dn = "dc=example,dc=org"
bind_dn = "cn=admin,dc=example,dc=org"
bind_credential = "admin"
bind_credential = "adminpassword"

connection_timeout = "5s"
read_timeout = "10s"
Expand Down Expand Up @@ -327,7 +327,7 @@ resource "keycloak_ldap_user_federation" "openldap_no_default_mappers" {
connection_url = "ldap://openldap"
users_dn = "dc=example,dc=org"
bind_dn = "cn=admin,dc=example,dc=org"
bind_credential = "admin"
bind_credential = "adminpassword"

connection_timeout = "5s"
read_timeout = "10s"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/mrparkers/terraform-provider-keycloak
module github.com/keycloak/terraform-provider-keycloak

require (
github.com/hashicorp/errwrap v1.0.0
Expand Down
2 changes: 1 addition & 1 deletion keycloak/extra_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package keycloak

import (
"encoding/json"
"github.com/mrparkers/terraform-provider-keycloak/keycloak/types"
"github.com/keycloak/terraform-provider-keycloak/keycloak/types"
"reflect"
"strconv"
"strings"
Expand Down
2 changes: 1 addition & 1 deletion keycloak/identity_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package keycloak
import (
"context"
"fmt"
"github.com/mrparkers/terraform-provider-keycloak/keycloak/types"
"github.com/keycloak/terraform-provider-keycloak/keycloak/types"
"reflect"
)

Expand Down
2 changes: 1 addition & 1 deletion keycloak/openid_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package keycloak
import (
"context"
"fmt"
"github.com/mrparkers/terraform-provider-keycloak/keycloak/types"
"github.com/keycloak/terraform-provider-keycloak/keycloak/types"
"reflect"
)

Expand Down
2 changes: 1 addition & 1 deletion keycloak/openid_client_scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package keycloak
import (
"context"
"fmt"
"github.com/mrparkers/terraform-provider-keycloak/keycloak/types"
"github.com/keycloak/terraform-provider-keycloak/keycloak/types"
)

type OpenidClientScope struct {
Expand Down
2 changes: 1 addition & 1 deletion keycloak/realm.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package keycloak
import (
"context"
"fmt"
"github.com/mrparkers/terraform-provider-keycloak/keycloak/types"
"github.com/keycloak/terraform-provider-keycloak/keycloak/types"
"strings"
)

Expand Down
2 changes: 1 addition & 1 deletion keycloak/saml_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package keycloak
import (
"context"
"fmt"
"github.com/mrparkers/terraform-provider-keycloak/keycloak/types"
"github.com/keycloak/terraform-provider-keycloak/keycloak/types"
"reflect"
)

Expand Down
2 changes: 1 addition & 1 deletion keycloak/saml_client_scope.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package keycloak
import (
"context"
"fmt"
"github.com/mrparkers/terraform-provider-keycloak/keycloak/types"
"github.com/keycloak/terraform-provider-keycloak/keycloak/types"
)

type SamlClientScope struct {
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/plugin"
"github.com/mrparkers/terraform-provider-keycloak/provider"
"github.com/keycloak/terraform-provider-keycloak/provider"
)

func main() {
Expand Down
12 changes: 6 additions & 6 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ build:
CGO_ENABLED=0 go build -trimpath -ldflags "-s -w -X main.version=$(VERSION)" -o terraform-provider-keycloak_$(VERSION)

build-example: build
mkdir -p example/.terraform/plugins/terraform.local/mrparkers/keycloak/4.0.0/$(GOOS)_$(GOARCH)
mkdir -p example/terraform.d/plugins/terraform.local/mrparkers/keycloak/4.0.0/$(GOOS)_$(GOARCH)
cp terraform-provider-keycloak_* example/.terraform/plugins/terraform.local/mrparkers/keycloak/4.0.0/$(GOOS)_$(GOARCH)/
cp terraform-provider-keycloak_* example/terraform.d/plugins/terraform.local/mrparkers/keycloak/4.0.0/$(GOOS)_$(GOARCH)/
mkdir -p example/.terraform/plugins/terraform.local/keycloak/keycloak/4.0.0/$(GOOS)_$(GOARCH)
mkdir -p example/terraform.d/plugins/terraform.local/keycloak/keycloak/4.0.0/$(GOOS)_$(GOARCH)
cp terraform-provider-keycloak_* example/.terraform/plugins/terraform.local/keycloak/keycloak/4.0.0/$(GOOS)_$(GOARCH)/
cp terraform-provider-keycloak_* example/terraform.d/plugins/terraform.local/keycloak/keycloak/4.0.0/$(GOOS)_$(GOARCH)/

local: deps
docker compose up --build -d
Expand All @@ -30,8 +30,8 @@ test: fmtcheck vet
go test $(TEST)

testacc: fmtcheck vet
go test -v github.com/mrparkers/terraform-provider-keycloak/keycloak
TF_ACC=1 CHECKPOINT_DISABLE=1 go test -v -timeout 60m -parallel 4 github.com/mrparkers/terraform-provider-keycloak/provider $(TESTARGS)
go test -v github.com/keycloak/terraform-provider-keycloak/keycloak
TF_ACC=1 CHECKPOINT_DISABLE=1 go test -v -timeout 60m -parallel 4 github.com/keycloak/terraform-provider-keycloak/provider $(TESTARGS)

fmtcheck:
lineCount=$(shell gofmt -l -s $(GOFMT_FILES) | wc -l | tr -d ' ') && exit $$lineCount
Expand Down
2 changes: 1 addition & 1 deletion provider/data_source_keycloak_authentication_execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/mrparkers/terraform-provider-keycloak/keycloak"
"github.com/keycloak/terraform-provider-keycloak/keycloak"
)

func dataSourceKeycloakAuthenticationExecution() *schema.Resource {
Expand Down
2 changes: 1 addition & 1 deletion provider/data_source_keycloak_authentication_flow.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/mrparkers/terraform-provider-keycloak/keycloak"
"github.com/keycloak/terraform-provider-keycloak/keycloak"
)

func dataSourceKeycloakAuthenticationFlow() *schema.Resource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/mrparkers/terraform-provider-keycloak/keycloak"
"github.com/keycloak/terraform-provider-keycloak/keycloak"
)

func dataSourceKeycloakClientDescriptionConverter() *schema.Resource {
Expand Down
2 changes: 1 addition & 1 deletion provider/data_source_keycloak_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/mrparkers/terraform-provider-keycloak/keycloak"
"github.com/keycloak/terraform-provider-keycloak/keycloak"
)

func dataSourceKeycloakGroup() *schema.Resource {
Expand Down
2 changes: 1 addition & 1 deletion provider/data_source_keycloak_openid_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/mrparkers/terraform-provider-keycloak/keycloak"
"github.com/keycloak/terraform-provider-keycloak/keycloak"
)

func dataSourceKeycloakOpenidClient() *schema.Resource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/mrparkers/terraform-provider-keycloak/keycloak"
"github.com/keycloak/terraform-provider-keycloak/keycloak"
)

func dataSourceKeycloakOpenidClientAuthorizationPolicy() *schema.Resource {
Expand Down
Loading

0 comments on commit 1211823

Please sign in to comment.