@next-k8s/auth 1.0.16 → 1.0.20

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.
@@ -0,0 +1,165 @@
1
+ TN:
2
+ SF:src/app.ts
3
+ FN:30,(anonymous_8)
4
+ FN:30,(anonymous_9)
5
+ FNF:2
6
+ FNH:0
7
+ FNDA:0,(anonymous_8)
8
+ FNDA:0,(anonymous_9)
9
+ DA:1,4
10
+ DA:2,4
11
+ DA:3,4
12
+ DA:4,4
13
+ DA:5,4
14
+ DA:9,4
15
+ DA:10,4
16
+ DA:11,4
17
+ DA:12,4
18
+ DA:14,4
19
+ DA:16,4
20
+ DA:17,4
21
+ DA:18,4
22
+ DA:19,4
23
+ DA:20,4
24
+ DA:25,4
25
+ DA:26,4
26
+ DA:27,4
27
+ DA:28,4
28
+ DA:30,4
29
+ DA:31,0
30
+ DA:34,4
31
+ DA:36,4
32
+ LF:23
33
+ LH:22
34
+ BRDA:14,0,0,0
35
+ BRF:1
36
+ BRH:0
37
+ end_of_record
38
+ TN:
39
+ SF:src/models/user.ts
40
+ FN:24,(anonymous_1)
41
+ FN:36,(anonymous_2)
42
+ FNF:2
43
+ FNH:2
44
+ FNDA:9,(anonymous_1)
45
+ FNDA:9,(anonymous_2)
46
+ DA:1,4
47
+ DA:2,4
48
+ DA:11,4
49
+ DA:25,9
50
+ DA:26,9
51
+ DA:27,9
52
+ DA:32,4
53
+ DA:34,4
54
+ DA:35,4
55
+ DA:37,9
56
+ LF:10
57
+ LH:10
58
+ BRF:0
59
+ BRH:0
60
+ end_of_record
61
+ TN:
62
+ SF:src/routes/current-user.ts
63
+ FN:6,(anonymous_8)
64
+ FN:6,(anonymous_9)
65
+ FNF:2
66
+ FNH:2
67
+ FNDA:2,(anonymous_8)
68
+ FNDA:2,(anonymous_9)
69
+ DA:1,4
70
+ DA:2,4
71
+ DA:5,4
72
+ DA:6,4
73
+ DA:7,2
74
+ DA:10,4
75
+ LF:6
76
+ LH:6
77
+ BRDA:7,0,0,1
78
+ BRDA:7,0,1,1
79
+ BRDA:7,1,0,2
80
+ BRDA:7,1,1,1
81
+ BRF:4
82
+ BRH:4
83
+ end_of_record
84
+ TN:
85
+ SF:src/routes/signin.ts
86
+ FN:14,(anonymous_8)
87
+ FN:14,(anonymous_9)
88
+ FNF:2
89
+ FNH:2
90
+ FNDA:2,(anonymous_8)
91
+ FNDA:2,(anonymous_9)
92
+ DA:1,4
93
+ DA:2,4
94
+ DA:3,4
95
+ DA:4,4
96
+ DA:6,4
97
+ DA:8,4
98
+ DA:13,4
99
+ DA:14,4
100
+ DA:15,2
101
+ DA:16,2
102
+ DA:17,2
103
+ DA:18,2
104
+ DA:20,2
105
+ DA:25,2
106
+ DA:26,2
107
+ DA:29,4
108
+ LF:16
109
+ LH:16
110
+ BRDA:16,0,0,0
111
+ BRDA:18,1,0,0
112
+ BRF:2
113
+ BRH:0
114
+ end_of_record
115
+ TN:
116
+ SF:src/routes/signout.ts
117
+ FN:4,(anonymous_1)
118
+ FNF:1
119
+ FNH:1
120
+ FNDA:1,(anonymous_1)
121
+ DA:1,4
122
+ DA:3,4
123
+ DA:4,4
124
+ DA:5,1
125
+ DA:6,1
126
+ DA:9,4
127
+ LF:6
128
+ LH:6
129
+ BRF:0
130
+ BRH:0
131
+ end_of_record
132
+ TN:
133
+ SF:src/routes/signup.ts
134
+ FN:15,(anonymous_8)
135
+ FN:15,(anonymous_9)
136
+ FNF:2
137
+ FNH:2
138
+ FNDA:8,(anonymous_8)
139
+ FNDA:8,(anonymous_9)
140
+ DA:1,4
141
+ DA:2,4
142
+ DA:3,4
143
+ DA:4,4
144
+ DA:6,4
145
+ DA:8,4
146
+ DA:10,4
147
+ DA:15,8
148
+ DA:16,8
149
+ DA:17,8
150
+ DA:18,8
151
+ DA:20,7
152
+ DA:21,7
153
+ DA:22,7
154
+ DA:24,7
155
+ DA:29,7
156
+ DA:30,7
157
+ DA:32,0
158
+ DA:33,0
159
+ DA:37,4
160
+ LF:20
161
+ LH:18
162
+ BRDA:18,0,0,1
163
+ BRF:1
164
+ BRH:1
165
+ end_of_record
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next-k8s/auth",
3
- "version": "1.0.16",
3
+ "version": "1.0.20",
4
4
  "main": "index.js",
5
5
  "license": "MIT",
6
6
  "scripts": {
@@ -8,6 +8,8 @@
8
8
  "build": "tsc",
9
9
  "test": "jest --no-cache",
10
10
  "test:watch": "jest --watchAll --no-cache",
11
+ "test:debug": "node --inspect-brk --inspect=19229 node_modules/jest/bin/jest.js --runInBand --no-cache",
12
+ "test:debug:watch": "node --inspect-brk --inspect=19229 node_modules/jest/bin/jest.js --runInBand --watchAll --no-cache",
11
13
  "docker:build": "docker build -t mathiscode/k8s-boilerplate-service-auth .",
12
14
  "docker:push": "docker push mathiscode/k8s-boilerplate-service-auth"
13
15
  },
@@ -16,6 +18,10 @@
16
18
  },
17
19
  "jest": {
18
20
  "preset": "ts-jest",
21
+ "displayName": "@next-k8s/auth",
22
+ "collectCoverage": true,
23
+ "notify": true,
24
+ "notifyMode": "always",
19
25
  "testEnvironment": "node",
20
26
  "testPathIgnorePatterns": [
21
27
  "build"
@@ -47,8 +53,9 @@
47
53
  "@types/supertest": "^2.0.12",
48
54
  "jest": "^28.1.1",
49
55
  "mongodb-memory-server": "^8.6.0",
56
+ "node-notifier": "^10.0.1",
50
57
  "supertest": "^6.2.3",
51
58
  "ts-jest": "^28.0.4"
52
59
  },
53
- "gitHead": "20a9347e420d886b4e16ecd88afabb7b5768f2c0"
60
+ "gitHead": "b8fc7bc41d078b2fac00e9117329ccc7cfc7400a"
54
61
  }
package/pnpm-lock.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  lockfileVersion: 5.4
2
2
 
3
3
  specifiers:
4
- '@next-k8s/common': ^0.1.7
4
+ '@next-k8s/common': ^0.1.30
5
5
  '@types/body-parser': ^1.19.2
6
6
  '@types/cookie-session': ^2.0.44
7
7
  '@types/express': ^4.17.13
@@ -19,13 +19,14 @@ specifiers:
19
19
  mongodb-memory-server: ^8.6.0
20
20
  mongoose: ^6.3.5
21
21
  mongoose-bcrypt: ^1.9.0
22
+ node-notifier: ^10.0.1
22
23
  supertest: ^6.2.3
23
24
  ts-jest: ^28.0.4
24
25
  ts-node-dev: ^2.0.0
25
26
  typescript: ^4.7.3
26
27
 
27
28
  dependencies:
