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

Wondering about hooks #33

Open
rwxrob opened this issue May 31, 2015 · 1 comment
Open

Wondering about hooks #33

rwxrob opened this issue May 31, 2015 · 1 comment

Comments

@rwxrob
Copy link

rwxrob commented May 31, 2015

Been playing around with this and realized it almost meets the needs I have except for I want to be able to do some GPG application-level field encryption on the server side before any PUT or POST would make it actually into the DB. Of course this would be over HTTPs as well and hadn't read of support for that as well.

But my main question is really related to being able to do 99% CRUD with mora and then 1% application specific data transformations, log triggers and the like with some sort of hook. I suppose I could just customize mora to my needs, but was wondering if any thought had already been given into providing such hooks into the pipeline.

@emicklei
Copy link
Owner

Mora is organized such that it can be embedded in your own application. In the root you find one main.go file that imports and wires-up all to start the application. It is also the right place to start a TLS server instead (I am now thinking about making this configurable)

Mora uses the go-restful package for mapping Http requests to Go functions. One of its features is the implementation of request and response filters. Filters allow you to add behavior/change data before and after handling the request by a function. Using a filter function, you could read the request body, encrypt it and put back that result in the same request for further processing.

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

No branches or pull requests

2 participants