Commit Graph

694 Commits

Author SHA1 Message Date
pancho horrillo
3a47b34bc1 Drop stale GetReason() and associated tests 2019-11-20 04:54:07 +01:00
pancho horrillo
b40f73115f Add missing comment to GetReasonFromBody() 2019-11-20 04:51:29 +01:00
pancho horrillo
b130cfdec7 Add some examples
Note that the example on redirecting a URL is BROKEN.  Possibly a bug in Kapow!
2019-11-19 21:52:10 +01:00
pancho horrillo
81c677c3be internal/http/request.go: replace GetReason() with GetReasonFromBody()
Update tests to inject the required JSON error body with reason.
2019-11-19 21:17:49 +01:00
pancho horrillo
e7619238ae Add GetReasonFromBody() that extracts reason from JSON 2019-11-19 21:17:34 +01:00
pancho horrillo
28f4b969f9 Update go.{mod,sum} recreating them from scratch
$ rm go.{mod,sum}; go mod init github.com/BBVA/kapow
go: creating new go.mod: module github.com/BBVA/kapow
$ go mod tidy -v
go: finding github.com/google/shlex latest

With this, we've gotten rid an unneeded dep (github.com/spf13/pflag @ v1.0.5).
2019-11-19 17:50:16 +01:00
pancho horrillo
806905c49c Update go.{mod,sum}
Set base version to go 1.13

and run:

$ go mod tidy -v
unused github.com/gogo/protobuf
unused github.com/golangci/gocyclo
unused github.com/golangci/golangci-lint
unused github.com/golangci/revgrep
unused github.com/gostaticanalysis/analysisutil
unused github.com/konsorten/go-windows-terminal-sequences
unused github.com/magiconair/properties
unused github.com/mattn/go-isatty
unused github.com/pelletier/go-toml
unused github.com/securego/gosec
unused github.com/spf13/afero
unused github.com/spf13/jwalterweatherman
unused github.com/uudashr/gocognit
unused golang.org/x/sys
unused golang.org/x/tools
unused mvdan.cc/unparam
unused sourcegraph.com/sqs/pbtypes
2019-11-19 17:32:28 +01:00
Roberto Abdelkader Martínez Pérez
4492bfdf54 Finish merge and recover README 2019-11-19 16:50:41 +01:00
Roberto Abdelkader Martínez Pérez
5462dd4323 Merge branch 'feature-new-doc' 2019-11-19 16:37:22 +01:00
pancho horrillo
83e4523dc7 Simplify files via gofmt -s (thanks, Go Report Card!) 2019-11-19 14:14:55 +01:00
pancho horrillo
92fbb72735 Fix typos catched via misspell (thanks Go Report Card!) 2019-11-19 14:07:58 +01:00
Roberto Abdelkader Martínez Pérez
12106338b0 Merge remote-tracking branch 'origin/master' into feature-new-doc 2019-11-19 13:02:48 +01:00
Roberto Abdelkader Martínez Pérez
2313b2b933 Update working with forms 2019-11-19 13:00:13 +01:00
Roberto Abdelkader Martínez Pérez
4144e2be9e Update working_with_forms.rst 2019-11-19 12:49:27 +01:00
Roberto Abdelkader Martínez Pérez
0e9bf9ff54 Working with forms example 2019-11-19 12:45:17 +01:00
Roberto Abdelkader Martínez Pérez
bc917ff166 Update README.rst 2019-11-19 11:03:42 +01:00
Roberto Abdelkader Martínez Pérez
c82cfd5bc2 Go Report Card badge 2019-11-19 09:30:06 +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
pancho horrillo
1249b23458 Fix case mismatch in error JSON (adding tag) 2019-11-18 17:44:39 +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
Héctor Hurtado
edff842c3b New srverrors package added. New error handling added to control package 2019-11-18 14:32:54 +01:00
Roberto Abdelkader Martínez Pérez
2c32daedcb Default value in case there is no header 2019-11-18 10:31:00 +01:00
pancho horrillo
402bbf00d7 Fix style in comment 2019-11-15 21:00:21 +01:00
Roberto Abdelkader Martínez Pérez
0397ad647f Update README.rst 2019-11-15 13:33:34 +01:00
Roberto Abdelkader Martínez Pérez
6b3413a8d4 Documentation WIP 2019-11-15 13:31:43 +01:00
pancho horrillo
3af5def406 poc: make error_body(reason) return a JSON with extraneous fields
We then ensure that the cucumber steps only test the
presence of the required fields, not just comparing it byte-wise.