28
- '@next-k8s/common': 0.1.7
29
+ '@next-k8s/common': 0.1.30
29
30
  '@types/cookie-session': 2.0.44
30
31
  '@types/express': 4.17.13
31
32
  '@types/jsonwebtoken': 8.5.8
@@ -37,7 +38,7 @@ dependencies:
37
38
  jsonwebtoken: 8.5.1
38
39
  mongoose: 6.3.5
39
40
  mongoose-bcrypt: 1.9.0
40
- ts-node-dev: 2.0.0_fvkldoeufjjq5mlpfdkzhuqzdy
41
+ ts-node-dev: 2.0.0_mdwa2u5d66aaselucuqqyziihu
41
42
  typescript: 4.7.3
42
43
 
43
44
  devDependencies:
@@ -45,8 +46,9 @@ devDependencies:
45
46
  '@types/jest': 28.1.1
46
47
  '@types/mongoose': 5.11.97
47
48
  '@types/supertest': 2.0.12
48
- jest: 28.1.1_@types+node@17.0.40
49
+ jest: 28.1.1_dnk3gtlqhswgyp7ytm36pfjzga
49
50
  mongodb-memory-server: 8.6.0
51
+ node-notifier: 10.0.1
50
52
  supertest: 6.2.3
51
53
  ts-jest: 28.0.4_ighm2axwo4w2kweegjclfnfl74
52
54
 
@@ -410,7 +412,7 @@ packages:
410
412
  slash: 3.0.0
411
413
  dev: true
412
414
 
413
- /@jest/core/28.1.1:
415
+ /@jest/core/28.1.1_node-notifier@10.0.1:
414
416
  resolution: {integrity: sha512-3pYsBoZZ42tXMdlcFeCc/0j9kOlK7MYuXs2B1QbvDgMoW1K9NJ4G/VYvIbMb26iqlkTfPHo7SC2JgjDOk/mxXw==}
415
417
  engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0}
416
418
  peerDependencies:
@@ -420,7 +422,7 @@ packages:
420
422
  optional: true
421
423
  dependencies:
422
424
  '@jest/console': 28.1.1
423
- '@jest/reporters': 28.1.1
425
+ '@jest/reporters': 28.1.1_node-notifier@10.0.1
424
426
  '@jest/test-result': 28.1.1
425
427
  '@jest/transform': 28.1.1
426
428
  '@jest/types': 28.1.1
@@ -444,6 +446,7 @@ packages:
444
446
  jest-validate: 28.1.1
445
447
  jest-watcher: 28.1.1
446
448
  micromatch: 4.0.5
449
+ node-notifier: 10.0.1
447
450
  pretty-format: 28.1.1
448
451
  rimraf: 3.0.2
449
452
  slash: 3.0.0
@@ -503,7 +506,7 @@ packages:
503
506
  - supports-color
504
507
  dev: true
505
508
 
506
- /@jest/reporters/28.1.1:
509
+ /@jest/reporters/28.1.1_node-notifier@10.0.1:
507
510
  resolution: {integrity: sha512-597Zj4D4d88sZrzM4atEGLuO7SdA/YrOv9SRXHXRNC+/FwPCWxZhBAEzhXoiJzfRwn8zes/EjS8Lo6DouGN5Gg==}
508
511
  engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0}
509
512
  peerDependencies:
@@ -532,6 +535,7 @@ packages:
532
535
  jest-message-util: 28.1.1
533
536
  jest-util: 28.1.1
534
537
  jest-worker: 28.1.1
538
+ node-notifier: 10.0.1
535
539
  slash: 3.0.0
536
540
  string-length: 4.0.2
537
541
  strip-ansi: 6.0.1
@@ -647,13 +651,14 @@ packages:
647
651
  '@jridgewell/resolve-uri': 3.0.7
648
652
  '@jridgewell/sourcemap-codec': 1.4.13
649
653
 
