macielti / common-clj Goto Github PK
View Code? Open in Web Editor NEWJust common Clojure code that I use across projects
License: Other
Just common Clojure code that I use across projects
License: Other
Use this lib as base:
https://github.com/killme2008/clj-rate-limiter
An interceptor that enable another interceptor when specific conditions are attended.
The interceptor should require a X-Recaptcha-Token
header to fetch the https://www.google.com/recaptcha/api/siteverify endpoint so we can check if the request is fraudulent.
https://stackoverflow.com/questions/27297067/google-recaptcha-how-to-get-user-response-and-validate-in-the-server-side
https://developers.google.com/recaptcha/docs/verify
Don't forget to add a integration test for that interceptor.
We need to split the consumption from the production of Telegram bot messages/commands. So we can put them in different services.
The idea is to have an interceptor that adds an HTTP header with a random correlation ID.
This Header should be required. Whoever makes the request to the service endpoint should provide an initial or preexistent correlation ID.
For the consumer component, when the service name is not set up properly we need to log a human-friendly error message.
We need a HTTP Client component so we can have more flexibility on integration tests assertions. Like having the possibility of assert that a HTTP request was made to a service/URI.
When doing integrations tests and Kafka mocked messages are produced, the mocked consumer component must be able to consume that.
Be able to define InlineKeyboardButton handlers.
Be able to define the statuses that the endpoint can return and the schema for every status code.
I need a function that receives a schema map and makes all the keys optional.
Should allow us to consume fake messages
(def routes [["/api/handler" :post [(fn telegram-bot-handler
[{update :json-params
components :components}]
(component.telegram.consumer/consume-update! update diplomat.telegram.consumer/consumers components)
{:status 200})] :route-name :telegram-bot-handler]])
With this component the services can authenticate between themselves.
We can use interceptors to assure authentication or preconditions on commands processing.
On message production, we need to attach a meta map to the message.
While consuming messages we need to retrieve and append a new segment to the correlation-id
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.