Skip to content

Commit

Permalink
add feature flag
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Wiedemann <[email protected]>
  • Loading branch information
wistefan committed Jan 17, 2024
1 parent b900a41 commit c81dff9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
2 changes: 2 additions & 0 deletions common/src/main/java/org/keycloak/common/Profile.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ public enum Feature {
MULTI_SITE("Multi-site support", Type.PREVIEW),

OFFLINE_SESSION_PRELOADING("Offline session preloading", Type.DEPRECATED),

OID4VC_VCI("Support for the OID4VCI protocol as part of OID4VC.", Type.PREVIEW)
;

private final Type type;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.keycloak.protocol.oid4vc.issuance.signing;

import org.keycloak.Config;
import org.keycloak.component.ComponentModel;
import org.keycloak.component.ComponentValidationException;
import org.keycloak.models.KeycloakSession;
Expand Down Expand Up @@ -51,5 +52,6 @@ public void validateSpecificConfiguration(KeycloakSession session, RealmModel re
public Format supportedFormat() {
return SUPPORTED_FORMAT;
}

}

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.keycloak.protocol.oid4vc.issuance.signing;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.keycloak.Config;
import org.keycloak.common.Profile;
import org.keycloak.component.ComponentFactory;
import org.keycloak.component.ComponentModel;
import org.keycloak.component.ComponentValidationException;
Expand All @@ -10,14 +10,15 @@
import org.keycloak.models.RealmModel;
import org.keycloak.protocol.oid4vc.model.Format;
import org.keycloak.provider.ConfigurationValidationHelper;
import org.keycloak.provider.EnvironmentDependentProviderFactory;
import org.keycloak.provider.ProviderConfigurationBuilder;

import java.time.Clock;

/**
* @author <a href="https://github.com/wistefan">Stefan Wiedemann</a>
*/
public interface VCSigningServiceProviderFactory extends ComponentFactory<VerifiableCredentialsSigningService, VerifiableCredentialsSigningService> {
public interface VCSigningServiceProviderFactory extends ComponentFactory<VerifiableCredentialsSigningService, VerifiableCredentialsSigningService>, EnvironmentDependentProviderFactory {
Clock CLOCK = Clock.systemUTC();

public static ProviderConfigurationBuilder configurationBuilder() {
Expand Down Expand Up @@ -48,8 +49,20 @@ default void postInit(KeycloakSessionFactory factory) {
// no-op
}

void validateSpecificConfiguration(KeycloakSession session, RealmModel realm, ComponentModel model) throws ComponentValidationException;
@Override
default boolean isSupported(Config.Scope config) {
return Profile.isFeatureEnabled(Profile.Feature.OID4VC_VCI);
}

@Override
default boolean isSupported() {
return Profile.isFeatureEnabled(Profile.Feature.OID4VC_VCI);
}

/**
* Should validate potential implementation specific configuration of the factory.
*/
void validateSpecificConfiguration(KeycloakSession session, RealmModel realm, ComponentModel model) throws ComponentValidationException;

/**
* Should return the credentials format supported by the signing service.
Expand Down

0 comments on commit c81dff9

Please sign in to comment.