<?xml version="1.0" encoding="UTF-8"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.5.0" name="pax-keycloak-3.4.1.Final">


    <!--

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

     -->

    <!-- Keycloak core adapter jars -->
    <feature name="pax-keycloak-adapter-core" version="3.4.1.Final" hidden="true">
        <details>The keycloak adapter core stuff</details>
        <bundle dependency="true">mvn:org.apache.httpcomponents/httpclient-osgi/4.5.4</bundle>
        <bundle dependency="true">mvn:org.apache.httpcomponents/httpcore-osgi/4.4.8</bundle>
        <bundle dependency="true">mvn:org.bouncycastle/bcprov-jdk15on/1.56</bundle>
        <bundle dependency="true">mvn:org.bouncycastle/bcpkix-jdk15on/1.56</bundle>
        <bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-core/2.7.0</bundle>
        <bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-annotations/2.7.0</bundle>
        <bundle dependency="true">mvn:com.fasterxml.jackson.core/jackson-databind/2.7.0</bundle>
        <bundle dependency="true">mvn:com.fasterxml.jackson.module/jackson-module-jaxb-annotations/2.7.0</bundle>
        <bundle dependency="true">mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-base/2.7.0</bundle>
        <bundle dependency="true">mvn:com.fasterxml.jackson.jaxrs/jackson-jaxrs-json-provider/2.7.0</bundle>
        <bundle>mvn:org.ops4j.pax.keycloak/pax-keycloak-core/0.2.0</bundle>
    </feature>

    <!-- Keycloak adapter for PaxWeb jetty provider -->
    <feature name="pax-keycloak-http-jetty" version="3.4.1.Final">
        <details>The keycloak web adapter for jetty</details>
        <feature>pax-keycloak-adapter-core</feature>
        <feature>pax-http-jetty</feature>
        <bundle>mvn:org.ops4j.pax.keycloak/pax-keycloak-jetty/0.2.0</bundle>
    </feature>

    <!-- Keycloak adapter for PaxWeb undertow provider -->
    <feature name="pax-keycloak-http-undertow" version="3.4.1.Final">
        <details>The keycloak web adapter for undertow</details>
        <feature>pax-keycloak-adapter-core</feature>
        <feature>pax-http-undertow</feature>
        <bundle>mvn:org.ops4j.pax.keycloak/pax-keycloak-undertow/0.2.0</bundle>
    </feature>

    <!-- Keycloak adapter for PaxWeb tomcat provider -->
    <feature name="pax-keycloak-http-tomcat" version="3.4.1.Final">
        <details>The keycloak web adapter for tomcat</details>
        <feature>pax-keycloak-adapter-core</feature>
        <feature>pax-http-tomcat</feature>
        <bundle>mvn:org.ops4j.pax.keycloak/pax-keycloak-tomcat/0.2.0</bundle>
    </feature>

    <!-- Keycloak JAAS integration -->
    <feature name="pax-keycloak-jaas" version="3.4.1.Final">
        <details>The keycloak JAAS configuration</details>
        <config name="org.ops4j.pax.keycloak.jaas">
            jaasBearerKeycloakConfigFile = \${karaf.etc}/keycloak-bearer.json
            jaasBearerRolePrincipalClass = org.apache.karaf.jaas.boot.principal.RolePrincipal

            jaasDirectAccessKeycloakConfigFile = \${karaf.etc}/keycloak-direct-access.json
            jaasDirectAccessRolePrincipalClass = org.apache.karaf.jaas.boot.principal.RolePrincipal

            audit.eventadmin.enabled = true
            audit.eventadmin.topic = org/apache/karaf/login
        </config>
        <feature>pax-keycloak-adapter-core</feature>
        <feature>jaas</feature>
        <bundle>mvn:org.ops4j.pax.keycloak/pax-keycloak-jaas/0.2.0</bundle>
        <conditional>
            <condition>hawtio-core</condition>
            <bundle start-level="20">mvn:org.ops4j.pax.keycloak/pax-keycloak-hawtio/0.2.0</bundle>
        </conditional>
    </feature>

    <!-- Keycloak installation -->
    <feature name="pax-keycloak" version="3.4.1.Final">
        <details>The keycloak adapter core stuff</details>
        <feature>pax-keycloak-jaas</feature>
    </feature>

</features>
