saml2-sp 0.1.3

SAML 2.0 service provider
Documentation
# syntax=docker/dockerfile:1
# SPDX-FileCopyrightText: 2026 Iya CyberSecurity Solutions, LLC
# SPDX-License-Identifier: MIT
# `docker build --target test` runs the suite in this image.
# The demo image below does not run it.
FROM rust:1 AS test
RUN apt-get update && apt-get install -y --no-install-recommends python3 \
 && rm -rf /var/lib/apt/lists/*
WORKDIR /src
COPY . .
RUN cargo test

FROM rust:1
WORKDIR /app
COPY Cargo.toml Cargo.lock ./
COPY src src
RUN cargo build --release --bin saml2-sp --bin demo \
 && cp target/release/saml2-sp /usr/local/bin/saml2-sp \
 && cp target/release/demo /usr/local/bin/saml-demo
# demo/ comes after the build, so a new trust chain does not rebuild the binaries.
# .dockerignore admits one file of demo/generated: idp-ca.pem, the iya-sts listener
# CA trust chain scripts/configure_iya_sts.py writes where idpCa names it. When it
# exists, this COPY puts it at /app/demo/generated/idp-ca.pem; when it does not (a
# fresh clone, CI), the directory carries nothing from demo/generated and the build
# still succeeds. Keys and metadata never enter the image.
COPY demo demo
COPY scripts scripts
COPY README.md LICENSE VERSION ./
ENV PORT=3000
EXPOSE 3000
HEALTHCHECK --interval=15s --timeout=3s --start-period=5s \
  CMD ["bash", "-c", "exec 3<>/dev/tcp/127.0.0.1/${PORT} && printf 'GET /healthz HTTP/1.0\\r\\nHost: 127.0.0.1\\r\\n\\r\\n' >&3 && grep -q '^ok' <&3"]
CMD ["saml-demo"]