@gjermundgaraba/clankerauth-sdk 0.8.0 → 0.9.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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @gjermundgaraba/clankerauth-sdk
2
2
 
3
- Effect-native [Clanker Auth](https://github.com/gjermundgaraba/clankerauth) verification. Verifies JWT access tokens and API keys, including the tokens a reverse proxy obtains through the issuer's forward auth for browser sessions. Optional **effect-actions** integration provides request-scoped identity, OAuth discovery, scope enforcement and a `session` contract a browser page can import on its own.
3
+ Effect-native [clankerauth](https://github.com/gjermundgaraba/clankerauth) verification. Verifies JWT access tokens and API keys, including the tokens a reverse proxy obtains through the issuer's forward auth for browser sessions. Optional **effect-actions** integration provides request-scoped identity, OAuth discovery, scope enforcement and a `session` contract a browser page can import on its own.
4
4
 
5
5
  ## Install
6
6
 
@@ -41,7 +41,7 @@ import { FetchHttpClient } from "effect/unstable/http";
41
41
  import { Verifier } from "@gjermundgaraba/clankerauth-sdk";
42
42
 
43
43
  const makeVerifier = Verifier.make({
44
- issuer: "https://auth.internal/api/auth",
44
+ issuer: "https://clankerauth.internal/api/auth",
45
45
  resource: "https://notes.internal/",
46
46
  requiredScopes: ["notes:read"],
47
47
  }).pipe(Effect.provide(FetchHttpClient.layer));
@@ -50,7 +50,7 @@ const makeVerifier = Verifier.make({
50
50
 
51
51
  ## One resource per application
52
52
 
53
- Register **one** resource in the Clanker Auth dashboard, identified by the application's public origin root, written with its trailing slash: `https://notes.internal/`. That one resource covers `/api`, `/mcp` and any socket, with one RFC 9728 document at `/.well-known/oauth-protected-resource` and one `forward_auth` block in the proxy.
53
+ Register **one** resource in the clankerauth dashboard, identified by the application's public origin root, written with its trailing slash: `https://notes.internal/`. That one resource covers `/api`, `/mcp` and any socket, with one RFC 9728 document at `/.well-known/oauth-protected-resource` and one `forward_auth` block in the proxy.
54
54
 
55
55
  `Resource.make` takes the public URL and derives that identifier itself, so the application never writes it twice and never writes a form an MCP client would rewrite. Any path on the URL is discarded. The official client's own `checkResourceAllowed` accepts an origin-root resource for an endpoint beneath it.
56
56
 
@@ -67,7 +67,7 @@ import * as ActionMcp from "@gjermundgaraba/effect-actions/ActionMcp";
67
67
  const routes = Layer.unwrap(
68
68
  Effect.gen(function* () {
69
69
  const notes = yield* Resource.make({
70
- issuer: "https://auth.internal/api/auth",
70
+ issuer: "https://clankerauth.internal/api/auth",
71
71
  publicUrl: new URL("https://notes.internal"),
72
72
  scopes: { read: "notes:read", write: "notes:write" },
73
73
  });
@@ -178,7 +178,7 @@ Both checks are raw string comparisons on the headers as sent. Nothing is parsed
178
178
 
179
179
  ## Browser applications
180
180
 
181
- A browser page holds no credential of its own: put it behind a reverse proxy with the issuer's forward auth, described in the Clanker Auth README, and the proxy adds the `Authorization` header this package verifies. What the page does need is who it is signed in as, and a way out:
181
+ A browser page holds no credential of its own: put it behind a reverse proxy with the issuer's forward auth, described in the clankerauth README, and the proxy adds the `Authorization` header this package verifies. What the page does need is who it is signed in as, and a way out:
182
182
 
183
183
  ```ts
184
184
  import { Principal, Session, signOutUrl } from "@gjermundgaraba/clankerauth-sdk/session";
package/dist/verify.js CHANGED
@@ -138,7 +138,7 @@ export const make = Effect.fn("Verifier.make")(function* (options) {
138
138
  };
139
139
  }, Effect.scoped);
140
140
  const verifyToken = Effect.fn("Verifier.verifyToken")(function* (token) {
141
- const principal = yield* token.startsWith("ca_")
141
+ const principal = yield* token.startsWith("clankerauth_")
142
142
  ? options.apiKeys === false
143
143
  ? Effect.fail(unauthorized())
144
144
  : verifyKey(token)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@gjermundgaraba/clankerauth-sdk",
3
- "version": "0.8.0",
4
- "description": "Effect-native Clanker Auth access-token and API-key verification, with optional effect-actions integration",
3
+ "version": "0.9.0",
4
+ "description": "Effect-native clankerauth access-token and API-key verification, with optional effect-actions integration",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",