@iveri/contracts 0.1.0 → 0.3.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/README.md +72 -14
- package/dist/cjs/api/conduit/capture.type.d.ts +70 -0
- package/dist/cjs/api/conduit/capture.type.d.ts.map +1 -0
- package/dist/cjs/api/conduit/capture.type.js +3 -0
- package/dist/cjs/api/conduit/capture.type.js.map +1 -0
- package/dist/cjs/api/conduit/endpoint.type.d.ts +66 -0
- package/dist/cjs/api/conduit/endpoint.type.d.ts.map +1 -0
- package/dist/cjs/api/conduit/endpoint.type.js +3 -0
- package/dist/cjs/api/conduit/endpoint.type.js.map +1 -0
- package/dist/cjs/api/conduit/handshake-kind.enum.d.ts +22 -0
- package/dist/cjs/api/conduit/handshake-kind.enum.d.ts.map +1 -0
- package/dist/cjs/api/conduit/handshake-kind.enum.js +26 -0
- package/dist/cjs/api/conduit/handshake-kind.enum.js.map +1 -0
- package/dist/cjs/api/conduit/index.d.ts +11 -0
- package/dist/cjs/api/conduit/index.d.ts.map +1 -0
- package/dist/cjs/api/conduit/index.js +27 -0
- package/dist/cjs/api/conduit/index.js.map +1 -0
- package/dist/cjs/api/conduit/provider.type.d.ts +138 -0
- package/dist/cjs/api/conduit/provider.type.d.ts.map +1 -0
- package/dist/cjs/api/conduit/provider.type.js +8 -0
- package/dist/cjs/api/conduit/provider.type.js.map +1 -0
- package/dist/cjs/api/conduit/replay.type.d.ts +48 -0
- package/dist/cjs/api/conduit/replay.type.d.ts.map +1 -0
- package/dist/cjs/api/conduit/replay.type.js +3 -0
- package/dist/cjs/api/conduit/replay.type.js.map +1 -0
- package/dist/cjs/api/conduit/signature-algorithm.enum.d.ts +17 -0
- package/dist/cjs/api/conduit/signature-algorithm.enum.d.ts.map +1 -0
- package/dist/cjs/api/conduit/signature-algorithm.enum.js +21 -0
- package/dist/cjs/api/conduit/signature-algorithm.enum.js.map +1 -0
- package/dist/cjs/api/conduit/signature-encoding.enum.d.ts +13 -0
- package/dist/cjs/api/conduit/signature-encoding.enum.d.ts.map +1 -0
- package/dist/cjs/api/conduit/signature-encoding.enum.js +17 -0
- package/dist/cjs/api/conduit/signature-encoding.enum.js.map +1 -0
- package/dist/cjs/api/conduit/signature-header-scheme.enum.d.ts +19 -0
- package/dist/cjs/api/conduit/signature-header-scheme.enum.d.ts.map +1 -0
- package/dist/cjs/api/conduit/signature-header-scheme.enum.js +23 -0
- package/dist/cjs/api/conduit/signature-header-scheme.enum.js.map +1 -0
- package/dist/cjs/api/conduit/signature-verdict.enum.d.ts +50 -0
- package/dist/cjs/api/conduit/signature-verdict.enum.d.ts.map +1 -0
- package/dist/cjs/api/conduit/signature-verdict.enum.js +54 -0
- package/dist/cjs/api/conduit/signature-verdict.enum.js.map +1 -0
- package/dist/cjs/api/conduit/signature.type.d.ts +54 -0
- package/dist/cjs/api/conduit/signature.type.d.ts.map +1 -0
- package/dist/cjs/api/conduit/signature.type.js +3 -0
- package/dist/cjs/api/conduit/signature.type.js.map +1 -0
- package/dist/cjs/api/identity/auth.type.d.ts +92 -0
- package/dist/cjs/api/identity/auth.type.d.ts.map +1 -0
- package/dist/cjs/api/identity/auth.type.js +3 -0
- package/dist/cjs/api/identity/auth.type.js.map +1 -0
- package/dist/cjs/api/identity/index.d.ts +4 -0
- package/dist/cjs/api/identity/index.d.ts.map +1 -0
- package/dist/cjs/api/identity/index.js +20 -0
- package/dist/cjs/api/identity/index.js.map +1 -0
- package/dist/cjs/api/identity/membership-status.enum.d.ts +16 -0
- package/dist/cjs/api/identity/membership-status.enum.d.ts.map +1 -0
- package/dist/cjs/api/identity/membership-status.enum.js +20 -0
- package/dist/cjs/api/identity/membership-status.enum.js.map +1 -0
- package/dist/cjs/api/identity/tenant-status.enum.d.ts +28 -0
- package/dist/cjs/api/identity/tenant-status.enum.d.ts.map +1 -0
- package/dist/cjs/api/identity/tenant-status.enum.js +32 -0
- package/dist/cjs/api/identity/tenant-status.enum.js.map +1 -0
- package/dist/cjs/enum/index.d.ts +1 -0
- package/dist/cjs/enum/index.d.ts.map +1 -1
- package/dist/cjs/enum/index.js +1 -0
- package/dist/cjs/enum/index.js.map +1 -1
- package/dist/cjs/enum/user-permission.enum.d.ts +72 -0
- package/dist/cjs/enum/user-permission.enum.d.ts.map +1 -0
- package/dist/cjs/enum/user-permission.enum.js +87 -0
- package/dist/cjs/enum/user-permission.enum.js.map +1 -0
- package/dist/cjs/type/api-response.type.d.ts +24 -28
- package/dist/cjs/type/api-response.type.d.ts.map +1 -1
- package/dist/cjs/type/index.d.ts +1 -0
- package/dist/cjs/type/index.d.ts.map +1 -1
- package/dist/cjs/type/index.js +1 -0
- package/dist/cjs/type/index.js.map +1 -1
- package/dist/cjs/type/iso-date-time.type.d.ts +17 -0
- package/dist/cjs/type/iso-date-time.type.d.ts.map +1 -0
- package/dist/cjs/type/iso-date-time.type.js +3 -0
- package/dist/cjs/type/iso-date-time.type.js.map +1 -0
- package/dist/esm/api/conduit/capture.type.d.ts +70 -0
- package/dist/esm/api/conduit/capture.type.d.ts.map +1 -0
- package/dist/esm/api/conduit/capture.type.js +2 -0
- package/dist/esm/api/conduit/capture.type.js.map +1 -0
- package/dist/esm/api/conduit/endpoint.type.d.ts +66 -0
- package/dist/esm/api/conduit/endpoint.type.d.ts.map +1 -0
- package/dist/esm/api/conduit/endpoint.type.js +2 -0
- package/dist/esm/api/conduit/endpoint.type.js.map +1 -0
- package/dist/esm/api/conduit/handshake-kind.enum.d.ts +22 -0
- package/dist/esm/api/conduit/handshake-kind.enum.d.ts.map +1 -0
- package/dist/esm/api/conduit/handshake-kind.enum.js +23 -0
- package/dist/esm/api/conduit/handshake-kind.enum.js.map +1 -0
- package/dist/esm/api/conduit/index.d.ts +11 -0
- package/dist/esm/api/conduit/index.d.ts.map +1 -0
- package/dist/esm/api/conduit/index.js +11 -0
- package/dist/esm/api/conduit/index.js.map +1 -0
- package/dist/esm/api/conduit/provider.type.d.ts +138 -0
- package/dist/esm/api/conduit/provider.type.d.ts.map +1 -0
- package/dist/esm/api/conduit/provider.type.js +5 -0
- package/dist/esm/api/conduit/provider.type.js.map +1 -0
- package/dist/esm/api/conduit/replay.type.d.ts +48 -0
- package/dist/esm/api/conduit/replay.type.d.ts.map +1 -0
- package/dist/esm/api/conduit/replay.type.js +2 -0
- package/dist/esm/api/conduit/replay.type.js.map +1 -0
- package/dist/esm/api/conduit/signature-algorithm.enum.d.ts +17 -0
- package/dist/esm/api/conduit/signature-algorithm.enum.d.ts.map +1 -0
- package/dist/esm/api/conduit/signature-algorithm.enum.js +18 -0
- package/dist/esm/api/conduit/signature-algorithm.enum.js.map +1 -0
- package/dist/esm/api/conduit/signature-encoding.enum.d.ts +13 -0
- package/dist/esm/api/conduit/signature-encoding.enum.d.ts.map +1 -0
- package/dist/esm/api/conduit/signature-encoding.enum.js +14 -0
- package/dist/esm/api/conduit/signature-encoding.enum.js.map +1 -0
- package/dist/esm/api/conduit/signature-header-scheme.enum.d.ts +19 -0
- package/dist/esm/api/conduit/signature-header-scheme.enum.d.ts.map +1 -0
- package/dist/esm/api/conduit/signature-header-scheme.enum.js +20 -0
- package/dist/esm/api/conduit/signature-header-scheme.enum.js.map +1 -0
- package/dist/esm/api/conduit/signature-verdict.enum.d.ts +50 -0
- package/dist/esm/api/conduit/signature-verdict.enum.d.ts.map +1 -0
- package/dist/esm/api/conduit/signature-verdict.enum.js +51 -0
- package/dist/esm/api/conduit/signature-verdict.enum.js.map +1 -0
- package/dist/esm/api/conduit/signature.type.d.ts +54 -0
- package/dist/esm/api/conduit/signature.type.d.ts.map +1 -0
- package/dist/esm/api/conduit/signature.type.js +2 -0
- package/dist/esm/api/conduit/signature.type.js.map +1 -0
- package/dist/esm/api/identity/auth.type.d.ts +92 -0
- package/dist/esm/api/identity/auth.type.d.ts.map +1 -0
- package/dist/esm/api/identity/auth.type.js +2 -0
- package/dist/esm/api/identity/auth.type.js.map +1 -0
- package/dist/esm/api/identity/index.d.ts +4 -0
- package/dist/esm/api/identity/index.d.ts.map +1 -0
- package/dist/esm/api/identity/index.js +4 -0
- package/dist/esm/api/identity/index.js.map +1 -0
- package/dist/esm/api/identity/membership-status.enum.d.ts +16 -0
- package/dist/esm/api/identity/membership-status.enum.d.ts.map +1 -0
- package/dist/esm/api/identity/membership-status.enum.js +17 -0
- package/dist/esm/api/identity/membership-status.enum.js.map +1 -0
- package/dist/esm/api/identity/tenant-status.enum.d.ts +28 -0
- package/dist/esm/api/identity/tenant-status.enum.d.ts.map +1 -0
- package/dist/esm/api/identity/tenant-status.enum.js +29 -0
- package/dist/esm/api/identity/tenant-status.enum.js.map +1 -0
- package/dist/esm/enum/index.d.ts +1 -0
- package/dist/esm/enum/index.d.ts.map +1 -1
- package/dist/esm/enum/index.js +1 -0
- package/dist/esm/enum/index.js.map +1 -1
- package/dist/esm/enum/user-permission.enum.d.ts +72 -0
- package/dist/esm/enum/user-permission.enum.d.ts.map +1 -0
- package/dist/esm/enum/user-permission.enum.js +84 -0
- package/dist/esm/enum/user-permission.enum.js.map +1 -0
- package/dist/esm/type/api-response.type.d.ts +24 -28
- package/dist/esm/type/api-response.type.d.ts.map +1 -1
- package/dist/esm/type/index.d.ts +1 -0
- package/dist/esm/type/index.d.ts.map +1 -1
- package/dist/esm/type/index.js +1 -0
- package/dist/esm/type/index.js.map +1 -1
- package/dist/esm/type/iso-date-time.type.d.ts +17 -0
- package/dist/esm/type/iso-date-time.type.d.ts.map +1 -0
- package/dist/esm/type/iso-date-time.type.js +2 -0
- package/dist/esm/type/iso-date-time.type.js.map +1 -0
- package/package.json +22 -2
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SignatureAlgorithm = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Hash backing a provider's HMAC.
|
|
6
|
+
*
|
|
7
|
+
* `SHA1` is here because Meta still sends `x-hub-signature` alongside the SHA-256 header and
|
|
8
|
+
* some older integrations only have that one. It is **not** a recommendation — a manifest using
|
|
9
|
+
* it is verifying what the provider actually sends, which is the only useful thing a diagnostic
|
|
10
|
+
* can do. Nothing in Conduit ever *chooses* SHA-1.
|
|
11
|
+
*
|
|
12
|
+
* Values are the strings `node:crypto` expects, so no lookup table stands between the manifest
|
|
13
|
+
* and `createHmac` — one fewer place for a typo to become "signature mismatch".
|
|
14
|
+
*/
|
|
15
|
+
var SignatureAlgorithm;
|
|
16
|
+
(function (SignatureAlgorithm) {
|
|
17
|
+
SignatureAlgorithm["SHA1"] = "sha1";
|
|
18
|
+
SignatureAlgorithm["SHA256"] = "sha256";
|
|
19
|
+
SignatureAlgorithm["SHA512"] = "sha512";
|
|
20
|
+
})(SignatureAlgorithm || (exports.SignatureAlgorithm = SignatureAlgorithm = {}));
|
|
21
|
+
//# sourceMappingURL=signature-algorithm.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signature-algorithm.enum.js","sourceRoot":"","sources":["../../../../src/api/conduit/signature-algorithm.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;GAUG;AACH,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC1B,mCAAa,CAAA;IACb,uCAAiB,CAAA;IACjB,uCAAiB,CAAA;AACrB,CAAC,EAJW,kBAAkB,kCAAlB,kBAAkB,QAI7B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How the computed digest is rendered before comparison.
|
|
3
|
+
*
|
|
4
|
+
* Getting this wrong is one of the two most common causes of a webhook signature that "should
|
|
5
|
+
* work but doesn't" — the digest is right and the string is not. Naming it in the manifest is
|
|
6
|
+
* what lets the diagnostic show the caller both encodings of the same digest rather than a bare
|
|
7
|
+
* "mismatch".
|
|
8
|
+
*/
|
|
9
|
+
export declare enum SignatureEncoding {
|
|
10
|
+
HEX = "hex",
|
|
11
|
+
BASE64 = "base64"
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=signature-encoding.enum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signature-encoding.enum.d.ts","sourceRoot":"","sources":["../../../../src/api/conduit/signature-encoding.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,oBAAY,iBAAiB;IACzB,GAAG,QAAQ;IACX,MAAM,WAAW;CACpB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SignatureEncoding = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* How the computed digest is rendered before comparison.
|
|
6
|
+
*
|
|
7
|
+
* Getting this wrong is one of the two most common causes of a webhook signature that "should
|
|
8
|
+
* work but doesn't" — the digest is right and the string is not. Naming it in the manifest is
|
|
9
|
+
* what lets the diagnostic show the caller both encodings of the same digest rather than a bare
|
|
10
|
+
* "mismatch".
|
|
11
|
+
*/
|
|
12
|
+
var SignatureEncoding;
|
|
13
|
+
(function (SignatureEncoding) {
|
|
14
|
+
SignatureEncoding["HEX"] = "hex";
|
|
15
|
+
SignatureEncoding["BASE64"] = "base64";
|
|
16
|
+
})(SignatureEncoding || (exports.SignatureEncoding = SignatureEncoding = {}));
|
|
17
|
+
//# sourceMappingURL=signature-encoding.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signature-encoding.enum.js","sourceRoot":"","sources":["../../../../src/api/conduit/signature-encoding.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IACzB,gCAAW,CAAA;IACX,sCAAiB,CAAA;AACrB,CAAC,EAHW,iBAAiB,iCAAjB,iBAAiB,QAG5B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How the signature is packed into its header.
|
|
3
|
+
*
|
|
4
|
+
* Two shapes cover every provider we have met:
|
|
5
|
+
*
|
|
6
|
+
* - `DIRECT` — the header *is* the signature, optionally behind a prefix:
|
|
7
|
+
* `x-hub-signature-256: sha256=a1b2…`
|
|
8
|
+
* - `KEY_VALUE_LIST` — a comma-separated list the signature is one entry of, because the
|
|
9
|
+
* provider also ships a timestamp in the same header:
|
|
10
|
+
* `stripe-signature: t=1737031234,v1=a1b2…`
|
|
11
|
+
*
|
|
12
|
+
* Modelling the packing separately from the digest is what keeps "add TikTok" a manifest rather
|
|
13
|
+
* than a code change.
|
|
14
|
+
*/
|
|
15
|
+
export declare enum SignatureHeaderScheme {
|
|
16
|
+
DIRECT = "direct",
|
|
17
|
+
KEY_VALUE_LIST = "key-value-list"
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=signature-header-scheme.enum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signature-header-scheme.enum.d.ts","sourceRoot":"","sources":["../../../../src/api/conduit/signature-header-scheme.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,oBAAY,qBAAqB;IAC7B,MAAM,WAAW;IACjB,cAAc,mBAAmB;CACpC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SignatureHeaderScheme = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* How the signature is packed into its header.
|
|
6
|
+
*
|
|
7
|
+
* Two shapes cover every provider we have met:
|
|
8
|
+
*
|
|
9
|
+
* - `DIRECT` — the header *is* the signature, optionally behind a prefix:
|
|
10
|
+
* `x-hub-signature-256: sha256=a1b2…`
|
|
11
|
+
* - `KEY_VALUE_LIST` — a comma-separated list the signature is one entry of, because the
|
|
12
|
+
* provider also ships a timestamp in the same header:
|
|
13
|
+
* `stripe-signature: t=1737031234,v1=a1b2…`
|
|
14
|
+
*
|
|
15
|
+
* Modelling the packing separately from the digest is what keeps "add TikTok" a manifest rather
|
|
16
|
+
* than a code change.
|
|
17
|
+
*/
|
|
18
|
+
var SignatureHeaderScheme;
|
|
19
|
+
(function (SignatureHeaderScheme) {
|
|
20
|
+
SignatureHeaderScheme["DIRECT"] = "direct";
|
|
21
|
+
SignatureHeaderScheme["KEY_VALUE_LIST"] = "key-value-list";
|
|
22
|
+
})(SignatureHeaderScheme || (exports.SignatureHeaderScheme = SignatureHeaderScheme = {}));
|
|
23
|
+
//# sourceMappingURL=signature-header-scheme.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signature-header-scheme.enum.js","sourceRoot":"","sources":["../../../../src/api/conduit/signature-header-scheme.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;GAaG;AACH,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC7B,0CAAiB,CAAA;IACjB,0DAAiC,CAAA;AACrC,CAAC,EAHW,qBAAqB,qCAArB,qBAAqB,QAGhC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The outcome of a signature check.
|
|
3
|
+
*
|
|
4
|
+
* **Not a boolean, and that is the entire point of the feature.** "Invalid" is the least useful
|
|
5
|
+
* thing you can tell someone whose webhook is failing: the interesting cases are all the ways
|
|
6
|
+
* verification could not even run. Six of these eight are "we did not check", each for a
|
|
7
|
+
* different and separately fixable reason, and collapsing them into `false` is what makes
|
|
8
|
+
* webhook debugging take an afternoon.
|
|
9
|
+
*
|
|
10
|
+
* Stored on every capture so the list view can be filtered by it, and returned by the
|
|
11
|
+
* diagnostic alongside the evidence.
|
|
12
|
+
*
|
|
13
|
+
* A UI must not colour all six red. Only {@link SignatureVerdict.INVALID} and
|
|
14
|
+
* {@link SignatureVerdict.TIMESTAMP_OUT_OF_TOLERANCE} indicate something wrong; the other five
|
|
15
|
+
* "could not verify" verdicts mean nobody configured verification, and painting those as
|
|
16
|
+
* failures sends people to debug a provider that is behaving correctly.
|
|
17
|
+
*/
|
|
18
|
+
export declare enum SignatureVerdict {
|
|
19
|
+
/** Computed digest matched the received one, and any timestamp was inside tolerance. */
|
|
20
|
+
VALID = "valid",
|
|
21
|
+
/**
|
|
22
|
+
* Everything needed was present and the digests differ.
|
|
23
|
+
*
|
|
24
|
+
* The only verdict that suggests something is actually wrong — and even then, usually with
|
|
25
|
+
* the secret or the manifest rather than with the request. The diagnostic's hints exist for
|
|
26
|
+
* this case.
|
|
27
|
+
*/
|
|
28
|
+
INVALID = "invalid",
|
|
29
|
+
/** The endpoint names no provider, so there is no manifest describing what to check. */
|
|
30
|
+
NO_PROVIDER = "no-provider",
|
|
31
|
+
/** The manifest describes no signature scheme — this provider signs nothing. */
|
|
32
|
+
NOT_SIGNED = "not-signed",
|
|
33
|
+
/** No signing secret is configured on the endpoint. Nothing to compute a digest with. */
|
|
34
|
+
MISSING_SECRET = "missing-secret",
|
|
35
|
+
/** The manifest's header is absent from the request. Often the provider is not who you think. */
|
|
36
|
+
MISSING_SIGNATURE = "missing-signature",
|
|
37
|
+
/**
|
|
38
|
+
* The header is present but does not parse — a `key-value-list` without the expected key, or
|
|
39
|
+
* a prefix that is not there. Distinct from `INVALID` because no digest was ever compared.
|
|
40
|
+
*/
|
|
41
|
+
MALFORMED_SIGNATURE = "malformed-signature",
|
|
42
|
+
/**
|
|
43
|
+
* Digest matched, but the signed timestamp is outside the provider's replay window.
|
|
44
|
+
*
|
|
45
|
+
* Separate from both `VALID` and `INVALID` on purpose: the signature is genuine, so this is
|
|
46
|
+
* either a replay or a clock-skew problem, and those have opposite fixes.
|
|
47
|
+
*/
|
|
48
|
+
TIMESTAMP_OUT_OF_TOLERANCE = "timestamp-out-of-tolerance"
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=signature-verdict.enum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signature-verdict.enum.d.ts","sourceRoot":"","sources":["../../../../src/api/conduit/signature-verdict.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,oBAAY,gBAAgB;IACxB,wFAAwF;IACxF,KAAK,UAAU;IAEf;;;;;;OAMG;IACH,OAAO,YAAY;IAEnB,wFAAwF;IACxF,WAAW,gBAAgB;IAE3B,gFAAgF;IAChF,UAAU,eAAe;IAEzB,yFAAyF;IACzF,cAAc,mBAAmB;IAEjC,iGAAiG;IACjG,iBAAiB,sBAAsB;IAEvC;;;OAGG;IACH,mBAAmB,wBAAwB;IAE3C;;;;;OAKG;IACH,0BAA0B,+BAA+B;CAC5D"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SignatureVerdict = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The outcome of a signature check.
|
|
6
|
+
*
|
|
7
|
+
* **Not a boolean, and that is the entire point of the feature.** "Invalid" is the least useful
|
|
8
|
+
* thing you can tell someone whose webhook is failing: the interesting cases are all the ways
|
|
9
|
+
* verification could not even run. Six of these eight are "we did not check", each for a
|
|
10
|
+
* different and separately fixable reason, and collapsing them into `false` is what makes
|
|
11
|
+
* webhook debugging take an afternoon.
|
|
12
|
+
*
|
|
13
|
+
* Stored on every capture so the list view can be filtered by it, and returned by the
|
|
14
|
+
* diagnostic alongside the evidence.
|
|
15
|
+
*
|
|
16
|
+
* A UI must not colour all six red. Only {@link SignatureVerdict.INVALID} and
|
|
17
|
+
* {@link SignatureVerdict.TIMESTAMP_OUT_OF_TOLERANCE} indicate something wrong; the other five
|
|
18
|
+
* "could not verify" verdicts mean nobody configured verification, and painting those as
|
|
19
|
+
* failures sends people to debug a provider that is behaving correctly.
|
|
20
|
+
*/
|
|
21
|
+
var SignatureVerdict;
|
|
22
|
+
(function (SignatureVerdict) {
|
|
23
|
+
/** Computed digest matched the received one, and any timestamp was inside tolerance. */
|
|
24
|
+
SignatureVerdict["VALID"] = "valid";
|
|
25
|
+
/**
|
|
26
|
+
* Everything needed was present and the digests differ.
|
|
27
|
+
*
|
|
28
|
+
* The only verdict that suggests something is actually wrong — and even then, usually with
|
|
29
|
+
* the secret or the manifest rather than with the request. The diagnostic's hints exist for
|
|
30
|
+
* this case.
|
|
31
|
+
*/
|
|
32
|
+
SignatureVerdict["INVALID"] = "invalid";
|
|
33
|
+
/** The endpoint names no provider, so there is no manifest describing what to check. */
|
|
34
|
+
SignatureVerdict["NO_PROVIDER"] = "no-provider";
|
|
35
|
+
/** The manifest describes no signature scheme — this provider signs nothing. */
|
|
36
|
+
SignatureVerdict["NOT_SIGNED"] = "not-signed";
|
|
37
|
+
/** No signing secret is configured on the endpoint. Nothing to compute a digest with. */
|
|
38
|
+
SignatureVerdict["MISSING_SECRET"] = "missing-secret";
|
|
39
|
+
/** The manifest's header is absent from the request. Often the provider is not who you think. */
|
|
40
|
+
SignatureVerdict["MISSING_SIGNATURE"] = "missing-signature";
|
|
41
|
+
/**
|
|
42
|
+
* The header is present but does not parse — a `key-value-list` without the expected key, or
|
|
43
|
+
* a prefix that is not there. Distinct from `INVALID` because no digest was ever compared.
|
|
44
|
+
*/
|
|
45
|
+
SignatureVerdict["MALFORMED_SIGNATURE"] = "malformed-signature";
|
|
46
|
+
/**
|
|
47
|
+
* Digest matched, but the signed timestamp is outside the provider's replay window.
|
|
48
|
+
*
|
|
49
|
+
* Separate from both `VALID` and `INVALID` on purpose: the signature is genuine, so this is
|
|
50
|
+
* either a replay or a clock-skew problem, and those have opposite fixes.
|
|
51
|
+
*/
|
|
52
|
+
SignatureVerdict["TIMESTAMP_OUT_OF_TOLERANCE"] = "timestamp-out-of-tolerance";
|
|
53
|
+
})(SignatureVerdict || (exports.SignatureVerdict = SignatureVerdict = {}));
|
|
54
|
+
//# sourceMappingURL=signature-verdict.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signature-verdict.enum.js","sourceRoot":"","sources":["../../../../src/api/conduit/signature-verdict.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,IAAY,gBAsCX;AAtCD,WAAY,gBAAgB;IACxB,wFAAwF;IACxF,mCAAe,CAAA;IAEf;;;;;;OAMG;IACH,uCAAmB,CAAA;IAEnB,wFAAwF;IACxF,+CAA2B,CAAA;IAE3B,gFAAgF;IAChF,6CAAyB,CAAA;IAEzB,yFAAyF;IACzF,qDAAiC,CAAA;IAEjC,iGAAiG;IACjG,2DAAuC,CAAA;IAEvC;;;OAGG;IACH,+DAA2C,CAAA;IAE3C;;;;;OAKG;IACH,6EAAyD,CAAA;AAC7D,CAAC,EAtCW,gBAAgB,gCAAhB,gBAAgB,QAsC3B"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Nullable } from '../../type/nil.type.js';
|
|
2
|
+
import type { SignatureAlgorithm } from './signature-algorithm.enum.js';
|
|
3
|
+
import type { SignatureEncoding } from './signature-encoding.enum.js';
|
|
4
|
+
import type { SignatureVerdict } from './signature-verdict.enum.js';
|
|
5
|
+
/** Why a timestamp was or was not inside its replay window. */
|
|
6
|
+
export interface TimestampDiagnostic {
|
|
7
|
+
/** Where the timestamp was read from — a header name, or a key inside one. */
|
|
8
|
+
source: string;
|
|
9
|
+
/** Exactly as received. A provider sending milliseconds shows up here. */
|
|
10
|
+
rawValue: string;
|
|
11
|
+
/** Seconds old. Negative means the provider's clock is ahead of ours. */
|
|
12
|
+
ageSeconds: Nullable<number>;
|
|
13
|
+
toleranceSeconds: number;
|
|
14
|
+
withinTolerance: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The evidence behind a {@link SignatureVerdict}, not the verdict alone.
|
|
18
|
+
* `GET /api/v1/capture/:id/signature`.
|
|
19
|
+
*
|
|
20
|
+
* **The signing secret never appears here**, in any form — not the value, not a hash, not a
|
|
21
|
+
* length.
|
|
22
|
+
*/
|
|
23
|
+
export interface SignatureDiagnostic {
|
|
24
|
+
verdict: SignatureVerdict;
|
|
25
|
+
/** One sentence, safe to render directly. */
|
|
26
|
+
summary: string;
|
|
27
|
+
providerKey: Nullable<string>;
|
|
28
|
+
algorithm: Nullable<SignatureAlgorithm>;
|
|
29
|
+
encoding: Nullable<SignatureEncoding>;
|
|
30
|
+
headerName: Nullable<string>;
|
|
31
|
+
/** The header exactly as received, before any prefix was stripped. */
|
|
32
|
+
receivedHeader: Nullable<string>;
|
|
33
|
+
/** The digest read out of that header. */
|
|
34
|
+
receivedSignature: Nullable<string>;
|
|
35
|
+
/** What we computed, in the manifest's encoding. */
|
|
36
|
+
computedSignature: Nullable<string>;
|
|
37
|
+
/**
|
|
38
|
+
* Readable rendering of the exact bytes hashed — truncated and lossy, for recognising the
|
|
39
|
+
* shape. When the bytes themselves matter, use `signedPayloadByteLength` and `bodySha256`.
|
|
40
|
+
*/
|
|
41
|
+
signedPayloadPreview: Nullable<string>;
|
|
42
|
+
signedPayloadByteLength: Nullable<number>;
|
|
43
|
+
/** Hex SHA-256 of the body. Compare against what the provider says it sent. */
|
|
44
|
+
bodySha256: string;
|
|
45
|
+
bodyByteLength: number;
|
|
46
|
+
timestamp: Nullable<TimestampDiagnostic>;
|
|
47
|
+
/**
|
|
48
|
+
* Specific, verified observations — each produced by recomputing the digest a different way
|
|
49
|
+
* and finding that it matched. **Every hint is a verified alternative, never a guess**, so
|
|
50
|
+
* acting on one always fixes the problem.
|
|
51
|
+
*/
|
|
52
|
+
hints: string[];
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=signature.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signature.type.d.ts","sourceRoot":"","sources":["../../../../src/api/conduit/signature.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACtE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAEpE,+DAA+D;AAC/D,MAAM,WAAW,mBAAmB;IAChC,8EAA8E;IAC9E,MAAM,EAAE,MAAM,CAAC;IAEf,0EAA0E;IAC1E,QAAQ,EAAE,MAAM,CAAC;IAEjB,yEAAyE;IACzE,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAE7B,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,OAAO,CAAC;CAC5B;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAChC,OAAO,EAAE,gBAAgB,CAAC;IAE1B,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAEhB,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC9B,SAAS,EAAE,QAAQ,CAAC,kBAAkB,CAAC,CAAC;IACxC,QAAQ,EAAE,QAAQ,CAAC,iBAAiB,CAAC,CAAC;IACtC,UAAU,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAE7B,sEAAsE;IACtE,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAEjC,0CAA0C;IAC1C,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAEpC,oDAAoD;IACpD,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAEpC;;;OAGG;IACH,oBAAoB,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAEvC,uBAAuB,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAE1C,+EAA+E;IAC/E,UAAU,EAAE,MAAM,CAAC;IAEnB,cAAc,EAAE,MAAM,CAAC;IAEvB,SAAS,EAAE,QAAQ,CAAC,mBAAmB,CAAC,CAAC;IAEzC;;;;OAIG;IACH,KAAK,EAAE,MAAM,EAAE,CAAC;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signature.type.js","sourceRoot":"","sources":["../../../../src/api/conduit/signature.type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type { UserPermission } from '../../enum/user-permission.enum.js';
|
|
2
|
+
import type { Nullable } from '../../type/nil.type.js';
|
|
3
|
+
import type { UUID } from '../../type/uuid.type.js';
|
|
4
|
+
import type { MembershipStatus } from './membership-status.enum.js';
|
|
5
|
+
import type { TenantStatus } from './tenant-status.enum.js';
|
|
6
|
+
/** `POST /auth/signup` — creates a tenant and its first owner in one call. */
|
|
7
|
+
export interface SignupBody {
|
|
8
|
+
tenantName: string;
|
|
9
|
+
/** Login identifier for the tenant. Globally unique and permanent. */
|
|
10
|
+
tenantSlug: string;
|
|
11
|
+
email: string;
|
|
12
|
+
password: string;
|
|
13
|
+
firstName: string;
|
|
14
|
+
lastName: string;
|
|
15
|
+
}
|
|
16
|
+
/** `POST /auth/login`. */
|
|
17
|
+
export interface LoginBody {
|
|
18
|
+
/**
|
|
19
|
+
* Users are tenant-scoped — `(tenantId, email)` is what is unique, not the email — so a
|
|
20
|
+
* login cannot be resolved without knowing the tenant. That is the decision that lets
|
|
21
|
+
* `BaseRepository` scope every table with no exceptions; the slug on this body is its
|
|
22
|
+
* visible cost.
|
|
23
|
+
*/
|
|
24
|
+
tenantSlug: string;
|
|
25
|
+
email: string;
|
|
26
|
+
password: string;
|
|
27
|
+
}
|
|
28
|
+
/** `POST /auth/refresh` and `POST /auth/logout`. */
|
|
29
|
+
export interface RefreshTokenBody {
|
|
30
|
+
refreshToken: string;
|
|
31
|
+
}
|
|
32
|
+
/** `POST /auth/accept-invitation` — the invitee sets a password and the membership activates. */
|
|
33
|
+
export interface AcceptInvitationBody {
|
|
34
|
+
invitationToken: string;
|
|
35
|
+
password: string;
|
|
36
|
+
}
|
|
37
|
+
/** Returned by `POST /auth/refresh`, and nested inside {@link AuthSession}. */
|
|
38
|
+
export interface AuthTokens {
|
|
39
|
+
/** Send as `Authorization: Bearer <accessToken>`. */
|
|
40
|
+
accessToken: string;
|
|
41
|
+
/**
|
|
42
|
+
* Opaque. Rotated on every refresh — the previous value stops working immediately, and
|
|
43
|
+
* presenting a spent one is treated as a leak and revokes every token for that user.
|
|
44
|
+
*
|
|
45
|
+
* A client therefore needs a **single-flight guard** around refresh: four honest concurrent
|
|
46
|
+
* requests reacting to one expired access token would send the same refresh token four
|
|
47
|
+
* times, and three of those are replays. `conduit-admin-web/src/lib/auth` has the reference
|
|
48
|
+
* implementation; any new frontend needs it on day one, not after the first logout bug.
|
|
49
|
+
*/
|
|
50
|
+
refreshToken: string;
|
|
51
|
+
/** Lifetime of `accessToken` in seconds, not of `refreshToken`. */
|
|
52
|
+
expiresInSeconds: number;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Who the caller is. Returned by `GET /auth/me` and nested inside {@link AuthSession}.
|
|
56
|
+
*
|
|
57
|
+
* The user fields are nullable because a machine principal — an API key — has permissions and
|
|
58
|
+
* a tenant but no person behind it. A client rendering this must handle that.
|
|
59
|
+
*
|
|
60
|
+
* `permissions` is a **snapshot resolved when the access token was issued**, not a live read.
|
|
61
|
+
* Access tokens are stateless JWTs carrying their permissions precisely so a service like
|
|
62
|
+
* `conduit-api` can authorize locally without calling identity on the hot path; the price is
|
|
63
|
+
* that a permission revoked elsewhere stays effective until the token expires. Do not "fix"
|
|
64
|
+
* that with a database read in a guard.
|
|
65
|
+
*/
|
|
66
|
+
export interface Principal {
|
|
67
|
+
/** Null for an API-key principal. */
|
|
68
|
+
userId: Nullable<UUID>;
|
|
69
|
+
email: Nullable<string>;
|
|
70
|
+
firstName: Nullable<string>;
|
|
71
|
+
lastName: Nullable<string>;
|
|
72
|
+
tenantId: UUID;
|
|
73
|
+
tenantName: string;
|
|
74
|
+
tenantSlug: string;
|
|
75
|
+
tenantStatus: TenantStatus;
|
|
76
|
+
/** Null for an API-key principal. */
|
|
77
|
+
membershipStatus: Nullable<MembershipStatus>;
|
|
78
|
+
roleSlugs: string[];
|
|
79
|
+
/** What this credential can do right now, as of token issue. */
|
|
80
|
+
permissions: UserPermission[];
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Returned by signup, login and invitation acceptance.
|
|
84
|
+
*
|
|
85
|
+
* Tokens and principal together, so a client does not have to follow every login with a call
|
|
86
|
+
* to `/auth/me` before it can render anything.
|
|
87
|
+
*/
|
|
88
|
+
export interface AuthSession {
|
|
89
|
+
principal: Principal;
|
|
90
|
+
tokens: AuthTokens;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=auth.type.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.type.d.ts","sourceRoot":"","sources":["../../../../src/api/identity/auth.type.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,8EAA8E;AAC9E,MAAM,WAAW,UAAU;IACvB,UAAU,EAAE,MAAM,CAAC;IAEnB,sEAAsE;IACtE,UAAU,EAAE,MAAM,CAAC;IAEnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,0BAA0B;AAC1B,MAAM,WAAW,SAAS;IACtB;;;;;OAKG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,oDAAoD;AACpD,MAAM,WAAW,gBAAgB;IAC7B,YAAY,EAAE,MAAM,CAAC;CACxB;AAED,iGAAiG;AACjG,MAAM,WAAW,oBAAoB;IACjC,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,+EAA+E;AAC/E,MAAM,WAAW,UAAU;IACvB,qDAAqD;IACrD,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;;;;OAQG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB,mEAAmE;IACnE,gBAAgB,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,SAAS;IACtB,qCAAqC;IACrC,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IAEvB,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACxB,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC5B,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAE3B,QAAQ,EAAE,IAAI,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,YAAY,CAAC;IAE3B,qCAAqC;IACrC,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB,CAAC,CAAC;IAE7C,SAAS,EAAE,MAAM,EAAE,CAAC;IAEpB,gEAAgE;IAChE,WAAW,EAAE,cAAc,EAAE,CAAC;CACjC;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IACxB,SAAS,EAAE,SAAS,CAAC;IACrB,MAAM,EAAE,UAAU,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.type.js","sourceRoot":"","sources":["../../../../src/api/identity/auth.type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/api/identity/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./auth.type.js"), exports);
|
|
18
|
+
__exportStar(require("./membership-status.enum.js"), exports);
|
|
19
|
+
__exportStar(require("./tenant-status.enum.js"), exports);
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/api/identity/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,8DAA4C;AAC5C,0DAAwC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A user's standing inside their tenant.
|
|
3
|
+
*
|
|
4
|
+
* Lives on the membership rather than the user because it is a statement about access, not
|
|
5
|
+
* about identity — and keeping the two apart is what stops "deactivate this person" and
|
|
6
|
+
* "delete this account" from becoming the same operation.
|
|
7
|
+
*/
|
|
8
|
+
export declare enum MembershipStatus {
|
|
9
|
+
/** Invited but has not set a password yet. Cannot authenticate. */
|
|
10
|
+
INVITED = "INVITED",
|
|
11
|
+
/** Normal operation. */
|
|
12
|
+
ACTIVE = "ACTIVE",
|
|
13
|
+
/** Access revoked without deleting anything. Reversible; existing sessions stop working. */
|
|
14
|
+
SUSPENDED = "SUSPENDED"
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=membership-status.enum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"membership-status.enum.d.ts","sourceRoot":"","sources":["../../../../src/api/identity/membership-status.enum.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,oBAAY,gBAAgB;IACxB,mEAAmE;IACnE,OAAO,YAAY;IAEnB,wBAAwB;IACxB,MAAM,WAAW;IAEjB,4FAA4F;IAC5F,SAAS,cAAc;CAC1B"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MembershipStatus = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* A user's standing inside their tenant.
|
|
6
|
+
*
|
|
7
|
+
* Lives on the membership rather than the user because it is a statement about access, not
|
|
8
|
+
* about identity — and keeping the two apart is what stops "deactivate this person" and
|
|
9
|
+
* "delete this account" from becoming the same operation.
|
|
10
|
+
*/
|
|
11
|
+
var MembershipStatus;
|
|
12
|
+
(function (MembershipStatus) {
|
|
13
|
+
/** Invited but has not set a password yet. Cannot authenticate. */
|
|
14
|
+
MembershipStatus["INVITED"] = "INVITED";
|
|
15
|
+
/** Normal operation. */
|
|
16
|
+
MembershipStatus["ACTIVE"] = "ACTIVE";
|
|
17
|
+
/** Access revoked without deleting anything. Reversible; existing sessions stop working. */
|
|
18
|
+
MembershipStatus["SUSPENDED"] = "SUSPENDED";
|
|
19
|
+
})(MembershipStatus || (exports.MembershipStatus = MembershipStatus = {}));
|
|
20
|
+
//# sourceMappingURL=membership-status.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"membership-status.enum.js","sourceRoot":"","sources":["../../../../src/api/identity/membership-status.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;;GAMG;AACH,IAAY,gBASX;AATD,WAAY,gBAAgB;IACxB,mEAAmE;IACnE,uCAAmB,CAAA;IAEnB,wBAAwB;IACxB,qCAAiB,CAAA;IAEjB,4FAA4F;IAC5F,2CAAuB,CAAA;AAC3B,CAAC,EATW,gBAAgB,gCAAhB,gBAAgB,QAS3B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lifecycle state of a tenant.
|
|
3
|
+
*
|
|
4
|
+
* Every authenticated request checks it, so a suspended tenant loses access without any of its
|
|
5
|
+
* data being touched.
|
|
6
|
+
*
|
|
7
|
+
* Lives here rather than in `iveri-identity-api` because it is on the wire: it rides inside
|
|
8
|
+
* every principal, which means every service and every frontend reads it. `conduit-admin-web`
|
|
9
|
+
* hand-transcribed it as `'active' | 'suspended' | 'cancelled'` — wrong casing and a member
|
|
10
|
+
* identity has never had — and nothing caught it, because a hand-written mirror of an enum is
|
|
11
|
+
* checked by nobody. That is the whole argument for this directory.
|
|
12
|
+
*/
|
|
13
|
+
export declare enum TenantStatus {
|
|
14
|
+
/** Normal operation. */
|
|
15
|
+
ACTIVE = "ACTIVE",
|
|
16
|
+
/**
|
|
17
|
+
* Access blocked — non-payment, abuse, or a customer request. Reversible, and nothing is
|
|
18
|
+
* deleted. Logins fail and existing access tokens stop working at the next request.
|
|
19
|
+
*/
|
|
20
|
+
SUSPENDED = "SUSPENDED",
|
|
21
|
+
/**
|
|
22
|
+
* Scheduled for erasure. Behaves like `SUSPENDED` for access purposes; the distinction is
|
|
23
|
+
* that the data is on its way out, which matters for a GDPR deletion request having a
|
|
24
|
+
* documented, auditable state rather than a row silently vanishing.
|
|
25
|
+
*/
|
|
26
|
+
PENDING_DELETION = "PENDING_DELETION"
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=tenant-status.enum.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant-status.enum.d.ts","sourceRoot":"","sources":["../../../../src/api/identity/tenant-status.enum.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,oBAAY,YAAY;IACpB,wBAAwB;IACxB,MAAM,WAAW;IAEjB;;;OAGG;IACH,SAAS,cAAc;IAEvB;;;;OAIG;IACH,gBAAgB,qBAAqB;CACxC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TenantStatus = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Lifecycle state of a tenant.
|
|
6
|
+
*
|
|
7
|
+
* Every authenticated request checks it, so a suspended tenant loses access without any of its
|
|
8
|
+
* data being touched.
|
|
9
|
+
*
|
|
10
|
+
* Lives here rather than in `iveri-identity-api` because it is on the wire: it rides inside
|
|
11
|
+
* every principal, which means every service and every frontend reads it. `conduit-admin-web`
|
|
12
|
+
* hand-transcribed it as `'active' | 'suspended' | 'cancelled'` — wrong casing and a member
|
|
13
|
+
* identity has never had — and nothing caught it, because a hand-written mirror of an enum is
|
|
14
|
+
* checked by nobody. That is the whole argument for this directory.
|
|
15
|
+
*/
|
|
16
|
+
var TenantStatus;
|
|
17
|
+
(function (TenantStatus) {
|
|
18
|
+
/** Normal operation. */
|
|
19
|
+
TenantStatus["ACTIVE"] = "ACTIVE";
|
|
20
|
+
/**
|
|
21
|
+
* Access blocked — non-payment, abuse, or a customer request. Reversible, and nothing is
|
|
22
|
+
* deleted. Logins fail and existing access tokens stop working at the next request.
|
|
23
|
+
*/
|
|
24
|
+
TenantStatus["SUSPENDED"] = "SUSPENDED";
|
|
25
|
+
/**
|
|
26
|
+
* Scheduled for erasure. Behaves like `SUSPENDED` for access purposes; the distinction is
|
|
27
|
+
* that the data is on its way out, which matters for a GDPR deletion request having a
|
|
28
|
+
* documented, auditable state rather than a row silently vanishing.
|
|
29
|
+
*/
|
|
30
|
+
TenantStatus["PENDING_DELETION"] = "PENDING_DELETION";
|
|
31
|
+
})(TenantStatus || (exports.TenantStatus = TenantStatus = {}));
|
|
32
|
+
//# sourceMappingURL=tenant-status.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tenant-status.enum.js","sourceRoot":"","sources":["../../../../src/api/identity/tenant-status.enum.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;GAWG;AACH,IAAY,YAgBX;AAhBD,WAAY,YAAY;IACpB,wBAAwB;IACxB,iCAAiB,CAAA;IAEjB;;;OAGG;IACH,uCAAuB,CAAA;IAEvB;;;;OAIG;IACH,qDAAqC,CAAA;AACzC,CAAC,EAhBW,YAAY,4BAAZ,YAAY,QAgBvB"}
|
package/dist/cjs/enum/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/enum/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/enum/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC"}
|
package/dist/cjs/enum/index.js
CHANGED
|
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./error-code.enum.js"), exports);
|
|
18
|
+
__exportStar(require("./user-permission.enum.js"), exports);
|
|
18
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/enum/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/enum/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,4DAA0C"}
|