-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
59 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ HEREDOC | |
|
||
COPY hydra /usr/bin/hydra | ||
|
||
USER ory | ||
|
||
ENTRYPOINT ["hydra"] | ||
CMD ["serve", "all"] | ||
USER ory |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# This file is only used for testing the HSM feature of Hydra. It is not used in production nor is it being | ||
# distributed. | ||
FROM golang:1.22-alpine3.21 AS builder | ||
|
||
RUN apk -U --no-cache --upgrade --latest add build-base git gcc bash | ||
|
||
WORKDIR /go/src/github.com/ory/hydra | ||
RUN mkdir -p ./internal/httpclient | ||
|
||
COPY go.mod go.sum ./ | ||
COPY internal/httpclient/go.* ./internal/httpclient | ||
|
||
ENV CGO_ENABLED 1 | ||
|
||
RUN go mod download | ||
|
||
COPY . . | ||
|
||
FROM builder as build-hydra | ||
|
||
ENV HSM_ENABLED=true | ||
ENV HSM_LIBRARY=/usr/lib/softhsm/libsofthsm2.so | ||
ENV HSM_TOKEN_LABEL=hydra | ||
ENV HSM_PIN=1234 | ||
ENV UPDATE_SNAPSHOTS=true | ||
|
||
RUN apt-get -y install softhsm opensc | ||
RUN pkcs11-tool --module "$HSM_LIBRARY" --slot 0 --init-token --so-pin 0000 --init-pin --pin "$HSM_PIN" --label "$HSM_TOKEN_LABEL" | ||
|
||
FROM builder as test-hsm | ||
|
||
RUN go test -p 1 -failfast -short -tags=sqlite,hsm ./... | ||
|
||
FROM builder AS test-refresh-hsm | ||
|
||
RUN go test -p 1 -failfast -short -tags=sqlite,hsm,refresh ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters