Denis Arh
8309e6e710
Fix multival (string) requst param parsing (for POST)
2019-06-21 14:23:12 +02:00
Denis Arh
5c750fb7cf
Fix handler/request codegens
...
Missing return caused malformed response output:
{"error":{"message":"invalid username/password combination"}}{"response":false}
Remove param logging when params.Fill() returns an error
2019-05-28 10:51:56 +02:00
Denis Arh
22476933f4
Improve cli env setup & running
2019-05-26 08:41:20 +02:00
Denis Arh
b732894109
Fix codegen and its outputs
2019-05-24 12:46:30 +02:00
Tit Petric
4c166d92c6
Update codegen for cleanup/less verbosity
2019-05-22 16:37:53 +02:00
Denis Arh
94d459eb7d
Rename handlers/request receivers
2019-05-16 00:52:50 +02:00
Denis Arh
1c1643fbe7
Add support for auditable params
...
With Auditable() func on request structs we can now be more selective
about params we want to log:
- sensitive data (with sensitive flag on params)
- filesize & name on uploads
2019-05-16 00:43:54 +02:00
Denis Arh
aea9741a2b
Improve logging, migrate to zap, use requestID
...
- migrate from log to go.uber.org/zap package
- add requestID header with sticky log field
- push logging via context to REST controllers & HTTP middleware
- enhance request/resnpose logging
- add service logging framework
- add ZapProfiler for db query profiling
2019-05-07 21:18:23 +02:00
Tit Petric
2cca75cb1d
upd(codegen): check for func(w,r) in http handlers return
2019-04-26 22:11:28 +02:00
Denis Arh
4763ca863f
Better support for array get params in request parsers
...
We now support `&var=1&var=2` and (or!) `&var[]=1&var[]=2`.
2019-04-26 09:32:16 +02:00
Tit Petric
a1aadeaa2f
upd(codegen): custom types, camel case structs
2019-04-03 14:38:13 +02:00
Denis Arh
79229ef1f1
Append suffix to receiver name to avoid naming colision
...
Names starting with letter r colided with r for *http.Request
2019-02-28 23:51:36 +01:00
Tit Petric
eb9869bcdf
upd(codegen): special handling of *Set types
2018-12-04 16:36:52 +01:00
Tit Petric
43554592e4
upd(codegen): enable imports with requests
2018-12-04 15:26:51 +01:00
Tit Petric
71fb80945a
fix(codegen): rbac.Operations is a type
2018-12-04 14:38:31 +01:00
Tit Petric
f2dfffbab2
update:
...
- codegen includes rbac since it's used everywhere,
- update permissions structure naming for title/subtitle
2018-12-04 14:38:31 +01:00
Tit Petric
6c2d11c050
upd(codegen): keep readme indentation
2018-11-25 13:04:48 +01:00
Tit Petric
d1fba3b3b1
add(codegen): docs codegen for all
2018-11-05 13:37:18 +01:00
Tit Petric
e36621f016
upd(all): parse uint64 from post arrays
2018-10-25 12:10:35 +02:00
Tit Petric
31c38f683c
upd(all): json []uint64 should also be encoded as str
2018-10-25 10:52:13 +02:00
Denis Arh
6ea52301f4
Fix multipart codegen
2018-10-22 13:24:04 +02:00
Tit Petric
803b72d979
fix(sam): codegen for multipart, gofmt service
2018-10-22 11:12:32 +02:00
Tit Petric
e259a949b8
upd(all): codegen uint64 types with string encoding
2018-10-16 18:12:04 +02:00
Denis Arh
0400451823
Add upload/attachment capabilities
2018-09-08 22:04:36 +02:00
Tit Petric
30d12b4041
upd(codegen): update some basic templates
2018-09-04 15:38:05 +02:00
Tit Petric
ffa5f9995d
upd(all): return error on parsing json body
2018-09-04 10:13:37 +02:00
Tit Petric
ec2213bf61
fix(crm,sam): vars come through path, get, post
2018-09-04 09:45:19 +02:00
Denis Arh
4f6bf888bb
Parse JSON from request payload only when is set to
2018-09-03 07:14:53 +02:00
Tit Petric
0a8a33f1db
add(codegen): parseJSONText parser
2018-09-02 22:35:39 +02:00
Tit Petric
bb02b827de
upd(codegen): close request body, parse body as json
2018-09-02 21:34:41 +02:00
Tit Petric
ca47286a60
upd(codegen): refactor for handlers/requests separation
2018-08-29 17:20:46 +02:00
Tit Petric
1b2a9d8f37
upd(codegen): add json to spec gen, omitempty
2018-08-23 11:05:44 +00:00
Tit Petric
d2f0ab908b
upd(codegen): re-add minimal type generation
2018-08-15 18:08:39 +02:00
Denis Arh
5a347dddb5
Types structs reduced & simplified
2018-07-29 16:37:41 +02:00
Denis Arh
d886a98740
Implements JWT authorization along with some refactoring
...
- introduces auth package, for common (sam, crm) auth handlers
- routes are now generated inside server package, each handler got its own MountRoutes(r chi.Router, middlewares ...func(http.Handler) http.Handler)
- there MountRoute methods are now called from non-generated code so we can inject services to (rest) controllers
2018-07-26 20:12:14 +02:00
Denis Arh
c11a1a74d1
Prevent codegen from doing empty type() when no struct is defined
2018-07-19 22:32:54 +02:00
Tit Petric
efecfd31b8
Merge branch 'master' of https://github.com/crusttech/crust
2018-07-19 20:24:50 +02:00
Tit Petric
8ae57475e0
del(codegen): remove route debug
2018-07-19 20:21:53 +02:00
Denis Arh
ff79246202
Fix codegen template for rest controllers, remove obsolete code
2018-07-19 19:09:07 +02:00
Denis Arh
922cd6af35
Fix govet warning 'composite literal uses unkeyed fields'
2018-07-19 18:50:53 +02:00
Tit Petric
2222c53158
upd(generator): add docs from spec files
2018-07-19 16:39:09 +02:00
Tit Petric
235574bf42
upd(all): pass context from http request to service bridge
2018-07-17 12:23:57 +02:00
Tit Petric
5aae6e9001
upd(all): move rest implementation into subpkg
2018-07-16 00:35:01 +02:00
Tit Petric
b68337c111
upd(codegen): generate subpackages
2018-07-16 00:13:45 +02:00
Tit Petric
837c10e448
update(all): moved codegen to root /codegen
2018-07-13 17:47:05 +02:00