@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.
Files changed (58) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +16 -2
  3. package/cases/admin.json +326 -0
  4. package/cases/audit-and-errors.json +233 -0
  5. package/cases/csrf.json +413 -0
  6. package/cases/email-verification.json +567 -0
  7. package/cases/identity.json +546 -0
  8. package/cases/login.json +446 -0
  9. package/cases/logout.json +213 -0
  10. package/cases/password-change.json +270 -0
  11. package/cases/password-reset.json +698 -0
  12. package/cases/rate-limits.json +667 -0
  13. package/cases/rbac.json +575 -0
  14. package/cases/registration.json +782 -0
  15. package/cases/resources.json +373 -0
  16. package/cases/sessions.json +308 -0
  17. package/dist/compliance.d.ts +118 -0
  18. package/dist/compliance.d.ts.map +1 -0
  19. package/dist/compliance.js +201 -0
  20. package/dist/compliance.js.map +1 -0
  21. package/dist/coverage.d.ts +26 -0
  22. package/dist/coverage.d.ts.map +1 -0
  23. package/dist/coverage.js +105 -0
  24. package/dist/coverage.js.map +1 -0
  25. package/dist/index.d.ts +9 -0
  26. package/dist/index.d.ts.map +1 -0
  27. package/dist/index.js +9 -0
  28. package/dist/index.js.map +1 -0
  29. package/dist/load.d.ts +12 -0
  30. package/dist/load.d.ts.map +1 -0
  31. package/dist/load.js +26 -0
  32. package/dist/load.js.map +1 -0
  33. package/dist/render.d.ts +19 -0
  34. package/dist/render.d.ts.map +1 -0
  35. package/dist/render.js +20 -0
  36. package/dist/render.js.map +1 -0
  37. package/dist/report.d.ts +3 -0
  38. package/dist/report.d.ts.map +1 -0
  39. package/dist/report.js +31 -0
  40. package/dist/report.js.map +1 -0
  41. package/dist/runner/assertions.d.ts +11 -0
  42. package/dist/runner/assertions.d.ts.map +1 -0
  43. package/dist/runner/assertions.js +253 -0
  44. package/dist/runner/assertions.js.map +1 -0
  45. package/dist/runner/driver.d.ts +58 -0
  46. package/dist/runner/driver.d.ts.map +1 -0
  47. package/dist/runner/driver.js +2 -0
  48. package/dist/runner/driver.js.map +1 -0
  49. package/dist/runner/run.d.ts +17 -0
  50. package/dist/runner/run.d.ts.map +1 -0
  51. package/dist/runner/run.js +390 -0
  52. package/dist/runner/run.js.map +1 -0
  53. package/dist/schema.d.ts +168 -0
  54. package/dist/schema.d.ts.map +1 -0
  55. package/dist/schema.js +121 -0
  56. package/dist/schema.js.map +1 -0
  57. package/package.json +53 -3
  58. package/verification.json +165 -0