Co-authored-by: Roberto Abdelkader Martínez Pérez <robertomartinezp@gmail.com>
2019-11-14 17:40:47 +01:00
pancho horrillo
03de51e6ca Fix missing quotes in step
Co-authored-by: César Gallego Rodríguez <cesar.gallego.next@bbva.com>
Co-Authored-By: Roberto Abdelkader Martínez Pérez <robertomartinezp@gmail.com>
2019-11-14 17:13:34 +01:00
Héctor Hurtado
ee9bb8df9c New error handling in poc and features 2019-11-14 15:05:19 +01:00
pancho horrillo
9ebc989bc7 poc/Makefile: add 'fix' target (mirroring spec/Makefile) 2019-11-14 17:53:32 +01:00
pancho horrillo
3e2bc44c0b spec/Makefile: on fix target, skip tagged scenarios and features
Co-authored-by: Roberto Abdelkader Martínez Pérez <robertomartinezp@gmail.com>
2019-11-14 17:53:02 +01:00
Héctor Hurtado
e6b779dfbb Specification modified to include changes in error responses 2019-11-14 13:51:16 +01:00
Héctor Hurtado
ec788f68c2 Added documentation comments to the control package 2019-11-14 12:10:00 +01:00
pancho horrillo
f43e47f4f1 Remove leftover script 2019-11-14 11:57:44 +01:00
Roberto Abdelkader Martínez Pérez
ffeb668ea9 Fix readthedocs compilation 2019-11-14 10:34:36 +01:00
Roberto Abdelkader Martínez Pérez
95a6c7597f Sphinx documentation quickstart plus README.md and README.rst merge. 2019-11-14 10:12:29 +01:00
Héctor Hurtado
0618e55ce0 New documentation. Resume, short example and intallation 2019-11-13 21:18:30 +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
Roberto Abdelkader Martínez Pérez
19bc0df968 Old poc examples were full of injections due to migration strategy. Will be rewritten in doc. 2019-11-12 13:16:30 +01:00
Roberto Abdelkader Martínez Pérez
049081c8b0 Update topdf 2019-11-12 13:06:31 +01:00
Roberto Abdelkader Martínez Pérez
1566dcf30f Sanitize input 2019-11-12 13:05:25 +01:00
Roberto Abdelkader Martínez Pérez
653fc3eb32 Escape input 2019-11-12 13:04:29 +01:00
pancho horrillo
822e4f85df spec: clarify the order of the execution of the tests
Co-authored-by: Roberto Abdelkader Martínez Pérez <robertomartinezp@gmail.com>
2019-11-11 18:02:07 +01:00
pancho horrillo
6194c6961a Tweak PoC to pass current test suite
Co-authored-by: Roberto Abdelkader Martínez Pérez <robertomartinezp@gmail.com>
2019-11-11 17:47:28 +01:00
pancho horrillo
e4606ab84a Drop compound error scenario
In order to allow different Kapow! implementations (Go, Python, ...)
compound errors will be left as implementation-dependent.
The spec will only test for simple error conditions.

Co-authored-by: Roberto Abdelkader Martínez Pérez <robertomartinezp@gmail.com>
2019-11-11 17:47:28 +01:00
pancho horrillo
9eb186bd0f Revert "Closes: #66"
This reverts commit c3be29255a.

Co-authored-by: Roberto Abdelkader Martínez Pérez <robertomartinezp@gmail.com>
2019-11-11 17:47:20 +01:00
Roberto Abdelkader Martínez Pérez
19f7cb0171 Revert "Removed references to reason phrase from spec". Closes #66
This reverts commit d9e072f89a.
2019-11-11 16:39:21 +01:00
pancho horrillo
fe303d4d02 README.rst: Fix heading 2019-11-03 23:39:21 +01:00
pancho horrillo
28f0ae03d5 doc: misc fixes and tweaks
* doc/README.md:
  - Fix a couple of typos.
  - Fix spacing and shell quote style (for consistency with other markdown docs
  already in the tree).
  - Fix indent with spaces not tabs in heredocs with <<- style¹.
  - Fix shell example partially inserted twice.

* doc/*.pow:
  - Fix indent with spaces not tabs in heredocs with <<- style¹.

¹: See the last paragraph in
https://www.gnu.org/savannah-checkouts/gnu/bash/manual/bash.html#Here-Documents

"If the redirection operator is ‘<<-’, then all leading tab characters
are stripped from input lines and the line containing delimiter. This allows
here-documents within shell scripts to be indented in a natural fashion."
2019-10-31 18:49:48 +01:00
pancho horrillo
0639b3af50 spec: add missing empty line 2019-10-31 18:45:48 +01:00