650
- /@next-k8s/common/0.1.7:
651
- resolution: {integrity: sha512-rWnRx9ejjE9k8TlarwY901zUZCLLkoRoiFGQlIVAlKpAEL1EIk5DfEQkoownsL91a31XxGAyMD4SStqdn/u66g==}
654
+ /@next-k8s/common/0.1.30:
655
+ resolution: {integrity: sha512-weuxOM1+zCGCSgIjYa1dAyRgJISRODxl5tolxE/yeEorVoykI+UgHUEA1y60UprnjX+BBRvujuDzBtwAsnOIng==}
652
656
  dependencies:
653
657
  cookie-session: 2.0.0
654
658
  express: 4.18.1
655
659
  express-validator: 6.14.2
656
660
  jsonwebtoken: 8.5.1
661
+ node-nats-streaming: 0.3.2
657
662
  transitivePeerDependencies:
658
663
  - supports-color
659
664
  dev: false
@@ -1759,10 +1764,17 @@ packages:
1759
1764
  engines: {node: '>=4'}
1760
1765
  dev: true
1761
1766
 
1767
+ /google-protobuf/3.20.1:
1768
+ resolution: {integrity: sha512-XMf1+O32FjYIV3CYu6Tuh5PNbfNEU5Xu22X+Xkdb/DUexFlCzhvv7d5Iirm4AOwn8lv4al1YvIhzGrg2j9Zfzw==}
1769
+ dev: false
1770
+
1762
1771
  /graceful-fs/4.2.10:
1763
1772
  resolution: {integrity: sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==}
1764
1773
  dev: true
1765
1774
 
1775
+ /growly/1.3.0:
1776
+ resolution: {integrity: sha512-+xGQY0YyAWCnqy7Cd++hc2JqMYzlm0dG30Jd0beaA64sROr8C4nt8Yc9V5Ro3avlSUDTN0ulqP/VBKi1/lLygw==}
1777
+
1766
1778
  /has-flag/3.0.0:
1767
1779
  resolution: {integrity: sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==}
1768
1780
  engines: {node: '>=4'}
@@ -1875,6 +1887,11 @@ packages:
1875
1887
  dependencies:
1876
1888
  has: 1.0.3
1877
1889
 
1890
+ /is-docker/2.2.1:
1891
+ resolution: {integrity: sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==}
1892
+ engines: {node: '>=8'}
1893
+ hasBin: true
1894
+
1878
1895
  /is-extglob/2.1.1:
1879
1896
  resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==}
1880
1897
  engines: {node: '>=0.10.0'}
@@ -1906,9 +1923,14 @@ packages:
1906
1923
  engines: {node: '>=8'}
1907
1924
  dev: true
1908
1925
 
1926
+ /is-wsl/2.2.0:
1927
+ resolution: {integrity: sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==}
1928
+ engines: {node: '>=8'}
1929
+ dependencies:
1930
+ is-docker: 2.2.1
1931
+
1909
1932
  /isexe/2.0.0:
1910
1933
  resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}
1911
- dev: true
1912
1934
 
1913
1935
  /istanbul-lib-coverage/3.2.0:
1914
1936
  resolution: {integrity: sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw==}
@@ -1991,7 +2013,7 @@ packages:
1991
2013
  - supports-color
1992
2014
  dev: true
1993
2015
 
1994
- /jest-cli/28.1.1_@types+node@17.0.40:
2016
+ /jest-cli/28.1.1_dnk3gtlqhswgyp7ytm36pfjzga:
1995
2017
  resolution: {integrity: sha512-+sUfVbJqb1OjBZ0OdBbI6OWfYM1i7bSfzYy6gze1F1w3OKWq8ZTEKkZ8a7ZQPq6G/G1qMh/uKqpdWhgl11NFQQ==}
1996
2018
  engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0}
1997
2019
  hasBin: true
@@ -2001,7 +2023,7 @@ packages:
2001
2023
  node-notifier:
2002
2024
  optional: true
2003
2025
  dependencies:
2004
- '@jest/core': 28.1.1
2026
+ '@jest/core': 28.1.1_node-notifier@10.0.1
2005
2027
  '@jest/test-result': 28.1.1
