@selfauth/conformance 0.0.0-stage → 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 +16 -2
- package/cases/admin.json +326 -0
- package/cases/audit-and-errors.json +233 -0
- package/cases/csrf.json +413 -0
- package/cases/email-verification.json +567 -0
- package/cases/identity.json +546 -0
- package/cases/login.json +446 -0
- package/cases/logout.json +213 -0
- package/cases/password-change.json +270 -0
- package/cases/password-reset.json +698 -0
- package/cases/rate-limits.json +667 -0
- package/cases/rbac.json +575 -0
- package/cases/registration.json +782 -0
- package/cases/resources.json +373 -0
- package/cases/sessions.json +308 -0
- package/dist/compliance.d.ts +118 -0
- package/dist/compliance.d.ts.map +1 -0
- package/dist/compliance.js +201 -0
- package/dist/compliance.js.map +1 -0
- package/dist/coverage.d.ts +26 -0
- package/dist/coverage.d.ts.map +1 -0
- package/dist/coverage.js +105 -0
- package/dist/coverage.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/load.d.ts +12 -0
- package/dist/load.d.ts.map +1 -0
- package/dist/load.js +26 -0
- package/dist/load.js.map +1 -0
- package/dist/render.d.ts +19 -0
- package/dist/render.d.ts.map +1 -0
- package/dist/render.js +20 -0
- package/dist/render.js.map +1 -0
- package/dist/report.d.ts +3 -0
- package/dist/report.d.ts.map +1 -0
- package/dist/report.js +31 -0
- package/dist/report.js.map +1 -0
- package/dist/runner/assertions.d.ts +11 -0
- package/dist/runner/assertions.d.ts.map +1 -0
- package/dist/runner/assertions.js +253 -0
- package/dist/runner/assertions.js.map +1 -0
- package/dist/runner/driver.d.ts +58 -0
- package/dist/runner/driver.d.ts.map +1 -0
- package/dist/runner/driver.js +2 -0
- package/dist/runner/driver.js.map +1 -0
- package/dist/runner/run.d.ts +17 -0
- package/dist/runner/run.d.ts.map +1 -0
- package/dist/runner/run.js +390 -0
- package/dist/runner/run.js.map +1 -0
- package/dist/schema.d.ts +168 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +121 -0
- package/dist/schema.js.map +1 -0
- package/package.json +53 -3
- package/verification.json +165 -0
package/dist/schema.js
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { ERROR_CODES, REQUIREMENT_ID_PATTERN } from "@selfauth/spec";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
const requirementId = z.string().regex(new RegExp(`^${REQUIREMENT_ID_PATTERN.source}$`));
|
|
4
|
+
/** Operations a conformance driver must implement (specs/CONFORMANCE.md). */
|
|
5
|
+
export const OPERATIONS = [
|
|
6
|
+
// Authentication
|
|
7
|
+
"register",
|
|
8
|
+
"login",
|
|
9
|
+
"logout",
|
|
10
|
+
"logoutAll",
|
|
11
|
+
"getCurrentUser",
|
|
12
|
+
"listSessions",
|
|
13
|
+
"revokeSession",
|
|
14
|
+
"requestEmailVerification",
|
|
15
|
+
"verifyEmail",
|
|
16
|
+
"changePassword",
|
|
17
|
+
"requestPasswordReset",
|
|
18
|
+
"resetPassword",
|
|
19
|
+
"deleteAccount",
|
|
20
|
+
// Authorization
|
|
21
|
+
"callProtected",
|
|
22
|
+
"listOwned",
|
|
23
|
+
// Administration
|
|
24
|
+
"assignRole",
|
|
25
|
+
"removeRole",
|
|
26
|
+
"setAccountState",
|
|
27
|
+
// Harness
|
|
28
|
+
"advanceClock",
|
|
29
|
+
"readLastEmail",
|
|
30
|
+
"concurrent",
|
|
31
|
+
"inspectStorage",
|
|
32
|
+
"mutateStorage",
|
|
33
|
+
"inspectEvents",
|
|
34
|
+
"inspectLogs",
|
|
35
|
+
"rawRequest",
|
|
36
|
+
];
|
|
37
|
+
export const LEVELS = ["core", "authorization", "production"];
|
|
38
|
+
export const ACCOUNT_STATES = ["pending", "active", "suspended", "disabled", "deleted"];
|
|
39
|
+
const errorCode = z.enum(ERROR_CODES);
|
|
40
|
+
export const expectationSchema = z
|
|
41
|
+
.strictObject({
|
|
42
|
+
outcome: z.enum(["success", "error"]),
|
|
43
|
+
code: errorCode.optional(),
|
|
44
|
+
codeOneOf: z.array(errorCode).min(2).optional(),
|
|
45
|
+
indistinguishableFrom: z.string().optional(),
|
|
46
|
+
sessionCreated: z.boolean().optional(),
|
|
47
|
+
successCount: z.number().int().min(0).optional(),
|
|
48
|
+
assert: z.record(z.string(), z.unknown()).optional(),
|
|
49
|
+
})
|
|
50
|
+
.superRefine((e, ctx) => {
|
|
51
|
+
const hasCode = e.code !== undefined || e.codeOneOf !== undefined;
|
|
52
|
+
if (e.outcome === "error" && !hasCode) {
|
|
53
|
+
ctx.addIssue({ code: "custom", message: "error expectations need code or codeOneOf" });
|
|
54
|
+
}
|
|
55
|
+
if (e.outcome === "success" && hasCode) {
|
|
56
|
+
ctx.addIssue({ code: "custom", message: "success expectations must not name an error code" });
|
|
57
|
+
}
|
|
58
|
+
if (e.code !== undefined && e.codeOneOf !== undefined) {
|
|
59
|
+
ctx.addIssue({ code: "custom", message: "use code or codeOneOf, not both" });
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
export const stepSchema = z.lazy(() => z.strictObject({
|
|
63
|
+
op: z.enum(OPERATIONS),
|
|
64
|
+
as: z.string().min(1).optional(),
|
|
65
|
+
note: z.string().optional(),
|
|
66
|
+
input: z.record(z.string(), z.unknown()).optional(),
|
|
67
|
+
expect: expectationSchema.optional(),
|
|
68
|
+
save: z
|
|
69
|
+
.string()
|
|
70
|
+
.regex(/^[A-Za-z][A-Za-z0-9_]*$/)
|
|
71
|
+
.optional(),
|
|
72
|
+
}));
|
|
73
|
+
const userFixture = z.strictObject({
|
|
74
|
+
user: z.string().min(1),
|
|
75
|
+
email: z.string().min(3),
|
|
76
|
+
password: z.string().min(1),
|
|
77
|
+
state: z.enum(ACCOUNT_STATES).default("active"),
|
|
78
|
+
roles: z.array(z.string()).optional(),
|
|
79
|
+
});
|
|
80
|
+
const resourceFixture = z.strictObject({
|
|
81
|
+
resource: z.strictObject({
|
|
82
|
+
type: z.string().min(1),
|
|
83
|
+
id: z.string().min(1),
|
|
84
|
+
owner: z.string().min(1),
|
|
85
|
+
}),
|
|
86
|
+
});
|
|
87
|
+
export const caseSchema = z.strictObject({
|
|
88
|
+
id: z.string().regex(/^CT-[A-Z]+-\d{3}$/),
|
|
89
|
+
title: z.string().min(1),
|
|
90
|
+
category: z.string().min(1),
|
|
91
|
+
level: z.enum(LEVELS),
|
|
92
|
+
requirements: z.array(requirementId).min(1),
|
|
93
|
+
/** Runtime environment the driver must simulate (default: development). */
|
|
94
|
+
environment: z.enum(["development", "production"]).optional(),
|
|
95
|
+
/** Partial SelfAuth configuration merged over the driver's base configuration. */
|
|
96
|
+
config: z.record(z.string(), z.unknown()).optional(),
|
|
97
|
+
given: z.array(z.union([userFixture, resourceFixture])).default([]),
|
|
98
|
+
steps: z.array(stepSchema).min(1),
|
|
99
|
+
});
|
|
100
|
+
export const caseFileSchema = z.strictObject({
|
|
101
|
+
$schema: z.string().optional(),
|
|
102
|
+
cases: z.array(caseSchema).min(1),
|
|
103
|
+
});
|
|
104
|
+
export const VERIFICATION_METHODS = [
|
|
105
|
+
"schema-test",
|
|
106
|
+
"adapter-test",
|
|
107
|
+
"code-review",
|
|
108
|
+
"documentation",
|
|
109
|
+
"static-analysis",
|
|
110
|
+
"migration-test",
|
|
111
|
+
];
|
|
112
|
+
export const verificationEntrySchema = z.strictObject({
|
|
113
|
+
requirement: requirementId,
|
|
114
|
+
methods: z.array(z.enum(VERIFICATION_METHODS)).min(1),
|
|
115
|
+
how: z.string().min(10),
|
|
116
|
+
});
|
|
117
|
+
export const verificationFileSchema = z.strictObject({
|
|
118
|
+
$comment: z.string().optional(),
|
|
119
|
+
entries: z.array(verificationEntrySchema),
|
|
120
|
+
});
|
|
121
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.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ClC,aAAa;IACb,cAAc;IACd,aAAa;IACb,eAAe;IACf,iBAAiB;IACjB,gBAAgB;CACR,CAAC;AAEX,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,YAAY,CAAC;IACpD,WAAW,EAAE,aAAa;IAC1B,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;IACrD,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC;CACxB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,YAAY,CAAC;IACnD,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,uBAAuB,CAAC;CAC1C,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,56 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@selfauth/conformance",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Language-neutral SelfAuth conformance cases and requirement-coverage tooling.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/thetejasmagade/selfauth.git",
|
|
9
|
+
"directory": "conformance"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/thetejasmagade/selfauth/tree/main/conformance#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/thetejasmagade/selfauth/issues"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"selfauth",
|
|
17
|
+
"authentication",
|
|
18
|
+
"conformance",
|
|
19
|
+
"testing"
|
|
20
|
+
],
|
|
21
|
+
"type": "module",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"default": "./dist/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./cases/*": "./cases/*",
|
|
28
|
+
"./verification.json": "./verification.json",
|
|
29
|
+
"./package.json": "./package.json"
|
|
30
|
+
},
|
|
31
|
+
"bin": {
|
|
32
|
+
"selfauth-coverage": "./dist/report.js"
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist",
|
|
36
|
+
"cases",
|
|
37
|
+
"verification.json"
|
|
38
|
+
],
|
|
39
|
+
"engines": {
|
|
40
|
+
"node": ">=22"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"zod": "^4.6.7",
|
|
44
|
+
"@selfauth/spec": "0.2.0"
|
|
45
|
+
},
|
|
46
|
+
"publishConfig": {
|
|
47
|
+
"access": "public",
|
|
48
|
+
"provenance": true
|
|
49
|
+
},
|
|
50
|
+
"scripts": {
|
|
51
|
+
"build": "tsc -p tsconfig.build.json",
|
|
52
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
53
|
+
"test": "vitest run",
|
|
54
|
+
"coverage:report": "node dist/report.js"
|
|
55
|
+
}
|
|
6
56
|
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$comment": "Verification methods other than conformance cases (ADR 0007, specs/CONFORMANCE.md). Each mandatory requirement must appear here or in at least one case.",
|
|
3
|
+
"entries": [
|
|
4
|
+
{
|
|
5
|
+
"requirement": "IDENT-DELETE-005",
|
|
6
|
+
"methods": ["documentation"],
|
|
7
|
+
"how": "Adapter README states which data is retained after deletion (security events, tombstone) and for how long."
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"requirement": "AUTHN-REG-003",
|
|
11
|
+
"methods": ["adapter-test"],
|
|
12
|
+
"how": "Adapter test injects a failure while writing the credential and asserts no user row remains (transaction rollback)."
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"requirement": "AUTHN-LOGIN-003",
|
|
16
|
+
"methods": ["adapter-test", "code-review"],
|
|
17
|
+
"how": "Adapter test asserts the password verifier is invoked (against a dummy hash) when the user does not exist; reviewers confirm no early return before verification."
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"requirement": "AUTHN-REG-010",
|
|
21
|
+
"methods": ["adapter-test", "code-review"],
|
|
22
|
+
"how": "Adapter test asserts the password hasher runs when registering an existing email; reviewers confirm no early return before hashing."
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"requirement": "AUTHZ-CORE-002",
|
|
26
|
+
"methods": ["code-review"],
|
|
27
|
+
"how": "Supplements CT-AUTHZ-002: reviewers confirm every generated protected route declares requireAuth/requirePermission/authorize; adapter lint rule flags routes without a guard where feasible."
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"requirement": "AUTHZ-PERM-001",
|
|
31
|
+
"methods": ["schema-test"],
|
|
32
|
+
"how": "selfAuthConfigSchema rejects malformed permission names (packages/spec/test/config.test.ts)."
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"requirement": "AUTHZ-PERM-002",
|
|
36
|
+
"methods": ["schema-test"],
|
|
37
|
+
"how": "selfAuthConfigSchema rejects project permissions with the reserved 'auth.' prefix."
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"requirement": "AUTHZ-PERM-004",
|
|
41
|
+
"methods": ["schema-test", "adapter-test"],
|
|
42
|
+
"how": "Schema rejects roles referencing undefined permissions; adapter test asserts requirePermission('undefined.perm') throws at route registration."
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"requirement": "AUTHZ-RBAC-005",
|
|
46
|
+
"methods": ["migration-test", "code-review"],
|
|
47
|
+
"how": "Role/permission sync is a generated seed or migration; migration tests run it; reviewers confirm no role sync on application startup."
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"requirement": "SEC-HASH-001",
|
|
51
|
+
"methods": ["adapter-test", "code-review"],
|
|
52
|
+
"how": "Supplements CT-IDENT-007: reviewers confirm a maintained Argon2id library (ADR) is used, not a hand-written implementation."
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"requirement": "SEC-HASH-006",
|
|
56
|
+
"methods": ["adapter-test"],
|
|
57
|
+
"how": "Adapter test asserts a concurrent lightweight request completes while a password hash is being computed (non-blocking API used)."
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"requirement": "SEC-PWPOLICY-001",
|
|
61
|
+
"methods": ["schema-test"],
|
|
62
|
+
"how": "Supplements CT-REG-005: selfAuthConfigSchema rejects minLength below 8."
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"requirement": "SEC-PWPOLICY-005",
|
|
66
|
+
"methods": ["code-review"],
|
|
67
|
+
"how": "Reviewers confirm generated code has no password-age expiry or forced-rotation logic enabled by default."
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"requirement": "SEC-TOKEN-005",
|
|
71
|
+
"methods": ["adapter-test"],
|
|
72
|
+
"how": "Reference frontends (Vue, React): url-token unit tests assert the fragment token is read and stripped; the shared Playwright spec (apps/e2e) asserts email-link pages respond with Referrer-Policy: no-referrer and the token leaves the address bar, on both frontends."
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"requirement": "SEC-COOKIE-003",
|
|
76
|
+
"methods": ["adapter-test"],
|
|
77
|
+
"how": "Adapter test asserts startup fails when NODE_ENV=production and cookie.secure=false."
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"requirement": "SEC-REDIRECT-001",
|
|
81
|
+
"methods": ["code-review", "adapter-test"],
|
|
82
|
+
"how": "Frontend safeRedirect is unit-tested with absolute, protocol-relative (//evil), backslash and control-character targets; the shared Playwright spec signs in with hostile ?redirect= values on both frontends; the backend accepts no redirect targets."
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"requirement": "SEC-SECRET-001",
|
|
86
|
+
"methods": ["static-analysis", "code-review"],
|
|
87
|
+
"how": "Secret scanning in CI over templates and generated output; config schema has no secret fields."
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
"requirement": "SEC-SECRET-002",
|
|
91
|
+
"methods": ["adapter-test"],
|
|
92
|
+
"how": "Generator test asserts .env.example contains placeholders only and .gitignore covers .env."
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"requirement": "SEC-SECRET-003",
|
|
96
|
+
"methods": ["adapter-test"],
|
|
97
|
+
"how": "Adapter test asserts startup fails when SELFAUTH_APP_BASE_URL (or a required signing key) is missing or invalid."
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"requirement": "SEC-SECRET-004",
|
|
101
|
+
"methods": ["adapter-test", "code-review"],
|
|
102
|
+
"how": "Startup rejects CSRF secrets shorter than 32 bytes; test asserts tokens signed with SELFAUTH_CSRF_SECRET_PREVIOUS are still accepted."
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"requirement": "SEC-AUDIT-004",
|
|
106
|
+
"methods": ["code-review"],
|
|
107
|
+
"how": "Reviewers confirm generated routes and services expose no update/delete operation for individual security events."
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"requirement": "SEC-ENUM-004",
|
|
111
|
+
"methods": ["schema-test", "documentation", "adapter-test"],
|
|
112
|
+
"how": "Supplements CT-REG-009: schema defaults the options to false; adapter docs describe the trade-off; the CLI doctor test (Phase 6) asserts a warning when enabled."
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"requirement": "SEC-HTTP-002",
|
|
116
|
+
"methods": ["documentation"],
|
|
117
|
+
"how": "Adapter deployment guide requires HTTPS in production and documents HSTS."
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"requirement": "DATA-MODEL-001",
|
|
121
|
+
"methods": ["migration-test"],
|
|
122
|
+
"how": "Supplements CT-REG-006: migration tests assert the unique indexes exist on a fresh database."
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
"requirement": "DATA-MODEL-003",
|
|
126
|
+
"methods": ["migration-test", "code-review"],
|
|
127
|
+
"how": "Migration tests apply generated native migrations; reviewers confirm no schema sync (e.g. prisma db push, autoIndex in production) at startup."
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
"requirement": "DATA-MODEL-004",
|
|
131
|
+
"methods": ["migration-test"],
|
|
132
|
+
"how": "Migration tests run generation against a pre-existing schema containing application tables and assert they are untouched."
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"requirement": "ERR-FORMAT-003",
|
|
136
|
+
"methods": ["code-review"],
|
|
137
|
+
"how": "The conformance runner and frontend adapters branch only on error.code; reviewers reject message-text matching."
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"requirement": "CONF-FILE-001",
|
|
141
|
+
"methods": ["schema-test"],
|
|
142
|
+
"how": "selfAuthConfigSchema uses strict objects; tests assert unknown top-level and nested keys are rejected."
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"requirement": "CONF-FILE-002",
|
|
146
|
+
"methods": ["schema-test", "code-review"],
|
|
147
|
+
"how": "The schema defines no secret-bearing fields and rejects unknown keys, so secrets cannot be added to the config file."
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
"requirement": "CONF-FILE-003",
|
|
151
|
+
"methods": ["schema-test"],
|
|
152
|
+
"how": "Tests assert out-of-range values (TTLs, lengths, timeouts) are rejected rather than clamped."
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"requirement": "CONF-FILE-004",
|
|
156
|
+
"methods": ["adapter-test"],
|
|
157
|
+
"how": "Each adapter validates the resolved config against its capability list and the test asserts unsupported values are rejected."
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"requirement": "CONF-FILE-005",
|
|
161
|
+
"methods": ["schema-test"],
|
|
162
|
+
"how": "Schema rejects an unsupported major specVersion."
|
|
163
|
+
}
|
|
164
|
+
]
|
|
165
|
+
}
|