@johnnyboy11234/esg-idea-contest 0.3.1 → 0.3.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.
Files changed (58) hide show
  1. package/backend/api/openapi.yaml +36 -0
  2. package/backend/cmd/server/main.go +1 -0
  3. package/backend/internal/account/internal/passwords/NOTICE +36 -0
  4. package/backend/internal/account/internal/passwords/common-passwords.txt +10001 -0
  5. package/backend/internal/account/internal/passwords/passwords.go +37 -0
  6. package/backend/internal/account/internal/passwords/passwords_test.go +35 -0
  7. package/backend/internal/account/password.go +8 -2
  8. package/backend/internal/account/sequence.go +54 -0
  9. package/backend/internal/account/sequence_test.go +38 -0
  10. package/backend/internal/api/api.gen.go +38 -0
  11. package/backend/internal/idea/create.go +5 -1
  12. package/backend/internal/idea/create_integration_test.go +33 -3
  13. package/backend/internal/idea/download.go +193 -0
  14. package/backend/internal/idea/download_integration_test.go +311 -0
  15. package/backend/internal/idea/download_test.go +25 -0
  16. package/backend/internal/idea/handler.go +3 -0
  17. package/backend/internal/idea/service.go +2 -1
  18. package/backend/internal/server/api.go +5 -0
  19. package/backend/internal/server/binding.go +4 -0
  20. package/backend/internal/server/server.go +20 -1
  21. package/backend/internal/server/slides_test.go +82 -0
  22. package/backend/internal/shared/web/transport.go +4 -3
  23. package/backend/test/arch/arch_test.go +5 -1
  24. package/backend/test/matrix/matrix_integration_test.go +6 -0
  25. package/docs/Architecture/Architecture.md +1 -1
  26. package/docs/Architecture/Backend.md +2 -1
  27. package/frontend/Dockerfile +2 -0
  28. package/frontend/package-lock.json +1 -0
  29. package/frontend/package.json +1 -0
  30. package/frontend/src/app/pages/ideaCreate.test.tsx +308 -0
  31. package/frontend/src/app/pages/ideas.tsx +23 -9
  32. package/frontend/src/app/pages/login.test.tsx +38 -1
  33. package/frontend/src/app/pages/register.test.tsx +32 -0
  34. package/frontend/src/features/auth/LoginForm.tsx +21 -3
  35. package/frontend/src/features/auth/PasswordChecklist.test.tsx +73 -0
  36. package/frontend/src/features/auth/PasswordChecklist.tsx +96 -0
  37. package/frontend/src/features/auth/RegisterForm.tsx +11 -2
  38. package/frontend/src/features/auth/common-passwords.ts +31 -0
  39. package/frontend/src/features/auth/password-policy.test.ts +64 -0
  40. package/frontend/src/features/auth/password-policy.ts +168 -0
  41. package/frontend/src/features/auth/useCountdown.test.tsx +33 -0
  42. package/frontend/src/features/auth/useCountdown.ts +28 -0
  43. package/frontend/src/features/idea/CreateIdeaForm.tsx +279 -0
  44. package/frontend/src/features/idea/create.ts +123 -0
  45. package/frontend/src/shared/api/types.generated.ts +319 -1
  46. package/frontend/src/shared/i18n/locales/en.ts +45 -4
  47. package/frontend/src/shared/i18n/locales/zh-TW.ts +45 -4
  48. package/frontend/src/shared/slides/index.ts +74 -0
  49. package/frontend/src/shared/slides/slides.test.ts +51 -0
  50. package/frontend/src/shared/ui/copy-button.tsx +52 -0
  51. package/frontend/src/shared/ui/native-select.tsx +27 -0
  52. package/frontend/src/shared/ui/textarea.tsx +19 -0
  53. package/frontend/src/test-setup.ts +37 -2
  54. package/frontend/vite.config.ts +3 -1
  55. package/package.json +1 -1
  56. package/testdata/password.json +164 -7
  57. package/testdata/permission-matrix.json +23 -0
  58. package/testdata/schema/permission-matrix.schema.json +1 -1
