Merge pull request #3418 from stianst/KEYCLOAK-3782

KEYCLOAK-3782 Keysize for rsa-generated should be a dropdown
This commit is contained in:
Stian Thorgersen 2016-10-25 10:22:00 +02:00 committed by GitHub
commit 765c3a7b0d
2 changed files with 14 additions and 4 deletions

View file

@ -17,6 +17,7 @@
package org.keycloak.provider;
import java.util.Arrays;
import java.util.List;
/**
@ -62,6 +63,15 @@ public class ProviderConfigProperty {
this.defaultValue = defaultValue;
}
public ProviderConfigProperty(String name, String label, String helpText, String type, Object defaultValue, String... options) {
this.name = name;
this.label = label;
this.helpText = helpText;
this.type = type;
this.defaultValue = defaultValue;
this.options = Arrays.asList(options);
}
public ProviderConfigProperty(String name, String label, String helpText, String type, Object defaultValue, boolean secret) {
this(name, label, helpText, type, defaultValue);
this.secret = secret;

View file

@ -19,9 +19,9 @@ package org.keycloak.keys;
import org.keycloak.provider.ProviderConfigProperty;
import static org.keycloak.provider.ProviderConfigProperty.BOOLEAN_TYPE;
import static org.keycloak.provider.ProviderConfigProperty.FILE_TYPE;
import static org.keycloak.provider.ProviderConfigProperty.STRING_TYPE;
import java.util.LinkedList;
import static org.keycloak.provider.ProviderConfigProperty.*;
/**
* @author <a href="mailto:sthorger@redhat.com">Stian Thorgersen</a>
@ -44,6 +44,6 @@ public interface Attributes {
ProviderConfigProperty CERTIFICATE_PROPERTY = new ProviderConfigProperty(CERTIFICATE_KEY, "X509 Certificate", "X509 Certificate encoded in PEM format", FILE_TYPE, null);
String KEY_SIZE_KEY = "keySize";
ProviderConfigProperty KEY_SIZE_PROPERTY = new ProviderConfigProperty(KEY_SIZE_KEY, "Keysize", "Size for the generated keys (1024, 2048 or 4096)", STRING_TYPE, null);
ProviderConfigProperty KEY_SIZE_PROPERTY = new ProviderConfigProperty(KEY_SIZE_KEY, "Keysize", "Size for the generated keys (1024, 2048 or 4096)", LIST_TYPE, "2048", "1024", "2048", "4096");
}