@owlmeans/auth 0.1.18-rc.11 → 0.1.18-rc.13

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
@@ -20,9 +20,13 @@ bun add @owlmeans/auth@^0.1.18-rc.8
20
20
  Throw a typed auth error when a request lacks an entity:
21
21
 
22
22
  ```typescript
23
+ import { handlers } from '@owlmeans/server-api'
23
24
  import { AuthUnknown } from '@owlmeans/auth'
25
+ import type { Context } from 'my-app-backend'
26
+ import { projectEntrypoints } from 'my-app-common/entrypoints'
24
27
 
25
- export const create = handleBody(async (body, context, request) => {
28
+ const api = handlers<Context>()
29
+ export const create = api.request(projectEntrypoints.create, async (request, context) => {
26
30
  if (request.auth?.entityId == null) {
27
31
  throw new AuthUnknown('entity')
28
32
  }
@@ -88,7 +92,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
88
92
  your project's skill store (`.agents/skills/`):
89
93
 
90
94
  ```sh
91
- npx @owlmeans/agent-skills@^0.1.18-rc.14
95
+ npx @owlmeans/agent-skills@^0.1.18-rc.16
92
96
  ```
93
97
 
94
98
  The embedded files are version-matched to this package release. Do not edit them
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 2,
3
3
  "package": "@owlmeans/auth",
4
- "version": "0.1.18-rc.11",
5
- "generatedAt": "2026-09-10T23:12:07.501Z",
4
+ "version": "0.1.18-rc.13",
5
+ "generatedAt": "2026-09-12T12:33:32.484Z",
6
6
  "canonicalRepo": "https://github.com/owlmeans/common",
7
7
  "entries": [
8
8
  {
@@ -8,7 +8,7 @@ user-invocable: false
8
8
  # @owlmeans/auth
9
9
 
10
10
  **Layer:** Core
11
- **Install:** `"@owlmeans/auth": "^0.1.18-rc.11"` in `dependencies`
11
+ **Install:** `"@owlmeans/auth": "^0.1.18-rc.13"` in `dependencies`
12
12
 
13
13
  Types, enums, errors and schemas only — no services, no wiring. Every other auth package builds on
14
14
  this vocabulary, so a symbol belongs here exactly when both a server and a browser need to agree on
@@ -130,9 +130,9 @@ Throw from a handler when the request is missing the identity it needs:
130
130
 
131
131
  ```typescript
132
132
  import { AuthUnknown, entitySlugOf } from '@owlmeans/auth'
133
- import { handleRequest } from '@owlmeans/server-app'
133
+ import { handlers } from '@owlmeans/server-app'
134
134
 