2006
2028
  '@jest/types': 28.1.1
2007
2029
  chalk: 4.1.2
@@ -2011,6 +2033,7 @@ packages:
2011
2033
  jest-config: 28.1.1_@types+node@17.0.40
2012
2034
  jest-util: 28.1.1
2013
2035
  jest-validate: 28.1.1
2036
+ node-notifier: 10.0.1
2014
2037
  prompts: 2.4.2
2015
2038
  yargs: 17.5.1
2016
2039
  transitivePeerDependencies:
@@ -2367,7 +2390,7 @@ packages:
2367
2390
  supports-color: 8.1.1
2368
2391
  dev: true
2369
2392
 
2370
- /jest/28.1.1_@types+node@17.0.40:
2393
+ /jest/28.1.1_dnk3gtlqhswgyp7ytm36pfjzga:
2371
2394
  resolution: {integrity: sha512-qw9YHBnjt6TCbIDMPMpJZqf9E12rh6869iZaN08/vpOGgHJSAaLLUn6H8W3IAEuy34Ls3rct064mZLETkxJ2XA==}
2372
2395
  engines: {node: ^12.13.0 || ^14.15.0 || ^16.10.0 || >=17.0.0}
2373
2396
  hasBin: true
@@ -2377,10 +2400,11 @@ packages:
2377
2400
  node-notifier:
2378
2401
  optional: true
2379
2402
  dependencies:
2380
- '@jest/core': 28.1.1
2403
+ '@jest/core': 28.1.1_node-notifier@10.0.1
2381
2404
  '@jest/types': 28.1.1
2382
2405
  import-local: 3.1.0
2383
- jest-cli: 28.1.1_@types+node@17.0.40
2406
+ jest-cli: 28.1.1_dnk3gtlqhswgyp7ytm36pfjzga
2407
+ node-notifier: 10.0.1
2384
2408
  transitivePeerDependencies:
2385
2409
  - '@types/node'
2386
2410
  - supports-color
@@ -2710,6 +2734,15 @@ packages:
2710
2734
  /ms/2.1.3:
2711
2735
  resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==}
2712
2736
 
2737
+ /nats/1.4.12:
2738
+ resolution: {integrity: sha512-Jf4qesEF0Ay0D4AMw3OZnKMRTQm+6oZ5q8/m4gpy5bTmiDiK6wCXbZpzEslmezGpE93LV3RojNEG6dpK/mysLQ==}
2739
+ engines: {node: '>= 8.0.0'}
2740
+ hasBin: true
2741
+ dependencies:
2742
+ nuid: 1.1.6
2743
+ ts-nkeys: 1.0.16
2744
+ dev: false
2745
+
2713
2746
  /natural-compare/1.4.0:
2714
2747
  resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==}
2715
2748
  dev: true
@@ -2733,6 +2766,26 @@ packages:
2733
2766
  resolution: {integrity: sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==}
2734
2767
  dev: true
2735
2768
 
2769
+ /node-nats-streaming/0.3.2:
2770
+ resolution: {integrity: sha512-exeT+FwGYW3UbBSzu8a7ykwWoY6R/vjQLr1RoZ1gnoJ9F66WVvpMZQWCZzLxlf9XRpJTTygcp6P1+WRw9h07Sg==}
2771
+ engines: {node: '>= 8.0.0'}
2772
+ hasBin: true
2773
+ dependencies:
2774
+ google-protobuf: 3.20.1
2775
+ nats: 1.4.12
2776
+ nuid: 1.1.6
2777
+ dev: false
2778
+
2779
+ /node-notifier/10.0.1:
2780
+ resolution: {integrity: sha512-YX7TSyDukOZ0g+gmzjB6abKu+hTGvO8+8+gIFDsRCU2t8fLV/P2unmt+LGFaIa4y64aX98Qksa97rgz4vMNeLQ==}
2781
+ dependencies:
2782
+ growly: 1.3.0
2783
+ is-wsl: 2.2.0
2784
+ semver: 7.3.7
2785
+ shellwords: 0.1.1
2786
+ uuid: 8.3.2
2787
+ which: 2.0.2
2788
+
2736
2789
  /node-releases/2.0.5:
