@atlasauth/pca-ciba 0.1.0 → 0.2.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 -20
- package/package.json +27 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Atlas Authorization
|
|
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
CHANGED
|
@@ -1,46 +1,64 @@
|
|
|
1
1
|
# @atlasauth/pca-ciba
|
|
2
2
|
|
|
3
|
-
A CIBA (OpenID Connect Client-Initiated Backchannel Authentication) on-ramp for PCA
|
|
3
|
+
A CIBA (OpenID Connect Client-Initiated Backchannel Authentication) on-ramp for Proof-Carrying Authority (PCA) step-up. It turns a risk-gated step-up into a standard asynchronous human-approval flow, interrupting a person only for the actions that actually need it.
|
|
4
4
|
|
|
5
|
-
CIBA
|
|
5
|
+
In CIBA a backend opens an `auth_req_id`, the human is notified out of band, and the decision comes back by poll or ping/push. The `binding_message` carries the human-readable approval context, so the thing approved on the phone is the thing the agent is about to do ("Approve stripe.refund $480 on charge:ch_1 - because you asked support-bot to 'reconcile October refunds'").
|
|
6
6
|
|
|
7
|
-
This is a
|
|
7
|
+
This is a bridge, not a replacement. PCA's cryptographic step-up (a FROST threshold cosign, in `@atlasauth/pca`) stays the enforcement; CIBA is the notification and decision envelope around it.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Gating is risk-adaptive: only a tier-3 step-up (human required, typically irreversible) is routed through CIBA. Tier-2 (guardian auto-cosign) and tier-1 (`auto`) never interrupt a person.
|
|
10
10
|
|
|
11
11
|
## Install
|
|
12
12
|
|
|
13
13
|
```sh
|
|
14
|
-
npm i @atlasauth/pca-ciba
|
|
14
|
+
npm i @atlasauth/pca-ciba @atlasauth/pca
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
Depends on the core `@atlasauth/pca` (installed transitively).
|
|
18
|
-
|
|
19
17
|
## Usage
|
|
20
18
|
|
|
21
19
|
```ts
|
|
22
|
-
import { reviewAction } from '@atlasauth/pca';
|
|
20
|
+
import { agent, generateKeyPair, reviewAction } from '@atlasauth/pca';
|
|
23
21
|
import { requiresCiba, createCibaBroker, cibaDecisionToCosign } from '@atlasauth/pca-ciba';
|
|
24
22
|
|
|
25
|
-
const
|
|
23
|
+
const a = agent({
|
|
24
|
+
principal: generateKeyPair(),
|
|
25
|
+
goal: 'reconcile October refunds',
|
|
26
|
+
permissions: { stripe: ['payout'] },
|
|
27
|
+
limits: { payout: '$100' },
|
|
28
|
+
aud: 'rs_demo',
|
|
29
|
+
riskPolicy: { theta1: 0.3, theta2: 0.6 },
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const review = reviewAction(a, 'stripe.payout', 'acct:1', { amount: 80 }, { goal: 'reconcile October refunds' });
|
|
26
33
|
|
|
27
|
-
if (
|
|
28
|
-
const broker = createCibaBroker({ onComplete: (
|
|
34
|
+
if (review.kind === 'step_up' && requiresCiba(review)) {
|
|
35
|
+
const broker = createCibaBroker({ onComplete: (session) => console.log(session.status) }); // omit onComplete for POLL
|
|
29
36
|
const ciba = broker.start(review.request, { actsFor: 'support-bot', loginHint: 'owner@acme' });
|
|
30
|
-
// ciba.binding_message
|
|
31
|
-
|
|
37
|
+
// ciba.auth_req_id, ciba.binding_message, ciba.requested_expiry, ...
|
|
38
|
+
|
|
39
|
+
broker.poll(ciba.auth_req_id).status; // 'pending' | 'approved' | 'denied' | 'expired'
|
|
32
40
|
|
|
33
|
-
//
|
|
34
|
-
// The human acts out of band:
|
|
41
|
+
// The human decides out of band:
|
|
35
42
|
const session = broker.resolve(ciba.auth_req_id, 'approve', 'owner@acme');
|
|
36
43
|
|
|
37
|
-
// Fold the decision back into the trust budget
|
|
38
|
-
const { budget } = cibaDecisionToCosign(
|
|
44
|
+
// Fold the decision back into the trust budget:
|
|
45
|
+
const { budget, cosigned } = cibaDecisionToCosign(
|
|
46
|
+
session.status === 'approved' ? 'approve' : 'deny',
|
|
47
|
+
a.budget,
|
|
48
|
+
a.policy.riskPolicy,
|
|
49
|
+
Date.now(),
|
|
50
|
+
);
|
|
39
51
|
}
|
|
40
52
|
```
|
|
41
53
|
|
|
42
|
-
`toCibaAuthRequest(stepUp, opts?)` is the pure mapping
|
|
54
|
+
`toCibaAuthRequest(stepUp, opts?)` is the pure mapping from a step-up to a CIBA request, if you want to drive your own broker or a real OpenID provider.
|
|
55
|
+
|
|
56
|
+
## Status
|
|
57
|
+
|
|
58
|
+
The broker is in-memory and models the CIBA lifecycle without any network; a production deployment would swap in a real OpenID provider. The package computes approval envelopes and the derived trust budget and authorises nothing on its own: `cibaDecisionToCosign` is only the budget-level effect. The cryptographic cosign (FROST) is produced and verified separately, and the resource server's verifier remains the authority. Cryptography in PCA is unaudited.
|
|
59
|
+
|
|
60
|
+
Source and issues: https://github.com/Atlas-Authorization/pca
|
|
43
61
|
|
|
44
|
-
|
|
62
|
+
## License
|
|
45
63
|
|
|
46
|
-
|
|
64
|
+
MIT - see LICENSE
|
package/package.json
CHANGED
|
@@ -1,7 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlasauth/pca-ciba",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "CIBA (Client-Initiated Backchannel Authentication) bridge for PCA FROST step-up: turn a step-up request into a backchannel human-approval flow with risk-adaptive gating.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"ciba",
|
|
7
|
+
"backchannel",
|
|
8
|
+
"human approval",
|
|
9
|
+
"step-up",
|
|
10
|
+
"agent authorization",
|
|
11
|
+
"proof-carrying authority",
|
|
12
|
+
"pca",
|
|
13
|
+
"ai agents"
|
|
14
|
+
],
|
|
15
|
+
"license": "MIT",
|
|
16
|
+
"homepage": "https://github.com/Atlas-Authorization/pca#readme",
|
|
17
|
+
"bugs": {
|
|
18
|
+
"url": "https://github.com/Atlas-Authorization/pca/issues"
|
|
19
|
+
},
|
|
20
|
+
"repository": {
|
|
21
|
+
"type": "git",
|
|
22
|
+
"url": "git+https://github.com/Atlas-Authorization/pca.git",
|
|
23
|
+
"directory": "packages/pca-ciba"
|
|
24
|
+
},
|
|
5
25
|
"main": "./dist/index.js",
|
|
6
26
|
"types": "./dist/index.d.ts",
|
|
7
27
|
"exports": {
|
|
@@ -12,7 +32,7 @@
|
|
|
12
32
|
"./package.json": "./package.json"
|
|
13
33
|
},
|
|
14
34
|
"dependencies": {
|
|
15
|
-
"@atlasauth/pca": "0.
|
|
35
|
+
"@atlasauth/pca": "0.2.0"
|
|
16
36
|
},
|
|
17
37
|
"devDependencies": {
|
|
18
38
|
"typescript": "^5.6.3",
|
|
@@ -20,8 +40,12 @@
|
|
|
20
40
|
},
|
|
21
41
|
"files": [
|
|
22
42
|
"dist",
|
|
23
|
-
"README.md"
|
|
43
|
+
"README.md",
|
|
44
|
+
"LICENSE"
|
|
24
45
|
],
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">=20"
|
|
48
|
+
},
|
|
25
49
|
"publishConfig": {
|
|
26
50
|
"access": "public"
|
|
27
51
|
},
|