Update u2f to 0.2, which requires OpenSSL but also might solve the problems we've had with certificates.

The rust image doesn't need installing curl or tar, so removed. Also collapsed ENV lines.
This commit is contained in:
Daniel García
2020-01-18 20:09:52 +01:00
parent c0ba3406ef
commit 84ed185579
16 changed files with 109 additions and 241 deletions

150
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -14,7 +14,7 @@ build = "build.rs"
# Empty to keep compatibility, prefer to set USE_SYSLOG=true # Empty to keep compatibility, prefer to set USE_SYSLOG=true
enable_syslog = [] enable_syslog = []
mysql = ["diesel/mysql", "diesel_migrations/mysql"] mysql = ["diesel/mysql", "diesel_migrations/mysql"]
postgresql = ["diesel/postgres", "diesel_migrations/postgres", "openssl"] postgresql = ["diesel/postgres", "diesel_migrations/postgres"]
sqlite = ["diesel/sqlite", "diesel_migrations/sqlite", "libsqlite3-sys"] sqlite = ["diesel/sqlite", "diesel_migrations/sqlite", "libsqlite3-sys"]
[target."cfg(not(windows))".dependencies] [target."cfg(not(windows))".dependencies]
@ -75,7 +75,7 @@ data-encoding = "2.1.2"
jsonwebtoken = "6.0.1" jsonwebtoken = "6.0.1"
# U2F library # U2F library
u2f = "0.1.6" u2f = "0.2.0"
# Yubico Library # Yubico Library
yubico = { version = "0.7.1", features = ["online-tokio"], default-features = false } yubico = { version = "0.7.1", features = ["online-tokio"], default-features = false }
@ -107,8 +107,8 @@ soup = "0.4.1"
regex = "1.3.3" regex = "1.3.3"
data-url = "0.1.0" data-url = "0.1.0"
# Required for SSL support for PostgreSQL # Used by U2F, JWT and Postgres
openssl = { version = "0.10.26", optional = true } openssl = "0.10.26"
# URL encoding library # URL encoding library
percent-encoding = "2.1.0" percent-encoding = "2.1.0"

View File

@ -36,21 +36,10 @@ ENV VAULT_VERSION "v2.12.0b"
ENV URL "https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz" ENV URL "https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz"
{% if "alpine" in vault_stage_base_image %} {% if "alpine" in vault_stage_base_image %}
RUN apk add --no-cache --upgrade \ RUN apk add --no-cache --upgrade curl tar
curl \
tar
{% else %} {% else %}
# Build time options to avoid dpkg warnings and help with reproducible builds. # Build time options to avoid dpkg warnings and help with reproducible builds.
ARG DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 TZ=UTC TERM=xterm-256color
ARG LANG=C.UTF-8
ARG TZ=UTC
ARG TERM=xterm-256color
RUN apt-get update \
&& apt-get install -y \
--no-install-recommends \
curl \
tar
{% endif %} {% endif %}
RUN mkdir /web-vault RUN mkdir /web-vault
@ -88,10 +77,7 @@ ARG DB=postgresql
{% endif %} {% endif %}
# Build time options to avoid dpkg warnings and help with reproducible builds. # Build time options to avoid dpkg warnings and help with reproducible builds.
ARG DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 TZ=UTC TERM=xterm-256color
ARG LANG=C.UTF-8
ARG TZ=UTC
ARG TERM=xterm-256color
# Don't download rust docs # Don't download rust docs
RUN rustup set profile minimal RUN rustup set profile minimal

View File

@ -12,16 +12,7 @@ ENV VAULT_VERSION "v2.12.0b"
ENV URL "https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz" ENV URL "https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz"
# Build time options to avoid dpkg warnings and help with reproducible builds. # Build time options to avoid dpkg warnings and help with reproducible builds.
ARG DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 TZ=UTC TERM=xterm-256color
ARG LANG=C.UTF-8
ARG TZ=UTC
ARG TERM=xterm-256color
RUN apt-get update \
&& apt-get install -y \
--no-install-recommends \
curl \
tar
RUN mkdir /web-vault RUN mkdir /web-vault
WORKDIR /web-vault WORKDIR /web-vault
@ -40,10 +31,7 @@ FROM rust:1.40 as build
ARG DB=mysql ARG DB=mysql
# Build time options to avoid dpkg warnings and help with reproducible builds. # Build time options to avoid dpkg warnings and help with reproducible builds.
ARG DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 TZ=UTC TERM=xterm-256color
ARG LANG=C.UTF-8
ARG TZ=UTC
ARG TERM=xterm-256color
# Don't download rust docs # Don't download rust docs
RUN rustup set profile minimal RUN rustup set profile minimal

