@maronn-openid-connect/cli 0.0.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.
Files changed (47) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +134 -0
  3. package/dist/features.d.ts +19 -0
  4. package/dist/features.d.ts.map +1 -0
  5. package/dist/features.js +64 -0
  6. package/dist/features.js.map +1 -0
  7. package/dist/frameworks/express/index.d.ts +7 -0
  8. package/dist/frameworks/express/index.d.ts.map +1 -0
  9. package/dist/frameworks/express/index.js +9 -0
  10. package/dist/frameworks/express/index.js.map +1 -0
  11. package/dist/frameworks/fastify/index.d.ts +7 -0
  12. package/dist/frameworks/fastify/index.d.ts.map +1 -0
  13. package/dist/frameworks/fastify/index.js +9 -0
  14. package/dist/frameworks/fastify/index.js.map +1 -0
  15. package/dist/frameworks/hono/index.d.ts +7 -0
  16. package/dist/frameworks/hono/index.d.ts.map +1 -0
  17. package/dist/frameworks/hono/index.js +36 -0
  18. package/dist/frameworks/hono/index.js.map +1 -0
  19. package/dist/frameworks/hono/templates.d.ts +37 -0
  20. package/dist/frameworks/hono/templates.d.ts.map +1 -0
  21. package/dist/frameworks/hono/templates.js +8315 -0
  22. package/dist/frameworks/hono/templates.js.map +1 -0
  23. package/dist/frameworks/index.d.ts +5 -0
  24. package/dist/frameworks/index.d.ts.map +1 -0
  25. package/dist/frameworks/index.js +19 -0
  26. package/dist/frameworks/index.js.map +1 -0
  27. package/dist/frameworks/nextjs/index.d.ts +7 -0
  28. package/dist/frameworks/nextjs/index.d.ts.map +1 -0
  29. package/dist/frameworks/nextjs/index.js +9 -0
  30. package/dist/frameworks/nextjs/index.js.map +1 -0
  31. package/dist/frameworks/types.d.ts +16 -0
  32. package/dist/frameworks/types.d.ts.map +1 -0
  33. package/dist/frameworks/types.js +2 -0
  34. package/dist/frameworks/types.js.map +1 -0
  35. package/dist/frameworks/web-standard/templates.d.ts +21 -0
  36. package/dist/frameworks/web-standard/templates.d.ts.map +1 -0
  37. package/dist/frameworks/web-standard/templates.js +2191 -0
  38. package/dist/frameworks/web-standard/templates.js.map +1 -0
  39. package/dist/generator.d.ts +16 -0
  40. package/dist/generator.d.ts.map +1 -0
  41. package/dist/generator.js +15 -0
  42. package/dist/generator.js.map +1 -0
  43. package/dist/index.d.ts +3 -0
  44. package/dist/index.d.ts.map +1 -0
  45. package/dist/index.js +242 -0
  46. package/dist/index.js.map +1 -0
  47. package/package.json +53 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 maronnjapan
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,134 @@
1
+ # @maronn-openid-connect/cli
2
+
3
+ OpenID Connect Provider のコードを生成する CLI ツール。
4
+ Hono / Express / Fastify / Next.js 向けに、Authorization Code Flow(OAuth 2.1 / OIDC Core 1.0 準拠)を実装した OP コード一式を生成する。
5
+
6
+ 生成コードは [`@maronn-openid-connect/core`](../core) のロジックを HTTP に配線したもので、利用者はこのコードを改造しながら「自分の要件がこの仕様で実現できるか」を検証する。
7
+
8
+ 生成されるエンドポイントは、core の機能単位ステップ関数を 1 ステップ = 1 関数呼び出しの形で並べる。まとめ関数(`validateAuthorizationRequest` / `validateTokenRequest` / `authenticateClient` / `generateTokenResponse` / `handleUserInfoRequest` / `handleIntrospectionRequest` / `handleRevocationRequest` / `checkPromptNone`)を 1 回呼ぶのではなく各ステップを並べているため、不要な検証を消したり、ステップの間に独自処理を足したりして仕様の挙動を検証しやすい。
9
+
10
+ | 生成ファイル | 並べているステップ |
11
+ |---|---|
12
+ | `routes/authorize.ts` | 認可リクエスト検証(`resolveClientForAuthorization` → `validateResponseType` → `validateAuthorizationCodePkce` ほか)と `prompt=none`(`resolvePromptNoneSession` → `validatePromptNoneIdTokenHint` → `validatePromptNoneConsent`) |
13
+ | `routes/token.ts` | クライアント認証(`extractClientCredentials` → `validateClientAuthMethod` → `verifyClientSecret`)、grant 検証(`resolveAuthorizationCode` → `validateAuthorizationCodeExpiration` → `verifyAuthorizationCodePkce` ほか)、レスポンス生成(`buildAccessTokenPayload` → `computeAtHash` → `resolveAcrAmr` → `buildIdTokenPayload` → `generateIdToken`) |
14
+ | `routes/userinfo.ts` | `resolveUserInfoAccessToken` → `validateUserInfoTokenExpiration` → `validateUserInfoScope` → `validateUserInfoAudience` → `resolveUserInfoClaims` → `filterClaimsByScope` → `applyRequestedClaims` |
15
+ | `routes/introspection.ts` | `requireIntrospectionToken` → `requireIntrospectionClient` → `resolveIntrospectionToken` → `isIntrospectionTokenActive` → `buildIntrospectionResponse` |
16
+ | `routes/revocation.ts` | `requireRevocationToken` → `requireRevocationClient` → `resolveRevocationTarget` → `validateRevocationTokenClient` → `revokeResolvedToken` → `revokeGrantAccessTokens` |
17
+
18
+ ID Token へ独自クレームを足すなら `routes/token.ts` の `buildIdTokenPayload` の戻り値を署名前に書き換える、といった改修が生成コード上で完結する。ただし検証ステップを消した構成は `conformance.test.ts`(契約テスト)が失敗し、Basic OP の想定挙動から外れたことを検知できる。
19
+
20
+ ## インストールと実行
21
+
22
+ ```bash
23
+ # インストールせずに実行
24
+ pnpm dlx @maronn-openid-connect/cli generate hono
25
+
26
+ # またはプロジェクトに追加してから実行
27
+ pnpm add -D @maronn-openid-connect/cli
28
+ pnpm maronn-oidc generate hono
29
+ ```
30
+
31
+ ## 使い方
32
+
33
+ ```bash
34
+ # コード生成
35
+ maronn-oidc generate <framework> [options]
36
+
37
+ # 生成 + 既存エントリファイルへの組み込み(Next.js 以外)
38
+ maronn-oidc setup <framework> [options]
39
+ ```
40
+
41
+ 対応フレームワーク: `hono`, `express`, `fastify`, `nextjs`
42
+
43
+ `setup` は生成に加えて、エントリファイル内のプレースホルダーコメント(`// <!-- OIDC_IMPORT_PLACEHOLDER -->` と `// <!-- OIDC_SETUP_PLACEHOLDER -->`)を `applyOidc` の import と呼び出しに置換する。Next.js は App Router のファイル規約に従うため `setup` 非対応で、`maronn-oidc generate nextjs --output ./src/app` を使う。
44
+
45
+ ### オプション
46
+
47
+ | オプション | 説明 |
48
+ |---|---|
49
+ | `--output, -o <dir>` | 出力先ディレクトリ(既定: `./oidc-provider`) |
50
+ | `--entry, -e <file>` | setup 時にパッチするエントリファイル(既定: `./src/index.ts`) |
51
+ | `--enable <features>` | 有効化する機能(カンマ区切り・複数回指定可) |
52
+ | `--disable <features>` | 既定セットから外す機能(カンマ区切り・複数回指定可) |
53
+ | `--help, -h` | ヘルプ表示 |
54
+
55
+ ## 生成されるもの
56
+
57
+ ```
58
+ oidc-provider/
59
+ ├── app.ts / apply.ts # OP 本体と既存アプリへの組み込み関数
60
+ ├── config.ts # ProviderConfig・クライアント登録(既定値はローカル検証専用)
61
+ ├── store.ts # インメモリストア(認可コード・トークン・セッション等)
62
+ ├── resolvers.ts # セッション・同意状態の resolver
63
+ ├── views.ts # ログイン / 同意 / エラー画面のデフォルト UI
64
+ ├── routes/ # 各エンドポイントのルート実装
65
+ └── conformance.test.ts # 生成 OP の想定挙動を固定する契約テスト
66
+ ```
67
+
68
+ 生成される OP のエンドポイント:
69
+
70
+ | パス | 役割 |
71
+ |---|---|
72
+ | `/authorize` | 認可エンドポイント(`response_type=code`、PKCE S256、`prompt` / `max_age` / `claims` / Request Object 対応) |
73
+ | `/token` | トークンエンドポイント(`authorization_code` / `refresh_token` グラント、`client_secret_basic` / `client_secret_post` / public client) |
74
+ | `/userinfo` | UserInfo エンドポイント(Bearer トークン、scope 別クレーム) |
75
+ | `/login`, `/consent` | ログイン・同意画面(差し替え可能なデフォルト UI 付き) |
76
+ | `/.well-known/openid-configuration` | Discovery メタデータ |
77
+ | `/.well-known/jwks.json` | JWKS(公開鍵) |
78
+ | `/introspect` | RFC 7662 Token Introspection(`introspection` 有効時) |
79
+ | `/revoke` | RFC 7009 Token Revocation(`revocation` 有効時) |
80
+
81
+ ## 機能トグル(--enable / --disable)
82
+
83
+ 生成されるOPの機能は、既定の全部入り構成から機能単位で増減できる。
84
+
85
+ ```bash
86
+ # リフレッシュトークンとイントロスペクションを外した OP を生成
87
+ maronn-oidc generate hono --disable refresh-token,introspection
88
+
89
+ # PKCE を任意化(confidential client の非PKCEフローを許可)
90
+ maronn-oidc generate express --disable pkce
91
+ ```
92
+
93
+ | 機能名 | 既定 | `--disable` 時の挙動 |
94
+ |---|---|---|
95
+ | `pkce` | 有効 | PKCE を任意化する(`allowNonPkceAuthorizationCodeFlow: true`)。明示的な confidential client の完全な非PKCEリクエストのみ許可され、public client や不正な PKCE 値は引き続き拒否される |
96
+ | `refresh-token` | 有効 | `refresh_token` grant を `unsupported_grant_type` で拒否。`offline_access` は付与されず、リフレッシュトークンは発行されない。discovery からも除去される |
97
+ | `introspection` | 有効 | RFC 7662 introspection エンドポイント(`/introspect`)を生成しない |
98
+ | `revocation` | 有効 | RFC 7009 revocation エンドポイント(`/revoke`)を生成しない |
99
+ | `request-object` | 有効 | `request` パラメータ(Request Object by value, OIDC Core 1.0 §6.1)を `request_not_supported` で拒否。discovery は `request_parameter_supported: false` を広告する |
100
+
101
+ Basic OP に必須の機能(authorize / token / userinfo / discovery / jwks / login / consent)はトグル対象外で、常に生成される。
102
+ 未知の機能名や、同じ機能を `--enable` と `--disable` の両方に指定した場合はエラーになる。
103
+
104
+ ### conformance.test.ts との関係
105
+
106
+ 生成物には `conformance.test.ts`(契約テスト)が含まれ、選択した機能構成に合わせた内容で生成される。
107
+ 無効化した機能については「無効であること」(404 応答、`unsupported_grant_type` / `request_not_supported` の拒否、discovery メタデータの不在など)をテストで固定する。
108
+ 生成コードをカスタマイズした結果このテストが通らなくなった場合、本リポジトリが担保する Basic OP 挙動から外れている可能性がある。
109
+
110
+ ## 生成後のセットアップ
111
+
112
+ 1. ProviderConfig・署名鍵・クライアント resolver を環境変数 / DB / KV から供給する
113
+ 2. 生成される `JsonStoreBackend` を実装し、`createJsonProviderStores()` の結果を `storage` に渡す
114
+ 3. `config.ts` と未指定時のインメモリストアはローカル検証・契約テスト専用として扱う
115
+ 4. 依存をインストールしてサーバーを起動する(例: `pnpm add hono @maronn-openid-connect/core`)
116
+
117
+ 署名鍵は `SigningKeyProvider` として注入する。`createCachedSigningKeyProvider()`(core 提供)でラップすると、TTL 付きキャッシュで鍵ローテーションに追随できる。
118
+
119
+ ```typescript
120
+ import { applyOidc } from './oidc-provider/apply.js';
121
+ import { createJsonProviderStores } from './oidc-provider/store.js';
122
+
123
+ applyOidc(app, {
124
+ config: { issuer: 'http://localhost:3000' },
125
+ signingKeyProvider: yourSigningKeyProvider,
126
+ storage: createJsonProviderStores(yourJsonStoreBackend),
127
+ });
128
+ ```
129
+
130
+ Honoではリクエストごとのバインディングを受け取るstorage factoryも指定できる。配線済みの実例は本リポジトリの `samples/hono-cloudflare` / `samples/express-flyio` / `samples/fastify-flyio` / `samples/nextjs-vercel` を参照。
131
+
132
+ ## ライセンス
133
+
134
+ MIT
@@ -0,0 +1,19 @@
1
+ export declare const AVAILABLE_FEATURES: readonly ["pkce", "refresh-token", "introspection", "revocation", "request-object"];
2
+ export type FeatureName = (typeof AVAILABLE_FEATURES)[number];
3
+ export declare const EXPERIMENTAL_FEATURES: readonly ["par", "token-exchange"];
4
+ export type ExperimentalFeatureName = (typeof EXPERIMENTAL_FEATURES)[number];
5
+ export interface OidcFeatureConfig {
6
+ pkce: boolean;
7
+ refreshToken: boolean;
8
+ introspection: boolean;
9
+ revocation: boolean;
10
+ requestObject: boolean;
11
+ par: boolean;
12
+ tokenExchange: boolean;
13
+ }
14
+ export declare const DEFAULT_FEATURES: OidcFeatureConfig;
15
+ export declare function resolveFeatures(options: {
16
+ enable?: string[];
17
+ disable?: string[];
18
+ }): OidcFeatureConfig;
19
+ //# sourceMappingURL=features.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../src/features.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,kBAAkB,qFAMrB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC;AAa9D,eAAO,MAAM,qBAAqB,oCAAqC,CAAC;AAExE,MAAM,MAAM,uBAAuB,GAAG,CAAC,OAAO,qBAAqB,CAAC,CAAC,MAAM,CAAC,CAAC;AAuB7E,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,OAAO,CAAC;IACvB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;IACvB,GAAG,EAAE,OAAO,CAAC;IACb,aAAa,EAAE,OAAO,CAAC;CACxB;AAqBD,eAAO,MAAM,gBAAgB,EAAE,iBAQ9B,CAAC;AA6BF,wBAAgB,eAAe,CAAC,OAAO,EAAE;IACvC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB,GAAG,iBAAiB,CA0BpB"}
@@ -0,0 +1,64 @@
1
+ export const AVAILABLE_FEATURES = [
2
+ 'pkce',
3
+ 'refresh-token',
4
+ 'introspection',
5
+ 'revocation',
6
+ 'request-object',
7
+ ];
8
+ export const EXPERIMENTAL_FEATURES = ['par', 'token-exchange'];
9
+ const FEATURE_KEYS = {
10
+ pkce: 'pkce',
11
+ 'refresh-token': 'refreshToken',
12
+ introspection: 'introspection',
13
+ revocation: 'revocation',
14
+ 'request-object': 'requestObject',
15
+ };
16
+ const EXPERIMENTAL_FEATURE_KEYS = {
17
+ par: 'par',
18
+ 'token-exchange': 'tokenExchange',
19
+ };
20
+ export const DEFAULT_FEATURES = {
21
+ pkce: true,
22
+ refreshToken: true,
23
+ introspection: true,
24
+ revocation: true,
25
+ requestObject: true,
26
+ par: false,
27
+ tokenExchange: false,
28
+ };
29
+ function isExperimentalFeature(name) {
30
+ return EXPERIMENTAL_FEATURES.includes(name);
31
+ }
32
+ function assertKnownFeature(name) {
33
+ if (!AVAILABLE_FEATURES.includes(name) &&
34
+ !isExperimentalFeature(name)) {
35
+ throw new Error(`Unknown feature: "${name}". Available features: ${AVAILABLE_FEATURES.join(', ')}. ` +
36
+ `Experimental features (disabled by default): ${EXPERIMENTAL_FEATURES.join(', ')}`);
37
+ }
38
+ }
39
+ function featureKey(name) {
40
+ return isExperimentalFeature(name) ? EXPERIMENTAL_FEATURE_KEYS[name] : FEATURE_KEYS[name];
41
+ }
42
+ export function resolveFeatures(options) {
43
+ const enable = options.enable ?? [];
44
+ const disable = options.disable ?? [];
45
+ for (const name of [...enable, ...disable]) {
46
+ assertKnownFeature(name);
47
+ }
48
+ for (const name of enable) {
49
+ if (disable.includes(name)) {
50
+ throw new Error(`Feature "${name}" cannot be both enabled and disabled`);
51
+ }
52
+ }
53
+ const features = { ...DEFAULT_FEATURES };
54
+ for (const name of enable) {
55
+ assertKnownFeature(name);
56
+ features[featureKey(name)] = true;
57
+ }
58
+ for (const name of disable) {
59
+ assertKnownFeature(name);
60
+ features[featureKey(name)] = false;
61
+ }
62
+ return features;
63
+ }
64
+ //# sourceMappingURL=features.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features.js","sourceRoot":"","sources":["../src/features.ts"],"names":[],"mappings":"AAeA,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,MAAM;IACN,eAAe;IACf,eAAe;IACf,YAAY;IACZ,gBAAgB;CACR,CAAC;AAeX,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,KAAK,EAAE,gBAAgB,CAAU,CAAC;AAoCxE,MAAM,YAAY,GAAiD;IACjE,IAAI,EAAE,MAAM;IACZ,eAAe,EAAE,cAAc;IAC/B,aAAa,EAAE,eAAe;IAC9B,UAAU,EAAE,YAAY;IACxB,gBAAgB,EAAE,eAAe;CAClC,CAAC;AAGF,MAAM,yBAAyB,GAA6D;IAC1F,GAAG,EAAE,KAAK;IACV,gBAAgB,EAAE,eAAe;CAClC,CAAC;AAMF,MAAM,CAAC,MAAM,gBAAgB,GAAsB;IACjD,IAAI,EAAE,IAAI;IACV,YAAY,EAAE,IAAI;IAClB,aAAa,EAAE,IAAI;IACnB,UAAU,EAAE,IAAI;IAChB,aAAa,EAAE,IAAI;IACnB,GAAG,EAAE,KAAK;IACV,aAAa,EAAE,KAAK;CACrB,CAAC;AAEF,SAAS,qBAAqB,CAAC,IAAY;IACzC,OAAQ,qBAA2C,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACrE,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAY;IACtC,IACE,CAAE,kBAAwC,CAAC,QAAQ,CAAC,IAAI,CAAC;QACzD,CAAC,qBAAqB,CAAC,IAAI,CAAC,EAC5B,CAAC;QACD,MAAM,IAAI,KAAK,CACb,qBAAqB,IAAI,0BAA0B,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;YAClF,gDAAgD,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACrF,CAAC;IACJ,CAAC;AACH,CAAC;AAED,SAAS,UAAU,CAAC,IAA2C;IAC7D,OAAO,qBAAqB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,yBAAyB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;AAC5F,CAAC;AASD,MAAM,UAAU,eAAe,CAAC,OAG/B;IACC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,EAAE,CAAC;IACpC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC;IAEtC,KAAK,MAAM,IAAI,IAAI,CAAC,GAAG,MAAM,EAAE,GAAG,OAAO,CAAC,EAAE,CAAC;QAC3C,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;IAED,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC1B,IAAI,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YAC3B,MAAM,IAAI,KAAK,CAAC,YAAY,IAAI,uCAAuC,CAAC,CAAC;QAC3E,CAAC;IACH,CAAC;IAED,MAAM,QAAQ,GAAsB,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAC5D,KAAK,MAAM,IAAI,IAAI,MAAM,EAAE,CAAC;QAC1B,kBAAkB,CAAC,IAAI,CAAC,CAAC;QACzB,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC;IACpC,CAAC;IAGD,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;QAC3B,kBAAkB,CAAC,IAAI,CAAC,CAAC;QACzB,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC;IACrC,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import type { FrameworkGenerator, GeneratedFile, GeneratorOptions } from '../types.js';
2
+ export declare class ExpressGenerator implements FrameworkGenerator {
3
+ readonly name = "express";
4
+ readonly displayName = "Express";
5
+ generate(options: GeneratorOptions): GeneratedFile[];
6
+ }
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/frameworks/express/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGvF,qBAAa,gBAAiB,YAAW,kBAAkB;IACzD,QAAQ,CAAC,IAAI,aAAa;IAC1B,QAAQ,CAAC,WAAW,aAAa;IAEjC,QAAQ,CAAC,OAAO,EAAE,gBAAgB,GAAG,aAAa,EAAE;CAOrD"}
@@ -0,0 +1,9 @@
1
+ import { expressApplyTemplate, webGeneratedFiles } from '../web-standard/templates.js';
2
+ export class ExpressGenerator {
3
+ name = 'express';
4
+ displayName = 'Express';
5
+ generate(options) {
6
+ return webGeneratedFiles(options.corePackageName, expressApplyTemplate(options.features), options.features);
7
+ }
8
+ }
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/frameworks/express/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEvF,MAAM,OAAO,gBAAgB;IAClB,IAAI,GAAG,SAAS,CAAC;IACjB,WAAW,GAAG,SAAS,CAAC;IAEjC,QAAQ,CAAC,OAAyB;QAChC,OAAO,iBAAiB,CACtB,OAAO,CAAC,eAAe,EACvB,oBAAoB,CAAC,OAAO,CAAC,QAAQ,CAAC,EACtC,OAAO,CAAC,QAAQ,CACjB,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,7 @@
1
+ import type { FrameworkGenerator, GeneratedFile, GeneratorOptions } from '../types.js';
2
+ export declare class FastifyGenerator implements FrameworkGenerator {
3
+ readonly name = "fastify";
4
+ readonly displayName = "Fastify";
5
+ generate(options: GeneratorOptions): GeneratedFile[];
6
+ }
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/frameworks/fastify/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGvF,qBAAa,gBAAiB,YAAW,kBAAkB;IACzD,QAAQ,CAAC,IAAI,aAAa;IAC1B,QAAQ,CAAC,WAAW,aAAa;IAEjC,QAAQ,CAAC,OAAO,EAAE,gBAAgB,GAAG,aAAa,EAAE;CAOrD"}
@@ -0,0 +1,9 @@
1
+ import { fastifyApplyTemplate, webGeneratedFiles } from '../web-standard/templates.js';
2
+ export class FastifyGenerator {
3
+ name = 'fastify';
4
+ displayName = 'Fastify';
5
+ generate(options) {
6
+ return webGeneratedFiles(options.corePackageName, fastifyApplyTemplate(options.features), options.features);
7
+ }
8
+ }
9
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/frameworks/fastify/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEvF,MAAM,OAAO,gBAAgB;IAClB,IAAI,GAAG,SAAS,CAAC;IACjB,WAAW,GAAG,SAAS,CAAC;IAEjC,QAAQ,CAAC,OAAyB;QAChC,OAAO,iBAAiB,CACtB,OAAO,CAAC,eAAe,EACvB,oBAAoB,CAAC,OAAO,CAAC,QAAQ,CAAC,EACtC,OAAO,CAAC,QAAQ,CACjB,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,7 @@
1
+ import type { FrameworkGenerator, GeneratedFile, GeneratorOptions } from '../types.js';
2
+ export declare class HonoGenerator implements FrameworkGenerator {
3
+ readonly name = "hono";
4
+ readonly displayName = "Hono";
5
+ generate(options: GeneratorOptions): GeneratedFile[];
6
+ }
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/frameworks/hono/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAsBvF,qBAAa,aAAc,YAAW,kBAAkB;IACtD,QAAQ,CAAC,IAAI,UAAU;IACvB,QAAQ,CAAC,WAAW,UAAU;IAE9B,QAAQ,CAAC,OAAO,EAAE,gBAAgB,GAAG,aAAa,EAAE;CA+BrD"}
@@ -0,0 +1,36 @@
1
+ import { DEFAULT_FEATURES } from '../../features.js';
2
+ import { appTemplate, applyTemplate, configTemplate, storeTemplate, resolversTemplate, viewsTemplate, authorizeRouteTemplate, tokenRouteTemplate, userinfoRouteTemplate, introspectionRouteTemplate, revocationRouteTemplate, jwksRouteTemplate, parRouteTemplate, discoveryRouteTemplate, loginRouteTemplate, consentRouteTemplate, conformanceTestTemplate, } from './templates.js';
3
+ export class HonoGenerator {
4
+ name = 'hono';
5
+ displayName = 'Hono';
6
+ generate(options) {
7
+ const pkg = options.corePackageName;
8
+ const features = options.features ?? DEFAULT_FEATURES;
9
+ return [
10
+ { path: 'app.ts', content: appTemplate(pkg, features) },
11
+ { path: 'apply.ts', content: applyTemplate(pkg, features) },
12
+ { path: 'config.ts', content: configTemplate(pkg, features) },
13
+ { path: 'store.ts', content: storeTemplate(pkg, features) },
14
+ { path: 'resolvers.ts', content: resolversTemplate(pkg, features) },
15
+ { path: 'views.ts', content: viewsTemplate() },
16
+ { path: 'routes/authorize.ts', content: authorizeRouteTemplate(pkg, features) },
17
+ { path: 'routes/token.ts', content: tokenRouteTemplate(pkg, features) },
18
+ { path: 'routes/userinfo.ts', content: userinfoRouteTemplate(pkg) },
19
+ ...(features.introspection
20
+ ? [{ path: 'routes/introspection.ts', content: introspectionRouteTemplate(pkg) }]
21
+ : []),
22
+ ...(features.revocation
23
+ ? [{ path: 'routes/revocation.ts', content: revocationRouteTemplate(pkg) }]
24
+ : []),
25
+ ...(features.par
26
+ ? [{ path: 'routes/par.ts', content: parRouteTemplate(pkg) }]
27
+ : []),
28
+ { path: 'routes/jwks.ts', content: jwksRouteTemplate(pkg) },
29
+ { path: 'routes/discovery.ts', content: discoveryRouteTemplate(pkg, features) },
30
+ { path: 'routes/login.ts', content: loginRouteTemplate(pkg) },
31
+ { path: 'routes/consent.ts', content: consentRouteTemplate(pkg) },
32
+ { path: 'conformance.test.ts', content: conformanceTestTemplate(pkg, features) },
33
+ ];
34
+ }
35
+ }
36
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/frameworks/hono/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EACL,WAAW,EACX,aAAa,EACb,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,sBAAsB,EACtB,kBAAkB,EAClB,qBAAqB,EACrB,0BAA0B,EAC1B,uBAAuB,EACvB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,EACpB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AAExB,MAAM,OAAO,aAAa;IACf,IAAI,GAAG,MAAM,CAAC;IACd,WAAW,GAAG,MAAM,CAAC;IAE9B,QAAQ,CAAC,OAAyB;QAChC,MAAM,GAAG,GAAG,OAAO,CAAC,eAAe,CAAC;QACpC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,gBAAgB,CAAC;QAEtD,OAAO;YACL,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,CAAC,GAAG,EAAE,QAAQ,CAAC,EAAE;YACvD,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,CAAC,GAAG,EAAE,QAAQ,CAAC,EAAE;YAC3D,EAAE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AE,IAAI,EAAE,qBAAqB,EAAE,OAAO,EAAE,sBAAsB,CAAC,GAAG,EAAE,QAAQ,CAAC,EAAE;YAC/E,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,kBAAkB,CAAC,GAAG,CAAC,EAAE;YAC7D,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,EAAE,oBAAoB,CAAC,GAAG,CAAC,EAAE;YACjE,EAAE,IAAI,EAAE,qBAAqB,EAAE,OAAO,EAAE,uBAAuB,CAAC,GAAG,EAAE,QAAQ,CAAC,EAAE;SACjF,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,37 @@
1
+ import type { OidcFeatureConfig } from '../../features.js';
2
+ export declare const EXPERIMENTAL_PACKAGE = "@maronn-openid-connect/experimental";
3
+ export declare function appTemplate(_corePkg: string, features?: OidcFeatureConfig): string;
4
+ export declare function configTemplate(corePkg: string, features?: OidcFeatureConfig): string;
5
+ export declare function storeTemplate(corePkg: string, features?: OidcFeatureConfig): string;
6
+ export declare function resolversTemplate(corePkg: string, features?: OidcFeatureConfig): string;
7
+ export declare function authorizeRouteTemplate(corePkg: string, features?: OidcFeatureConfig): string;
8
+ export declare function parRouteTemplate(corePkg: string): string;
9
+ export declare function tokenRouteTemplate(corePkg: string, features?: OidcFeatureConfig): string;
10
+ export declare function userinfoRouteTemplate(corePkg: string): string;
11
+ export declare function jwksRouteTemplate(corePkg: string): string;
12
+ export declare function discoveryRouteTemplate(corePkg: string, features?: OidcFeatureConfig): string;
13
+ export declare function loginRouteTemplate(corePkg: string): string;
14
+ export declare function consentRouteTemplate(corePkg: string): string;
15
+ export declare function applyTemplate(_corePkg: string, features?: OidcFeatureConfig): string;
16
+ export declare function introspectionRouteTemplate(corePkg: string): string;
17
+ export declare function revocationRouteTemplate(corePkg: string): string;
18
+ export declare function viewsTemplate(): string;
19
+ export declare function requestObjectConformanceModuleSetup(features?: OidcFeatureConfig): string;
20
+ export declare function requestObjectConformanceBeforeAll(features?: OidcFeatureConfig): string;
21
+ export declare function reuseFlowConformanceTestBlock(features?: OidcFeatureConfig): string;
22
+ export declare function customViewConformanceTestBlock(): string;
23
+ export declare function conformanceTestClientsBlock(features: OidcFeatureConfig): string;
24
+ export declare function scopesSupportedConformanceTest(features: OidcFeatureConfig): string;
25
+ export declare function featureDisabledDiscoveryConformanceTests(features: OidcFeatureConfig): string;
26
+ export declare function introspectionConformanceBlock(features: OidcFeatureConfig): string;
27
+ export declare function revocationDisabledConformanceBlock(features: OidcFeatureConfig): string;
28
+ export declare function pkceDisabledConformanceBlock(features: OidcFeatureConfig): string;
29
+ export declare function tokenEndpointAuthMethodsConformanceBlock(): string;
30
+ export declare function endpointBehaviorConformanceBlock(features: OidcFeatureConfig, includeHonoApplyParity?: boolean): string;
31
+ export declare function idTokenHintConformanceBlock(): string;
32
+ export declare function consentWithdrawalConformanceBlock(features: OidcFeatureConfig): string;
33
+ export declare function persistentStorageConformanceBlock(): string;
34
+ export declare function tokenExchangeConformanceBlock(features: OidcFeatureConfig): string;
35
+ export declare function parConformanceBlock(features: OidcFeatureConfig): string;
36
+ export declare function conformanceTestTemplate(corePkg: string, features?: OidcFeatureConfig): string;
37
+ //# sourceMappingURL=templates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/frameworks/hono/templates.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAO3D,eAAO,MAAM,oBAAoB,wCAAwC,CAAC;AAsC1E,wBAAgB,WAAW,CACzB,QAAQ,EAAE,MAAM,EAChB,QAAQ,GAAE,iBAAoC,GAC7C,MAAM,CA0QR;AAED,wBAAgB,cAAc,CAC5B,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,iBAAoC,GAC7C,MAAM,CAoMR;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,QAAQ,GAAE,iBAAoC,GAC7C,MAAM,CAs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