@@ -246,6 +246,42 @@ paths:
246
246
  '401': { $ref: '#/components/responses/Problem' }
247
247
  '404': { $ref: '#/components/responses/Problem' }
248
248
  '500': { $ref: '#/components/responses/Problem' }
249
+ /ideas/{id}/slides:
250
+ get:
251
+ operationId: downloadSlides
252
+ tags: [ideas]
253
+ summary: Download the Idea's slides (Leader, Member, Admin)
254
+ description: >
255
+ The SLIDES_DOWNLOAD audit row is committed before the first byte is sent (PRD 6.11). The file
256
+ is named by the current expected filename (PRD 6.6). Range is not supported; HEAD answers 405
257
+ (no audit row). The Accept header is not checked on this route. MinIO unavailable before the
258
+ first byte answers 503 STORAGE_UNAVAILABLE; a storage failure after the headers are sent aborts
259
+ the connection (the body is shorter than Content-Length). A transaction whose outcome is
260
+ unknown answers 503 SERVICE_UNAVAILABLE and serves nothing.
261
+ parameters:
262
+ - $ref: '#/components/parameters/IdeaId'
263
+ responses:
264
+ '200':
265
+ description: The stored file
266
+ headers:
267
+ Content-Disposition:
268
+ description: 'attachment; filename="<ASCII fallback>"; filename*=UTF-8''''<percent-encoded> (RFC 6266)'
269
+ schema: { type: string }
270
+ Content-Length:
271
+ schema: { type: integer }
272
+ Cache-Control:
273
+ schema: { type: string, enum: [no-store] }
274
+ X-Content-Type-Options:
275
+ schema: { type: string, enum: [nosniff] }
276
+ content:
277
+ application/pdf:
278
+ schema: { type: string, format: binary }
279
+ application/vnd.openxmlformats-officedocument.presentationml.presentation:
280
+ schema: { type: string, format: binary }
281
+ '401': { $ref: '#/components/responses/Problem' }
282
+ '404': { $ref: '#/components/responses/Problem' }
283
+ '500': { $ref: '#/components/responses/Problem' }
284
+ '503': { $ref: '#/components/responses/Problem' }
249
285
  components:
250
286
  securitySchemes:
251
287
  sessionCookie:
@@ -87,6 +87,7 @@ func run() error {
87
87
  },
88
88
  ExpectedFilename: storage.ExpectedFilenameBase,
89
89
  Fail: errs.Write,
90
+ Log: log,
90
91
  },
91
92
  }
92
93
 
@@ -0,0 +1,36 @@
1
+ common-passwords.txt
2
+ ====================
3
+
4
+ Source: SecLists, Passwords/Common-Credentials/10k-most-common.txt
5
+ https://github.com/danielmiessler/SecLists
6
+ Commit: a1a06ab57c3f4efc450d80738a72c11597aac81a
7
+ SHA-256: 68782d6a4a19a4768d5f15dd66bd534e7a33055cc755411e33f16d18c50fdcce
8
+ Entries: 10,001 lines, printable ASCII, no case-folded duplicates
9
+ Changes: none (byte-for-byte copy)
10
+
11
+ Used by: backend rule COMMON_PASSWORD (PRD §6.4, embedded with go:embed) and
12
+ the frontend live password checklist (lazy-loaded chunk).
13
+
14
+ Licence of the source file:
15
+
16
+ MIT License
17
+
18
+ Copyright (c) 2018 Daniel Miessler
19
+
20
+ Permission is hereby granted, free of charge, to any person obtaining a copy
21
+ of this software and associated documentation files (the "Software"), to deal
22
+ in the Software without restriction, including without limitation the rights
23
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
24
+ copies of the Software, and to permit persons to whom the Software is
25
+ furnished to do so, subject to the following conditions:
26
+
27
+ The above copyright notice and this permission notice shall be included in all
28
+ copies or substantial portions of the Software.
29
+
30
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
31
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
32
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
33
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
34
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
35
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
36
+ SOFTWARE.