View File

@ -12,16 +12,7 @@ ENV VAULT_VERSION "v2.12.0b"
ENV URL "https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz" ENV URL "https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz"
# Build time options to avoid dpkg warnings and help with reproducible builds. # Build time options to avoid dpkg warnings and help with reproducible builds.
ARG DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 TZ=UTC TERM=xterm-256color
ARG LANG=C.UTF-8
ARG TZ=UTC
ARG TERM=xterm-256color
RUN apt-get update \
&& apt-get install -y \
--no-install-recommends \
curl \
tar
RUN mkdir /web-vault RUN mkdir /web-vault
WORKDIR /web-vault WORKDIR /web-vault
@ -40,10 +31,7 @@ FROM rust:1.40 as build
ARG DB=sqlite ARG DB=sqlite
# Build time options to avoid dpkg warnings and help with reproducible builds. # Build time options to avoid dpkg warnings and help with reproducible builds.
ARG DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 TZ=UTC TERM=xterm-256color
ARG LANG=C.UTF-8
ARG TZ=UTC
ARG TERM=xterm-256color
# Don't download rust docs # Don't download rust docs
RUN rustup set profile minimal RUN rustup set profile minimal

View File

@ -12,16 +12,7 @@ ENV VAULT_VERSION "v2.12.0b"
ENV URL "https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz" ENV URL "https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz"
# Build time options to avoid dpkg warnings and help with reproducible builds. # Build time options to avoid dpkg warnings and help with reproducible builds.
ARG DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 TZ=UTC TERM=xterm-256color
ARG LANG=C.UTF-8
ARG TZ=UTC
ARG TERM=xterm-256color
RUN apt-get update \
&& apt-get install -y \
--no-install-recommends \
curl \
tar
RUN mkdir /web-vault RUN mkdir /web-vault
WORKDIR /web-vault WORKDIR /web-vault
@ -40,10 +31,7 @@ FROM rust:1.40 as build
ARG DB=mysql ARG DB=mysql
# Build time options to avoid dpkg warnings and help with reproducible builds. # Build time options to avoid dpkg warnings and help with reproducible builds.
ARG DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 TZ=UTC TERM=xterm-256color
ARG LANG=C.UTF-8
ARG TZ=UTC
ARG TERM=xterm-256color
# Don't download rust docs # Don't download rust docs
RUN rustup set profile minimal RUN rustup set profile minimal

View File

@ -11,9 +11,7 @@ ENV VAULT_VERSION "v2.12.0b"
ENV URL "https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz" ENV URL "https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz"
RUN apk add --no-cache --upgrade \ RUN apk add --no-cache --upgrade curl tar
curl \
tar
RUN mkdir /web-vault RUN mkdir /web-vault
WORKDIR /web-vault WORKDIR /web-vault
@ -31,10 +29,7 @@ FROM clux/muslrust:nightly-2019-12-19 as build
ARG DB=mysql ARG DB=mysql
# Build time options to avoid dpkg warnings and help with reproducible builds. # Build time options to avoid dpkg warnings and help with reproducible builds.
ARG DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 TZ=UTC TERM=xterm-256color
ARG LANG=C.UTF-8
ARG TZ=UTC
ARG TERM=xterm-256color
# Don't download rust docs # Don't download rust docs
RUN rustup set profile minimal RUN rustup set profile minimal

View File

@ -12,16 +12,7 @@ ENV VAULT_VERSION "v2.12.0b"
ENV URL "https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz" ENV URL "https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz"
# Build time options to avoid dpkg warnings and help with reproducible builds. # Build time options to avoid dpkg warnings and help with reproducible builds.
ARG DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 TZ=UTC TERM=xterm-256color
ARG LANG=C.UTF-8
ARG TZ=UTC
ARG TERM=xterm-256color
RUN apt-get update \
&& apt-get install -y \
--no-install-recommends \
curl \
tar
RUN mkdir /web-vault RUN mkdir /web-vault
WORKDIR /web-vault WORKDIR /web-vault
@ -40,10 +31,7 @@ FROM rust:1.40 as build
ARG DB=postgresql ARG DB=postgresql
# Build time options to avoid dpkg warnings and help with reproducible builds. # Build time options to avoid dpkg warnings and help with reproducible builds.
ARG DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 TZ=UTC TERM=xterm-256color
ARG LANG=C.UTF-8
ARG TZ=UTC
ARG TERM=xterm-256color
# Don't download rust docs # Don't download rust docs
RUN rustup set profile minimal RUN rustup set profile minimal

