summaryrefslogtreecommitdiff
path: root/lib/nickserver/request_handlers
AgeCommit message (Collapse)Author
2016-09-10refactor: remove global require in test_helperAzul
require all the things we depend upon where we depend upon them.
2016-08-31wip: key lookup by address via leaps nicknymAzul
I added a RequestHandler that uses Nicknym::Source - but that has not been implemented yet.
2016-08-30refactor: make the RequestHandler classes callableAzul
Whenever a RequestHandler class is called we instantiate it with the request. Then we call handle on the instance. This way we can access the request and its content via accessors rather than only in the handle method.
2016-08-30refactor: rename EmailHandler to HkpEmailHandlerAzul
2016-08-30feature: keep trying if no Host header givenAzul
So far we would error out if no host was specified in the config or the request. It's true that we can't do local lookup if we don't know our own domain. However we can still use HKP. In the future we will query leaps own API for other providers. If the host was not set in the initial request we might even proxy a request to ourselves. Providing the Host header will prevent an infinite loop in that case.
2016-08-29refactor: split EmailHandler in 3Azul
InvalidEmailHandler - handle emails with an invalid format LocalEmailHandler - handle emails on the local domain EmailHandler - handle all other emails by using hkp This is a preparation to add leap provider email lookup and remove hkp eventually. But for now we keep the behaviour the same and only refactor.
2016-08-29refactor: let handlers check if they are applicableAzul
Instead of testing the preconditions for each handler in the dispatcher the dispatcher hands a request to one handler after the other until one of them responds. This is similar to the Chain of Responsibility patter but we iterate over the 'handler_chain' array instead of a linked list. To change the order of handlers or add other handlers change the array in the handler_chain function.
2016-08-29refactor: split up ResponseHandlerAzul
Now we have a Dispatcher and two ResponseHandlers that have the same interface. Moving towards a Chain of Responsibility pattern.