Skip to content

Commit

Permalink
feat: add all supported alogithms for java keystore
Browse files Browse the repository at this point in the history
  • Loading branch information
tboerger committed Jan 24, 2025
1 parent 45b8b6c commit 002660e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion provider/resource_keycloak_realm_keystore_java_keystore.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ package provider

import (
"context"

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

var (
keycloakRealmKeystoreJavaKeystoreAlgorithm = []string{"RS256", "RS384", "RS512", "PS256", "PS384", "PS512"}
keycloakRealmKeystoreJavaKeystoreAlgorithm = []string{"AES", "EdDSA", "ES256", "ES384", "ES512", "HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "PS256", "PS384", "PS512", "RSA1_5", "RSA-OAEP", "RSA-OAEP-256", "ECDH-ES", "ECDH-ES+A128KW", "ECDH-ES+A192KW", "ECDH-ES+A256KW"}
)

func resourceKeycloakRealmKeystoreJavaKeystore() *schema.Resource {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package provider

import (
"fmt"
"regexp"
"strconv"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
"github.com/keycloak/terraform-provider-keycloak/keycloak"
"regexp"
"strconv"
"testing"
)

func TestAccKeycloakRealmKeystoreJava_basic(t *testing.T) {
Expand Down Expand Up @@ -74,7 +75,7 @@ func TestAccKeycloakRealmKeystoreJava_algorithmValidation(t *testing.T) {

skipIfEnvSet(t, "CI") // temporary while I figure out how to put java keystore file to keycloak container in CI

algorithm := randomStringInSlice(keycloakRealmKeystoreRsaAlgorithm)
algorithm := randomStringInSlice(keycloakRealmKeystoreJavaKeystoreAlgorithm)

resource.Test(t, resource.TestCase{
ProviderFactories: testAccProviderFactories,
Expand Down

0 comments on commit 002660e

Please sign in to comment.