2737
2790
  resolution: {integrity: sha512-U9h1NLROZTq9uE1SNffn6WuPDg8icmi3ns4rEl/oTfIle4iLjTliCzgTsbaIFMq/Xn078/lfY/BL0GWZ+psK4Q==}
2738
2791
  dev: true
@@ -2748,6 +2801,11 @@ packages:
2748
2801
  path-key: 3.1.1
2749
2802
  dev: true
2750
2803
 
2804
+ /nuid/1.1.6:
2805
+ resolution: {integrity: sha512-Eb3CPCupYscP1/S1FQcO5nxtu6l/F3k0MQ69h7f5osnsemVk5pkc8/5AyalVT+NCfra9M71U8POqF6EZa6IHvg==}
2806
+ engines: {node: '>= 8.16.0'}
2807
+ dev: false
2808
+
2751
2809
  /object-inspect/1.12.2:
2752
2810
  resolution: {integrity: sha512-z+cPxW0QGUp0mcqcsgQyLVRDoXFQbXOwBaqyF7VIgI4TWNQsDHrBpUQslRmIfAoYWdYzs6UlKJtB2XJpTaNSpQ==}
2753
2811
 
@@ -3072,6 +3130,9 @@ packages:
3072
3130
  engines: {node: '>=8'}
3073
3131
  dev: true
3074
3132
 
3133
+ /shellwords/0.1.1:
3134
+ resolution: {integrity: sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==}
3135
+
3075
3136
  /side-channel/1.0.4:
3076
3137
  resolution: {integrity: sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==}
3077
3138
  dependencies:
@@ -3354,7 +3415,7 @@ packages:
3354
3415
  '@babel/core': 7.18.2
3355
3416
  bs-logger: 0.2.6
3356
3417
  fast-json-stable-stringify: 2.1.0
3357
- jest: 28.1.1_@types+node@17.0.40
3418
+ jest: 28.1.1_dnk3gtlqhswgyp7ytm36pfjzga
3358
3419
  jest-util: 28.1.1
3359
3420
  json5: 2.2.1
3360
3421
  lodash.memoize: 4.1.2
@@ -3364,7 +3425,13 @@ packages:
3364
3425
  yargs-parser: 20.2.9
3365
3426
  dev: true
3366
3427
 
3367
- /ts-node-dev/2.0.0_fvkldoeufjjq5mlpfdkzhuqzdy:
3428
+ /ts-nkeys/1.0.16:
3429
+ resolution: {integrity: sha512-1qrhAlavbm36wtW+7NtKOgxpzl+70NTF8xlz9mEhiA5zHMlMxjj3sEVKWm3pGZhHXE0Q3ykjrj+OSRVaYw+Dqg==}
3430
+ dependencies:
3431
+ tweetnacl: 1.0.3
3432
+ dev: false
3433
+
3434
+ /ts-node-dev/2.0.0_mdwa2u5d66aaselucuqqyziihu:
3368
3435
  resolution: {integrity: sha512-ywMrhCfH6M75yftYvrvNarLEY+SUXtUvU8/0Z6llrHQVBx12GiFk5sStF8UdfE/yfzk9IAq7O5EEbTQsxlBI8w==}
3369
3436
  engines: {node: '>=0.8.0'}
3370
3437
  hasBin: true
@@ -3379,6 +3446,7 @@ packages:
3379
3446
  dynamic-dedupe: 0.3.0
3380
3447
  minimist: 1.2.6
3381
3448
  mkdirp: 1.0.4
3449
+ node-notifier: 10.0.1
3382
3450
  resolve: 1.22.0
3383
3451
  rimraf: 2.7.1
3384
3452
  source-map-support: 0.5.21
@@ -3441,6 +3509,10 @@ packages:
3441
3509
  engines: {node: '>=0.6.x'}
