pancho horrillo
41be4f9344
refactor: use a common logger for consistency
...
All kapow messages will end up in stderr (incl. debug mode).
stdout is reserved for the access logs.
Co-authored-by: Roberto Abdelkader Martínez Pérez <robertomartinezp@gmail.com >
2020-12-16 17:29:26 +01:00
Héctor Hurtado
c7567fb4cc
Fix getSSLClietnDN returns DN instead CN
2020-09-11 11:18:11 +02:00
Héctor Hurtado
a17cc4838d
Add ssl/client/i/dn resource. Closes #113
2020-09-10 16:35:41 +02:00
Héctor Hurtado
6d24cc4d2d
Fix typo getRequestId -> getRouteId
2020-09-10 12:44:58 +02:00
Héctor Hurtado
9a78bddcc4
Change tests for getRequestId to validate against passed value
2020-09-10 12:41:04 +02:00
Héctor Hurtado
66b227e67b
Fix error getting HTTP version in getRequestVersion
2020-09-10 12:30:58 +02:00
Héctor Hurtado
99871de601
Fix error getting remote address in getRequestRemote
2020-09-10 12:07:25 +02:00
Héctor Hurtado
5c1a00e340
getRequestHeaders returns value for Host header. Fixes #78
2020-09-09 14:13:44 +02:00
Héctor Hurtado
6c3bee9ae0
Add route/id resource. Closes #10
2020-09-09 14:12:53 +02:00
Héctor Hurtado
774b9202b5
Add routes for /request/version and /request/remote in data server. Add resource tree documentation for /request/version and /request/remote. Closes #85
2020-09-09 14:11:46 +02:00
Héctor Hurtado
fc19b921be
Add request/remote resource
2020-09-09 08:53:40 +02:00
Héctor Hurtado
9988d0e0d4
Add request/version resource
2020-09-08 15:27:51 +02:00
pancho horrillo
975aea88ae
fix: prevent spurious stack trace with misbehaving clients
...
See 9997545a86
and the previous commit.
Co-authored-by: César Gallego Rodríguez <gallego.cesar@gmail.com >
2020-05-11 15:57:25 +02:00
pancho horrillo
13adcc37b6
fix: panic sentinel value if http client misbehaves
...
When an http client does not consume the whole body, we panic'ed a
custom message instead of the required sentinel value.
For the details, check ¹ and look for ErrAbortHandler.
¹: https://pkg.go.dev/net/http
Co-authored-by: César Gallego Rodríguez <gallego.cesar@gmail.com >
2020-05-11 13:59:09 +02:00
Héctor Hurtado
e1788b2874
Default handlers for NotFound and MethodNotAllowed returning json reason added to control y data servers
2020-04-07 12:22:15 +02:00
Héctor Hurtado
e6e25f25c7
Fix #102
2020-04-06 18:02:29 +02:00
Héctor Hurtado
73ef493f04
cmd/server sets now environment variables KAPOW_DATA_URL and KAPOW_CONTROL_URL
...
Remove golinter error S1036: unnecessary guard around map access in
spawn package
2020-04-03 21:42:42 +02:00
pancho horrillo
206aac5747
Rename package srverrors to httperror
...
- Package names are preferred to be in singular form¹.
- Since errors are just for HTTP and not generic, I changed the base name to
'http'.
- I didn't name it simply 'error', because it would then conflict with the
- standard 'error' interface.
¹: https://rakyll.org/style-packages/
2019-11-20 07:54:45 +01:00
pancho horrillo
0d66fe9963
Rename WriteErrorResponse() to simply ErrorJSON() and reorder arguments
...
This way we better mimic net/http.Error()
https://pkg.go.dev/net/http?tab=doc#Error
2019-11-20 07:37:35 +01:00
pancho horrillo
7ea43048bc
Add missing comments
2019-11-20 07:14:00 +01:00
pancho horrillo
92fbb72735
Fix typos catched via misspell (thanks Go Report Card!)
2019-11-19 14:07:58 +01:00
Héctor Hurtado
7bca5b8577
New error handling added to module resource in package data. Minor coding improvements.
2019-11-18 19:09:55 +01:00
Héctor Hurtado
4c7eae8ebb
New error handling added to getRequestBody function in data package
2019-11-18 15:01:02 +01:00
Héctor Hurtado
e4b3a4f718
New error handling added to server and decorator module in data package
2019-11-18 14:52:52 +01:00
pancho horrillo
2d5743af84
Add blank line between legal header and package declaration
...
Otherwise, the legal header is rendered as package documentation.
2019-11-13 18:18:44 +01:00
Héctor Hurtado
84a71815e4
FIXES : #44
2019-10-24 10:44:57 +02:00
Héctor Hurtado
723e4787b3
Added legal header to all Go source files
2019-10-23 13:35:01 +02:00
Roberto Abdelkader Martínez Pérez
d465d10b49
Add missing pattern in data server resource endpoints
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-22 13:16:06 +02:00
Roberto Abdelkader Martínez Pérez
0762728ef5
Remove unused dependency
2019-10-22 12:24:10 +02:00
Roberto Abdelkader Martínez Pérez
8994b8da8c
Implement Run function for data server.
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-22 10:22:10 +02:00
Roberto Abdelkader Martínez Pérez
6a05b31320
Implement configRouter
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-22 09:48:58 +02:00
Roberto Abdelkader Martínez Pérez
5eae018ee6
Data server decorators implementation.
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-21 17:54:47 +02:00
Roberto Abdelkader Martínez Pérez
63cd125327
Implement setResponseBody
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-21 10:25:34 +02:00
Roberto Abdelkader Martínez Pérez
0f8d0266b9
Implement setResponseCookies.
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-21 10:01:34 +02:00
Roberto Abdelkader Martínez Pérez
ffc737d1b7
Pending test for header validation.
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-21 09:26:56 +02:00
Roberto Abdelkader Martínez Pérez
5e2a15b34e
Relax lint error about SA1008 because is actually needed in tests
2019-10-18 23:57:12 +02:00
Roberto Abdelkader Martínez Pérez
ecfa3dfa74
WIP implementation of setResponseHeaders
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-18 14:11:56 +02:00
Roberto Abdelkader Martínez Pérez
03e138396d
Fix mispelled handler name.
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-18 13:15:08 +02:00
Roberto Abdelkader Martínez Pérez
bf791a36c6
Implement setResponseStatus.
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-18 13:07:57 +02:00
Roberto Abdelkader Martínez Pérez
e161e14fd6
Implement getRequestFiles.
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-18 10:06:26 +02:00
Roberto Abdelkader Martínez Pérez
d2427b722c
Implement getRequestFileName
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-18 09:22:58 +02:00
Héctor Hurtado
06c1c49d8e
First test for files feature
2019-10-18 08:35:33 +02:00
Roberto Abdelkader Martínez Pérez
efaa0ba375
Implement getRequestForm.
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-17 17:16:04 +02:00
Roberto Abdelkader Martínez Pérez
f5d7521a45
Implement getRequestCookies
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-17 15:35:29 +02:00
Roberto Abdelkader Martínez Pérez
cfac3fafaa
Make the tests great again.
2019-10-17 15:03:35 +02:00
Roberto Abdelkader Martínez Pérez
635d2c31a7
Implemented getRequestHeaders
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-17 14:59:34 +02:00
Héctor Hurtado
92e1658844
Added tests for getHeaders feature Co-authored-by: Roberto Abdelkader Martínez Pérez <robertomartinezp@gmail.com>
2019-10-17 13:37:15 +02:00
Roberto Abdelkader Martínez Pérez
0a171a8232
Some data server handlers
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-17 12:49:05 +02:00
Roberto Abdelkader Martínez Pérez
2e4a3a0bf7
Remove old implentation
...
Co-authored-by: Hector Hurtado <hector.hurtado@bbva.com >
2019-10-17 10:02:53 +02:00
Héctor Hurtado
93dfe9ef7b
Finished last test case; over, embarrassing but over
2019-10-10 22:33:17 +02:00