@agenticprimitives/connect-auth 0.1.0-alpha.2
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 +100 -0
- package/dist/csrf.d.ts +13 -0
- package/dist/csrf.d.ts.map +1 -0
- package/dist/csrf.js +85 -0
- package/dist/csrf.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -0
- package/dist/methods/google.d.ts +72 -0
- package/dist/methods/google.d.ts.map +1 -0
- package/dist/methods/google.js +239 -0
- package/dist/methods/google.js.map +1 -0
- package/dist/methods/passkey.d.ts +106 -0
- package/dist/methods/passkey.d.ts.map +1 -0
- package/dist/methods/passkey.js +307 -0
- package/dist/methods/passkey.js.map +1 -0
- package/dist/methods/siwe.d.ts +92 -0
- package/dist/methods/siwe.d.ts.map +1 -0
- package/dist/methods/siwe.js +207 -0
- package/dist/methods/siwe.js.map +1 -0
- package/dist/salt.d.ts +22 -0
- package/dist/salt.d.ts.map +1 -0
- package/dist/salt.js +54 -0
- package/dist/salt.js.map +1 -0
- package/dist/sessions.d.ts +15 -0
- package/dist/sessions.d.ts.map +1 -0
- package/dist/sessions.js +143 -0
- package/dist/sessions.js.map +1 -0
- package/dist/types.d.ts +61 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/verify-signature.d.ts +163 -0
- package/dist/verify-signature.d.ts.map +1 -0
- package/dist/verify-signature.js +118 -0
- package/dist/verify-signature.js.map +1 -0
- package/package.json +73 -0
- package/spec.md +6 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Universal signature verification for app servers.
|
|
3
|
+
*
|
|
4
|
+
* Consumers (e.g. demo-a2a's `/auth/siwe-verify`) call `verifyUserSignature`
|
|
5
|
+
* with `{ signer, hash, signature, universalValidator, publicClient }` and
|
|
6
|
+
* get back a single boolean — they do NOT branch on signer method (EOA,
|
|
7
|
+
* passkey, etc.). The on-chain `UniversalSignatureValidator` contract
|
|
8
|
+
* dispatches: ECDSA for code-less signers, ERC-1271 for deployed smart
|
|
9
|
+
* accounts, ERC-6492 for counterfactual smart accounts (deploys via
|
|
10
|
+
* factoryCalldata embedded in the signature, then ERC-1271).
|
|
11
|
+
*
|
|
12
|
+
* Doctrine — see [[feedback-demo-a2a-is-signer-agnostic]] memory and
|
|
13
|
+
* spec 130 §7: connect-auth ships the verifier helper; demo-a2a calls
|
|
14
|
+
* it; passkey internals stay out of demo-a2a entirely.
|
|
15
|
+
*
|
|
16
|
+
* Two modes:
|
|
17
|
+
* - `verifyUserSignature` (state-changing): calls `isValidSig` on the
|
|
18
|
+
* validator. The 6492 path may DEPLOY the user's smart account
|
|
19
|
+
* before verifying. Suitable for relayer pre-flight where the
|
|
20
|
+
* submitter is OK paying for deploy gas if verification succeeds.
|
|
21
|
+
* - `verifyUserSignatureView` (read-only): calls `isValidSigView`. 6492
|
|
22
|
+
* wrappers without already-deployed accounts will return false.
|
|
23
|
+
* Suitable for cheap pre-checks.
|
|
24
|
+
*
|
|
25
|
+
* The function signature intentionally takes the validator address as a
|
|
26
|
+
* parameter — connect-auth is transport- and deployment-agnostic; the
|
|
27
|
+
* caller wires in the deployed contract address from its config.
|
|
28
|
+
*/
|
|
29
|
+
import type { Address, Hex } from './types';
|
|
30
|
+
/** ERC-1271 magic value. */
|
|
31
|
+
export declare const ERC1271_MAGIC: Hex;
|
|
32
|
+
/** ERC-6492 32-byte magic suffix (`0x6492…6492` repeated). */
|
|
33
|
+
export declare const ERC6492_MAGIC: Hex;
|
|
34
|
+
/**
|
|
35
|
+
* Minimal viem-like public-client shape — accepts any client with
|
|
36
|
+
* `readContract` (view-only) and `simulateContract` (state-changing
|
|
37
|
+
* dry-run) supporting the universal-validator ABI. Kept loose so this
|
|
38
|
+
* works with viem, ethers-via-shim, or test mocks.
|
|
39
|
+
*/
|
|
40
|
+
export interface UniversalValidatorClient {
|
|
41
|
+
readContract(args: {
|
|
42
|
+
address: Address;
|
|
43
|
+
abi: readonly unknown[];
|
|
44
|
+
functionName: 'isValidSigView';
|
|
45
|
+
args: readonly [Address, Hex, Hex];
|
|
46
|
+
}): Promise<boolean>;
|
|
47
|
+
simulateContract?(args: {
|
|
48
|
+
address: Address;
|
|
49
|
+
abi: readonly unknown[];
|
|
50
|
+
functionName: 'isValidSig';
|
|
51
|
+
args: readonly [Address, Hex, Hex];
|
|
52
|
+
}): Promise<{
|
|
53
|
+
result: boolean;
|
|
54
|
+
}>;
|
|
55
|
+
}
|
|
56
|
+
export declare const universalSignatureValidatorAbi: readonly [{
|
|
57
|
+
readonly type: "function";
|
|
58
|
+
readonly name: "isValidSig";
|
|
59
|
+
readonly stateMutability: "nonpayable";
|
|
60
|
+
readonly inputs: readonly [{
|
|
61
|
+
readonly name: "signer";
|
|
62
|
+
readonly type: "address";
|
|
63
|
+
}, {
|
|
64
|
+
readonly name: "hash";
|
|
65
|
+
readonly type: "bytes32";
|
|
66
|
+
}, {
|
|
67
|
+
readonly name: "sig";
|
|
68
|
+
readonly type: "bytes";
|
|
69
|
+
}];
|
|
70
|
+
readonly outputs: readonly [{
|
|
71
|
+
readonly name: "";
|
|
72
|
+
readonly type: "bool";
|
|
73
|
+
}];
|
|
74
|
+
}, {
|
|
75
|
+
readonly type: "function";
|
|
76
|
+
readonly name: "isValidSigView";
|
|
77
|
+
readonly stateMutability: "view";
|
|
78
|
+
readonly inputs: readonly [{
|
|
79
|
+
readonly name: "signer";
|
|
80
|
+
readonly type: "address";
|
|
81
|
+
}, {
|
|
82
|
+
readonly name: "hash";
|
|
83
|
+
readonly type: "bytes32";
|
|
84
|
+
}, {
|
|
85
|
+
readonly name: "sig";
|
|
86
|
+
readonly type: "bytes";
|
|
87
|
+
}];
|
|
88
|
+
readonly outputs: readonly [{
|
|
89
|
+
readonly name: "";
|
|
90
|
+
readonly type: "bool";
|
|
91
|
+
}];
|
|
92
|
+
}];
|
|
93
|
+
export interface VerifyUserSignatureArgs {
|
|
94
|
+
/** The on-chain UniversalSignatureValidator contract address. */
|
|
95
|
+
universalValidator: Address;
|
|
96
|
+
/** The claimed signer — for passkey-owned accounts, this is the
|
|
97
|
+
* smart-account address derived from the passkey's pubkey. */
|
|
98
|
+
signer: Address;
|
|
99
|
+
/** The 32-byte digest the user signed. */
|
|
100
|
+
hash: Hex;
|
|
101
|
+
/** The signature blob — EOA 65-byte sig, ERC-1271 1271-compliant blob,
|
|
102
|
+
* or ERC-6492-wrapped counterfactual blob. */
|
|
103
|
+
signature: Hex;
|
|
104
|
+
client: UniversalValidatorClient;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Result of a signature verify call. H7-B.3 (PKG-CONNECT-AUTH-001 closure):
|
|
108
|
+
* the legacy boolean return conflated three very different outcomes that
|
|
109
|
+
* callers MUST distinguish:
|
|
110
|
+
*
|
|
111
|
+
* - `{ ok: true }` — signature verified.
|
|
112
|
+
* - `{ ok: false, reason: 'invalid' }` — chain answered, signature is bad.
|
|
113
|
+
* - `{ ok: false, reason: 'rpc' }` — chain unreachable / call reverted /
|
|
114
|
+
* RPC error. Caller may retry, fall back to a different RPC, or surface
|
|
115
|
+
* a soft error. **Treating this as 'invalid' is a fail-open hazard**
|
|
116
|
+
* (chain down → every verify returns false → caller gates on truthiness).
|
|
117
|
+
* - `{ ok: false, reason: 'config' }` — the client doesn't expose the
|
|
118
|
+
* verb required (e.g. `simulateContract` for state-tolerant verify).
|
|
119
|
+
*
|
|
120
|
+
* `details` carries the underlying error (when applicable) for telemetry.
|
|
121
|
+
*/
|
|
122
|
+
export type SignatureVerifyResult = {
|
|
123
|
+
ok: true;
|
|
124
|
+
} | {
|
|
125
|
+
ok: false;
|
|
126
|
+
reason: 'invalid';
|
|
127
|
+
} | {
|
|
128
|
+
ok: false;
|
|
129
|
+
reason: 'rpc';
|
|
130
|
+
details?: unknown;
|
|
131
|
+
} | {
|
|
132
|
+
ok: false;
|
|
133
|
+
reason: 'config';
|
|
134
|
+
details?: string;
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* Read-only verification. Counterfactual signatures (6492-wrapped) for
|
|
138
|
+
* not-yet-deployed accounts will return `{ ok: false, reason: 'invalid' }`
|
|
139
|
+
* here — use `verifyUserSignature` (which performs the 6492 deploy via
|
|
140
|
+
* `simulateContract`) for the state-tolerant path.
|
|
141
|
+
*
|
|
142
|
+
* H7-B.3: typed result; chain errors propagate as `reason: 'rpc'` so the
|
|
143
|
+
* caller can distinguish a forged signature from a network/RPC fault.
|
|
144
|
+
*/
|
|
145
|
+
export declare function verifyUserSignatureView(args: VerifyUserSignatureArgs): Promise<SignatureVerifyResult>;
|
|
146
|
+
/**
|
|
147
|
+
* State-tolerant verification. Uses `simulateContract` (eth_call) against
|
|
148
|
+
* the `isValidSig` entry, which will counterfactually deploy the account
|
|
149
|
+
* in the simulated state if the signature is a 6492 wrapper for a
|
|
150
|
+
* not-yet-deployed signer. The on-chain state is NOT mutated (it's a
|
|
151
|
+
* simulation), so this is safe to call from read-only HTTP handlers.
|
|
152
|
+
*
|
|
153
|
+
* Falls back to the view path if the client doesn't expose
|
|
154
|
+
* `simulateContract`. H7-B.3: typed result.
|
|
155
|
+
*/
|
|
156
|
+
export declare function verifyUserSignature(args: VerifyUserSignatureArgs): Promise<SignatureVerifyResult>;
|
|
157
|
+
/**
|
|
158
|
+
* Check whether a signature blob is ERC-6492-wrapped (last 32 bytes are
|
|
159
|
+
* the magic suffix). Useful for callers that want to log "user signed
|
|
160
|
+
* counterfactually" without inspecting deeper.
|
|
161
|
+
*/
|
|
162
|
+
export declare function isErc6492Wrapped(signature: Hex): boolean;
|
|
163
|
+
//# sourceMappingURL=verify-signature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-signature.d.ts","sourceRoot":"","sources":["../src/verify-signature.ts"],"names":[],"mappings":"AAAA;;;;;;;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Z;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,SAAS,CAAA;CAAE,GAChC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,KAAK,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAC/C;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,QAAQ,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtD;;;;;;;;GAQG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,uBAAuB,GAC5B,OAAO,CAAC,qBAAqB,CAAC,CAYhC;AAED;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,uBAAuB,GAC5B,OAAO,CAAC,qBAAqB,CAAC,CAehC;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,GAAG,GAAG,OAAO,CAMxD"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Universal signature verification for app servers.
|
|
3
|
+
*
|
|
4
|
+
* Consumers (e.g. demo-a2a's `/auth/siwe-verify`) call `verifyUserSignature`
|
|
5
|
+
* with `{ signer, hash, signature, universalValidator, publicClient }` and
|
|
6
|
+
* get back a single boolean — they do NOT branch on signer method (EOA,
|
|
7
|
+
* passkey, etc.). The on-chain `UniversalSignatureValidator` contract
|
|
8
|
+
* dispatches: ECDSA for code-less signers, ERC-1271 for deployed smart
|
|
9
|
+
* accounts, ERC-6492 for counterfactual smart accounts (deploys via
|
|
10
|
+
* factoryCalldata embedded in the signature, then ERC-1271).
|
|
11
|
+
*
|
|
12
|
+
* Doctrine — see [[feedback-demo-a2a-is-signer-agnostic]] memory and
|
|
13
|
+
* spec 130 §7: connect-auth ships the verifier helper; demo-a2a calls
|
|
14
|
+
* it; passkey internals stay out of demo-a2a entirely.
|
|
15
|
+
*
|
|
16
|
+
* Two modes:
|
|
17
|
+
* - `verifyUserSignature` (state-changing): calls `isValidSig` on the
|
|
18
|
+
* validator. The 6492 path may DEPLOY the user's smart account
|
|
19
|
+
* before verifying. Suitable for relayer pre-flight where the
|
|
20
|
+
* submitter is OK paying for deploy gas if verification succeeds.
|
|
21
|
+
* - `verifyUserSignatureView` (read-only): calls `isValidSigView`. 6492
|
|
22
|
+
* wrappers without already-deployed accounts will return false.
|
|
23
|
+
* Suitable for cheap pre-checks.
|
|
24
|
+
*
|
|
25
|
+
* The function signature intentionally takes the validator address as a
|
|
26
|
+
* parameter — connect-auth is transport- and deployment-agnostic; the
|
|
27
|
+
* caller wires in the deployed contract address from its config.
|
|
28
|
+
*/
|
|
29
|
+
/** ERC-1271 magic value. */
|
|
30
|
+
export const ERC1271_MAGIC = '0x1626ba7e';
|
|
31
|
+
/** ERC-6492 32-byte magic suffix (`0x6492…6492` repeated). */
|
|
32
|
+
export const ERC6492_MAGIC = '0x6492649264926492649264926492649264926492649264926492649264926492';
|
|
33
|
+
export const universalSignatureValidatorAbi = [
|
|
34
|
+
{
|
|
35
|
+
type: 'function',
|
|
36
|
+
name: 'isValidSig',
|
|
37
|
+
stateMutability: 'nonpayable',
|
|
38
|
+
inputs: [
|
|
39
|
+
{ name: 'signer', type: 'address' },
|
|
40
|
+
{ name: 'hash', type: 'bytes32' },
|
|
41
|
+
{ name: 'sig', type: 'bytes' },
|
|
42
|
+
],
|
|
43
|
+
outputs: [{ name: '', type: 'bool' }],
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
type: 'function',
|
|
47
|
+
name: 'isValidSigView',
|
|
48
|
+
stateMutability: 'view',
|
|
49
|
+
inputs: [
|
|
50
|
+
{ name: 'signer', type: 'address' },
|
|
51
|
+
{ name: 'hash', type: 'bytes32' },
|
|
52
|
+
{ name: 'sig', type: 'bytes' },
|
|
53
|
+
],
|
|
54
|
+
outputs: [{ name: '', type: 'bool' }],
|
|
55
|
+
},
|
|
56
|
+
];
|
|
57
|
+
/**
|
|
58
|
+
* Read-only verification. Counterfactual signatures (6492-wrapped) for
|
|
59
|
+
* not-yet-deployed accounts will return `{ ok: false, reason: 'invalid' }`
|
|
60
|
+
* here — use `verifyUserSignature` (which performs the 6492 deploy via
|
|
61
|
+
* `simulateContract`) for the state-tolerant path.
|
|
62
|
+
*
|
|
63
|
+
* H7-B.3: typed result; chain errors propagate as `reason: 'rpc'` so the
|
|
64
|
+
* caller can distinguish a forged signature from a network/RPC fault.
|
|
65
|
+
*/
|
|
66
|
+
export async function verifyUserSignatureView(args) {
|
|
67
|
+
try {
|
|
68
|
+
const ok = await args.client.readContract({
|
|
69
|
+
address: args.universalValidator,
|
|
70
|
+
abi: universalSignatureValidatorAbi,
|
|
71
|
+
functionName: 'isValidSigView',
|
|
72
|
+
args: [args.signer, args.hash, args.signature],
|
|
73
|
+
});
|
|
74
|
+
return ok ? { ok: true } : { ok: false, reason: 'invalid' };
|
|
75
|
+
}
|
|
76
|
+
catch (e) {
|
|
77
|
+
return { ok: false, reason: 'rpc', details: e };
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* State-tolerant verification. Uses `simulateContract` (eth_call) against
|
|
82
|
+
* the `isValidSig` entry, which will counterfactually deploy the account
|
|
83
|
+
* in the simulated state if the signature is a 6492 wrapper for a
|
|
84
|
+
* not-yet-deployed signer. The on-chain state is NOT mutated (it's a
|
|
85
|
+
* simulation), so this is safe to call from read-only HTTP handlers.
|
|
86
|
+
*
|
|
87
|
+
* Falls back to the view path if the client doesn't expose
|
|
88
|
+
* `simulateContract`. H7-B.3: typed result.
|
|
89
|
+
*/
|
|
90
|
+
export async function verifyUserSignature(args) {
|
|
91
|
+
if (!args.client.simulateContract) {
|
|
92
|
+
return verifyUserSignatureView(args);
|
|
93
|
+
}
|
|
94
|
+
try {
|
|
95
|
+
const { result } = await args.client.simulateContract({
|
|
96
|
+
address: args.universalValidator,
|
|
97
|
+
abi: universalSignatureValidatorAbi,
|
|
98
|
+
functionName: 'isValidSig',
|
|
99
|
+
args: [args.signer, args.hash, args.signature],
|
|
100
|
+
});
|
|
101
|
+
return result ? { ok: true } : { ok: false, reason: 'invalid' };
|
|
102
|
+
}
|
|
103
|
+
catch (e) {
|
|
104
|
+
return { ok: false, reason: 'rpc', details: e };
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Check whether a signature blob is ERC-6492-wrapped (last 32 bytes are
|
|
109
|
+
* the magic suffix). Useful for callers that want to log "user signed
|
|
110
|
+
* counterfactually" without inspecting deeper.
|
|
111
|
+
*/
|
|
112
|
+
export function isErc6492Wrapped(signature) {
|
|
113
|
+
if (signature.length < 2 + 64)
|
|
114
|
+
return false; // '0x' + 32 bytes hex
|
|
115
|
+
return (signature.slice(-64).toLowerCase() ===
|
|
116
|
+
ERC6492_MAGIC.slice(2).toLowerCase());
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=verify-signature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-signature.js","sourceRoot":"","sources":["../src/verify-signature.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAIH,4BAA4B;AAC5B,MAAM,CAAC,MAAM,aAAa,GAAQ,YAAY,CAAC;AAE/C,8DAA8D;AAC9D,MAAM,CAAC,MAAM,aAAa,GACxB,oEAAoE,CAAC;AAuBvE,MAAM,CAAC,MAAM,8BAA8B,GAAG;IAC5C;QACE,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,YAAY;QAClB,eAAe,EAAE,YAAY;QAC7B,MAAM,EAAE;YACN,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;YACnC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE;YACjC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE;SAC/B;QACD,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAA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OAAO,uBAAuB,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IACD,IAAI,CAAC;QACH,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC;YACpD,OAAO,EAAE,IAAI,CAAC,kBAAkB;YAChC,GAAG,EAAE,8BAA8B;YACnC,YAAY,EAAE,YAAY;YAC1B,IAAI,EAAE,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;SAC/C,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IAClE,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IAClD,CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,SAAc;IAC7C,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,GAAG,EAAE;QAAE,OAAO,KAAK,CAAC,CAAC,sBAAsB;IACnE,OAAO,CACL,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,WAAW,EAAE;QAClC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CACrC,CAAC;AACJ,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@agenticprimitives/connect-auth",
|
|
3
|
+
"version": "0.1.0-alpha.2",
|
|
4
|
+
"description": "User authentication (passkey + SIWE + Google OAuth), JWT sessions, and pluggable signer interfaces.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/agentictrustlabs/agenticprimitives.git",
|
|
9
|
+
"directory": "packages/connect-auth"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/agentictrustlabs/agenticprimitives/tree/master/packages/connect-auth",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/agentictrustlabs/agenticprimitives/issues"
|
|
14
|
+
},
|
|
15
|
+
"type": "module",
|
|
16
|
+
"main": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./passkey": {
|
|
24
|
+
"types": "./dist/methods/passkey.d.ts",
|
|
25
|
+
"import": "./dist/methods/passkey.js"
|
|
26
|
+
},
|
|
27
|
+
"./siwe": {
|
|
28
|
+
"types": "./dist/methods/siwe.d.ts",
|
|
29
|
+
"import": "./dist/methods/siwe.js"
|
|
30
|
+
},
|
|
31
|
+
"./google": {
|
|
32
|
+
"types": "./dist/methods/google.d.ts",
|
|
33
|
+
"import": "./dist/methods/google.js"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"LICENSE",
|
|
38
|
+
"dist",
|
|
39
|
+
"spec.md",
|
|
40
|
+
"README.md"
|
|
41
|
+
],
|
|
42
|
+
"scripts": {
|
|
43
|
+
"build": "tsc -p tsconfig.build.json",
|
|
44
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
45
|
+
"test": "vitest run",
|
|
46
|
+
"test:unit": "vitest run test/unit",
|
|
47
|
+
"test:integration": "vitest run test/integration --passWithNoTests",
|
|
48
|
+
"test:watch": "vitest",
|
|
49
|
+
"clean": "rm -rf dist"
|
|
50
|
+
},
|
|
51
|
+
"publishConfig": {
|
|
52
|
+
"access": "public"
|
|
53
|
+
},
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"@noble/curves": "^1.6.0",
|
|
56
|
+
"@noble/hashes": "^1.5.0"
|
|
57
|
+
},
|
|
58
|
+
"peerDependencies": {
|
|
59
|
+
"@agenticprimitives/types": "workspace:*",
|
|
60
|
+
"viem": "^2.50.0"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"vitest": "^2.1.0"
|
|
64
|
+
},
|
|
65
|
+
"keywords": [
|
|
66
|
+
"auth",
|
|
67
|
+
"passkey",
|
|
68
|
+
"siwe",
|
|
69
|
+
"oauth",
|
|
70
|
+
"session",
|
|
71
|
+
"agentic"
|
|
72
|
+
]
|
|
73
|
+
}
|
package/spec.md
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# @agenticprimitives/connect-auth — spec
|
|
2
|
+
|
|
3
|
+
The authoritative specification for this package lives at the repo root:
|
|
4
|
+
**[`../../specs/200-connect-auth.md`](../../specs/200-connect-auth.md)**
|
|
5
|
+
|
|
6
|
+
When this package is published, the spec is included verbatim from that file. Do not edit a divergent copy here — edit the canonical one.
|