@@ -0,0 +1,270 @@
1
+ {
2
+ "cases": [
3
+ {
4
+ "id": "CT-PWCHG-001",
5
+ "title": "Password change revokes other sessions and outstanding reset tokens",
6
+ "category": "password-change",
7
+ "level": "core",
8
+ "requirements": ["AUTHN-PWCHG-003", "AUTHN-PWCHG-004", "AUTHN-PWCHG-006", "AUTHN-SESS-006"],
9
+ "given": [
10
+ {
11
+ "user": "alice",
12
+ "email": "alice@example.test",
13
+ "password": "correct horse battery staple",
14
+ "state": "active"
15
+ }
16
+ ],
17
+ "steps": [
18
+ {
19
+ "op": "login",
20
+ "as": "laptop",
21
+ "input": {
22
+ "email": "alice@example.test",
23
+ "password": "correct horse battery staple"
24
+ }
25
+ },
26
+ {
27
+ "op": "login",
28
+ "as": "phone",
29
+ "input": {
30
+ "email": "alice@example.test",
31
+ "password": "correct horse battery staple"
32
+ }
33
+ },
34
+ {
35
+ "op": "requestPasswordReset",
36
+ "input": {
37
+ "email": "alice@example.test"
38
+ }
39
+ },
40
+ {
41
+ "op": "readLastEmail",
42
+ "input": {
43
+ "to": "alice@example.test"
44
+ },
45
+ "save": "reset"
46
+ },
47
+ {
48
+ "op": "changePassword",
49
+ "as": "laptop",
50
+ "input": {
51
+ "currentPassword": "correct horse battery staple",
52
+ "newPassword": "a brand new passphrase 42"
53
+ },
54
+ "expect": {
55
+ "outcome": "success"
56
+ }
57
+ },
58
+ {
59
+ "op": "getCurrentUser",
60
+ "as": "laptop",
61
+ "note": "current session kept or rotated (cookie follows)",
62
+ "expect": {
63
+ "outcome": "success"
64
+ }
65
+ },
66
+ {
67
+ "op": "getCurrentUser",
68
+ "as": "phone",
69
+ "expect": {
70
+ "outcome": "error",
71
+ "code": "UNAUTHENTICATED"
72
+ }
73
+ },
74
+ {
75
+ "op": "resetPassword",
76
+ "input": {
77
+ "token": "$reset.token",
78
+ "newPassword": "yet another passphrase"
79
+ },
80
+ "expect": {
81
+ "outcome": "error",
82
+ "code": "TOKEN_INVALID"
83
+ }
84
+ },
85
+ {
86
+ "op": "login",
87
+ "input": {
88
+ "email": "alice@example.test",
89
+ "password": "a brand new passphrase 42"
90
+ },
91
+ "expect": {
92
+ "outcome": "success"
93
+ }
94
+ },
95
+ {
96
+ "op": "inspectEvents",
97
+ "input": {
98
+ "type": "password.changed"
99
+ },
100
+ "expect": {
101
+ "outcome": "success",
102
+ "assert": {
103
+ "count": 1
104
+ }
105
+ }
106
+ }
107
+ ]
108
+ },
109
+ {
110
+ "id": "CT-PWCHG-002",
111
+ "title": "Password change requires a session and the current password, and is rate limited",
112
+ "category": "password-change",
113
+ "level": "core",
114
+ "requirements": ["AUTHN-PWCHG-001", "SEC-RATE-001"],
115
+ "given": [
116
+ {
117
+ "user": "alice",
118
+ "email": "alice@example.test",
119
+ "password": "correct horse battery staple",
120
+ "state": "active"
121
+ }
122
+ ],
123
+ "steps": [
124
+ {
125
+ "op": "changePassword",
126
+ "as": "stranger",
127
+ "input": {
128
+ "currentPassword": "correct horse battery staple",
129
+ "newPassword": "a brand new passphrase 42"
130
+ },
131
+ "expect": {
132
+ "outcome": "error",
133
+ "code": "UNAUTHENTICATED"
134
+ }
135
+ },
136
+ {
137
+ "op": "login",
138
+ "input": {
139
+ "email": "alice@example.test",
140
+ "password": "correct horse battery staple"
141
+ }
142
+ },
143
+ {
144
+ "op": "changePassword",
145
+ "input": {
146
+ "currentPassword": "wrong password!!",
147
+ "newPassword": "a brand new passphrase 42"
148
+ },
149
+ "expect": {
150
+ "outcome": "error",
151
+ "code": "INVALID_CREDENTIALS"
152
+ }
153
+ },
154
+ {
155
+ "op": "changePassword",
156
+ "input": {
157
+ "currentPassword": "wrong password!!",
158
+ "newPassword": "a brand new passphrase 42"
159
+ },
160
+ "expect": {
161
+ "outcome": "error",
162
+ "code": "INVALID_CREDENTIALS"
163
+ }
164
+ },
165
+ {
166
+ "op": "changePassword",
167
+ "input": {
168
+ "currentPassword": "wrong password!!",
169
+ "newPassword": "a brand new passphrase 42"
170
+ },
171
+ "expect": {
172
+ "outcome": "error",
173
+ "code": "INVALID_CREDENTIALS"
174
+ }
175
+ },
176
+ {
177
+ "op": "changePassword",
178
+ "input": {
179
+ "currentPassword": "wrong password!!",
180
+ "newPassword": "a brand new passphrase 42"
181
+ },
182
+ "expect": {
183
+ "outcome": "error",
184
+ "code": "INVALID_CREDENTIALS"
185
+ }
186
+ },
187
+ {
188
+ "op": "changePassword",
189
+ "input": {
190
+ "currentPassword": "wrong password!!",
191
+ "newPassword": "a brand new passphrase 42"
192
+ },
193
+ "expect": {
194
+ "outcome": "error",
195
+ "code": "INVALID_CREDENTIALS"
196
+ }
197
+ },
198
+ {
199
+ "op": "changePassword",
200
+ "input": {
201
+ "currentPassword": "wrong password!!",
202
+ "newPassword": "a brand new passphrase 42"
203
+ },
204
+ "expect": {
205
+ "outcome": "error",
206
+ "code": "RATE_LIMITED"
207
+ }
208
+ }
209
+ ]
210
+ },
211
+ {
212
+ "id": "CT-PWCHG-003",
213
+ "title": "The new password must satisfy the policy",
214
+ "category": "password-change",
215
+ "level": "core",
216
+ "requirements": ["AUTHN-PWCHG-002", "SEC-PWPOLICY-002"],
217
+ "given": [
218
+ {
219
+ "user": "alice",
220
+ "email": "alice@example.test",
221
+ "password": "correct horse battery staple",
222
+ "state": "active"
223
+ }
224
+ ],
225
+ "steps": [
226
+ {
227
+ "op": "login",
228
+ "input": {
229
+ "email": "alice@example.test",
230
+ "password": "correct horse battery staple"
231
+ }
232
+ },
233
+ {
234
+ "op": "changePassword",
235
+ "input": {
236
+ "currentPassword": "correct horse battery staple",
237
+ "newPassword": "short"
238
+ },
239
+ "expect": {
240
+ "outcome": "error",
241
+ "code": "PASSWORD_POLICY_VIOLATION"
242
+ }
243
+ },
244
+ {
245
+ "op": "changePassword",
246
+ "input": {
247
+ "currentPassword": "correct horse battery staple",
248
+ "newPassword": "yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"
249
+ },
250
+ "expect": {
251
+ "outcome": "error",
252
+ "code": "PASSWORD_POLICY_VIOLATION"
253
+ }
254
+ },
255
+ {
256
+ "op": "login",
257
+ "as": "other",
258
+ "note": "old password unchanged",
259
+ "input": {
260
+ "email": "alice@example.test",
261
+ "password": "correct horse battery staple"
262
+ },
263
+ "expect": {
264
+ "outcome": "success"
265
+ }
266
+ }
267
+ ]
268
+ }
269
+ ]
270
+ }