View File

@ -11,9 +11,7 @@ ENV VAULT_VERSION "v2.12.0b"
ENV URL "https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz" ENV URL "https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz"
RUN apk add --no-cache --upgrade \ RUN apk add --no-cache --upgrade curl tar
curl \
tar
RUN mkdir /web-vault RUN mkdir /web-vault
WORKDIR /web-vault WORKDIR /web-vault
@ -31,10 +29,7 @@ FROM clux/muslrust:nightly-2019-12-19 as build
ARG DB=postgresql ARG DB=postgresql
# Build time options to avoid dpkg warnings and help with reproducible builds. # Build time options to avoid dpkg warnings and help with reproducible builds.
ARG DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 TZ=UTC TERM=xterm-256color
ARG LANG=C.UTF-8
ARG TZ=UTC
ARG TERM=xterm-256color
# Don't download rust docs # Don't download rust docs
RUN rustup set profile minimal RUN rustup set profile minimal

View File

@ -12,16 +12,7 @@ ENV VAULT_VERSION "v2.12.0b"
ENV URL "https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz" ENV URL "https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz"
# Build time options to avoid dpkg warnings and help with reproducible builds. # Build time options to avoid dpkg warnings and help with reproducible builds.
ARG DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 TZ=UTC TERM=xterm-256color
ARG LANG=C.UTF-8
ARG TZ=UTC
ARG TERM=xterm-256color
RUN apt-get update \
&& apt-get install -y \
--no-install-recommends \
curl \
tar
RUN mkdir /web-vault RUN mkdir /web-vault
WORKDIR /web-vault WORKDIR /web-vault
@ -40,10 +31,7 @@ FROM rust:1.40 as build
ARG DB=sqlite ARG DB=sqlite
# Build time options to avoid dpkg warnings and help with reproducible builds. # Build time options to avoid dpkg warnings and help with reproducible builds.
ARG DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 TZ=UTC TERM=xterm-256color
ARG LANG=C.UTF-8
ARG TZ=UTC
ARG TERM=xterm-256color
# Don't download rust docs # Don't download rust docs
RUN rustup set profile minimal RUN rustup set profile minimal

View File

@ -11,9 +11,7 @@ ENV VAULT_VERSION "v2.12.0b"
ENV URL "https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz" ENV URL "https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz"
RUN apk add --no-cache --upgrade \ RUN apk add --no-cache --upgrade curl tar
curl \
tar
RUN mkdir /web-vault RUN mkdir /web-vault
WORKDIR /web-vault WORKDIR /web-vault
@ -31,10 +29,7 @@ FROM clux/muslrust:nightly-2019-12-19 as build
ARG DB=sqlite ARG DB=sqlite
# Build time options to avoid dpkg warnings and help with reproducible builds. # Build time options to avoid dpkg warnings and help with reproducible builds.
ARG DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 TZ=UTC TERM=xterm-256color
ARG LANG=C.UTF-8
ARG TZ=UTC
ARG TERM=xterm-256color
# Don't download rust docs # Don't download rust docs
RUN rustup set profile minimal RUN rustup set profile minimal

View File

@ -12,16 +12,7 @@ ENV VAULT_VERSION "v2.12.0b"
ENV URL "https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz" ENV URL "https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz"
# Build time options to avoid dpkg warnings and help with reproducible builds. # Build time options to avoid dpkg warnings and help with reproducible builds.
ARG DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 TZ=UTC TERM=xterm-256color
ARG LANG=C.UTF-8
ARG TZ=UTC
ARG TERM=xterm-256color
RUN apt-get update \
&& apt-get install -y \
--no-install-recommends \
curl \
tar
RUN mkdir /web-vault RUN mkdir /web-vault
WORKDIR /web-vault WORKDIR /web-vault
@ -40,10 +31,7 @@ FROM rust:1.40 as build
ARG DB=mysql ARG DB=mysql
# Build time options to avoid dpkg warnings and help with reproducible builds. # Build time options to avoid dpkg warnings and help with reproducible builds.
ARG DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 TZ=UTC TERM=xterm-256color
ARG LANG=C.UTF-8
ARG TZ=UTC
ARG TERM=xterm-256color
# Don't download rust docs # Don't download rust docs
RUN rustup set profile minimal RUN rustup set profile minimal

