@restingowlorg/owlauth 1.0.1

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 (69) hide show
  1. package/LICENSE +373 -0
  2. package/README.md +307 -0
  3. package/dist/config.d.ts +13 -0
  4. package/dist/config.js +16 -0
  5. package/dist/core/auth.manager.d.ts +6 -0
  6. package/dist/core/auth.manager.js +21 -0
  7. package/dist/core/auth.service.init.d.ts +2 -0
  8. package/dist/core/auth.service.init.js +26 -0
  9. package/dist/index.d.ts +5 -0
  10. package/dist/index.js +11 -0
  11. package/dist/infra/databases/mongo/adapter.d.ts +6 -0
  12. package/dist/infra/databases/mongo/adapter.js +24 -0
  13. package/dist/infra/databases/mongo/db.d.ts +5 -0
  14. package/dist/infra/databases/mongo/db.js +43 -0
  15. package/dist/infra/databases/mongo/mongo.d.ts +5 -0
  16. package/dist/infra/databases/mongo/mongo.js +11 -0
  17. package/dist/infra/databases/postgresql/adapter.d.ts +6 -0
  18. package/dist/infra/databases/postgresql/adapter.js +26 -0
  19. package/dist/infra/databases/postgresql/db.d.ts +5 -0
  20. package/dist/infra/databases/postgresql/db.js +50 -0
  21. package/dist/infra/databases/postgresql/helpers.d.ts +8 -0
  22. package/dist/infra/databases/postgresql/helpers.js +55 -0
  23. package/dist/infra/databases/postgresql/postgres.d.ts +5 -0
  24. package/dist/infra/databases/postgresql/postgres.js +11 -0
  25. package/dist/infra/databases/postgresql/schema.d.ts +6 -0
  26. package/dist/infra/databases/postgresql/schema.js +9 -0
  27. package/dist/infra/security/bcrypt.adapter.d.ts +9 -0
  28. package/dist/infra/security/bcrypt.adapter.js +62 -0
  29. package/dist/infra/security/bcrypt.adapter.test.d.ts +1 -0
  30. package/dist/infra/security/bcrypt.adapter.test.js +67 -0
  31. package/dist/infra/security/pwned-passwords.d.ts +5 -0
  32. package/dist/infra/security/pwned-passwords.js +45 -0
  33. package/dist/infra/security/pwned-passwords.test.d.ts +1 -0
  34. package/dist/infra/security/pwned-passwords.test.js +62 -0
  35. package/dist/infra/security/security-audit-logger.d.ts +11 -0
  36. package/dist/infra/security/security-audit-logger.js +90 -0
  37. package/dist/repositories/contracts.d.ts +21 -0
  38. package/dist/repositories/contracts.js +2 -0
  39. package/dist/repositories/mongo/magicLink.repo.d.ts +26 -0
  40. package/dist/repositories/mongo/magicLink.repo.js +106 -0
  41. package/dist/repositories/mongo/user.repo.d.ts +16 -0
  42. package/dist/repositories/mongo/user.repo.js +84 -0
  43. package/dist/repositories/postgresql/magic.link.repo.d.ts +21 -0
  44. package/dist/repositories/postgresql/magic.link.repo.js +97 -0
  45. package/dist/repositories/postgresql/user.repo.d.ts +14 -0
  46. package/dist/repositories/postgresql/user.repo.js +50 -0
  47. package/dist/services/auth.service.d.ts +22 -0
  48. package/dist/services/auth.service.js +362 -0
  49. package/dist/services/auth.service.test.d.ts +1 -0
  50. package/dist/services/auth.service.test.js +297 -0
  51. package/dist/services/magic-link.service.d.ts +22 -0
  52. package/dist/services/magic-link.service.js +196 -0
  53. package/dist/services/magic-link.service.test.d.ts +1 -0
  54. package/dist/services/magic-link.service.test.js +230 -0
  55. package/dist/strategies/CredentialsStrategy.d.ts +4 -0
  56. package/dist/strategies/CredentialsStrategy.js +32 -0
  57. package/dist/strategies/CredentialsStrategy.test.d.ts +1 -0
  58. package/dist/strategies/CredentialsStrategy.test.js +29 -0
  59. package/dist/strategies/MagicLinkStrategy.d.ts +4 -0
  60. package/dist/strategies/MagicLinkStrategy.js +21 -0
  61. package/dist/strategies/MagicLinkStrategy.test.d.ts +1 -0
  62. package/dist/strategies/MagicLinkStrategy.test.js +38 -0
  63. package/dist/types/index.d.ts +224 -0
  64. package/dist/types/index.js +2 -0
  65. package/dist/utils/check-blocked-passwords.d.ts +1 -0
  66. package/dist/utils/check-blocked-passwords.js +10 -0
  67. package/dist/utils/check-blocked-passwords.test.d.ts +1 -0
  68. package/dist/utils/check-blocked-passwords.test.js +27 -0
  69. package/package.json +102 -0
