Commit Graph

56 Commits

Author SHA1 Message Date
536b5909c8
go,tmpl: use CSRF token in relevant places
All checks were successful
continuous-integration/drone/push Build is passing
2023-08-05 21:43:45 +02:00
eb555cfcad
go: add + use sessionMaxAge
Some checks failed
continuous-integration/drone/push Build is failing
2023-08-04 18:28:56 +02:00
leo
31e86833aa
MiddlewareSession: simplify logic
All checks were successful
continuous-integration/drone/push Build is passing
2023-06-04 12:07:07 +02:00
leo
3cacea8c1f
signin.go: change login failed msg
All checks were successful
continuous-integration/drone/push Build is passing
2023-06-04 11:57:47 +02:00
leo
ce383b5818
refactor: mv ctx to a later point
All checks were successful
continuous-integration/drone/push Build is passing
2023-06-04 11:36:07 +02:00
leo
afc97407f6
healthz: use proper JSON
All checks were successful
continuous-integration/drone/push Build is passing
2023-06-04 11:32:57 +02:00
leo
5f8548958f
go: add usr updating [wip]
All checks were successful
continuous-integration/drone/push Build is passing
2023-06-02 20:00:14 +02:00
leo
32aa8d8852
go: add+enable compression middleware
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-31 22:42:50 +02:00
leo
ffc9b74c75
go: add a simple caching middleware for assets
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-31 22:29:52 +02:00
leo
dbd0e9d01d
go: implement session auth middleware
All checks were successful
continuous-integration/drone/push Build is passing
* simplify protection of endpoints
* role discernment still occures in respective handlers
* db client needs to be passed into handlers as a global var now
2023-05-30 23:50:37 +02:00
leo
1f11b71341
user-mgmt: clear err messages + page rendering
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-30 21:08:34 +02:00
leo
ae5c4f1dd4
go,tmpl: add usr details listing
All checks were successful
continuous-integration/drone/push Build is passing
* add tmpl
* add handler for route /manage/user/:id
* add convenience helper func
* handle not found/invalid uuid errors
2023-05-29 22:42:18 +02:00
leo
e2a29fa692
handlers,tmpl: render+log signin better errors
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-28 22:47:10 +02:00
leo
e0a7656b2b
handlers(types): add validation
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-28 18:57:37 +02:00
leo
547f6e7b3c
add user creation
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-22 06:47:33 +02:00
leo
97ea29d043
add user listing
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-22 03:22:58 +02:00
leo
3a2f85f683
feat: add license headers (+spdx id)
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-20 20:15:57 +02:00
leo
be1709794a
fix(session panic): check if nil before use
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-16 13:49:02 +02:00
leo
695039e882
handlers(echo): use c.Bind in sign{in,up}
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-15 23:57:38 +02:00
leo
31ab083f8a
handlers: add health-check endpoints
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-13 22:33:38 +02:00
leo
b77c2fe941
handlers: add func addHeaders
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-11 23:50:40 +02:00
leo
1fb7479d8e
slogger: rename Logger to Slogger
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-11 17:06:20 +02:00
leo
a385b194b9
handlers/home: render success with StatusOK
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-11 05:07:53 +02:00
leo
468e20da0a
handlers/index: refactor to use c.Render
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-11 05:01:19 +02:00
leo
f80e06078a
handlers/home: redirect w/ 303 instead of 301
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-11 04:55:56 +02:00
leo
847d4aab22
handlers: rename helper.go -> error.go
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-11 04:54:31 +02:00
leo
122ea638c9
go: refactor template rendering
All checks were successful
continuous-integration/drone/push Build is passing
* create pkg 'modules/template'
* move template rendering code from 'handlers' to 'modules/template'
* update call sites
* walk the 'templates' dir to discover nested hierarchies
* solidify LiveMode handling (vs embedded assets)
* break out funcMap to it's own file
* general clean-up
2023-05-11 04:32:39 +02:00
leo
46cc1d663f
go(handlers): split get,set funcMap funcs
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-10 19:17:17 +02:00
leo
2215383c5d
go: refactor handlers
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-10 19:09:41 +02:00
leo
a879704535
go: partially rework how slogging works
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-09 17:35:00 +02:00
leo
0490786f11
refactor(handlers): break out signin funcs
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-07 00:19:10 +02:00
leo
9dbc475145
go: implement the Echo renderer for templates
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-06 21:50:35 +02:00
leo
c4f8cf87f5
go: redirect signed users from / to /home
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-06 00:09:13 +02:00
leo
eafc9c1e92
go,tmpl: conditionally show content to users
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-06 00:03:41 +02:00
leo
4dad751716
handlers: rm pages.go [skip ci] 2023-05-05 19:58:35 +02:00
leo
a2c17693c6
go: save,verify a bcrypt hash of the passwd
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-03 06:30:12 +02:00
leo
864e2ec815
handlers.go: change msg log level
All checks were successful
continuous-integration/drone/push Build is passing
2023-05-03 06:03:38 +02:00
leo
c4d0cb209b
go: add settings struct
All checks were successful
continuous-integration/drone/push Build is passing
* let the settings struct be the single source of truth
* rm app fields that are covered by settings
* pass around a pointer to settings instead of config
* consolidate config+flags into settings on start-up
* update tests
* rm empty settings.go file

fixes #4
2023-05-03 02:18:29 +02:00
leo
593454d616
go: add user email handling + improve sessions
All checks were successful
continuous-integration/drone/push Build is passing
* add Email field to User entity (+codegen)
* switch to Echo contrib sessions backed by Gorilla sessions
* use SessionCookieSecret value from the config
* stage mod,sum changes
* add clearer signup/signin redirect logic
* render error pages on 500/404s and only fall back to returning raw
  errors when the error is some unexpected kind
* add username/email "exists" funcs+tests - handle "not found" and "not
  unique" errors, return errors otherwise
2023-05-01 22:48:11 +02:00
leo
1d421465f5
go: have a dynamic {asset,tmpl}Path
All checks were successful
continuous-integration/drone/push Build is passing
* handle errors more specifically when loading assets/tmpls
2023-04-28 23:16:58 +02:00
leo
555bc65502
handlers: update error handling
All checks were successful
continuous-integration/drone/push Build is passing
* have a common error page tmpl
2023-04-21 12:33:14 +02:00
leo
edf720bcb9
go: create proper (non-string) ctx key in user pkg
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 23:44:49 +02:00
leo
f00b5bdaf8
handlers: add a TODO [skip ci] 2023-04-19 23:23:22 +02:00
leo
aa63dafad4
go(handlers): add bluemonday HTML sanitiser
All checks were successful
continuous-integration/drone/push Build is passing
should aid at thwarting XSS.
2023-04-19 22:46:20 +02:00
leo
25335293eb
chore: clean up handlers pkg
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 22:08:17 +02:00
leo
c6378d7dd3
pass logger ctx under key 'l'
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 05:18:01 +02:00
leo
608b0952b2
handlers: clean up
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 04:45:49 +02:00
leo
773b10e60b
handlers: handle err on redirects
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 04:09:24 +02:00
leo
ff252df692
handlers: streamline SignupPost
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 04:01:03 +02:00
leo
62e038fa3e
simplify: funcMap member func
All checks were successful
continuous-integration/drone/push Build is passing
2023-04-19 03:57:07 +02:00