summaryrefslogtreecommitdiff
path: root/test/unit
AgeCommit message (Collapse)Author
2016-09-30minor: test: fix * interpreted as arg prefix warningAzul
2016-09-30logging: use proper loggerAzul
This way the logs do not interfere with test output
2016-09-22hand on connection errors to dispatcher so it can handle itAzul
2016-09-21rescue and track exceptions in handler chainAzul
2016-09-19refactor: separate handler chain from dispatcherAzul
Handler Chain is of handlers that respond to call. Invoking handle(*args) on the chain will call the handlers with the given args until one of them returns a result that is truethy (i.e. not false or nil). Extracted from the dispatcher so we can also handle exceptions there in the future. (So that if one of the network connections to the request_handlers fails we can continue while still tracking the failed exception.)
2016-09-16deal with network issues in nicknym sourceAzul
This is a first step. In case the suspected nicknym server cannot be reached we will now move on and try other sources. It's robably not what we want in the long run. In order to know wether no key exists or we just failed to connect to some servers a different http response code would be nice if network errors occured. This simplifies testing such scenarios in the unit test and makes the remote tests skip on network failure.
2016-09-16test: properly test nicknym source + fixesAzul
2016-09-12test: separate remote tests into own directoryAzul
Dropped the webmock dependency. We have our own http adapter. So we can stub that to inject a mock. As an added bonus this does not mess with other http requests. Also wrote down testing strategy. Not completely implemented yet.
2016-09-12[wip] nicknym source query implementedAzul
Also changed Nickserver::Response to not include the status code. This may be okay for error responses but in most cases we want to have a parsable message and not some status code prepended to it.
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-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-29cleanup: remove outdated ideasAzul
Lookup and InvalidSource were experiments for a design for the dispatching. Our new dispatcher seems better.
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.
2016-08-29expose Request class from RequestHandlerAzul
This way we can separate the EmailHandler and the FingerprintHandler as well.
2016-08-27refactor: push down adapter dependency injection to sourcesAzul
The original idea was that we would have all the celluloid related things injected in reel_server. However it seems unlikely that we will use a different http system anytime soon. Removing some layers of dependency injection to reduce complexity. We can easily bring this back if we want.
2016-08-26[update] trying to silence warningsAzul
These warnings were showing on gitlab ci. $ bundle exec rake test /usr/local/bin/ruby -w -Ilib:test -I/builds/leap/nickserver/vendor/ruby/2.1.0/gems/rake-11.2.2/lib /builds/leap/nickserver/vendor/ruby/2.1.0/gems/rake-11.2.2/lib/rake/rake_test_loader.rb test/**/*_test.rb /usr/local/lib/ruby/gems/2.1.0/gems/bundler-1.12.5/lib/bundler/rubygems_integration.rb:468: warning: method redefined; discarding old find_spec_for_exe /usr/local/lib/ruby/site_ruby/2.1.0/rubygems.rb:261: warning: previous definition of find_spec_for_exe was here I, [2016-08-26T15:34:46.162843 #325] INFO -- : Celluloid 0.17.3 is running in BACKPORTED mode. [ http://git.io/vJf3J ] /builds/leap/nickserver/test/unit/request_handler_test.rb:28: warning: mismatched indentations at 'end' with 'def' at 21 /builds/leap/nickserver/vendor/ruby/2.1.0/gems/celluloid-io-0.17.3/lib/celluloid/io/ssl_socket.rb:22: warning: instance variable @npn_protocols not initialized /builds/leap/nickserver/vendor/ruby/2.1.0/gems/celluloid-io-0.17.3/lib/celluloid/io/ssl_socket.rb:22: warning: instance variable @npn_select_cb not initialized Run options: --seed 61653 # Running: .................../builds/leap/nickserver/vendor/ruby/2.1.0/gems/celluloid-io-0.17.3/lib/celluloid/io/ssl_socket.rb:22: warning: instance variable @npn_protocols not initialized /builds/leap/nickserver/vendor/ruby/2.1.0/gems/celluloid-io-0.17.3/lib/celluloid/io/ssl_socket.rb:22: warning: instance variable @npn_select_cb not initialized .../builds/leap/nickserver/vendor/ruby/2.1.0/gems/celluloid-io-0.17.3/lib/celluloid/io/ssl_socket.rb:22: warning: instance variable @npn_protocols not initialized /builds/leap/nickserver/vendor/ruby/2.1.0/gems/celluloid-io-0.17.3/lib/celluloid/io/ssl_socket.rb:22: warning: instance variable @npn_select_cb not initialized ................. Finished in 2.029982s, 19.2120 runs/s, 10.8375 assertions/s.
2016-07-13[FEATURE] fetch key by fingerprintZara Gebru
- add fingerprint unit tests - add integration test - implement by_fingerprint
2016-07-12[Test] get email form hkpZara Gebru
2016-07-02refactor: turn EmailAddress into a class, cleanupAzul
2016-07-02refactor: replace blocks/yields with returnsAzul
This became possible because we now use celluloid. Celluloid handles asynchronity without the need for callbacks or blocks.
2016-07-02minor: silence warnings and cleanupAzul
2016-06-30use proper ssl connection with ca_file - green!Azul
2016-06-30actually use celluloid io for http requestsAzul
2016-06-30Trying to replace EM base server with reelAzul
some tests are still broken. But at least they are running now.
2016-06-21refactor: change send_response -> respond in em_serverAzul
This way the interface mimics the one of Celluloid Reels request. request.respond status, content
2016-06-20seperate generic RequestHandler from EmServerAzul
The request handler takes a responder (the EmServer) and an adapter as initialization arguments. It will then respond to requests by querying the sources using the adapter and calling send_response on the responder.
2016-06-09refactor: remove EM specific stuff from Hkp::FetchKey interfaceAzul
2016-06-09move hkp test to integration testsAzul
That's what it actually is
2016-05-25fix our own warningsAzul
2016-05-25move nickserver_test to integration dirAzul
it really is more of an integration test
2016-05-25copy over all files from rewritten attemptAzul
I started a nickserver from scratch to implement the things that are independent of our choice of stack (eventmachine or other). This commit copies them over and tests both things in parallel.
2016-05-25rubocop: fix deprecated class methodsAzul
2016-05-25rubocop: initialize and use ruby 1.9 hash syntaxAzul
2016-04-10add test for 200 without matching keysAzul
2014-08-05added kkp_ca_file config optionelijah
2014-01-23upgraded gem requirements to most recent versionselijah
2013-08-06fix crash when fetched key is rejected (e.g. too short, etc), report errors ↵elijah
in the request, prevent most crashes by catching exceptions.
2013-08-05fix bug with couchdb result parsingelijah
2013-05-19fix bug with empty request parameterselijah
2013-05-19many related changes -- allow command line configs, validate addresses, ↵elijah
overhaul bootstrap.
2013-05-15add CouchDB support.elijah
2013-05-12switch to new api for nickserver (get or post, json response)elijah
2012-12-24added nickserver daemonelijah
2012-12-24remove cruftelijah
2012-12-24initial commitelijah