1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

fix: hotfix for invalid api base url prefix (#203)

This commit is contained in:
Ferdinand Mütsch 2021-05-19 10:18:18 +02:00
parent 712949afc7
commit ee31212cdd
12 changed files with 486 additions and 435 deletions

View File

@ -131,8 +131,8 @@ Wakapi relies on the open-source [WakaTime](https://github.com/wakatime/wakatime
```ini
[settings]
# Your Wakapi server URL or 'https://wakapi.dev/api/heartbeat' when using the cloud server
api_url = http://localhost:3000/api/heartbeat
# Your Wakapi server URL or 'https://wakapi.dev/api' when using the cloud server
api_url = http://localhost:3000/api
# Your Wakapi API key (get it from the web interface after having created an account)
api_key = 406fe41f-6d69-4183-a4cc-121e0c524c2b

View File

@ -1,12 +1,99 @@
mode: set
github.com/muety/wakapi/models/heartbeat.go:32.34,34.2 1 1
github.com/muety/wakapi/models/heartbeat.go:36.65,38.46 2 1
github.com/muety/wakapi/models/heartbeat.go:38.46,39.108 1 1
github.com/muety/wakapi/models/heartbeat.go:39.108,42.4 2 1
github.com/muety/wakapi/models/heartbeat.go:46.50,47.11 1 1
github.com/muety/wakapi/models/heartbeat.go:60.2,60.15 1 1
github.com/muety/wakapi/models/heartbeat.go:64.2,64.12 1 1
github.com/muety/wakapi/models/heartbeat.go:48.22,49.18 1 1
github.com/muety/wakapi/models/heartbeat.go:50.21,51.17 1 1
github.com/muety/wakapi/models/heartbeat.go:52.23,53.19 1 1
github.com/muety/wakapi/models/heartbeat.go:54.17,55.26 1 1
github.com/muety/wakapi/models/heartbeat.go:56.22,57.18 1 1
github.com/muety/wakapi/models/heartbeat.go:60.15,62.3 1 1
github.com/muety/wakapi/models/heartbeat.go:67.37,83.2 1 0
github.com/muety/wakapi/models/heartbeat.go:91.41,93.16 2 0
github.com/muety/wakapi/models/heartbeat.go:96.2,97.10 2 0
github.com/muety/wakapi/models/heartbeat.go:93.16,95.3 1 0
github.com/muety/wakapi/models/interval.go:39.47,40.23 1 0
github.com/muety/wakapi/models/interval.go:45.2,45.14 1 0
github.com/muety/wakapi/models/interval.go:40.23,41.13 1 0
github.com/muety/wakapi/models/interval.go:41.13,43.4 1 0
github.com/muety/wakapi/models/language_mapping.go:11.42,13.2 1 0
github.com/muety/wakapi/models/language_mapping.go:15.51,17.2 1 0
github.com/muety/wakapi/models/language_mapping.go:19.52,21.2 1 0
github.com/muety/wakapi/models/mail.go:19.44,23.2 3 0
github.com/muety/wakapi/models/mail.go:25.44,29.2 3 0
github.com/muety/wakapi/models/mail.go:31.32,44.2 1 0
github.com/muety/wakapi/models/mail.go:46.41,48.2 1 0
github.com/muety/wakapi/models/mail_address.go:15.13,18.2 2 1
github.com/muety/wakapi/models/mail_address.go:24.38,26.2 1 0
github.com/muety/wakapi/models/mail_address.go:28.35,30.21 2 1
github.com/muety/wakapi/models/mail_address.go:36.2,36.11 1 1
github.com/muety/wakapi/models/mail_address.go:30.21,31.21 1 1
github.com/muety/wakapi/models/mail_address.go:34.3,34.18 1 1
github.com/muety/wakapi/models/mail_address.go:31.21,33.4 1 1
github.com/muety/wakapi/models/mail_address.go:39.35,41.2 1 1
github.com/muety/wakapi/models/mail_address.go:43.43,45.22 2 0
github.com/muety/wakapi/models/mail_address.go:48.2,48.12 1 0
github.com/muety/wakapi/models/mail_address.go:45.22,47.3 1 0
github.com/muety/wakapi/models/mail_address.go:51.46,53.22 2 1
github.com/muety/wakapi/models/mail_address.go:56.2,56.12 1 1
github.com/muety/wakapi/models/mail_address.go:53.22,55.3 1 1
github.com/muety/wakapi/models/mail_address.go:59.40,60.22 1 1
github.com/muety/wakapi/models/mail_address.go:65.2,65.13 1 1
github.com/muety/wakapi/models/mail_address.go:60.22,61.17 1 1
github.com/muety/wakapi/models/mail_address.go:61.17,63.4 1 1
github.com/muety/wakapi/models/models.go:3.14,5.2 0 1
github.com/muety/wakapi/models/shared.go:35.52,37.2 1 0
github.com/muety/wakapi/models/shared.go:39.52,42.16 3 0
github.com/muety/wakapi/models/shared.go:45.2,47.12 3 0
github.com/muety/wakapi/models/shared.go:42.16,44.3 1 0
github.com/muety/wakapi/models/shared.go:50.52,56.22 2 0
github.com/muety/wakapi/models/shared.go:71.2,74.12 3 0
github.com/muety/wakapi/models/shared.go:57.14,61.17 2 0
github.com/muety/wakapi/models/shared.go:64.17,66.8 2 0
github.com/muety/wakapi/models/shared.go:67.10,68.64 1 0
github.com/muety/wakapi/models/shared.go:61.17,63.4 1 0
github.com/muety/wakapi/models/shared.go:77.51,80.2 2 0
github.com/muety/wakapi/models/shared.go:82.45,84.2 1 0
github.com/muety/wakapi/models/shared.go:86.37,88.2 1 0
github.com/muety/wakapi/models/shared.go:90.35,92.2 1 0
github.com/muety/wakapi/models/shared.go:94.34,96.2 1 0
github.com/muety/wakapi/models/alias.go:12.32,14.2 1 0
github.com/muety/wakapi/models/alias.go:16.37,17.35 1 0
github.com/muety/wakapi/models/alias.go:22.2,22.14 1 0
github.com/muety/wakapi/models/alias.go:17.35,18.18 1 0
github.com/muety/wakapi/models/alias.go:18.18,20.4 1 0
github.com/muety/wakapi/models/filters.go:16.56,17.16 1 0
github.com/muety/wakapi/models/filters.go:29.2,29.19 1 0
github.com/muety/wakapi/models/filters.go:18.22,19.32 1 0
github.com/muety/wakapi/models/filters.go:20.17,21.27 1 0
github.com/muety/wakapi/models/filters.go:22.23,23.33 1 0
github.com/muety/wakapi/models/filters.go:24.21,25.31 1 0
github.com/muety/wakapi/models/filters.go:26.22,27.32 1 0
github.com/muety/wakapi/models/filters.go:32.47,33.21 1 1
github.com/muety/wakapi/models/filters.go:44.2,44.21 1 1
github.com/muety/wakapi/models/filters.go:33.21,35.3 1 1
github.com/muety/wakapi/models/filters.go:35.8,35.23 1 1
github.com/muety/wakapi/models/filters.go:35.23,37.3 1 0
github.com/muety/wakapi/models/filters.go:37.8,37.29 1 1
github.com/muety/wakapi/models/filters.go:37.29,39.3 1 1
github.com/muety/wakapi/models/filters.go:39.8,39.27 1 1
github.com/muety/wakapi/models/filters.go:39.27,41.3 1 0
github.com/muety/wakapi/models/filters.go:41.8,41.28 1 1
github.com/muety/wakapi/models/filters.go:41.28,43.3 1 0
github.com/muety/wakapi/models/heartbeats.go:7.31,9.2 1 0
github.com/muety/wakapi/models/heartbeats.go:11.41,13.2 1 0
github.com/muety/wakapi/models/heartbeats.go:15.36,17.2 1 0
github.com/muety/wakapi/models/heartbeats.go:19.43,22.2 2 0
github.com/muety/wakapi/models/heartbeats.go:24.41,26.18 1 0
github.com/muety/wakapi/models/heartbeats.go:29.2,29.16 1 0
github.com/muety/wakapi/models/heartbeats.go:26.18,28.3 1 0
github.com/muety/wakapi/models/heartbeats.go:32.40,34.18 1 0
github.com/muety/wakapi/models/heartbeats.go:37.2,37.24 1 0
github.com/muety/wakapi/models/heartbeats.go:34.18,36.3 1 0
github.com/muety/wakapi/models/summary.go:70.29,72.2 1 1
github.com/muety/wakapi/models/summary.go:74.37,81.2 6 1
github.com/muety/wakapi/models/summary.go:83.35,85.2 1 1
@ -58,70 +145,6 @@ github.com/muety/wakapi/models/summary.go:238.50,242.2 1 0
github.com/muety/wakapi/models/summary.go:244.33,246.2 1 1
github.com/muety/wakapi/models/summary.go:248.43,250.2 1 1
github.com/muety/wakapi/models/summary.go:252.38,254.2 1 1
github.com/muety/wakapi/models/heartbeat.go:32.34,34.2 1 1
github.com/muety/wakapi/models/heartbeat.go:36.65,38.46 2 1
github.com/muety/wakapi/models/heartbeat.go:38.46,39.108 1 1
github.com/muety/wakapi/models/heartbeat.go:39.108,42.4 2 1
github.com/muety/wakapi/models/heartbeat.go:46.50,47.11 1 1
github.com/muety/wakapi/models/heartbeat.go:60.2,60.15 1 1
github.com/muety/wakapi/models/heartbeat.go:64.2,64.12 1 1
github.com/muety/wakapi/models/heartbeat.go:48.22,49.18 1 1
github.com/muety/wakapi/models/heartbeat.go:50.21,51.17 1 1
github.com/muety/wakapi/models/heartbeat.go:52.23,53.19 1 1
github.com/muety/wakapi/models/heartbeat.go:54.17,55.26 1 1
github.com/muety/wakapi/models/heartbeat.go:56.22,57.18 1 1
github.com/muety/wakapi/models/heartbeat.go:60.15,62.3 1 1
github.com/muety/wakapi/models/heartbeat.go:67.37,83.2 1 0
github.com/muety/wakapi/models/heartbeat.go:91.41,93.16 2 0
github.com/muety/wakapi/models/heartbeat.go:96.2,97.10 2 0
github.com/muety/wakapi/models/heartbeat.go:93.16,95.3 1 0
github.com/muety/wakapi/models/heartbeats.go:7.31,9.2 1 0
github.com/muety/wakapi/models/heartbeats.go:11.41,13.2 1 0
github.com/muety/wakapi/models/heartbeats.go:15.36,17.2 1 0
github.com/muety/wakapi/models/heartbeats.go:19.43,22.2 2 0
github.com/muety/wakapi/models/heartbeats.go:24.41,26.18 1 0
github.com/muety/wakapi/models/heartbeats.go:29.2,29.16 1 0
github.com/muety/wakapi/models/heartbeats.go:26.18,28.3 1 0
github.com/muety/wakapi/models/heartbeats.go:32.40,34.18 1 0
github.com/muety/wakapi/models/heartbeats.go:37.2,37.24 1 0
github.com/muety/wakapi/models/heartbeats.go:34.18,36.3 1 0
github.com/muety/wakapi/models/language_mapping.go:11.42,13.2 1 0
github.com/muety/wakapi/models/language_mapping.go:15.51,17.2 1 0
github.com/muety/wakapi/models/language_mapping.go:19.52,21.2 1 0
github.com/muety/wakapi/models/mail_address.go:15.13,18.2 2 1
github.com/muety/wakapi/models/mail_address.go:24.38,26.2 1 0
github.com/muety/wakapi/models/mail_address.go:28.35,30.21 2 1
github.com/muety/wakapi/models/mail_address.go:36.2,36.11 1 1
github.com/muety/wakapi/models/mail_address.go:30.21,31.21 1 1
github.com/muety/wakapi/models/mail_address.go:34.3,34.18 1 1
github.com/muety/wakapi/models/mail_address.go:31.21,33.4 1 1
github.com/muety/wakapi/models/mail_address.go:39.35,41.2 1 1
github.com/muety/wakapi/models/mail_address.go:43.43,45.22 2 0
github.com/muety/wakapi/models/mail_address.go:48.2,48.12 1 0
github.com/muety/wakapi/models/mail_address.go:45.22,47.3 1 0
github.com/muety/wakapi/models/mail_address.go:51.46,53.22 2 1
github.com/muety/wakapi/models/mail_address.go:56.2,56.12 1 1
github.com/muety/wakapi/models/mail_address.go:53.22,55.3 1 1
github.com/muety/wakapi/models/mail_address.go:59.40,60.22 1 1
github.com/muety/wakapi/models/mail_address.go:65.2,65.13 1 1
github.com/muety/wakapi/models/mail_address.go:60.22,61.17 1 1
github.com/muety/wakapi/models/mail_address.go:61.17,63.4 1 1
github.com/muety/wakapi/models/models.go:3.14,5.2 0 1
github.com/muety/wakapi/models/shared.go:35.52,37.2 1 0
github.com/muety/wakapi/models/shared.go:39.52,42.16 3 0
github.com/muety/wakapi/models/shared.go:45.2,47.12 3 0
github.com/muety/wakapi/models/shared.go:42.16,44.3 1 0
github.com/muety/wakapi/models/shared.go:50.52,56.22 2 0
github.com/muety/wakapi/models/shared.go:71.2,74.12 3 0
github.com/muety/wakapi/models/shared.go:57.14,61.17 2 0
github.com/muety/wakapi/models/shared.go:64.17,66.8 2 0
github.com/muety/wakapi/models/shared.go:67.10,68.64 1 0
github.com/muety/wakapi/models/shared.go:61.17,63.4 1 0
github.com/muety/wakapi/models/shared.go:77.51,80.2 2 0
github.com/muety/wakapi/models/shared.go:82.45,84.2 1 0
github.com/muety/wakapi/models/shared.go:86.37,88.2 1 0
github.com/muety/wakapi/models/shared.go:90.35,92.2 1 0
github.com/muety/wakapi/models/shared.go:94.34,96.2 1 0
github.com/muety/wakapi/models/user.go:8.13,10.2 1 1
github.com/muety/wakapi/models/user.go:78.36,79.22 1 1
github.com/muety/wakapi/models/user.go:82.2,83.16 2 1
@ -137,65 +160,6 @@ github.com/muety/wakapi/models/user.go:115.45,117.2 1 0
github.com/muety/wakapi/models/user.go:119.45,121.2 1 0
github.com/muety/wakapi/models/user.go:123.39,125.2 1 0
github.com/muety/wakapi/models/user.go:127.39,130.2 2 0
github.com/muety/wakapi/models/alias.go:12.32,14.2 1 0
github.com/muety/wakapi/models/alias.go:16.37,17.35 1 0
github.com/muety/wakapi/models/alias.go:22.2,22.14 1 0
github.com/muety/wakapi/models/alias.go:17.35,18.18 1 0
github.com/muety/wakapi/models/alias.go:18.18,20.4 1 0
github.com/muety/wakapi/models/filters.go:16.56,17.16 1 0
github.com/muety/wakapi/models/filters.go:29.2,29.19 1 0
github.com/muety/wakapi/models/filters.go:18.22,19.32 1 0
github.com/muety/wakapi/models/filters.go:20.17,21.27 1 0
github.com/muety/wakapi/models/filters.go:22.23,23.33 1 0
github.com/muety/wakapi/models/filters.go:24.21,25.31 1 0
github.com/muety/wakapi/models/filters.go:26.22,27.32 1 0
github.com/muety/wakapi/models/filters.go:32.47,33.21 1 1
github.com/muety/wakapi/models/filters.go:44.2,44.21 1 1
github.com/muety/wakapi/models/filters.go:33.21,35.3 1 1
github.com/muety/wakapi/models/filters.go:35.8,35.23 1 1
github.com/muety/wakapi/models/filters.go:35.23,37.3 1 0
github.com/muety/wakapi/models/filters.go:37.8,37.29 1 1
github.com/muety/wakapi/models/filters.go:37.29,39.3 1 1
github.com/muety/wakapi/models/filters.go:39.8,39.27 1 1
github.com/muety/wakapi/models/filters.go:39.27,41.3 1 0
github.com/muety/wakapi/models/filters.go:41.8,41.28 1 1
github.com/muety/wakapi/models/filters.go:41.28,43.3 1 0
github.com/muety/wakapi/config/fs.go:9.56,10.19 1 0
github.com/muety/wakapi/config/fs.go:13.2,13.19 1 0
github.com/muety/wakapi/config/fs.go:10.19,12.3 1 0
github.com/muety/wakapi/config/sentry.go:22.35,24.2 1 0
github.com/muety/wakapi/config/sentry.go:26.62,29.2 2 0
github.com/muety/wakapi/config/sentry.go:39.33,46.2 2 0
github.com/muety/wakapi/config/sentry.go:48.79,51.2 2 0
github.com/muety/wakapi/config/sentry.go:53.72,57.2 3 0
github.com/muety/wakapi/config/sentry.go:59.71,63.2 3 0
github.com/muety/wakapi/config/sentry.go:65.71,69.2 3 0
github.com/muety/wakapi/config/sentry.go:71.72,75.2 3 0
github.com/muety/wakapi/config/sentry.go:77.72,81.2 3 0
github.com/muety/wakapi/config/sentry.go:83.67,88.18 4 0
github.com/muety/wakapi/config/sentry.go:100.2,100.28 1 0
github.com/muety/wakapi/config/sentry.go:88.18,89.65 1 0
github.com/muety/wakapi/config/sentry.go:89.65,92.42 3 0
github.com/muety/wakapi/config/sentry.go:95.4,96.10 2 0
github.com/muety/wakapi/config/sentry.go:92.42,94.5 1 0
github.com/muety/wakapi/config/sentry.go:110.50,114.91 1 0
github.com/muety/wakapi/config/sentry.go:114.91,115.29 1 0
github.com/muety/wakapi/config/sentry.go:119.4,122.38 3 0
github.com/muety/wakapi/config/sentry.go:127.4,127.39 1 0
github.com/muety/wakapi/config/sentry.go:130.4,130.69 1 0
github.com/muety/wakapi/config/sentry.go:115.29,117.5 1 0
github.com/muety/wakapi/config/sentry.go:122.38,123.38 1 0
github.com/muety/wakapi/config/sentry.go:123.38,125.6 1 0
github.com/muety/wakapi/config/sentry.go:127.39,129.5 1 0
github.com/muety/wakapi/config/sentry.go:132.79,133.27 1 0
github.com/muety/wakapi/config/sentry.go:140.4,140.16 1 0
github.com/muety/wakapi/config/sentry.go:133.27,134.84 1 0
github.com/muety/wakapi/config/sentry.go:134.84,135.42 1 0
github.com/muety/wakapi/config/sentry.go:135.42,137.7 1 0
github.com/muety/wakapi/config/sentry.go:142.17,144.3 1 0
github.com/muety/wakapi/config/sentry.go:147.49,151.51 2 0
github.com/muety/wakapi/config/sentry.go:154.2,154.12 1 0
github.com/muety/wakapi/config/sentry.go:151.51,153.3 1 0
github.com/muety/wakapi/config/utils.go:5.78,7.22 2 0
github.com/muety/wakapi/config/utils.go:13.2,13.11 1 0
github.com/muety/wakapi/config/utils.go:7.22,8.18 1 0
@ -261,19 +225,23 @@ github.com/muety/wakapi/config/config.go:312.20,314.2 1 0
github.com/muety/wakapi/config/config.go:316.35,321.96 3 0
github.com/muety/wakapi/config/config.go:325.2,334.52 6 0
github.com/muety/wakapi/config/config.go:338.2,338.47 1 0
github.com/muety/wakapi/config/config.go:344.2,344.70 1 0
github.com/muety/wakapi/config/config.go:348.2,348.28 1 0
github.com/muety/wakapi/config/config.go:352.2,352.29 1 0
github.com/muety/wakapi/config/config.go:357.2,357.94 1 0
github.com/muety/wakapi/config/config.go:361.2,362.14 2 0
github.com/muety/wakapi/config/config.go:344.2,344.29 1 0
github.com/muety/wakapi/config/config.go:350.2,350.70 1 0
github.com/muety/wakapi/config/config.go:353.2,353.28 1 0
github.com/muety/wakapi/config/config.go:356.2,356.94 1 0
github.com/muety/wakapi/config/config.go:359.2,359.81 1 0
github.com/muety/wakapi/config/config.go:362.2,362.75 1 0
github.com/muety/wakapi/config/config.go:366.2,367.14 2 0
github.com/muety/wakapi/config/config.go:321.96,323.3 1 0
github.com/muety/wakapi/config/config.go:334.52,336.3 1 0
github.com/muety/wakapi/config/config.go:338.47,339.14 1 0
github.com/muety/wakapi/config/config.go:339.14,341.4 1 0
github.com/muety/wakapi/config/config.go:344.70,346.3 1 0
github.com/muety/wakapi/config/config.go:348.28,350.3 1 0
github.com/muety/wakapi/config/config.go:352.29,355.3 2 0
github.com/muety/wakapi/config/config.go:357.94,359.3 1 0
github.com/muety/wakapi/config/config.go:344.29,347.3 2 0
github.com/muety/wakapi/config/config.go:350.70,352.3 1 0
github.com/muety/wakapi/config/config.go:353.28,355.3 1 0
github.com/muety/wakapi/config/config.go:356.94,358.3 1 0
github.com/muety/wakapi/config/config.go:359.81,361.3 1 0
github.com/muety/wakapi/config/config.go:362.75,364.3 1 0
github.com/muety/wakapi/config/db.go:39.50,40.19 1 0
github.com/muety/wakapi/config/db.go:53.2,53.12 1 0
github.com/muety/wakapi/config/db.go:41.23,45.5 1 0
@ -286,136 +254,42 @@ github.com/muety/wakapi/config/db.go:70.16,72.3 1 0
github.com/muety/wakapi/config/db.go:84.54,86.2 1 1
github.com/muety/wakapi/config/eventbus.go:18.13,20.2 1 1
github.com/muety/wakapi/config/eventbus.go:22.26,24.2 1 0
github.com/muety/wakapi/utils/filesystem.go:14.68,16.16 2 0
github.com/muety/wakapi/utils/filesystem.go:20.2,21.15 2 0
github.com/muety/wakapi/utils/filesystem.go:33.2,33.15 1 0
github.com/muety/wakapi/utils/filesystem.go:16.16,18.3 1 0
github.com/muety/wakapi/utils/filesystem.go:21.15,23.47 2 0
github.com/muety/wakapi/utils/filesystem.go:23.47,25.23 2 0
github.com/muety/wakapi/utils/filesystem.go:29.4,29.19 1 0
github.com/muety/wakapi/utils/filesystem.go:25.23,27.5 1 0
github.com/muety/wakapi/utils/set.go:3.51,5.26 2 0
github.com/muety/wakapi/utils/set.go:8.2,8.12 1 0
github.com/muety/wakapi/utils/set.go:5.26,7.3 1 0
github.com/muety/wakapi/utils/set.go:11.49,13.21 2 0
github.com/muety/wakapi/utils/set.go:16.2,16.14 1 0
github.com/muety/wakapi/utils/set.go:13.21,15.3 1 0
github.com/muety/wakapi/utils/common.go:18.73,19.58 1 0
github.com/muety/wakapi/utils/common.go:22.2,22.87 1 0
github.com/muety/wakapi/utils/common.go:25.2,25.64 1 0
github.com/muety/wakapi/utils/common.go:19.58,21.3 1 0
github.com/muety/wakapi/utils/common.go:22.87,24.3 1 0
github.com/muety/wakapi/utils/common.go:28.40,30.2 1 0
github.com/muety/wakapi/utils/common.go:32.44,34.2 1 0
github.com/muety/wakapi/utils/common.go:36.49,38.2 1 0
github.com/muety/wakapi/utils/common.go:40.45,42.2 1 0
github.com/muety/wakapi/utils/common.go:44.24,46.2 1 0
github.com/muety/wakapi/utils/common.go:48.56,51.45 3 1
github.com/muety/wakapi/utils/common.go:54.2,54.40 1 1
github.com/muety/wakapi/utils/common.go:51.45,53.3 1 1
github.com/muety/wakapi/utils/color.go:8.90,10.32 2 0
github.com/muety/wakapi/utils/color.go:15.2,15.15 1 0
github.com/muety/wakapi/utils/color.go:10.32,11.50 1 0
github.com/muety/wakapi/utils/color.go:11.50,13.4 1 0
github.com/muety/wakapi/utils/date.go:8.43,10.2 1 1
github.com/muety/wakapi/utils/date.go:12.48,14.2 1 0
github.com/muety/wakapi/utils/date.go:16.41,18.21 2 1
github.com/muety/wakapi/utils/date.go:21.2,21.23 1 1
github.com/muety/wakapi/utils/date.go:18.21,20.3 1 0
github.com/muety/wakapi/utils/date.go:24.46,26.2 1 0
github.com/muety/wakapi/utils/date.go:28.51,30.2 1 0
github.com/muety/wakapi/utils/date.go:32.44,35.2 2 1
github.com/muety/wakapi/utils/date.go:37.52,39.2 1 0
github.com/muety/wakapi/utils/date.go:41.45,43.2 1 0
github.com/muety/wakapi/utils/date.go:45.51,47.2 1 0
github.com/muety/wakapi/utils/date.go:49.44,51.2 1 0
github.com/muety/wakapi/utils/date.go:54.42,56.2 1 1
github.com/muety/wakapi/utils/date.go:59.41,61.21 2 1
github.com/muety/wakapi/utils/date.go:64.2,64.36 1 1
github.com/muety/wakapi/utils/date.go:61.21,63.3 1 1
github.com/muety/wakapi/utils/date.go:68.63,70.2 1 0
github.com/muety/wakapi/utils/date.go:73.62,79.2 5 0
github.com/muety/wakapi/utils/date.go:82.67,85.33 2 1
github.com/muety/wakapi/utils/date.go:94.2,94.18 1 1
github.com/muety/wakapi/utils/date.go:85.33,87.19 2 1
github.com/muety/wakapi/utils/date.go:90.3,91.10 2 1
github.com/muety/wakapi/utils/date.go:87.19,89.4 1 1
github.com/muety/wakapi/utils/date.go:97.50,103.2 5 0
github.com/muety/wakapi/utils/date.go:106.79,109.36 3 1
github.com/muety/wakapi/utils/date.go:113.2,113.21 1 1
github.com/muety/wakapi/utils/date.go:117.2,117.21 1 1
github.com/muety/wakapi/utils/date.go:121.2,121.13 1 1
github.com/muety/wakapi/utils/date.go:109.36,112.3 2 0
github.com/muety/wakapi/utils/date.go:113.21,116.3 2 1
github.com/muety/wakapi/utils/date.go:117.21,120.3 2 1
github.com/muety/wakapi/utils/http.go:9.90,12.58 3 0
github.com/muety/wakapi/utils/http.go:12.58,14.3 1 0
github.com/muety/wakapi/utils/strings.go:8.34,10.2 1 0
github.com/muety/wakapi/utils/strings.go:12.77,13.29 1 0
github.com/muety/wakapi/utils/strings.go:18.2,18.19 1 0
github.com/muety/wakapi/utils/strings.go:13.29,14.18 1 0
github.com/muety/wakapi/utils/strings.go:14.18,16.4 1 0
github.com/muety/wakapi/utils/summary.go:10.66,11.40 1 0
github.com/muety/wakapi/utils/summary.go:16.2,16.48 1 0
github.com/muety/wakapi/utils/summary.go:11.40,12.27 1 0
github.com/muety/wakapi/utils/summary.go:12.27,14.4 1 0
github.com/muety/wakapi/utils/summary.go:19.88,22.2 2 0
github.com/muety/wakapi/utils/summary.go:24.95,26.16 2 0
github.com/muety/wakapi/utils/summary.go:29.2,29.38 1 0
github.com/muety/wakapi/utils/summary.go:26.16,28.3 1 0
github.com/muety/wakapi/utils/summary.go:32.105,35.18 2 0
github.com/muety/wakapi/utils/summary.go:70.2,70.22 1 0
github.com/muety/wakapi/utils/summary.go:36.28,37.26 1 0
github.com/muety/wakapi/utils/summary.go:38.32,40.24 2 0
github.com/muety/wakapi/utils/summary.go:41.31,42.29 1 0
github.com/muety/wakapi/utils/summary.go:43.31,45.27 2 0
github.com/muety/wakapi/utils/summary.go:46.32,47.30 1 0
github.com/muety/wakapi/utils/summary.go:48.32,50.28 2 0
github.com/muety/wakapi/utils/summary.go:51.31,52.29 1 0
github.com/muety/wakapi/utils/summary.go:53.32,54.44 1 0
github.com/muety/wakapi/utils/summary.go:55.41,57.42 2 0
github.com/muety/wakapi/utils/summary.go:58.33,59.45 1 0
github.com/muety/wakapi/utils/summary.go:60.33,61.45 1 0
github.com/muety/wakapi/utils/summary.go:62.35,63.45 1 0
github.com/muety/wakapi/utils/summary.go:64.26,65.21 1 0
github.com/muety/wakapi/utils/summary.go:66.10,67.39 1 0
github.com/muety/wakapi/utils/summary.go:73.73,80.56 5 0
github.com/muety/wakapi/utils/summary.go:96.2,103.8 2 0
github.com/muety/wakapi/utils/summary.go:80.56,82.3 1 0
github.com/muety/wakapi/utils/summary.go:82.8,82.54 1 0
github.com/muety/wakapi/utils/summary.go:82.54,84.3 1 0
github.com/muety/wakapi/utils/summary.go:84.8,86.17 2 0
github.com/muety/wakapi/utils/summary.go:90.3,91.17 2 0
github.com/muety/wakapi/utils/summary.go:86.17,88.4 1 0
github.com/muety/wakapi/utils/summary.go:91.17,93.4 1 0
github.com/muety/wakapi/utils/summary.go:106.48,110.51 2 0
github.com/muety/wakapi/utils/summary.go:113.2,113.12 1 0
github.com/muety/wakapi/utils/summary.go:110.51,112.3 1 0
github.com/muety/wakapi/utils/template.go:8.41,10.16 2 0
github.com/muety/wakapi/utils/template.go:13.2,13.23 1 0
github.com/muety/wakapi/utils/template.go:10.16,12.3 1 0
github.com/muety/wakapi/utils/template.go:16.37,17.30 1 0
github.com/muety/wakapi/utils/template.go:20.2,20.10 1 0
github.com/muety/wakapi/utils/template.go:17.30,19.3 1 0
github.com/muety/wakapi/utils/auth.go:16.79,18.54 2 0
github.com/muety/wakapi/utils/auth.go:22.2,24.16 3 0
github.com/muety/wakapi/utils/auth.go:28.2,30.45 3 0
github.com/muety/wakapi/utils/auth.go:33.2,34.32 2 0
github.com/muety/wakapi/utils/auth.go:18.54,20.3 1 0
github.com/muety/wakapi/utils/auth.go:24.16,26.3 1 0
github.com/muety/wakapi/utils/auth.go:30.45,32.3 1 0
github.com/muety/wakapi/utils/auth.go:37.65,39.85 2 0
github.com/muety/wakapi/utils/auth.go:43.2,44.30 2 0
github.com/muety/wakapi/utils/auth.go:39.85,41.3 1 0
github.com/muety/wakapi/utils/auth.go:47.94,49.16 2 0
github.com/muety/wakapi/utils/auth.go:53.2,53.107 1 0
github.com/muety/wakapi/utils/auth.go:57.2,57.22 1 0
github.com/muety/wakapi/utils/auth.go:49.16,51.3 1 0
github.com/muety/wakapi/utils/auth.go:53.107,55.3 1 0
github.com/muety/wakapi/utils/auth.go:60.56,64.2 3 0
github.com/muety/wakapi/utils/auth.go:66.55,69.16 3 0
github.com/muety/wakapi/utils/auth.go:72.2,72.16 1 0
github.com/muety/wakapi/utils/auth.go:69.16,71.3 1 0
github.com/muety/wakapi/config/fs.go:9.56,10.19 1 0
github.com/muety/wakapi/config/fs.go:13.2,13.19 1 0
github.com/muety/wakapi/config/fs.go:10.19,12.3 1 0
github.com/muety/wakapi/config/sentry.go:22.35,24.2 1 0
github.com/muety/wakapi/config/sentry.go:26.62,29.2 2 0
github.com/muety/wakapi/config/sentry.go:39.33,46.2 2 0
github.com/muety/wakapi/config/sentry.go:48.79,51.2 2 0
github.com/muety/wakapi/config/sentry.go:53.72,57.2 3 0
github.com/muety/wakapi/config/sentry.go:59.71,63.2 3 0
github.com/muety/wakapi/config/sentry.go:65.71,69.2 3 0
github.com/muety/wakapi/config/sentry.go:71.72,75.2 3 0
github.com/muety/wakapi/config/sentry.go:77.72,81.2 3 0
github.com/muety/wakapi/config/sentry.go:83.67,88.18 4 0
github.com/muety/wakapi/config/sentry.go:100.2,100.28 1 0
github.com/muety/wakapi/config/sentry.go:88.18,89.65 1 0
github.com/muety/wakapi/config/sentry.go:89.65,92.42 3 0
github.com/muety/wakapi/config/sentry.go:95.4,96.10 2 0
github.com/muety/wakapi/config/sentry.go:92.42,94.5 1 0
github.com/muety/wakapi/config/sentry.go:110.50,114.91 1 0
github.com/muety/wakapi/config/sentry.go:114.91,115.29 1 0
github.com/muety/wakapi/config/sentry.go:119.4,122.38 3 0
github.com/muety/wakapi/config/sentry.go:127.4,127.39 1 0
github.com/muety/wakapi/config/sentry.go:130.4,130.69 1 0
github.com/muety/wakapi/config/sentry.go:115.29,117.5 1 0
github.com/muety/wakapi/config/sentry.go:122.38,123.38 1 0
github.com/muety/wakapi/config/sentry.go:123.38,125.6 1 0
github.com/muety/wakapi/config/sentry.go:127.39,129.5 1 0
github.com/muety/wakapi/config/sentry.go:132.79,133.27 1 0
github.com/muety/wakapi/config/sentry.go:140.4,140.16 1 0
github.com/muety/wakapi/config/sentry.go:133.27,134.84 1 0
github.com/muety/wakapi/config/sentry.go:134.84,135.42 1 0
github.com/muety/wakapi/config/sentry.go:135.42,137.7 1 0
github.com/muety/wakapi/config/sentry.go:142.17,144.3 1 0
github.com/muety/wakapi/config/sentry.go:147.49,151.51 2 0
github.com/muety/wakapi/config/sentry.go:154.2,154.12 1 0
github.com/muety/wakapi/config/sentry.go:151.51,153.3 1 0
github.com/muety/wakapi/middlewares/authenticate.go:19.91,25.2 1 1
github.com/muety/wakapi/middlewares/authenticate.go:27.90,30.2 2 0
github.com/muety/wakapi/middlewares/authenticate.go:32.90,35.2 2 0
@ -499,6 +373,136 @@ github.com/muety/wakapi/middlewares/sentry.go:16.43,20.3 1 0
github.com/muety/wakapi/middlewares/sentry.go:23.78,26.54 3 0
github.com/muety/wakapi/middlewares/sentry.go:26.54,27.43 1 0
github.com/muety/wakapi/middlewares/sentry.go:27.43,29.4 1 0
github.com/muety/wakapi/utils/color.go:8.90,10.32 2 0
github.com/muety/wakapi/utils/color.go:15.2,15.15 1 0
github.com/muety/wakapi/utils/color.go:10.32,11.50 1 0
github.com/muety/wakapi/utils/color.go:11.50,13.4 1 0
github.com/muety/wakapi/utils/common.go:18.73,19.58 1 0
github.com/muety/wakapi/utils/common.go:22.2,22.87 1 0
github.com/muety/wakapi/utils/common.go:25.2,25.64 1 0
github.com/muety/wakapi/utils/common.go:19.58,21.3 1 0
github.com/muety/wakapi/utils/common.go:22.87,24.3 1 0
github.com/muety/wakapi/utils/common.go:28.40,30.2 1 0
github.com/muety/wakapi/utils/common.go:32.44,34.2 1 0
github.com/muety/wakapi/utils/common.go:36.49,38.2 1 0
github.com/muety/wakapi/utils/common.go:40.45,42.2 1 0
github.com/muety/wakapi/utils/common.go:44.24,46.2 1 0
github.com/muety/wakapi/utils/common.go:48.56,51.45 3 1
github.com/muety/wakapi/utils/common.go:54.2,54.40 1 1
github.com/muety/wakapi/utils/common.go:51.45,53.3 1 1
github.com/muety/wakapi/utils/date.go:8.43,10.2 1 1
github.com/muety/wakapi/utils/date.go:12.48,14.2 1 0
github.com/muety/wakapi/utils/date.go:16.41,18.21 2 1
github.com/muety/wakapi/utils/date.go:21.2,21.23 1 1
github.com/muety/wakapi/utils/date.go:18.21,20.3 1 0
github.com/muety/wakapi/utils/date.go:24.46,26.2 1 0
github.com/muety/wakapi/utils/date.go:28.51,30.2 1 0
github.com/muety/wakapi/utils/date.go:32.44,35.2 2 1
github.com/muety/wakapi/utils/date.go:37.52,39.2 1 0
github.com/muety/wakapi/utils/date.go:41.45,43.2 1 0
github.com/muety/wakapi/utils/date.go:45.51,47.2 1 0
github.com/muety/wakapi/utils/date.go:49.44,51.2 1 0
github.com/muety/wakapi/utils/date.go:54.42,56.2 1 1
github.com/muety/wakapi/utils/date.go:59.41,61.21 2 1
github.com/muety/wakapi/utils/date.go:64.2,64.36 1 1
github.com/muety/wakapi/utils/date.go:61.21,63.3 1 1
github.com/muety/wakapi/utils/date.go:68.63,70.2 1 0
github.com/muety/wakapi/utils/date.go:73.62,79.2 5 0
github.com/muety/wakapi/utils/date.go:82.67,85.33 2 1
github.com/muety/wakapi/utils/date.go:94.2,94.18 1 1
github.com/muety/wakapi/utils/date.go:85.33,87.19 2 1
github.com/muety/wakapi/utils/date.go:90.3,91.10 2 1
github.com/muety/wakapi/utils/date.go:87.19,89.4 1 1
github.com/muety/wakapi/utils/date.go:97.50,103.2 5 0
github.com/muety/wakapi/utils/date.go:106.79,109.36 3 1
github.com/muety/wakapi/utils/date.go:113.2,113.21 1 1
github.com/muety/wakapi/utils/date.go:117.2,117.21 1 1
github.com/muety/wakapi/utils/date.go:121.2,121.13 1 1
github.com/muety/wakapi/utils/date.go:109.36,112.3 2 0
github.com/muety/wakapi/utils/date.go:113.21,116.3 2 1
github.com/muety/wakapi/utils/date.go:117.21,120.3 2 1
github.com/muety/wakapi/utils/http.go:9.90,12.58 3 0
github.com/muety/wakapi/utils/http.go:12.58,14.3 1 0
github.com/muety/wakapi/utils/set.go:3.51,5.26 2 0
github.com/muety/wakapi/utils/set.go:8.2,8.12 1 0
github.com/muety/wakapi/utils/set.go:5.26,7.3 1 0
github.com/muety/wakapi/utils/set.go:11.49,13.21 2 0
github.com/muety/wakapi/utils/set.go:16.2,16.14 1 0
github.com/muety/wakapi/utils/set.go:13.21,15.3 1 0
github.com/muety/wakapi/utils/summary.go:10.66,11.40 1 0
github.com/muety/wakapi/utils/summary.go:16.2,16.48 1 0
github.com/muety/wakapi/utils/summary.go:11.40,12.27 1 0
github.com/muety/wakapi/utils/summary.go:12.27,14.4 1 0
github.com/muety/wakapi/utils/summary.go:19.88,22.2 2 0
github.com/muety/wakapi/utils/summary.go:24.95,26.16 2 0
github.com/muety/wakapi/utils/summary.go:29.2,29.38 1 0
github.com/muety/wakapi/utils/summary.go:26.16,28.3 1 0
github.com/muety/wakapi/utils/summary.go:32.105,35.18 2 0
github.com/muety/wakapi/utils/summary.go:70.2,70.22 1 0
github.com/muety/wakapi/utils/summary.go:36.28,37.26 1 0
github.com/muety/wakapi/utils/summary.go:38.32,40.24 2 0
github.com/muety/wakapi/utils/summary.go:41.31,42.29 1 0
github.com/muety/wakapi/utils/summary.go:43.31,45.27 2 0
github.com/muety/wakapi/utils/summary.go:46.32,47.30 1 0
github.com/muety/wakapi/utils/summary.go:48.32,50.28 2 0
github.com/muety/wakapi/utils/summary.go:51.31,52.29 1 0
github.com/muety/wakapi/utils/summary.go:53.32,54.44 1 0
github.com/muety/wakapi/utils/summary.go:55.41,57.42 2 0
github.com/muety/wakapi/utils/summary.go:58.33,59.45 1 0
github.com/muety/wakapi/utils/summary.go:60.33,61.45 1 0
github.com/muety/wakapi/utils/summary.go:62.35,63.45 1 0
github.com/muety/wakapi/utils/summary.go:64.26,65.21 1 0
github.com/muety/wakapi/utils/summary.go:66.10,67.39 1 0
github.com/muety/wakapi/utils/summary.go:73.73,80.56 5 0
github.com/muety/wakapi/utils/summary.go:96.2,103.8 2 0
github.com/muety/wakapi/utils/summary.go:80.56,82.3 1 0
github.com/muety/wakapi/utils/summary.go:82.8,82.54 1 0
github.com/muety/wakapi/utils/summary.go:82.54,84.3 1 0
github.com/muety/wakapi/utils/summary.go:84.8,86.17 2 0
github.com/muety/wakapi/utils/summary.go:90.3,91.17 2 0
github.com/muety/wakapi/utils/summary.go:86.17,88.4 1 0
github.com/muety/wakapi/utils/summary.go:91.17,93.4 1 0
github.com/muety/wakapi/utils/summary.go:106.48,110.51 2 0
github.com/muety/wakapi/utils/summary.go:113.2,113.12 1 0
github.com/muety/wakapi/utils/summary.go:110.51,112.3 1 0
github.com/muety/wakapi/utils/auth.go:16.79,18.54 2 0
github.com/muety/wakapi/utils/auth.go:22.2,24.16 3 0
github.com/muety/wakapi/utils/auth.go:28.2,30.45 3 0
github.com/muety/wakapi/utils/auth.go:33.2,34.32 2 0
github.com/muety/wakapi/utils/auth.go:18.54,20.3 1 0
github.com/muety/wakapi/utils/auth.go:24.16,26.3 1 0
github.com/muety/wakapi/utils/auth.go:30.45,32.3 1 0
github.com/muety/wakapi/utils/auth.go:37.65,39.85 2 0
github.com/muety/wakapi/utils/auth.go:43.2,44.30 2 0
github.com/muety/wakapi/utils/auth.go:39.85,41.3 1 0
github.com/muety/wakapi/utils/auth.go:47.94,49.16 2 0
github.com/muety/wakapi/utils/auth.go:53.2,53.107 1 0
github.com/muety/wakapi/utils/auth.go:57.2,57.22 1 0
github.com/muety/wakapi/utils/auth.go:49.16,51.3 1 0
github.com/muety/wakapi/utils/auth.go:53.107,55.3 1 0
github.com/muety/wakapi/utils/auth.go:60.56,64.2 3 0
github.com/muety/wakapi/utils/auth.go:66.55,69.16 3 0
github.com/muety/wakapi/utils/auth.go:72.2,72.16 1 0
github.com/muety/wakapi/utils/auth.go:69.16,71.3 1 0
github.com/muety/wakapi/utils/filesystem.go:14.68,16.16 2 0
github.com/muety/wakapi/utils/filesystem.go:20.2,21.15 2 0
github.com/muety/wakapi/utils/filesystem.go:33.2,33.15 1 0
github.com/muety/wakapi/utils/filesystem.go:16.16,18.3 1 0
github.com/muety/wakapi/utils/filesystem.go:21.15,23.47 2 0
github.com/muety/wakapi/utils/filesystem.go:23.47,25.23 2 0
github.com/muety/wakapi/utils/filesystem.go:29.4,29.19 1 0
github.com/muety/wakapi/utils/filesystem.go:25.23,27.5 1 0
github.com/muety/wakapi/utils/strings.go:8.34,10.2 1 0
github.com/muety/wakapi/utils/strings.go:12.77,13.29 1 0
github.com/muety/wakapi/utils/strings.go:18.2,18.19 1 0
github.com/muety/wakapi/utils/strings.go:13.29,14.18 1 0
github.com/muety/wakapi/utils/strings.go:14.18,16.4 1 0
github.com/muety/wakapi/utils/template.go:8.41,10.16 2 0
github.com/muety/wakapi/utils/template.go:13.2,13.23 1 0
github.com/muety/wakapi/utils/template.go:10.16,12.3 1 0
github.com/muety/wakapi/utils/template.go:16.37,17.30 1 0
github.com/muety/wakapi/utils/template.go:20.2,20.10 1 0
github.com/muety/wakapi/utils/template.go:17.30,19.3 1 0
github.com/muety/wakapi/services/alias.go:17.77,22.2 1 1
github.com/muety/wakapi/services/alias.go:26.60,27.43 1 1
github.com/muety/wakapi/services/alias.go:30.2,30.14 1 1
@ -534,6 +538,123 @@ github.com/muety/wakapi/services/alias.go:95.21,97.4 1 0
github.com/muety/wakapi/services/alias.go:104.31,106.3 1 0
github.com/muety/wakapi/services/alias.go:111.52,112.51 1 0
github.com/muety/wakapi/services/alias.go:112.51,114.3 1 0
github.com/muety/wakapi/services/key_value.go:14.89,19.2 1 0
github.com/muety/wakapi/services/key_value.go:21.83,23.2 1 0
github.com/muety/wakapi/services/key_value.go:25.78,27.16 2 0
github.com/muety/wakapi/services/key_value.go:33.2,33.11 1 0
github.com/muety/wakapi/services/key_value.go:27.16,32.3 1 0
github.com/muety/wakapi/services/key_value.go:36.72,38.2 1 0
github.com/muety/wakapi/services/key_value.go:40.60,42.2 1 0
github.com/muety/wakapi/services/report.go:30.122,44.33 4 0
github.com/muety/wakapi/services/report.go:50.2,50.12 1 0
github.com/muety/wakapi/services/report.go:44.33,45.31 1 0
github.com/muety/wakapi/services/report.go:45.31,47.4 1 0
github.com/muety/wakapi/services/report.go:53.38,57.16 3 0
github.com/muety/wakapi/services/report.go:61.2,62.26 2 0
github.com/muety/wakapi/services/report.go:57.16,59.3 1 0
github.com/muety/wakapi/services/report.go:62.26,64.3 1 0
github.com/muety/wakapi/services/report.go:69.61,74.22 3 0
github.com/muety/wakapi/services/report.go:80.2,80.61 1 0
github.com/muety/wakapi/services/report.go:94.2,94.24 1 0
github.com/muety/wakapi/services/report.go:74.22,77.3 2 0
github.com/muety/wakapi/services/report.go:80.61,89.47 3 0
github.com/muety/wakapi/services/report.go:89.47,91.4 1 0
github.com/muety/wakapi/services/report.go:97.80,98.22 1 0
github.com/muety/wakapi/services/report.go:102.2,102.29 1 0
github.com/muety/wakapi/services/report.go:107.2,111.16 4 0
github.com/muety/wakapi/services/report.go:116.2,123.65 2 0
github.com/muety/wakapi/services/report.go:128.2,129.12 2 0
github.com/muety/wakapi/services/report.go:98.22,100.3 1 0
github.com/muety/wakapi/services/report.go:102.29,105.3 2 0
github.com/muety/wakapi/services/report.go:111.16,114.3 2 0
github.com/muety/wakapi/services/report.go:123.65,126.3 2 0
github.com/muety/wakapi/services/report.go:132.63,133.41 1 0
github.com/muety/wakapi/services/report.go:140.2,140.12 1 0
github.com/muety/wakapi/services/report.go:133.41,134.30 1 0
github.com/muety/wakapi/services/report.go:134.30,135.16 1 0
github.com/muety/wakapi/services/report.go:135.16,137.5 1 0
github.com/muety/wakapi/services/user.go:21.73,28.2 1 0
github.com/muety/wakapi/services/user.go:30.74,31.40 1 0
github.com/muety/wakapi/services/user.go:35.2,36.16 2 0
github.com/muety/wakapi/services/user.go:40.2,41.15 2 0
github.com/muety/wakapi/services/user.go:31.40,33.3 1 0
github.com/muety/wakapi/services/user.go:36.16,38.3 1 0
github.com/muety/wakapi/services/user.go:44.72,45.37 1 0
github.com/muety/wakapi/services/user.go:49.2,50.16 2 0
github.com/muety/wakapi/services/user.go:54.2,55.15 2 0
github.com/muety/wakapi/services/user.go:45.37,47.3 1 0
github.com/muety/wakapi/services/user.go:50.16,52.3 1 0
github.com/muety/wakapi/services/user.go:58.76,60.2 1 0
github.com/muety/wakapi/services/user.go:62.86,64.2 1 0
github.com/muety/wakapi/services/user.go:66.58,68.2 1 0
github.com/muety/wakapi/services/user.go:70.86,72.2 1 0
github.com/muety/wakapi/services/user.go:74.61,77.2 2 0
github.com/muety/wakapi/services/user.go:79.48,81.2 1 0
github.com/muety/wakapi/services/user.go:83.102,93.93 2 0
github.com/muety/wakapi/services/user.go:99.2,99.38 1 0
github.com/muety/wakapi/services/user.go:93.93,95.3 1 0
github.com/muety/wakapi/services/user.go:95.8,97.3 1 0
github.com/muety/wakapi/services/user.go:102.73,106.2 3 0
github.com/muety/wakapi/services/user.go:108.78,112.2 3 0
github.com/muety/wakapi/services/user.go:114.99,117.2 2 0
github.com/muety/wakapi/services/user.go:119.106,122.96 3 0
github.com/muety/wakapi/services/user.go:127.2,127.68 1 0
github.com/muety/wakapi/services/user.go:122.96,124.3 1 0
github.com/muety/wakapi/services/user.go:124.8,126.3 1 0
github.com/muety/wakapi/services/user.go:130.85,132.2 1 0
github.com/muety/wakapi/services/user.go:134.57,141.2 4 0
github.com/muety/wakapi/services/user.go:143.38,145.2 1 0
github.com/muety/wakapi/services/user.go:147.57,152.2 1 0
github.com/muety/wakapi/services/aggregation.go:29.142,37.2 1 0
github.com/muety/wakapi/services/aggregation.go:46.43,48.37 1 0
github.com/muety/wakapi/services/aggregation.go:52.2,54.19 3 0
github.com/muety/wakapi/services/aggregation.go:48.37,50.3 1 0
github.com/muety/wakapi/services/aggregation.go:57.67,58.47 1 0
github.com/muety/wakapi/services/aggregation.go:61.2,66.40 4 0
github.com/muety/wakapi/services/aggregation.go:70.2,70.50 1 0
github.com/muety/wakapi/services/aggregation.go:75.2,75.60 1 0
github.com/muety/wakapi/services/aggregation.go:81.2,81.35 1 0
github.com/muety/wakapi/services/aggregation.go:58.47,60.3 1 0
github.com/muety/wakapi/services/aggregation.go:66.40,68.3 1 0
github.com/muety/wakapi/services/aggregation.go:70.50,72.3 1 0
github.com/muety/wakapi/services/aggregation.go:75.60,79.3 3 0
github.com/muety/wakapi/services/aggregation.go:84.109,85.24 1 0
github.com/muety/wakapi/services/aggregation.go:85.24,86.111 1 0
github.com/muety/wakapi/services/aggregation.go:86.111,88.4 1 0
github.com/muety/wakapi/services/aggregation.go:88.9,91.4 2 0
github.com/muety/wakapi/services/aggregation.go:95.80,96.33 1 0
github.com/muety/wakapi/services/aggregation.go:96.33,97.60 1 0
github.com/muety/wakapi/services/aggregation.go:97.60,99.4 1 0
github.com/muety/wakapi/services/aggregation.go:103.100,107.59 3 0
github.com/muety/wakapi/services/aggregation.go:122.2,123.16 2 0
github.com/muety/wakapi/services/aggregation.go:129.2,130.16 2 0
github.com/muety/wakapi/services/aggregation.go:136.2,137.44 2 0
github.com/muety/wakapi/services/aggregation.go:142.2,142.41 1 0
github.com/muety/wakapi/services/aggregation.go:156.2,156.12 1 0
github.com/muety/wakapi/services/aggregation.go:107.59,110.3 2 0
github.com/muety/wakapi/services/aggregation.go:110.8,110.47 1 0
github.com/muety/wakapi/services/aggregation.go:110.47,112.30 2 0
github.com/muety/wakapi/services/aggregation.go:112.30,113.43 1 0
github.com/muety/wakapi/services/aggregation.go:113.43,115.5 1 0
github.com/muety/wakapi/services/aggregation.go:117.8,119.3 1 0
github.com/muety/wakapi/services/aggregation.go:123.16,126.3 2 0
github.com/muety/wakapi/services/aggregation.go:130.16,133.3 2 0
github.com/muety/wakapi/services/aggregation.go:137.44,139.3 1 0
github.com/muety/wakapi/services/aggregation.go:142.41,143.21 1 0
github.com/muety/wakapi/services/aggregation.go:143.21,147.4 1 0
github.com/muety/wakapi/services/aggregation.go:147.9,147.62 1 0
github.com/muety/wakapi/services/aggregation.go:147.62,151.4 1 0
github.com/muety/wakapi/services/aggregation.go:159.73,162.27 3 0
github.com/muety/wakapi/services/aggregation.go:167.2,167.27 1 0
github.com/muety/wakapi/services/aggregation.go:170.2,170.12 1 0
github.com/muety/wakapi/services/aggregation.go:162.27,163.39 1 0
github.com/muety/wakapi/services/aggregation.go:163.39,165.4 1 0
github.com/muety/wakapi/services/aggregation.go:167.27,169.3 1 0
github.com/muety/wakapi/services/aggregation.go:173.69,176.27 3 0
github.com/muety/wakapi/services/aggregation.go:176.27,178.3 1 0
github.com/muety/wakapi/services/aggregation.go:181.83,196.41 5 0
github.com/muety/wakapi/services/aggregation.go:196.41,206.3 3 0
github.com/muety/wakapi/services/aggregation.go:209.34,212.2 2 0
github.com/muety/wakapi/services/heartbeat.go:21.141,28.2 1 0
github.com/muety/wakapi/services/heartbeat.go:30.72,33.2 2 0
github.com/muety/wakapi/services/heartbeat.go:35.80,40.32 3 0
@ -585,6 +706,27 @@ github.com/muety/wakapi/services/language_mapping.go:66.82,67.26 1 0
github.com/muety/wakapi/services/language_mapping.go:70.2,72.12 3 0
github.com/muety/wakapi/services/language_mapping.go:67.26,69.3 1 0
github.com/muety/wakapi/services/language_mapping.go:75.74,78.2 1 0
github.com/muety/wakapi/services/misc.go:21.126,28.2 1 0
github.com/muety/wakapi/services/misc.go:40.50,42.48 1 0
github.com/muety/wakapi/services/misc.go:46.2,48.19 3 0
github.com/muety/wakapi/services/misc.go:42.48,44.3 1 0
github.com/muety/wakapi/services/misc.go:51.51,53.16 2 0
github.com/muety/wakapi/services/misc.go:57.2,60.26 3 0
github.com/muety/wakapi/services/misc.go:66.2,68.40 2 0
github.com/muety/wakapi/services/misc.go:73.2,75.33 3 0
github.com/muety/wakapi/services/misc.go:79.2,84.17 2 0
github.com/muety/wakapi/services/misc.go:88.2,91.17 1 0
github.com/muety/wakapi/services/misc.go:95.2,95.12 1 0
github.com/muety/wakapi/services/misc.go:53.16,55.3 1 0
github.com/muety/wakapi/services/misc.go:60.26,65.3 1 0
github.com/muety/wakapi/services/misc.go:68.40,70.3 1 0
github.com/muety/wakapi/services/misc.go:75.33,78.3 2 0
github.com/muety/wakapi/services/misc.go:84.17,86.3 1 0
github.com/muety/wakapi/services/misc.go:91.17,93.3 1 0
github.com/muety/wakapi/services/misc.go:98.116,99.24 1 0
github.com/muety/wakapi/services/misc.go:99.24,100.151 1 0
github.com/muety/wakapi/services/misc.go:100.151,102.4 1 0
github.com/muety/wakapi/services/misc.go:102.9,107.4 1 0
github.com/muety/wakapi/services/summary.go:28.149,36.2 1 1
github.com/muety/wakapi/services/summary.go:40.136,43.66 2 1
github.com/muety/wakapi/services/summary.go:48.2,48.44 1 1
@ -678,135 +820,3 @@ github.com/muety/wakapi/services/summary.go:344.54,346.3 1 1
github.com/muety/wakapi/services/summary.go:351.59,353.25 2 1
github.com/muety/wakapi/services/summary.go:356.2,356.32 1 1
github.com/muety/wakapi/services/summary.go:353.25,355.3 1 1
github.com/muety/wakapi/services/user.go:21.73,28.2 1 0
github.com/muety/wakapi/services/user.go:30.74,31.40 1 0
github.com/muety/wakapi/services/user.go:35.2,36.16 2 0
github.com/muety/wakapi/services/user.go:40.2,41.15 2 0
github.com/muety/wakapi/services/user.go:31.40,33.3 1 0
github.com/muety/wakapi/services/user.go:36.16,38.3 1 0
github.com/muety/wakapi/services/user.go:44.72,45.37 1 0
github.com/muety/wakapi/services/user.go:49.2,50.16 2 0
github.com/muety/wakapi/services/user.go:54.2,55.15 2 0
github.com/muety/wakapi/services/user.go:45.37,47.3 1 0
github.com/muety/wakapi/services/user.go:50.16,52.3 1 0
github.com/muety/wakapi/services/user.go:58.76,60.2 1 0
github.com/muety/wakapi/services/user.go:62.86,64.2 1 0
github.com/muety/wakapi/services/user.go:66.58,68.2 1 0
github.com/muety/wakapi/services/user.go:70.86,72.2 1 0
github.com/muety/wakapi/services/user.go:74.61,77.2 2 0
github.com/muety/wakapi/services/user.go:79.48,81.2 1 0
github.com/muety/wakapi/services/user.go:83.102,93.93 2 0
github.com/muety/wakapi/services/user.go:99.2,99.38 1 0
github.com/muety/wakapi/services/user.go:93.93,95.3 1 0
github.com/muety/wakapi/services/user.go:95.8,97.3 1 0
github.com/muety/wakapi/services/user.go:102.73,106.2 3 0
github.com/muety/wakapi/services/user.go:108.78,112.2 3 0
github.com/muety/wakapi/services/user.go:114.99,117.2 2 0
github.com/muety/wakapi/services/user.go:119.106,122.96 3 0
github.com/muety/wakapi/services/user.go:127.2,127.68 1 0
github.com/muety/wakapi/services/user.go:122.96,124.3 1 0
github.com/muety/wakapi/services/user.go:124.8,126.3 1 0
github.com/muety/wakapi/services/user.go:130.85,132.2 1 0
github.com/muety/wakapi/services/user.go:134.57,141.2 4 0
github.com/muety/wakapi/services/user.go:143.38,145.2 1 0
github.com/muety/wakapi/services/user.go:147.57,152.2 1 0
github.com/muety/wakapi/services/aggregation.go:29.142,37.2 1 0
github.com/muety/wakapi/services/aggregation.go:46.43,48.37 1 0
github.com/muety/wakapi/services/aggregation.go:52.2,54.19 3 0
github.com/muety/wakapi/services/aggregation.go:48.37,50.3 1 0
github.com/muety/wakapi/services/aggregation.go:57.67,58.47 1 0
github.com/muety/wakapi/services/aggregation.go:61.2,66.40 4 0
github.com/muety/wakapi/services/aggregation.go:70.2,70.50 1 0
github.com/muety/wakapi/services/aggregation.go:75.2,75.60 1 0
github.com/muety/wakapi/services/aggregation.go:81.2,81.35 1 0
github.com/muety/wakapi/services/aggregation.go:58.47,60.3 1 0
github.com/muety/wakapi/services/aggregation.go:66.40,68.3 1 0
github.com/muety/wakapi/services/aggregation.go:70.50,72.3 1 0
github.com/muety/wakapi/services/aggregation.go:75.60,79.3 3 0
github.com/muety/wakapi/services/aggregation.go:84.109,85.24 1 0
github.com/muety/wakapi/services/aggregation.go:85.24,86.111 1 0
github.com/muety/wakapi/services/aggregation.go:86.111,88.4 1 0
github.com/muety/wakapi/services/aggregation.go:88.9,91.4 2 0
github.com/muety/wakapi/services/aggregation.go:95.80,96.33 1 0
github.com/muety/wakapi/services/aggregation.go:96.33,97.60 1 0
github.com/muety/wakapi/services/aggregation.go:97.60,99.4 1 0
github.com/muety/wakapi/services/aggregation.go:103.100,107.59 3 0
github.com/muety/wakapi/services/aggregation.go:122.2,123.16 2 0
github.com/muety/wakapi/services/aggregation.go:129.2,130.16 2 0
github.com/muety/wakapi/services/aggregation.go:136.2,137.44 2 0
github.com/muety/wakapi/services/aggregation.go:142.2,142.41 1 0
github.com/muety/wakapi/services/aggregation.go:156.2,156.12 1 0
github.com/muety/wakapi/services/aggregation.go:107.59,110.3 2 0
github.com/muety/wakapi/services/aggregation.go:110.8,110.47 1 0
github.com/muety/wakapi/services/aggregation.go:110.47,112.30 2 0
github.com/muety/wakapi/services/aggregation.go:112.30,113.43 1 0
github.com/muety/wakapi/services/aggregation.go:113.43,115.5 1 0
github.com/muety/wakapi/services/aggregation.go:117.8,119.3 1 0
github.com/muety/wakapi/services/aggregation.go:123.16,126.3 2 0
github.com/muety/wakapi/services/aggregation.go:130.16,133.3 2 0
github.com/muety/wakapi/services/aggregation.go:137.44,139.3 1 0
github.com/muety/wakapi/services/aggregation.go:142.41,143.21 1 0
github.com/muety/wakapi/services/aggregation.go:143.21,147.4 1 0
github.com/muety/wakapi/services/aggregation.go:147.9,147.62 1 0
github.com/muety/wakapi/services/aggregation.go:147.62,151.4 1 0
github.com/muety/wakapi/services/aggregation.go:159.73,162.27 3 0
github.com/muety/wakapi/services/aggregation.go:167.2,167.27 1 0
github.com/muety/wakapi/services/aggregation.go:170.2,170.12 1 0
github.com/muety/wakapi/services/aggregation.go:162.27,163.39 1 0
github.com/muety/wakapi/services/aggregation.go:163.39,165.4 1 0
github.com/muety/wakapi/services/aggregation.go:167.27,169.3 1 0
github.com/muety/wakapi/services/aggregation.go:173.69,176.27 3 0
github.com/muety/wakapi/services/aggregation.go:176.27,178.3 1 0
github.com/muety/wakapi/services/aggregation.go:181.83,196.41 5 0
github.com/muety/wakapi/services/aggregation.go:196.41,206.3 3 0
github.com/muety/wakapi/services/aggregation.go:209.34,212.2 2 0
github.com/muety/wakapi/services/key_value.go:14.89,19.2 1 0
github.com/muety/wakapi/services/key_value.go:21.83,23.2 1 0
github.com/muety/wakapi/services/key_value.go:25.78,27.16 2 0
github.com/muety/wakapi/services/key_value.go:33.2,33.11 1 0
github.com/muety/wakapi/services/key_value.go:27.16,32.3 1 0
github.com/muety/wakapi/services/key_value.go:36.72,38.2 1 0
github.com/muety/wakapi/services/key_value.go:40.60,42.2 1 0
github.com/muety/wakapi/services/misc.go:21.126,28.2 1 0
github.com/muety/wakapi/services/misc.go:40.50,42.48 1 0
github.com/muety/wakapi/services/misc.go:46.2,48.19 3 0
github.com/muety/wakapi/services/misc.go:42.48,44.3 1 0
github.com/muety/wakapi/services/misc.go:51.51,53.16 2 0
github.com/muety/wakapi/services/misc.go:57.2,60.26 3 0
github.com/muety/wakapi/services/misc.go:66.2,68.40 2 0
github.com/muety/wakapi/services/misc.go:73.2,75.33 3 0
github.com/muety/wakapi/services/misc.go:79.2,84.17 2 0
github.com/muety/wakapi/services/misc.go:88.2,91.17 1 0
github.com/muety/wakapi/services/misc.go:95.2,95.12 1 0
github.com/muety/wakapi/services/misc.go:53.16,55.3 1 0
github.com/muety/wakapi/services/misc.go:60.26,65.3 1 0
github.com/muety/wakapi/services/misc.go:68.40,70.3 1 0
github.com/muety/wakapi/services/misc.go:75.33,78.3 2 0
github.com/muety/wakapi/services/misc.go:84.17,86.3 1 0
github.com/muety/wakapi/services/misc.go:91.17,93.3 1 0
github.com/muety/wakapi/services/misc.go:98.116,99.24 1 0
github.com/muety/wakapi/services/misc.go:99.24,100.151 1 0
github.com/muety/wakapi/services/misc.go:100.151,102.4 1 0
github.com/muety/wakapi/services/misc.go:102.9,107.4 1 0
github.com/muety/wakapi/services/report.go:24.122,35.33 3 0
github.com/muety/wakapi/services/report.go:41.2,41.12 1 0
github.com/muety/wakapi/services/report.go:35.33,36.31 1 0
github.com/muety/wakapi/services/report.go:36.31,38.4 1 0
github.com/muety/wakapi/services/report.go:44.38,48.16 3 0
github.com/muety/wakapi/services/report.go:52.2,53.26 2 0
github.com/muety/wakapi/services/report.go:48.16,50.3 1 0
github.com/muety/wakapi/services/report.go:53.26,55.3 1 0
github.com/muety/wakapi/services/report.go:60.61,65.65 3 0
github.com/muety/wakapi/services/report.go:73.2,73.65 1 0
github.com/muety/wakapi/services/report.go:85.2,85.24 1 0
github.com/muety/wakapi/services/report.go:65.65,70.3 4 0
github.com/muety/wakapi/services/report.go:73.65,83.3 4 0
github.com/muety/wakapi/services/report.go:88.80,89.22 1 0
github.com/muety/wakapi/services/report.go:93.2,93.29 1 0
github.com/muety/wakapi/services/report.go:98.2,102.16 4 0
github.com/muety/wakapi/services/report.go:107.2,114.65 2 0
github.com/muety/wakapi/services/report.go:119.2,120.12 2 0
github.com/muety/wakapi/services/report.go:89.22,91.3 1 0
github.com/muety/wakapi/services/report.go:93.29,96.3 2 0
github.com/muety/wakapi/services/report.go:102.16,105.3 2 0
github.com/muety/wakapi/services/report.go:114.65,117.3 2 0

View File

@ -6,6 +6,7 @@ import (
conf "github.com/muety/wakapi/config"
"github.com/muety/wakapi/middlewares"
customMiddleware "github.com/muety/wakapi/middlewares/custom"
routeutils "github.com/muety/wakapi/routes/utils"
"github.com/muety/wakapi/services"
"github.com/muety/wakapi/utils"
"net/http"
@ -34,12 +35,14 @@ type heartbeatResponseVm struct {
}
func (h *HeartbeatApiHandler) RegisterRoutes(router *mux.Router) {
r := router.PathPrefix("/heartbeat").Subrouter()
r := router.PathPrefix("").Subrouter()
r.Use(
middlewares.NewAuthenticateMiddleware(h.userSrvc).Handler,
customMiddleware.NewWakatimeRelayMiddleware().Handler,
)
r.Methods(http.MethodPost).HandlerFunc(h.Post)
r.PathPrefix("/heartbeat").Methods(http.MethodPost).HandlerFunc(h.Post)
r.PathPrefix("/v1/users/{user}/heartbeats").Methods(http.MethodPost).HandlerFunc(h.Post)
r.PathPrefix("/compat/wakatime/v1/users/{user}/heartbeats").Methods(http.MethodPost).HandlerFunc(h.Post)
}
// @Summary Push a new heartbeat
@ -51,8 +54,12 @@ func (h *HeartbeatApiHandler) RegisterRoutes(router *mux.Router) {
// @Success 201
// @Router /heartbeat [post]
func (h *HeartbeatApiHandler) Post(w http.ResponseWriter, r *http.Request) {
user, err := routeutils.CheckEffectiveUser(w, r, h.userSrvc, "current")
if err != nil {
return // response was already sent by util function
}
var heartbeats []*models.Heartbeat
user := middlewares.GetPrincipal(r)
opSys, editor, _ := utils.ParseUserAgent(r.Header.Get("User-Agent"))
machineName := r.Header.Get("X-Machine-Name")

View File

@ -6,6 +6,7 @@ import (
"github.com/muety/wakapi/middlewares"
"github.com/muety/wakapi/models"
v1 "github.com/muety/wakapi/models/compat/wakatime/v1"
routeutils "github.com/muety/wakapi/routes/utils"
"github.com/muety/wakapi/services"
"github.com/muety/wakapi/utils"
"net/http"
@ -45,18 +46,14 @@ func (h *AllTimeHandler) RegisterRoutes(router *mux.Router) {
// @Success 200 {object} v1.AllTimeViewModel
// @Router /compat/wakatime/v1/users/{user}/all_time_since_today [get]
func (h *AllTimeHandler) Get(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
values, _ := url.ParseQuery(r.URL.RawQuery)
requestedUser := vars["user"]
authorizedUser := middlewares.GetPrincipal(r)
if requestedUser != authorizedUser.ID && requestedUser != "current" {
w.WriteHeader(http.StatusForbidden)
return
user, err := routeutils.CheckEffectiveUser(w, r, h.userSrvc, "current")
if err != nil {
return // response was already sent by util function
}
summary, err, status := h.loadUserSummary(authorizedUser)
summary, err, status := h.loadUserSummary(user)
if err != nil {
w.WriteHeader(status)
w.Write([]byte(err.Error()))

View File

@ -6,6 +6,7 @@ import (
"github.com/muety/wakapi/middlewares"
"github.com/muety/wakapi/models"
v1 "github.com/muety/wakapi/models/compat/wakatime/v1"
routeutils "github.com/muety/wakapi/routes/utils"
"github.com/muety/wakapi/services"
"github.com/muety/wakapi/utils"
"net/http"
@ -45,16 +46,12 @@ func (h *ProjectsHandler) RegisterRoutes(router *mux.Router) {
// @Success 200 {object} v1.ProjectsViewModel
// @Router /compat/wakatime/v1/users/{user}/projects [get]
func (h *ProjectsHandler) Get(w http.ResponseWriter, r *http.Request) {
var vars = mux.Vars(r)
requestedUser := vars["user"]
authorizedUser := middlewares.GetPrincipal(r)
if requestedUser != authorizedUser.ID && requestedUser != "current" {
w.WriteHeader(http.StatusForbidden)
return
user, err := routeutils.CheckEffectiveUser(w, r, h.userSrvc, "current")
if err != nil {
return // response was already sent by util function
}
results, err := h.heartbeatSrvc.GetEntitySetByUser(models.SummaryProject, authorizedUser)
results, err := h.heartbeatSrvc.GetEntitySetByUser(models.SummaryProject, user)
if err != nil {
w.WriteHeader(http.StatusInternalServerError)
w.Write([]byte("something went wrong"))

View File

@ -7,6 +7,7 @@ import (
"github.com/muety/wakapi/middlewares"
"github.com/muety/wakapi/models"
v1 "github.com/muety/wakapi/models/compat/wakatime/v1"
routeutils "github.com/muety/wakapi/routes/utils"
"github.com/muety/wakapi/services"
"github.com/muety/wakapi/utils"
"net/http"
@ -54,13 +55,9 @@ func (h *SummariesHandler) RegisterRoutes(router *mux.Router) {
// @Success 200 {object} v1.SummariesViewModel
// @Router /compat/wakatime/v1/users/{user}/summaries [get]
func (h *SummariesHandler) Get(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
requestedUser := vars["user"]
authorizedUser := middlewares.GetPrincipal(r)
if requestedUser != authorizedUser.ID && requestedUser != "current" {
w.WriteHeader(http.StatusForbidden)
return
_, err := routeutils.CheckEffectiveUser(w, r, h.userSrvc, "current")
if err != nil {
return // response was already sent by util function
}
summaries, err, status := h.loadUserSummaries(r)

View File

@ -5,6 +5,7 @@ import (
conf "github.com/muety/wakapi/config"
"github.com/muety/wakapi/middlewares"
v1 "github.com/muety/wakapi/models/compat/wakatime/v1"
routeutils "github.com/muety/wakapi/routes/utils"
"github.com/muety/wakapi/services"
"github.com/muety/wakapi/utils"
"net/http"
@ -42,18 +43,13 @@ func (h *UsersHandler) RegisterRoutes(router *mux.Router) {
// @Success 200 {object} v1.UserViewModel
// @Router /compat/wakatime/v1/users/{user} [get]
func (h *UsersHandler) Get(w http.ResponseWriter, r *http.Request) {
vars := mux.Vars(r)
requestedUser := vars["user"]
authorizedUser := middlewares.GetPrincipal(r)
if requestedUser != authorizedUser.ID && requestedUser != "current" {
w.WriteHeader(http.StatusForbidden)
return
wakapiUser, err := routeutils.CheckEffectiveUser(w, r, h.userSrvc, "current")
if err != nil {
return // response was already sent by util function
}
user := v1.NewFromUser(authorizedUser)
if hb, err := h.heartbeatSrvc.GetLatestByUser(authorizedUser); err == nil {
user := v1.NewFromUser(wakapiUser)
if hb, err := h.heartbeatSrvc.GetLatestByUser(wakapiUser); err == nil {
user = user.WithLatestHeartbeat(hb)
} else {
conf.Log().Request(r).Error("%v", err)

View File

@ -0,0 +1,46 @@
package utils
import (
"errors"
"github.com/gorilla/mux"
conf "github.com/muety/wakapi/config"
"github.com/muety/wakapi/middlewares"
"github.com/muety/wakapi/models"
"github.com/muety/wakapi/services"
"net/http"
)
// CheckEffectiveUser extracts the requested user from a URL (like '/users/{user}'), compares it with the currently authorized user and writes an HTTP error if they differ.
// Fallback can be used to manually set a value for '{user}' if none is present.
func CheckEffectiveUser(w http.ResponseWriter, r *http.Request, userService services.IUserService, fallback string) (*models.User, error) {
var vars = mux.Vars(r)
var authorizedUser, requestedUser *models.User
if vars["user"] == "" {
vars["user"] = fallback
}
authorizedUser = middlewares.GetPrincipal(r)
if authorizedUser != nil {
if vars["user"] == "current" {
vars["user"] = authorizedUser.ID
}
}
requestedUser, err := userService.GetUserById(vars["user"])
if err != nil {
err := errors.New("user not found")
w.WriteHeader(http.StatusNotFound)
w.Write([]byte(err.Error()))
return nil, err
}
if authorizedUser == nil || authorizedUser.ID != requestedUser.ID {
err := errors.New(conf.ErrUnauthorized)
w.WriteHeader(http.StatusUnauthorized)
w.Write([]byte(err.Error()))
return nil, err
}
return authorizedUser, nil
}

View File

@ -1,3 +1,3 @@
#!/bin/bash
docker run -d -p 3306:3306 -e MYSQL_ROOT_PASSWORD=secretpassword -e MYSQL_DATABASE=wakapi_local -e MYSQL_USER=wakapi_user -e MYSQL_PASSWORD=wakapi --name wakapi-mysql mysql:5
docker run -d -p 3306:3306 -e MYSQL_ROOT_PASSWORD=secretpassword -e MYSQL_DATABASE=wakapi_local -e MYSQL_USER=wakapi_user -e MYSQL_PASSWORD=wakapi --name wakapi-mysql mysql:8

View File

@ -1 +1 @@
1.27.1
1.27.2

View File

@ -69,6 +69,7 @@
<li><span class="iconify inline text-green-700" data-icon="ant-design:check-square-filled"></span> &nbsp; Built by developers for developers</li>
<li><span class="iconify inline text-green-700" data-icon="ant-design:check-square-filled"></span> &nbsp; Fancy statistics and plots</li>
<li><span class="iconify inline text-green-700" data-icon="ant-design:check-square-filled"></span> &nbsp; Cool badges for readmes</li>
<li><span class="iconify inline text-green-700" data-icon="ant-design:check-square-filled"></span> &nbsp; Weekly e-mail reports</li>
<li><span class="iconify inline text-green-700" data-icon="ant-design:check-square-filled"></span> &nbsp; Intuitive REST API</li>
<li><span class="iconify inline text-green-700" data-icon="ant-design:check-square-filled"></span> &nbsp; Compatible with <a href="https://wakatime.com" target="_blank" rel="noopener noreferrer" class="underline">Wakatime</a></li>
<li><span class="iconify inline text-green-700" data-icon="ant-design:check-square-filled"></span> &nbsp; <a href="https://prometheus.io" target="_blank" rel="noopener noreferrer" class="underline">Prometheus</a> metrics</li>

View File

@ -192,7 +192,7 @@
# <strong>Step 2:</strong> Adapt your config<br>
$ vi ~/.wakatime.cfg<br>
# Set <em>api_url = <span class="with-url-inner">%s/api/heartbeat</span></em><br>
# Set <em>api_url = <span class="with-url-inner">%s/api</span></em><br>
# Set <em>api_key = <span id="api-key-instruction"></span></em><br><br>
# <strong>Step 3:</strong> Start coding and then check back here!