Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go validation #7

Merged
merged 30 commits into from
Jul 5, 2024
Merged

Go validation #7

merged 30 commits into from
Jul 5, 2024

Conversation

TheTeaCat
Copy link
Member

No description provided.

@TheTeaCat TheTeaCat self-assigned this Aug 9, 2023
@muhammadn
Copy link
Collaborator

I took a look here: https://github.com/helmut-jacob/jsonschema-c

Unfortunately the implementation is very old.

So i see, you are going to call Go function from C via FFI?

@TheTeaCat
Copy link
Member Author

Yeah, we've got a Go library here:

https://github.com/FireTail-io/firetail-go-lib

I'm going to try and make use of the middleware func there.

TheTeaCat and others added 21 commits January 31, 2024 14:23
* add changes to load spec in c

* finish up code end of the day

* fix lint errors for firetail module

* Add Request Validation and Code Cleanup

* Cleanup unused code to avoid all the noise
* Add Request Validation

* lint

* curl cleanups and change firetail backend url to prod

* lint (again)

* write code for request

* Format

* Add /profile/alice and bob

* Initial docs for request and response validation

* buffer header and response

* commit working code

* lint

* small fixes

* last commit of the day

* formatting

* formatting

* set original variable declaration

* fix malformed request caused by premature kNextResponseBodyFilter

* revert dockerfile to stable nginx release, update go.sum

* fix all other methods in request handlers like POST/PUT/PATCH/etc..

* fix lint issues

* Add post comment & proxy endpoint

* use real method name for request/response

* add response from /profile/bob to readme

* fix code styling

* Format

* Fix some crossed wires in ValidateRequestBody

* complete with request validation

* remove debug code

* Mark comment property as required in appspec

* add header validation

* fix styling

* fix styling again

* remove commented code from go lib

* code cleanups

* more cleanups

* rewrite some code

* Major fixes

* Fixed a bug where the REQUEST validation was bypassed with a POST request without a body
* Added validation for request headers

* fix lint issues

* should be in access phase and not preaccess phase

* ignore vim files

* fix a bug where a valid request get an incorrect response

* proper naming of functions

* fix lint issues

* add missing proxy path that should be there

* update appspec

* fix a bug where GET requests cause nginx to crash

* fix lint

* Cleanups and removal old request filter code

* fix lint issues

* Remove some dead code

* Doc request validation

* Disable nginx debug logging

---------

Co-authored-by: theteacat <joshua@firetail.io>
@muhammadn muhammadn marked this pull request as ready for review January 31, 2024 06:28
@TheTeaCat TheTeaCat removed the request for review from rileyfiretail February 13, 2024 13:20
* Rewrite the nginx module to use the Go library as the client.
* Use a defined URL for firetail backend in nginx configuration
src/nginx_module/filter_response_body.c Outdated Show resolved Hide resolved
src/nginx_module/filter_response_body.c Outdated Show resolved Hide resolved
src/nginx_module/filter_response_body.c Outdated Show resolved Hide resolved
src/nginx_module/filter_response_body.c Outdated Show resolved Hide resolved
src/nginx_module/filter_response_body.c Outdated Show resolved Hide resolved
src/nginx_module/firetail_module.c Show resolved Hide resolved
src/nginx_module/filter_response_body.c Outdated Show resolved Hide resolved
@rileyfiretail rileyfiretail merged commit 42ea705 into dev Jul 5, 2024
1 check passed
@rileyfiretail rileyfiretail deleted the go-validation branch July 5, 2024 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants