@gjermundgaraba/clankerauth-dev 0.4.0
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/LICENSE +21 -0
- package/README.md +38 -0
- package/dist/THIRD_PARTY_NOTICES.txt +1576 -0
- package/dist/access-OpW0SRxm.mjs +1 -0
- package/dist/bun-sqlite-dialect-C7ftEUSI-DFKViJQ3.mjs +1 -0
- package/dist/compiled-query-xtJR566p.mjs +1 -0
- package/dist/d1-sqlite-dialect-D4qp4-wW-Rqu1eTED.mjs +1 -0
- package/dist/default-query-compiler-DTJtuKGc.mjs +1 -0
- package/dist/dist-DpbKAALD.mjs +1 -0
- package/dist/dist-lqtcybuJ.mjs +17 -0
- package/dist/esm-CdWTLqG7.mjs +1 -0
- package/dist/factory-BZXyDHm6.mjs +6 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.mjs +517 -0
- package/dist/kysely-adapter-C-VVCuVS.mjs +1 -0
- package/dist/kysely-migration-tables-DFfmKhq--DIOBV7Sd.mjs +1 -0
- package/dist/organization-Bz1iQbJ0.mjs +1 -0
- package/dist/random-D6srtOfs.mjs +1 -0
- package/dist/schema-check-2a0t7Pu_.mjs +8 -0
- package/dist/schemas-CYxWglEB.mjs +118 -0
- package/dist/sqlite-adapter-BG0MClj_.mjs +1 -0
- package/dist/web/assets/index-9VtsK-ro.css +1 -0
- package/dist/web/assets/index-HxNynbde.js +53 -0
- package/dist/web/index.html +14 -0
- package/package.json +40 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Gjermund Garaba
|
|
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,38 @@
|
|
|
1
|
+
# @gjermundgaraba/clankerauth-dev
|
|
2
|
+
|
|
3
|
+
A disposable [Clanker Auth](https://github.com/gjermundgaraba/clankerauth) issuer for developing and testing applications that authenticate against one. The package bundles the whole server and dashboard with no dependencies, so it needs only Node 26 or newer.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
npm install --save-dev @gjermundgaraba/clankerauth-dev
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { startDisposableIssuer } from "@gjermundgaraba/clankerauth-dev";
|
|
11
|
+
|
|
12
|
+
const issuer = await startDisposableIssuer({
|
|
13
|
+
resources: [
|
|
14
|
+
{ identifier: "http://127.0.0.1:8080/mcp", name: "Notes MCP", scopes: ["notes:read"] },
|
|
15
|
+
],
|
|
16
|
+
client: {
|
|
17
|
+
name: "Notes console",
|
|
18
|
+
redirect: "http://localhost:5173/callback",
|
|
19
|
+
resources: ["http://127.0.0.1:8080/mcp"],
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
issuer.issuer; // OAuth issuer URL, for discovery and token verification
|
|
24
|
+
issuer.url; // dashboard origin, sign in with issuer.owner.email and issuer.owner.password
|
|
25
|
+
issuer.clientId; // a confidential native client for the given redirect and resources
|
|
26
|
+
issuer.clientSecret;
|
|
27
|
+
|
|
28
|
+
await issuer.close();
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Each call listens on a random loopback port, creates a fresh SQLite database and secret in a temporary directory, provisions the owner, the resources and the client in-process through the server's administration module, and returns. Only the returned issuer is reached over HTTP. The client is first party: once the owner is signed in, an authorization request redirects straight to the callback with a code and no consent step. `close()` drains in-flight requests, closes the database and deletes the directory. Nothing is shared between calls and nothing survives them.
|
|
32
|
+
|
|
33
|
+
Two optional test hooks help exercise integrations:
|
|
34
|
+
|
|
35
|
+
- `cimdTransport(input, init)` replaces outbound Client ID Metadata Document retrieval and returns a `Response` or `Promise<Response>`. Its arguments match `fetch`. Use it to serve fixture metadata for HTTPS client IDs without an external server. When omitted, the issuer uses its secure metadata transport.
|
|
36
|
+
- `onRequest({ method, url })` observes actual incoming HTTP requests at the issuer listener, such as discovery, JWKS, dynamic client registration, and token requests. Provisioning is in-process, so the observer sees only the test's own traffic. `url` is a `URL`; headers and bodies are never passed. The callback runs synchronously before handling each request. A thrown error makes that request fail with HTTP 500, so keep observers nonthrowing.
|
|
37
|
+
|
|
38
|
+
MIT licensed. The bundled third-party licenses are listed in `dist/THIRD_PARTY_NOTICES.txt`.
|