3442
3510
  dev: false
3443
3511
 
3512
+ /tweetnacl/1.0.3:
3513
+ resolution: {integrity: sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==}
3514
+ dev: false
3515
+
3444
3516
  /type-detect/4.0.8:
3445
3517
  resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==}
3446
3518
  engines: {node: '>=4'}
@@ -3481,7 +3553,6 @@ packages:
3481
3553
  /uuid/8.3.2:
3482
3554
  resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==}
3483
3555
  hasBin: true
3484
- dev: true
3485
3556
 
3486
3557
  /v8-compile-cache-lib/3.0.1:
3487
3558
  resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==}
@@ -3529,7 +3600,6 @@ packages:
3529
3600
  hasBin: true
3530
3601
  dependencies:
3531
3602
  isexe: 2.0.0
3532
- dev: true
3533
3603
 
3534
3604
  /wrap-ansi/7.0.0:
3535
3605
  resolution: {integrity: sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==}
package/src/index.ts CHANGED
@@ -4,15 +4,15 @@ import app from './app'
4
4
  const start = async () => {
5
5
  try {
6
6
  if (process.env.MONGO_URI) await mongoose.connect(process.env.MONGO_URI)
7
- else throw new Error('Auth: MONGO_URI is undefined')
8
- console.log('Auth database connected!')
7
+ else throw new Error('MONGO_URI is undefined')
8
+ console.log('Database connected!')
9
9
  } catch (err) {
10
10
  console.error(err)
11
11
  }
12
12
 
13
13
  const port = process.env.PORT || 3000
14
14
  app.listen(port, () => {
15
- console.log('Auth service running on port:', port)
15
+ console.log('Service running on port:', port)
16
16
  })
17
17
  }
18
18
 
@@ -1,8 +1,9 @@
1
+ import mongoose from 'mongoose'
1
2
  import request from 'supertest'
3
+ import { getTokenCookie } from '@next-k8s/common'
2
4
  import app from '../../app'
3
- import { getTokenCookie } from '../../test/utils'
4
5
 
5
- describe('Route: /api/users/current', () => {
6
+ describe('[Get my Profile] Route: GET /api/users/current', () => {
6
7
  it('responds with the current user', async () => {
7
8
  const cookie = await getTokenCookie({ id: new mongoose.Types.ObjectId().toHexString() })
8
9
 
@@ -7,7 +7,7 @@ beforeEach(() => {
7
7
  .send({ email: 'test@test.com', password: 'testpass' })
8
8
  })
9
9
 
10
- describe('Route: /api/users/signin', () => {
10
+ describe('[User Signin] Route: POST /api/users/signin', () => {
11
11
  it('responds with 200 to successful signin request', async () => {
12
12
  return request(app)
13
13
  .post('/api/users/signin')
@@ -1,7 +1,7 @@
1
1
  import request from 'supertest'
2
2
  import app from '../../app'
3
3
 
4
- describe('Route: /api/users/signout', () => {
4
+ describe('[User Signout] Route: GET /api/users/signout', () => {
5
5
  it('clears cookie after signout', async () => {
6
6
  const response = await request(app)
7
7
  .get('/api/users/signout')
@@ -1,7 +1,7 @@
1
1
  import request from 'supertest'
2
2
  import app from '../../app'
3
3
 
4
- describe('Route: /api/users/signup', () => {
4
+ describe('[User Signup] Route: POST /api/users/signup', () => {
5
5
  it('responds with 201 to successful signup request', async () => {
6
6
  return request(app)
7
7
  .post('/api/users/signup')
package/src/test/utils.ts DELETED
@@ -1,13 +0,0 @@
1
- import request from 'supertest'
2
- import app from '../app'
3
-
4
- export const getTokenCookie = async () => {
5
- const email = 'test@test.com'
6
- const password = 'testpass'
7
- const response = await request(app)
8
- .post('/api/users/signup')
9
- .send({ email, password })
10
- .expect(201)
11
-
12
- return response.get('Set-Cookie')
13
- }