@o3co/create-auth-provider 0.17.0 → 0.18.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -198
- package/main.js +4 -0
- package/package.json +8 -30
- package/README.ja.md +0 -200
- package/dist/cli.d.mts +0 -3
- package/dist/cli.d.mts.map +0 -1
- package/dist/cli.mjs +0 -18
- package/dist/index.d.mts +0 -48
- package/dist/index.d.mts.map +0 -1
- package/dist/index.mjs +0 -325
- package/dist/internal/template-filter.d.mts +0 -14
- package/dist/internal/template-filter.d.mts.map +0 -1
- package/dist/internal/template-filter.mjs +0 -42
- package/templates/standalone/.dockerignore +0 -23
- package/templates/standalone/.env.example +0 -152
- package/templates/standalone/Dockerfile +0 -125
- package/templates/standalone/Makefile +0 -12
- package/templates/standalone/README.ja.md +0 -912
- package/templates/standalone/README.md +0 -1536
- package/templates/standalone/config/application.conf +0 -351
- package/templates/standalone/config/clients.yaml +0 -4
- package/templates/standalone/config/clients.yaml.example +0 -124
- package/templates/standalone/config/development.conf +0 -17
- package/templates/standalone/config/mailpit.conf +0 -13
- package/templates/standalone/config/production.conf +0 -15
- package/templates/standalone/config/reference.conf +0 -427
- package/templates/standalone/docker-compose.mailpit.yml +0 -39
- package/templates/standalone/docker-compose.production.yml +0 -229
- package/templates/standalone/docker-compose.test.yml +0 -16
- package/templates/standalone/docker-compose.yml +0 -67
- package/templates/standalone/gitignore +0 -23
- package/templates/standalone/package.json +0 -56
- package/templates/standalone/src/__tests__/adapters.test.mts +0 -425
- package/templates/standalone/src/__tests__/admission-lifecycle.test.mts +0 -87
- package/templates/standalone/src/__tests__/all-modules-composition.fixture.mts +0 -1188
- package/templates/standalone/src/__tests__/all-modules-composition.multi.test.mts +0 -285
- package/templates/standalone/src/__tests__/all-modules-composition.test.mts +0 -1154
- package/templates/standalone/src/__tests__/audit-sink.test.mts +0 -355
- package/templates/standalone/src/__tests__/backchannel-peer.fixture.mts +0 -64
- package/templates/standalone/src/__tests__/config-notices.test.mts +0 -157
- package/templates/standalone/src/__tests__/configPath.test.mts +0 -69
- package/templates/standalone/src/__tests__/configured-mfa-mode.fixture.mts +0 -48
- package/templates/standalone/src/__tests__/core-federations.test.mts +0 -252
- package/templates/standalone/src/__tests__/core-sections.test.mts +0 -192
- package/templates/standalone/src/__tests__/device-code-store-client-module.test.mts +0 -95
- package/templates/standalone/src/__tests__/documented-env-overrides.test.mts +0 -1291
- package/templates/standalone/src/__tests__/federation-grants-composition.test.mts +0 -787
- package/templates/standalone/src/__tests__/federation-grants-survive-logout.test.mts +0 -464
- package/templates/standalone/src/__tests__/federation-token-refresh-outage.test.mts +0 -141
- package/templates/standalone/src/__tests__/federation-types.test.mts +0 -239
- package/templates/standalone/src/__tests__/frontchannel-logout-csp.test.mts +0 -168
- package/templates/standalone/src/__tests__/google-session.fixture.mts +0 -318
- package/templates/standalone/src/__tests__/host-routes.test.mts +0 -134
- package/templates/standalone/src/__tests__/library-reference-resolution.smoke.test.mts +0 -29
- package/templates/standalone/src/__tests__/library-references.fixture.mts +0 -188
- package/templates/standalone/src/__tests__/lifecycle-pending-close.test.mts +0 -217
- package/templates/standalone/src/__tests__/listen.test.mts +0 -121
- package/templates/standalone/src/__tests__/logger-projection.test.mts +0 -77
- package/templates/standalone/src/__tests__/logout-session-cookie.test.mts +0 -113
- package/templates/standalone/src/__tests__/mail-sender.test.mts +0 -134
- package/templates/standalone/src/__tests__/mailpit-compose.test.mts +0 -393
- package/templates/standalone/src/__tests__/metrics.test.mts +0 -253
- package/templates/standalone/src/__tests__/mfa-routes-budget.test.mts +0 -122
- package/templates/standalone/src/__tests__/mfa-switch.redis.test.mts +0 -127
- package/templates/standalone/src/__tests__/mfa-switch.test.mts +0 -883
- package/templates/standalone/src/__tests__/own-modules.test.mts +0 -1480
- package/templates/standalone/src/__tests__/post-logout-redirect.test.mts +0 -183
- package/templates/standalone/src/__tests__/redis-assume-noeviction.test.mts +0 -283
- package/templates/standalone/src/__tests__/redis-connection-error-log.test.mts +0 -135
- package/templates/standalone/src/__tests__/redis-rate-limiter-config-survives.test.mts +0 -214
- package/templates/standalone/src/__tests__/redis-stand-in.fixture.mts +0 -98
- package/templates/standalone/src/__tests__/refresh-token-family-client-module.test.mts +0 -249
- package/templates/standalone/src/__tests__/replica-safety.test.mts +0 -657
- package/templates/standalone/src/__tests__/repositories-logger.test.mts +0 -119
- package/templates/standalone/src/__tests__/router-error-answers.test.mts +0 -146
- package/templates/standalone/src/__tests__/scaffold-assets.test.mts +0 -610
- package/templates/standalone/src/__tests__/sections.test.mts +0 -516
- package/templates/standalone/src/__tests__/session-lifecycle.test.mts +0 -213
- package/templates/standalone/src/__tests__/session-logout-invalidates-token.test.mts +0 -305
- package/templates/standalone/src/__tests__/session-logout-lifecycle.test.mts +0 -130
- package/templates/standalone/src/__tests__/session-requirements.test.mts +0 -382
- package/templates/standalone/src/__tests__/shipped-config-notices.test.mts +0 -274
- package/templates/standalone/src/__tests__/shutdown.test.mts +0 -622
- package/templates/standalone/src/__tests__/smoke.test.mts +0 -642
- package/templates/standalone/src/__tests__/startup-log-lines.test.mts +0 -164
- package/templates/standalone/src/__tests__/store-credential.test.mts +0 -314
- package/templates/standalone/src/__tests__/supertest-loopback.test.mts +0 -296
- package/templates/standalone/src/__tests__/three-tier-resolution.test.mts +0 -265
- package/templates/standalone/src/__tests__/two-phase-config.test.mts +0 -605
- package/templates/standalone/src/__tests__/upstream-amr.acceptance.test.mts +0 -385
- package/templates/standalone/src/adapters.mts +0 -162
- package/templates/standalone/src/app.mts +0 -127
- package/templates/standalone/src/bootRefusal.mts +0 -117
- package/templates/standalone/src/buildModules.mts +0 -358
- package/templates/standalone/src/configPath.mts +0 -487
- package/templates/standalone/src/listen.mts +0 -60
- package/templates/standalone/src/logger.mts +0 -80
- package/templates/standalone/src/metrics.mts +0 -167
- package/templates/standalone/src/mfaSwitch.mts +0 -284
- package/templates/standalone/src/modules.mts +0 -705
- package/templates/standalone/src/rootRenames.mts +0 -95
- package/templates/standalone/src/routes.mts +0 -89
- package/templates/standalone/src/sections.mts +0 -378
- package/templates/standalone/src/securityHeaders.mts +0 -36
- package/templates/standalone/src/shutdown.mts +0 -213
- package/templates/standalone/tests/Makefile +0 -5
- package/templates/standalone/tests/index.test.js +0 -283
- package/templates/standalone/tests/package-lock.json +0 -1617
- package/templates/standalone/tests/package.json +0 -16
- package/templates/standalone/tests/vitest.config.mjs +0 -26
- package/templates/standalone/tsconfig.json +0 -31
- package/templates/standalone/vitest.config.mts +0 -31
- package/templates/standalone/vitest.supertest-loopback.mts +0 -278
- package/templates/versions.json +0 -20
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
# The base image is pinned by digest, not just by tag: `node:26-alpine` is a
|
|
2
|
-
# moving pointer, so the same source produced a different image on every
|
|
3
|
-
# rebuild (#289). The digest is the multi-arch index, so amd64 and arm64 both
|
|
4
|
-
# resolve from it. Dependabot's `docker` ecosystem keeps the pair in step —
|
|
5
|
-
# bump the tag and the digest together, never the tag alone.
|
|
6
|
-
FROM node:26-alpine@sha256:0b36e8c136b94cd4fcf02188228e76c31ad5872eef3fec8cbd2eee500cfd9e80 AS node-base
|
|
7
|
-
|
|
8
|
-
ENV HOME=/home/node
|
|
9
|
-
|
|
10
|
-
# corepack is pinned too. `npm install -g corepack --force` resolved whatever
|
|
11
|
-
# was latest at build time, which is a mutable dependency of every build. The
|
|
12
|
-
# pnpm version itself comes from the `packageManager` field in package.json,
|
|
13
|
-
# which corepack reads.
|
|
14
|
-
RUN apk add --no-cache tini \
|
|
15
|
-
&& npm install -g corepack@0.35.0 --force \
|
|
16
|
-
&& corepack enable
|
|
17
|
-
|
|
18
|
-
WORKDIR /home/node
|
|
19
|
-
|
|
20
|
-
#############################################
|
|
21
|
-
FROM node-base AS deps
|
|
22
|
-
|
|
23
|
-
# pnpm-lock.yaml is a required build input: `create-auth-provider` generates
|
|
24
|
-
# it at scaffold time and the project commits it. Without it this COPY fails,
|
|
25
|
-
# which is the intended outcome — a build that silently re-resolves every
|
|
26
|
-
# dependency range is the thing this file stopped doing (#289).
|
|
27
|
-
#
|
|
28
|
-
# pnpm-workspace.yaml is required for the same reason and was missing (#407):
|
|
29
|
-
# the scaffolder generates it to carry bcrypt's `onlyBuiltDependencies`
|
|
30
|
-
# allowlist, and pnpm >= 10.29 reads that setting ONLY from this file, in
|
|
31
|
-
# single-package projects too (#360). Installing without it runs
|
|
32
|
-
# allowlist-less, so pnpm silently skips bcrypt's build hook — which costs
|
|
33
|
-
# nothing while an alpine prebuild exists, and re-creates #360 the day one
|
|
34
|
-
# is missing and the native addon has to compile.
|
|
35
|
-
COPY --chown=node:node package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
|
36
|
-
|
|
37
|
-
USER node
|
|
38
|
-
|
|
39
|
-
# --frozen-lockfile: install exactly what the lockfile pins, and fail if
|
|
40
|
-
# package.json and the lockfile disagree, rather than quietly rewriting it.
|
|
41
|
-
RUN pnpm install --frozen-lockfile
|
|
42
|
-
|
|
43
|
-
#############################################
|
|
44
|
-
FROM deps AS builder
|
|
45
|
-
|
|
46
|
-
# USER node inherited from deps stage; repeated here to make the builder
|
|
47
|
-
# hardening invariant obvious in Dockerfile reviews.
|
|
48
|
-
USER node
|
|
49
|
-
|
|
50
|
-
COPY --chown=node:node tsconfig.json ./
|
|
51
|
-
# What `.dockerignore` lets through (#705): the committed configuration layers
|
|
52
|
-
# and the example, never `clients.yaml` or a key. The runtime image copies
|
|
53
|
-
# this directory, so anything per-deployment here would be baked into it; the
|
|
54
|
-
# production compose mounts the client registry instead.
|
|
55
|
-
COPY --chown=node:node config/ ./config/
|
|
56
|
-
COPY --chown=node:node src/ ./src/
|
|
57
|
-
|
|
58
|
-
RUN pnpm run build
|
|
59
|
-
|
|
60
|
-
#############################################
|
|
61
|
-
# Dependencies are resolved once, in `deps`. This stage drops the dev half of
|
|
62
|
-
# that same tree instead of running a second `pnpm install --prod` in the
|
|
63
|
-
# runtime stage: a second install is a second resolution, and therefore a
|
|
64
|
-
# second chance for the runtime image to hold something the build never saw.
|
|
65
|
-
FROM deps AS prod-deps
|
|
66
|
-
|
|
67
|
-
USER node
|
|
68
|
-
|
|
69
|
-
RUN pnpm prune --prod
|
|
70
|
-
|
|
71
|
-
#############################################
|
|
72
|
-
FROM node-base AS runtime
|
|
73
|
-
|
|
74
|
-
ENV NODE_ENV=production
|
|
75
|
-
|
|
76
|
-
COPY --from=deps /home/node/package.json /home/node/pnpm-lock.yaml ./
|
|
77
|
-
COPY --from=prod-deps /home/node/node_modules/ ./node_modules/
|
|
78
|
-
COPY --from=builder /home/node/dist/ ./dist/
|
|
79
|
-
COPY --from=builder /home/node/config/ ./config/
|
|
80
|
-
|
|
81
|
-
USER node
|
|
82
|
-
|
|
83
|
-
ENV HTTP_PORT=3000
|
|
84
|
-
EXPOSE ${HTTP_PORT}
|
|
85
|
-
|
|
86
|
-
# Probes /_healthcheck (liveness), NOT /readyz. Docker has exactly one health
|
|
87
|
-
# signal, and on Swarm / ECS / autoheal-style supervisors an unhealthy
|
|
88
|
-
# container is stopped and replaced. Pointing it at /readyz would mean a 90s
|
|
89
|
-
# Redis failover marks every replica unhealthy and gets them all rescheduled —
|
|
90
|
-
# which reconnects nothing and adds cold starts to the incident. Losing Redis
|
|
91
|
-
# is a reason to stop routing to a replica, not to kill it.
|
|
92
|
-
#
|
|
93
|
-
# /readyz is the load-balancer / Kubernetes readinessProbe target; see the
|
|
94
|
-
# "Health endpoints" section of README.md. A compose file that genuinely wants
|
|
95
|
-
# `depends_on: condition: service_healthy` to mean "ready" can override this
|
|
96
|
-
# per-service, which keeps the restart-driving signal out of it.
|
|
97
|
-
#
|
|
98
|
-
# Use the shell form so ${HTTP_PORT} expands at probe time. The HOCON
|
|
99
|
-
# config reads `${?HTTP_PORT}` for `http.port`, so the listener and the
|
|
100
|
-
# probe stay in sync regardless of the operator's port choice.
|
|
101
|
-
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
|
|
102
|
-
CMD wget -q -O /dev/null "http://localhost:${HTTP_PORT}/_healthcheck" || exit 1
|
|
103
|
-
|
|
104
|
-
ENTRYPOINT ["tini", "--"]
|
|
105
|
-
CMD ["node", "dist/app.mjs"]
|
|
106
|
-
|
|
107
|
-
#############################################
|
|
108
|
-
FROM builder AS test
|
|
109
|
-
|
|
110
|
-
COPY --chown=node:node vitest.config.mts vitest.supertest-loopback.mts ./
|
|
111
|
-
COPY --chown=node:node tests/ ./tests/
|
|
112
|
-
# #512: the suite reads these from the project root (scaffold-assets,
|
|
113
|
-
# documented-env-overrides, smoke). The builder stage brings only what the
|
|
114
|
-
# build needs, so inside this image they did not exist and `make test` failed
|
|
115
|
-
# on files that were never a test's business. `.dockerignore` lets them into
|
|
116
|
-
# the context for the same reason; nothing copies them into `runtime`.
|
|
117
|
-
COPY --chown=node:node Dockerfile .dockerignore .env.example .gitignore README.md README.ja.md \
|
|
118
|
-
docker-compose.yml docker-compose.production.yml docker-compose.mailpit.yml ./
|
|
119
|
-
|
|
120
|
-
CMD ["pnpm", "run", "test", "--", "--passWithNoTests"]
|
|
121
|
-
|
|
122
|
-
#############################################
|
|
123
|
-
FROM builder AS develop
|
|
124
|
-
|
|
125
|
-
CMD ["pnpm", "run", "debug"]
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
IMAGE ?= auth-provider
|
|
2
|
-
|
|
3
|
-
.PHONY: dev test build
|
|
4
|
-
|
|
5
|
-
dev:
|
|
6
|
-
docker compose up --build
|
|
7
|
-
|
|
8
|
-
test:
|
|
9
|
-
docker compose -f docker-compose.test.yml up --build --abort-on-container-exit --exit-code-from test
|
|
10
|
-
|
|
11
|
-
build:
|
|
12
|
-
docker build --target runtime -t $(IMAGE) .
|