135
- export const list = handleRequest(async (req, context) => {
135
+ export const list = handlers<Context>().request(authEntrypoints.list, async (req, context) => {
136
136
  const slug = entitySlugOf(req.auth)
137
137
  if (slug == null) throw new AuthUnknown('entity')
138
138
 
@@ -32,7 +32,7 @@ Use case: browser clients, third-party IdP integration, multi-tenant SaaS.
32
32
  1. Standard OAuth2 authorization-code flow. The relying party redirects to the provider and the return leg exchanges the code: `makeOidcClientService` (`@owlmeans/server-oidc-rp`) replays the stored PKCE verifier and grants the token set.
33
33
  2. Server decodes the ID token, builds an `Auth` from its claims, and wraps it in an envelope of type `oidc-wrapped-token` signed with the service key — the bearer is `OIDC-WRAPPED-TOKEN <encoded>`.
34
34
  3. Subsequent requests are matched and handled by `makeOidcGuard` (`@owlmeans/oidc`), which verifies the envelope signature against the service key and delegates freshness to the `WRAPPED_OIDC` service.
35
- 4. Refresh: `makeOidcWrappingService` (`@owlmeans/server-oidc-rp`) re-validates the stored token set — introspection, or a refresh grant once `expires_at` has passed — and re-signs the wrapped token. When the value changes, the guard returns it in the **`TOKEN_UPDATE` response header** (`'auth-token-refresh'`, `@owlmeans/auth-common`); an empty value means the session is over. It is a header, not a route: `@owlmeans/server-api` lists it in `exposedHeaders` and `@owlmeans/api`'s client service feeds it back into `AuthService.update()`. Where the deployment has a separate auth manager, the wrapper reaches it over the `external-auth:auth:update` entrypoint that `setupAuthServiceEntrypoints` registers at `/<prefix>/auth/update`.
35
+ 4. Refresh: `makeOidcWrappingService` (`@owlmeans/server-oidc-rp`) re-validates the stored token set — introspection, or a refresh grant once `expires_at` has passed — and re-signs the wrapped token. When the value changes, the guard returns it in the **`TOKEN_UPDATE` response header** (`'auth-token-refresh'`, `@owlmeans/auth-common`); an empty value means the session is over. It is a header, not a route: `@owlmeans/server-api` lists it in `exposedHeaders` and `@owlmeans/api`'s client service feeds it back into `AuthService.update()`. Where the deployment has a separate auth manager, the wrapper reaches it over the `external-auth:auth:update` declaration from `makeAuthServiceEntrypoints`, bound at `/<prefix>/auth/update`.
36
36
 
37
37
  ### Provider-Backed Local Identity
38
38
 
@@ -103,7 +103,7 @@ rows on never appears in a token, a URL or a body. Read the slug with `entitySlu
103
103
 
104
104
  `@owlmeans/oidc` constants:
105
105
 
106
- - `OIDC_GATE = 'oidc-gate'` — the `gate(...)` value to attach OIDC enforcement to an entrypoint.
106
+ - `OIDC_GATE = 'oidc-gate'` — the gate alias to put in a protocol's `gate` option for OIDC enforcement.
107
107
  - `GOOGLE_CLIENT_AUTH = 'google-oauth'` — browser plugin type for Google OAuth.
108
108
  - `GOOGLE_SERVICE = 'google'` — provider service key used by backend config and identity linking.
109
109
 
@@ -184,14 +184,14 @@ export interface KeyPairModel {
184
184
 
185
185
  Server-side:
186
186
  - `makeAuthService(alias?)` / `appendAuthService(ctx, alias?)` (`@owlmeans/server-auth`) — the bearer guard.
187
- - `setupAuthServiceEntrypoints(entrypoints, serviceAlias, prefix = 'oidc-api')` (`@owlmeans/server-oidc-rp`) — registers the `external-auth:provider:list` and `external-auth:auth:update` routes, both behind `GUARD_ED25519`.
188
- - `makeOidcWrappingService`, `makeOidcGate`, `makeOidcClientService`, `appendOidcGuard`, `setupOidcGuard` — wire OIDC into a server context (`@owlmeans/server-oidc-rp`).
187
+ - `makeAuthServiceEntrypoints(serviceAlias, prefix = 'oidc-api')` (`@owlmeans/server-oidc-rp`) — returns `external-auth:provider:list` and `external-auth:auth:update` declarations, both behind `GUARD_ED25519`; bind them in the serving app.
188
+ - `makeOidcWrappingService`, `makeOidcGate`, `makeOidcClientService`, `appendOidcGuard`, `oidcEntrypoints` — wire OIDC services and server-local bindings into a server context (`@owlmeans/server-oidc-rp`). Decorate the app protocol tree with `withOidcGuard` from `@owlmeans/oidc` before binding it.
189
189
 
190
190
  Client-side:
191
191
  - `appendAuthService(ctx, alias?)` (`@owlmeans/client-auth`) — the client auth service with persistent storage.
192
192
  - `setupExternalAuthentication(service)` (`@owlmeans/client-auth`) — point `CAUTHEN_FLOW_ENTER` at the service an external provider redirects into.
193
193
  - `appendLogin(ctx)` (`@owlmeans/client-auth/login`) — the login-plugin host; `@owlmeans/web-client`'s `makeContext` already calls it.
194
- - `appendOidcGuard()`, `setupOidcGuard()` — `@owlmeans/web-oidc-rp` for browser-side.
194
+ - `appendOidcGuard()`, `oidcEntrypoints()` — `@owlmeans/web-oidc-rp` for browser-side bindings; `withOidcGuard` decorates the shared protocol tree.
195
195
 
196
196
  Local identity and the organization entity:
197
197
  - `appendAuthIdentityResources(context)` (`@owlmeans/server-auth-identity`) — registers the org-entity registry, the account/profile/credentials resources, the linking service and the entity resolver.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owlmeans/auth",
3
- "version": "0.1.18-rc.11",
3
+ "version": "0.1.18-rc.13",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -22,7 +22,7 @@
22
22
  }
23
23
  },
24
24
  "dependencies": {
25
- "@owlmeans/error": "^0.1.18-rc.10",
25
+ "@owlmeans/error": "^0.1.18-rc.12",
26
26
  "ajv-formats": "^3.0.1"
27
27
  },
28
28
  "peerDependencies": {