Skip to content

Commit

Permalink
Merge branch 'master' into cli-basic-auth
Browse files Browse the repository at this point in the history
  • Loading branch information
phsym committed May 20, 2022
2 parents 2cc643c + 9bc59be commit 5d1332f
Show file tree
Hide file tree
Showing 74 changed files with 1,375 additions and 469 deletions.
4 changes: 2 additions & 2 deletions .docker/Dockerfile-alpine
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM alpine:3.15.1
FROM alpine:3.15

RUN addgroup -S ory; \
adduser -S ory -G ory -D -H -s /bin/nologin
RUN apk --no-cache --update-cache --upgrade --latest add ca-certificates
RUN apk --no-cache --upgrade --latest add ca-certificates

COPY hydra /usr/bin/hydra

Expand Down
17 changes: 9 additions & 8 deletions .docker/Dockerfile-build
Original file line number Diff line number Diff line change
@@ -1,22 +1,20 @@
FROM golang:1.17-alpine3.15 AS builder

RUN apk -U --no-cache add build-base git gcc bash
RUN apk -U --no-cache --upgrade --latest add build-base git gcc bash

WORKDIR /go/src/github.com/ory/hydra

ADD go.mod go.mod
ADD go.sum go.sum

COPY go.mod go.sum ./
ENV GO111MODULE on
ENV CGO_ENABLED 1

RUN go mod download

ADD . .
COPY . .

RUN go build -tags sqlite -o /usr/bin/hydra

FROM alpine:3.15.1
FROM alpine:3.15

RUN addgroup -S ory; \
adduser -S ory -G ory -D -h /home/ory -s /bin/nologin; \
Expand All @@ -26,8 +24,9 @@ COPY --from=builder /usr/bin/hydra /usr/bin/hydra

# By creating the sqlite folder as the ory user, the mounted volume will be owned by ory:ory, which
# is required for read/write of SQLite.
RUN mkdir -p /var/lib/sqlite
RUN chown ory:ory /var/lib/sqlite
RUN mkdir -p /var/lib/sqlite && \
chown ory:ory /var/lib/sqlite

VOLUME /var/lib/sqlite

# Exposing the ory home directory
Expand All @@ -40,3 +39,5 @@ USER ory

ENTRYPOINT ["hydra"]
CMD ["serve"]


20 changes: 10 additions & 10 deletions .docker/Dockerfile-hsm
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
FROM golang:1.16-alpine AS builder
FROM golang:1.18-alpine AS builder

RUN apk --no-cache --update-cache --upgrade --latest add build-base git gcc bash
RUN apk --no-cache add --upgrade --latest build-base git gcc bash

WORKDIR /go/src/github.com/ory/hydra

ADD go.mod go.mod
ADD go.sum go.sum
COPY go.mod go.sum ./

ENV GO111MODULE on
ENV CGO_ENABLED 1

RUN go mod download

ADD . .
COPY . .

FROM builder as build-hydra
RUN go build -tags=sqlite,hsm -o /usr/bin/hydra
Expand All @@ -23,13 +22,13 @@ ENV HSM_LIBRARY=/usr/lib/softhsm/libsofthsm2.so
ENV HSM_TOKEN_LABEL=hydra
ENV HSM_PIN=1234

RUN apk --no-cache --update-cache --upgrade --latest add softhsm opensc; \
RUN apk --no-cache --upgrade --latest add softhsm opensc; \
pkcs11-tool --module /usr/lib/softhsm/libsofthsm2.so --slot 0 --init-token --so-pin 0000 --init-pin --pin 1234 --label hydra; \
go test -p 1 -v -failfast -short -tags=sqlite,hsm ./...

FROM alpine:3.15.1
FROM alpine:3.15

RUN apk --no-cache --update-cache --upgrade --latest add softhsm opensc; \
RUN apk --no-cache --upgrade --latest add softhsm opensc; \
pkcs11-tool --module /usr/lib/softhsm/libsofthsm2.so --slot 0 --init-token --so-pin 0000 --init-pin --pin 1234 --label hydra

RUN addgroup -S ory; \
Expand All @@ -41,8 +40,9 @@ COPY --from=build-hydra /usr/bin/hydra /usr/bin/hydra

# By creating the sqlite folder as the ory user, the mounted volume will be owned by ory:ory, which
# is required for read/write of SQLite.
RUN mkdir -p /var/lib/sqlite
RUN chown ory:ory /var/lib/sqlite
RUN mkdir -p /var/lib/sqlite && \
chown ory:ory /var/lib/sqlite

VOLUME /var/lib/sqlite

# Exposing the ory home directory
Expand Down
4 changes: 2 additions & 2 deletions .docker/Dockerfile-scratch
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM alpine:3.15.1
FROM alpine:3.15

RUN apk --no-cache --update-cache --upgrade --latest add ca-certificates
RUN apk --no-cache --upgrade --latest add ca-certificates

# set up nsswitch.conf for Go's "netgo" implementation
# - https://github.com/golang/go/blob/go1.9.1/src/net/conf.go#L194-L275
Expand Down
11 changes: 6 additions & 5 deletions .docker/Dockerfile-sqlite
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM alpine:3.15.1
FROM alpine:3.15

# Because this image is built for SQLite, we create /home/ory and /home/ory/sqlite which is owned by the ory user
# and declare /home/ory/sqlite a volume.
Expand All @@ -9,17 +9,18 @@ FROM alpine:3.15.1

RUN addgroup -S ory; \
adduser -S ory -G ory -D -h /home/ory -s /bin/nologin; \
chown -R ory:ory /home/ory
RUN apk --no-cache --update-cache --upgrade --latest add ca-certificates
chown -R ory:ory /home/ory && \
apk --no-cache --upgrade --latest add ca-certificates

WORKDIR /home/ory

COPY hydra /usr/bin/hydra

# By creating the sqlite folder as the ory user, the mounted volume will be owned by ory:ory, which
# is required for read/write of SQLite.
RUN mkdir -p /var/lib/sqlite
RUN chown ory:ory /var/lib/sqlite
RUN mkdir -p /var/lib/sqlite && \
chown ory:ory /var/lib/sqlite

VOLUME /var/lib/sqlite

# Exposing the ory home directory
Expand Down
8 changes: 8 additions & 0 deletions .schema/openapi/patches/oauth2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- op: remove
path: /components/schemas/consentRequestSession/properties/access_token/additionalProperties
- op: remove
path: /components/schemas/consentRequestSession/properties/access_token/type
- op: remove
path: /components/schemas/consentRequestSession/properties/id_token/additionalProperties
- op: remove
path: /components/schemas/consentRequestSession/properties/id_token/type

0 comments on commit 5d1332f

Please sign in to comment.