<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>ch.admin.bit.jeap</groupId>
        <artifactId>jeap-spring-boot-jwe-starter-parent</artifactId>
        <version>1.3.0</version>
    </parent>

    <artifactId>jeap-spring-boot-jwe-starter</artifactId>
    <name>${project.groupId}:${project.artifactId}</name>
    <description>jEAP Spring Boot starter for transparent JWE end-to-end encryption: auto-configuration, configuration
        properties, the JWKS endpoint and bean wiring.
    </description>
    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>ch.admin.bit.jeap</groupId>
            <artifactId>jeap-spring-boot-jwe-crypto</artifactId>
        </dependency>
        <dependency>
            <groupId>ch.admin.bit.jeap</groupId>
            <artifactId>jeap-spring-boot-jwe-key-management</artifactId>
        </dependency>
        <dependency>
            <groupId>ch.admin.bit.jeap</groupId>
            <artifactId>jeap-spring-boot-jwe-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-autoconfigure</artifactId>
        </dependency>
        <!-- Servlet API for the servlet-filter registration (FilterRegistrationBean<JweServletFilter>);
             supplied by the consuming application's web stack. -->
        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-configuration-processor</artifactId>
            <optional>true</optional>
        </dependency>

        <!-- Micrometer for the JWE metrics auto-configuration (JweMetricsAutoConfiguration references
             MeterRegistry). Optional, so it is not forced on apps that do not collect metrics; the
             auto-configuration is gated on @ConditionalOnClass/@ConditionalOnBean and is a no-op when
             no MeterRegistry is present. Not transitive, hence declared here in addition to
             jeap-spring-boot-jwe-key-management. -->
        <dependency>
            <groupId>io.micrometer</groupId>
            <artifactId>micrometer-core</artifactId>
            <optional>true</optional>
        </dependency>

        <!-- Optional Spring Security: only used to auto-permit the public JWKS and protocol-metadata
             endpoints when the consuming app secures its requests. Optional, so it is not pulled into
             apps without Spring Security; the security auto-configuration is gated on @ConditionalOnClass
             and is a no-op when these types are absent. -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <optional>true</optional>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- Servlet web stack for the JWKS endpoint integration test. -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-webmvc</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- Actuator + Prometheus registry to exercise the JWE metrics end to end (JweMetricsIT). -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.micrometer</groupId>
            <artifactId>micrometer-registry-prometheus</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>ch.admin.bit.jeap</groupId>
            <artifactId>jeap-spring-boot-jwe-test</artifactId>
            <scope>test</scope>
        </dependency>
        <!-- Real Vault dev container for the e2e integration test. -->
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>testcontainers-vault</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.testcontainers</groupId>
            <artifactId>testcontainers-junit-jupiter</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

</project>