View File

@ -12,16 +12,7 @@ ENV VAULT_VERSION "v2.12.0b"
ENV URL "https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz" ENV URL "https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz"
# Build time options to avoid dpkg warnings and help with reproducible builds. # Build time options to avoid dpkg warnings and help with reproducible builds.
ARG DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 TZ=UTC TERM=xterm-256color
ARG LANG=C.UTF-8
ARG TZ=UTC
ARG TERM=xterm-256color
RUN apt-get update \
&& apt-get install -y \
--no-install-recommends \
curl \
tar
RUN mkdir /web-vault RUN mkdir /web-vault
WORKDIR /web-vault WORKDIR /web-vault
@ -40,10 +31,7 @@ FROM rust:1.40 as build
ARG DB=sqlite ARG DB=sqlite
# Build time options to avoid dpkg warnings and help with reproducible builds. # Build time options to avoid dpkg warnings and help with reproducible builds.
ARG DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 TZ=UTC TERM=xterm-256color
ARG LANG=C.UTF-8
ARG TZ=UTC
ARG TERM=xterm-256color
# Don't download rust docs # Don't download rust docs
RUN rustup set profile minimal RUN rustup set profile minimal

View File

@ -12,16 +12,7 @@ ENV VAULT_VERSION "v2.12.0b"
ENV URL "https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz" ENV URL "https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz"
# Build time options to avoid dpkg warnings and help with reproducible builds. # Build time options to avoid dpkg warnings and help with reproducible builds.
ARG DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 TZ=UTC TERM=xterm-256color
ARG LANG=C.UTF-8
ARG TZ=UTC
ARG TERM=xterm-256color
RUN apt-get update \
&& apt-get install -y \
--no-install-recommends \
curl \
tar
RUN mkdir /web-vault RUN mkdir /web-vault
WORKDIR /web-vault WORKDIR /web-vault
@ -40,10 +31,7 @@ FROM rust:1.40 as build
ARG DB=mysql ARG DB=mysql
# Build time options to avoid dpkg warnings and help with reproducible builds. # Build time options to avoid dpkg warnings and help with reproducible builds.
ARG DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 TZ=UTC TERM=xterm-256color
ARG LANG=C.UTF-8
ARG TZ=UTC
ARG TERM=xterm-256color
# Don't download rust docs # Don't download rust docs
RUN rustup set profile minimal RUN rustup set profile minimal

View File

@ -12,16 +12,7 @@ ENV VAULT_VERSION "v2.12.0b"
ENV URL "https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz" ENV URL "https://github.com/dani-garcia/bw_web_builds/releases/download/$VAULT_VERSION/bw_web_$VAULT_VERSION.tar.gz"
# Build time options to avoid dpkg warnings and help with reproducible builds. # Build time options to avoid dpkg warnings and help with reproducible builds.
ARG DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 TZ=UTC TERM=xterm-256color
ARG LANG=C.UTF-8
ARG TZ=UTC
ARG TERM=xterm-256color
RUN apt-get update \
&& apt-get install -y \
--no-install-recommends \
curl \
tar
RUN mkdir /web-vault RUN mkdir /web-vault
WORKDIR /web-vault WORKDIR /web-vault
@ -40,10 +31,7 @@ FROM rust:1.40 as build
ARG DB=sqlite ARG DB=sqlite
# Build time options to avoid dpkg warnings and help with reproducible builds. # Build time options to avoid dpkg warnings and help with reproducible builds.
ARG DEBIAN_FRONTEND=noninteractive ENV DEBIAN_FRONTEND=noninteractive LANG=C.UTF-8 TZ=UTC TERM=xterm-256color
ARG LANG=C.UTF-8
ARG TZ=UTC
ARG TERM=xterm-256color
# Don't download rust docs # Don't download rust docs
RUN rustup set profile minimal RUN rustup set profile minimal

View File

@ -92,6 +92,7 @@ struct RegistrationDef {
key_handle: Vec<u8>, key_handle: Vec<u8>,
pub_key: Vec<u8>, pub_key: Vec<u8>,
attestation_cert: Option<Vec<u8>>, attestation_cert: Option<Vec<u8>>,
device_name: Option<String>,
} }
#[derive(Serialize, Deserialize)] #[derive(Serialize, Deserialize)]