mikser-io-auth 0.12.0 → 0.13.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.
Files changed (2) hide show
  1. package/index.js +8 -4
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import path from 'node:path'
2
- import { registerRoute, anyOf, useDurableDatabase } from 'mikser-io'
2
+ import { registerRoute, anyOf, useDurableDatabase, provideService } from 'mikser-io'
3
3
 
4
4
  import { createIdentityStore, parseHtpasswd, parseHtgroup, verifyPassword } from './lib/htpasswd.js'
5
5
  import { loadOrCreateKey, checkKeyContinuity, jwks, ALG } from './lib/keys.js'
@@ -99,14 +99,18 @@ export function auth(options = {}) {
99
99
 
100
100
  onLoad(async () => {
101
101
  const logger = useLogger()
102
- // Published so any transport can say which role is acting and
102
+ // Offered so any transport can say which role is acting and
103
103
  // which others exist. The catalogue is not secret — naming the
104
104
  // role that could do something is what makes a handoff possible,
105
105
  // and it reveals nothing about how to obtain one.
106
- runtime.options.roles = {
106
+ //
107
+ // A service rather than runtime.options.roles: mikser-io-mcp is
108
+ // the consumer, and it should not have to know this package
109
+ // exists to ask what roles there are.
110
+ provideService('roles', {
107
111
  catalogue: capabilities,
108
112
  summaries: roleSummaries,
109
- }
113
+ }, { plugin: 'mikser-io-auth' })
110
114
 
111
115
  const workingFolder = runtime.options.workingFolder
112
116
  const resolve = (f) => (path.isAbsolute(f) ? f : path.join(workingFolder, f))
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mikser-io-auth",
3
- "version": "0.12.0",
4
- "description": "Authentication for mikser-io: an OAuth 2.1 authorization server (self-registering clients, authorization code + PKCE, refresh rotation) and HTTP Basic / JWT verifiers over Apache-format htpasswd and htgroup files in the working folder. Implements the ADR-0012 verifier contract, so it plugs in wherever a static token does \u2014 api, mcp, forms.",
3
+ "version": "0.13.0",
4
+ "description": "Authentication for mikser-io: an OAuth 2.1 authorization server (self-registering clients, authorization code + PKCE, refresh rotation) and HTTP Basic / JWT verifiers over Apache-format htpasswd and htgroup files in the working folder. Implements the ADR-0012 verifier contract, so it plugs in wherever a static token does api, mcp, forms.",
5
5
  "main": "index.js",
6
6
  "type": "module",
7
7
  "scripts": {
@@ -26,7 +26,7 @@
26
26
  },
27
27
  "homepage": "https://github.com/almero-digital-marketing/mikser-io-auth#readme",
28
28
  "peerDependencies": {
29
- "mikser-io": "^9.57.0"
29
+ "mikser-io": "^10.0.0"
30
30
  },
31
31
  "dependencies": {
32
32
  "bcryptjs": "^3.0.0",