package/package.json ADDED
@@ -0,0 +1,102 @@
1
+ {
2
+ "name": "@restingowlorg/owlauth",
3
+ "version": "1.0.1",
4
+ "description": "owl-auth: OWASP-informed authentication primitives for Node.js",
5
+ "publishConfig": {
6
+ "access": "public"
7
+ },
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/restingowlorg/OwlAuth.git"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/restingowlorg/OwlAuth/issues"
14
+ },
15
+ "homepage": "https://github.com/restingowlorg/OwlAuth#readme",
16
+ "engines": {
17
+ "node": ">=18"
18
+ },
19
+ "main": "dist/index.js",
20
+ "exports": {
21
+ ".": "./dist/index.js",
22
+ "./mongo": "./dist/infra/databases/mongo/mongo.js",
23
+ "./postgres": "./dist/infra/databases/postgresql/postgres.js"
24
+ },
25
+ "scripts": {
26
+ "build": "tsc --declaration",
27
+ "typecheck": "tsc --noEmit",
28
+ "lint": "eslint --ext .ts,.js src/",
29
+ "lint:fix": "eslint --fix --ext .ts,.js src/",
30
+ "format": "prettier --write \"src/**/*.ts\" \"*.{json,md}\"",
31
+ "format:check": "prettier --check \"src/**/*.ts\" \"*.{json,md}\"",
32
+ "test": "jest",
33
+ "prepare": "husky",
34
+ "changeset": "changeset",
35
+ "version-packages": "changeset version",
36
+ "version-packages:snapshot": "changeset version --snapshot next",
37
+ "release": "changeset publish",
38
+ "release:next": "changeset publish --tag next",
39
+ "release:validate": "npm run format:check && npm run lint -- --max-warnings=0 && npm run typecheck && npm run build && npm test"
40
+ },
41
+ "keywords": [
42
+ "authentication",
43
+ "auth",
44
+ "auth-library",
45
+ "node-auth",
46
+ "framework-agnostic",
47
+ "backend-auth",
48
+ "session-auth",
49
+ "password-auth",
50
+ "magic-link",
51
+ "passwordless",
52
+ "login",
53
+ "signup",
54
+ "security",
55
+ "user-auth",
56
+ "nodejs",
57
+ "typescript",
58
+ "clean-architecture",
59
+ "hexagonal-architecture",
60
+ "backend",
61
+ "api-auth",
62
+ "express-auth",
63
+ "nest-auth"
64
+ ],
65
+ "author": "",
66
+ "license": "MPL-2.0",
67
+ "type": "commonjs",
68
+ "dependencies": {
69
+ "@nestjs/common": "^11.1.9",
70
+ "@zxcvbn-ts/core": "^3.0.4",
71
+ "bcryptjs": "^3.0.3",
72
+ "js-sha1": "^0.7.0",
73
+ "mongodb": "^7.1.0",
74
+ "pg": "^8.16.3"
75
+ },
76
+ "devDependencies": {
77
+ "@changesets/cli": "^2.29.7",
78
+ "@commitlint/cli": "^19.8.0",
79
+ "@commitlint/config-conventional": "^19.8.0",
80
+ "@secretlint/quick-start": "^8.4.0",
81
+ "@secretlint/secretlint-rule-preset-recommend": "^8.4.0",
82
+ "@types/bcryptjs": "^2.4.6",
83
+ "@types/express": "^5.0.6",
84
+ "@types/jest": "^29.5.14",
85
+ "@types/js-sha1": "^0.6.3",
86
+ "@types/pg": "^8.16.0",
87
+ "@typescript-eslint/eslint-plugin": "^7.18.0",
88
+ "@typescript-eslint/parser": "^7.18.0",
89
+ "eslint": "^8.57.1",
90
+ "husky": "^9.1.7",
91
+ "jest": "^29.7.0",
92
+ "jest-util": "^29.7.0",
93
+ "lint-staged": "^16.4.0",
94
+ "prettier": "^3.5.3",
95
+ "secretlint": "^8.4.0",
96
+ "ts-jest": "^29.4.6",
97
+ "typescript": "^5.8.2"
98
+ },
99
+ "files": [
100
+ "dist"
101
+ ]
102
+ }