@dreadkn1ght123/auth-core 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.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction.d.ts","sourceRoot":"","sources":["../src/transaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAC5E,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,EACvC,OAAO,EAAE,OAAO,CAAC,yBAAyB,CAAC,CAAC,CAAC,EAAE;IAAE,MAAM,EAAE,IAAI,CAAA;CAAE,CAAC,GAC/D,SAAS,CAaX"}
@@ -0,0 +1,17 @@
1
+ import { AuthError } from "./errors.js";
2
+ /**
3
+ * Converts an explicit, secret-free atomic consume result to the diagnostic
4
+ * used by adapters. The successful transaction is deliberately never copied
5
+ * into the error or its safe details.
6
+ */
7
+ export function transactionConsumeError(outcome) {
8
+ const reason = {
9
+ not_found: "transaction_not_found",
10
+ expired: "transaction_expired",
11
+ state_mismatch: "state_mismatch",
12
+ already_consumed: "transaction_already_consumed",
13
+ ambiguous: "transaction_consume_ambiguous",
14
+ };
15
+ return new AuthError("TRANSACTION_INVALID", "Authorization transaction cannot be consumed", { stage: "transaction_validation", reason: reason[outcome.status] });
16
+ }
17
+ //# sourceMappingURL=transaction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transaction.js","sourceRoot":"","sources":["../src/transaction.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;;GAIG;AACH,MAAM,UAAU,uBAAuB,CACrC,OAAgE;IAEhE,MAAM,MAAM,GAAG;QACb,SAAS,EAAE,uBAAuB;QAClC,OAAO,EAAE,qBAAqB;QAC9B,cAAc,EAAE,gBAAgB;QAChC,gBAAgB,EAAE,8BAA8B;QAChD,SAAS,EAAE,+BAA+B;KAClC,CAAC;IACX,OAAO,IAAI,SAAS,CAClB,qBAAqB,EACrB,8CAA8C,EAC9C,EAAE,KAAK,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CACpE,CAAC;AACJ,CAAC"}
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@dreadkn1ght123/auth-core",
3
+ "version": "0.2.0",
4
+ "description": "Server-side OpenID Connect primitives for VVP applications",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.js"
12
+ }
13
+ },
14
+ "files": [
15
+ "dist",
16
+ "README.md"
17
+ ],
18
+ "engines": {
19
+ "node": ">=20"
20
+ },
21
+ "dependencies": {
22
+ "jose": "^6.1.0",
23
+ "openid-client": "^6.8.1",
24
+ "@dreadkn1ght123/auth-types": "^0.2.0"
25
+ },
26
+ "publishConfig": {
27
+ "access": "public",
28
+ "provenance": true
29
+ },
30
+ "scripts": {
31
+ "build": "tsc -b",
32
+ "typecheck": "tsc -b --pretty false && tsc -p tsconfig.test.json --noEmit --pretty false",
33
+ "test": "vitest run"
34
+ }
35
+ }