Kali Kaneko [Mon, 30 Nov 2015 20:17:44 +0000 (16:17 -0400)]
[refactor] reorder and comment events
Reorder blocks of events, and comment about which user-specific info
it's being emitted with them.
Ruben Pollan [Thu, 12 Nov 2015 18:34:38 +0000 (19:34 +0100)]
[style] fix pep8
Ivan Alejandro [Wed, 11 Nov 2015 19:17:06 +0000 (16:17 -0300)]
[pkg] migrate changelog to rst and fold in changes
Also, convert issues like #1234 to link pointing to issue tracker.
Kali Kaneko [Wed, 11 Nov 2015 04:24:29 +0000 (00:24 -0400)]
[docs] add next-changelog to changes/
Kali Kaneko [Wed, 11 Nov 2015 03:47:19 +0000 (23:47 -0400)]
[feature] add variable to skip twisted version
Kali Kaneko [Mon, 2 Nov 2015 16:01:59 +0000 (12:01 -0400)]
[pkg] rename extras to 'http'
and document the dependencies on the README.
Ivan Alejandro [Tue, 27 Oct 2015 21:09:05 +0000 (18:09 -0300)]
[pkg] fold in changes
Folker Bernitt [Wed, 21 Oct 2015 08:07:06 +0000 (10:07 +0200)]
Workaround for deadlock problem in zmq auth
- See https://leap.se/code/issues/7536
- Actual root cause not identified yet
Ivan Alejandro [Tue, 13 Oct 2015 16:09:45 +0000 (13:09 -0300)]
[bug] fix typo on dirname usage
Kali Kaneko [Fri, 9 Oct 2015 19:01:13 +0000 (15:01 -0400)]
[bug] fix wrong ca_cert path inside bundle
-Resolves: #7524
Ivan Alejandro [Tue, 6 Oct 2015 17:41:18 +0000 (14:41 -0300)]
[bug] consider STANDALONE for the paths
Since we need to write a file we have to consider whether we are
running in 'standalone' mode or not to use the right path prefix.
- Related: #7512
Ivan Alejandro [Tue, 22 Sep 2015 16:30:24 +0000 (13:30 -0300)]
[pkg] fold in changes
Kali Kaneko [Wed, 16 Sep 2015 16:20:22 +0000 (12:20 -0400)]
[refactor] move checking flag to main module
Folker Bernitt [Wed, 16 Sep 2015 09:21:01 +0000 (11:21 +0200)]
[tests] Make txclient honor flags.EVENTS_ENABLED
- Breaks tests in dependent repos like soledad otherwise,
because server.key could not be found
Kali Kaneko [Tue, 15 Sep 2015 03:06:29 +0000 (23:06 -0400)]
[feat] expose async events in api
to make simpler the import of the tx client
- Related: #7274
Kali Kaneko [Wed, 9 Sep 2015 19:43:26 +0000 (15:43 -0400)]
[docs] add downloads badge
Kali Kaneko [Wed, 9 Sep 2015 18:58:47 +0000 (14:58 -0400)]
[docs] fix broken pypi badge
Kali Kaneko [Fri, 28 Aug 2015 16:10:41 +0000 (12:10 -0400)]
[style] pep8 fixes
Ivan Alejandro [Wed, 26 Aug 2015 19:28:30 +0000 (16:28 -0300)]
[pkg] fold in changes
Kali Kaneko [Mon, 17 Aug 2015 23:24:41 +0000 (19:24 -0400)]
[tests] add pep8/flake8 ignores
Kali Kaneko [Mon, 17 Aug 2015 23:15:05 +0000 (19:15 -0400)]
[style] pep8 fix
drebs [Tue, 11 Aug 2015 14:44:42 +0000 (11:44 -0300)]
[feature] allow passing callback to http client
Parménides GV [Tue, 4 Aug 2015 12:59:36 +0000 (14:59 +0200)]
[feat] WHEELHOUSE can be a url + --use-leap-wheels
--use-leap-wheels sets --trusted-host (remove it when we have a proper
cert) and WHEELHOUSE to https://ftp.lizard.leap.se
Until we get ftp.lizard cname, use lizard as the wheels server.
Bruno Wagner [Tue, 4 Aug 2015 21:44:21 +0000 (18:44 -0300)]
[bug] HTTP timeout was not being cleared on abort
In case the http client loses connection, it has to clear
it's timeout or the reactor will be left in a dirty state
Fixing this solves a problem with some of the tests in Soledad
that were trying to run on a dirty reactor
Kali Kaneko [Tue, 4 Aug 2015 03:24:49 +0000 (23:24 -0400)]
[tests] ignore trial temp folder
Parménides GV [Thu, 30 Jul 2015 16:29:59 +0000 (18:29 +0200)]
[feat] use wheels to install dependencies
generate_wheels uses $WHEELHOUSE to generate and store the wheels for
requirements.pip and requirements-testing.pip (if it exists).
pip_install_requirements.sh installs requirements.pip from them if
possible (if not, then it fetches them from pypi) or, if passed the
--testing flag, it installs requirements-testing.pip.
Kali Kaneko [Wed, 29 Jul 2015 20:08:30 +0000 (16:08 -0400)]
[docs] remove ref to protobuf from README
we stopped using protobuf after the events submodule refactor
Victor Shyba [Wed, 29 Jul 2015 16:34:08 +0000 (13:34 -0300)]
[bug] register and unregister controlled by flag
Since register and unregister cant be used without full zmq initialization,
it should make sense to also check flag for them.
Victor Shyba [Wed, 29 Jul 2015 16:30:41 +0000 (13:30 -0300)]
[refactor] Extract flags check to caller
Checking was done inside of emit method. Doing on emit function at
a module level makes it cleaner with less lines inside of check.
Victor Shyba [Tue, 28 Jul 2015 19:48:04 +0000 (16:48 -0300)]
[test] set flag before starting client
Test client will only start with flag set to True.
Change EventsGenericClientTestCase to set the flag on the
first line of setUp.
Victor Shyba [Tue, 28 Jul 2015 19:26:14 +0000 (16:26 -0300)]
[bug] Consider events flag when ensuring client
Change EventsClientThread behavior so it won't start anymore if
the events flag is set to False
Kali Kaneko [Tue, 28 Jul 2015 15:41:32 +0000 (11:41 -0400)]
[style] more pep8 cleanup
Kali Kaneko [Tue, 28 Jul 2015 13:55:33 +0000 (09:55 -0400)]
[tests] add pep8 to requirements-testing
Kali Kaneko [Tue, 28 Jul 2015 02:32:38 +0000 (22:32 -0400)]
[pkg] add AUTHORS file + one-liner to generate it
Kali Kaneko [Tue, 28 Jul 2015 01:42:47 +0000 (21:42 -0400)]
[pkg] add script to install base requirements
- update pip
- install base reqs, with insecure flags for dirspec. fuck canonical.
Kali Kaneko [Thu, 23 Jul 2015 20:36:12 +0000 (16:36 -0400)]
[tests] fix initialization of basetest case
Bruno Wagner [Thu, 23 Jul 2015 03:09:03 +0000 (00:09 -0300)]
[style] fixed pep8 warnings on http and test events
Bruno Wagner [Thu, 23 Jul 2015 03:00:39 +0000 (00:00 -0300)]
[tests] fixed events tests
The events tests check for register and emit signals,
but because the flag set_events_enabled was False by
default in the tests, no signals were being emitted.
I added the flag to the setUp and tearDown of the tests,
they are still very slow but at least they are passing now
Bruno Wagner [Thu, 23 Jul 2015 02:55:39 +0000 (23:55 -0300)]
[tests] implemented http feature according to test
Two test cases were broken and were implemented here:
The first was that HTTPClient should share the connection between
clients if a pool was not passed explicitly. If you initialize an
HTTPClient without a pool, it will reuse a pool created on the class.
The second was that you should be able to pass to the HTTPCLient a pool
on initialization. Added that possibility and fixed the tests accordingly
Bruno Wagner [Wed, 22 Jul 2015 22:17:03 +0000 (19:17 -0300)]
[tests] set environment for certs test
Bruno Wagner [Wed, 22 Jul 2015 20:04:34 +0000 (17:04 -0300)]
[tests] added setuptools_trial so the tests run using python setup.py test
Bruno Wagner [Wed, 22 Jul 2015 19:51:51 +0000 (16:51 -0300)]
[style] fixed extra requires typo
Bruno Wagner [Wed, 22 Jul 2015 18:38:56 +0000 (15:38 -0300)]
[style] Fixed pep8 warnings
drebs [Thu, 23 Jul 2015 20:03:50 +0000 (17:03 -0300)]
[bug] fix events ioloop client tests
The events ioloop client is not completelly thread safe, so we have to use
reactor.callFromThread whenever we need it to be thread-safe. Examples of this
behaviour are the events ioloop client tests that depend on the firing of
deferreds, which are not thread safe. This commit fixes tese tests.
drebs [Wed, 8 Jul 2015 22:15:56 +0000 (19:15 -0300)]
[bug] add http request timeout
The connectTimeout parameter of twisted.web.client.Agent only acts on the
connection setup, and the Agent will wait forever for incoming data after the
connection has been established.
This commit adds a timeout for the connection, and will cancel the deferred if
the result has not been received after a certain number of seconds.
drebs [Wed, 8 Jul 2015 22:14:00 +0000 (19:14 -0300)]
[feat] add close method for http agent
The ability to close cached connections is needed in order to have a clean
reactor when the program ends.
Kali Kaneko [Mon, 13 Jul 2015 15:48:47 +0000 (11:48 -0400)]
[feature] add global flag for disabling the events framework
this will be used to allow the unittests to disable the events
framework. this way, emit() will become a passthrough.
note that, until now, the basetest class is making use of the threaded
version of the client, which launches a zmq tornado-based ioloop. this
is wrong, and will have to be addressed in a future commit. we'll have
to make use of the global EVENTS_ENABLED flag in the txclient version
when those changes are made.
Related: #7259
Relases: 0.4.2
Kali Kaneko [Mon, 20 Jul 2015 23:18:03 +0000 (19:18 -0400)]
[bug] do not add a port string to non-tcp addresses
this, together with the events server registration, was breaking the
events signalling on the client whenever it used ipc:// sockets.
Kali Kaneko [Mon, 20 Jul 2015 19:18:57 +0000 (15:18 -0400)]
[refactor] remove use of reactor in threaded version of events client
the idea is that we'll be able to use the threaded version of the
client, which makes use of the tornado ioloop, in a non-twisted module,
like the main graphical client probably will be in the near future.
Ivan Alejandro [Fri, 10 Jul 2015 17:17:02 +0000 (14:17 -0300)]
[pkg] fold in changes
drebs [Fri, 26 Jun 2015 17:45:19 +0000 (14:45 -0300)]
[bug] run callback from thread in events client
drebs [Fri, 26 Jun 2015 17:44:37 +0000 (14:44 -0300)]
[bug] allow passing ':0' as port in events address
Ruben Pollan [Mon, 15 Jun 2015 19:24:59 +0000 (21:24 +0200)]
Merge branch 'feature/post-sync-hooks' into develop
Kali Kaneko [Wed, 10 Jun 2015 18:52:11 +0000 (14:52 -0400)]
[bug] catch missing section header error
Kali Kaneko [Fri, 5 Jun 2015 17:11:56 +0000 (13:11 -0400)]
[feature] utility collect_plugins
to be used in post-sync hooks.
Related: #6996
Releases: 0.4.1
drebs [Thu, 11 Jun 2015 14:54:10 +0000 (11:54 -0300)]
[bug] remove extraneous data from events logs
The emission of an event was being logged twice, and the second time was
logging the pickled content of the event. This pickled content contained line
breaks and other things that caused strange output on the client log.
This commit removes the second loggin of the event pickled content.
Closes #7130.
Victor Shyba [Mon, 8 Jun 2015 18:18:00 +0000 (15:18 -0300)]
[bug] Makes request method respect a hard limit
Altough we specify maxPersistentPerHost, Twisted won't stop opening
connections after that. This limit is used just to keep the size of
persistent connections pool under control. Additional connections will be
made as non persistent. So, if we ask 10000 requests, it will open 10000
connections immediately and leave 10 open after all finished.
For checking this behavior, see getConnection from Twisted source:
http://twistedmatrix.com/trac/browser/tags/releases/twisted-15.2.1/twisted/web/client.py#L1203
I tested this by using http_target from soledad without a local database to
download all encrypted docs from one account with 1700 of them. The
program just hangs and crashes with 1000+ connections and "Too many
files open" warnings.
With this fix, it was able to download normally, respecting the
maxPersistentPerHost as a limiter. :)
Kali Kaneko [Tue, 2 Jun 2015 21:27:42 +0000 (17:27 -0400)]
[bug] allow ipc socket types
previous regex wasn't capturing addresses of type ipc://<path>
Closes: #7089
Ivan Alejandro [Wed, 3 Jun 2015 17:42:52 +0000 (14:42 -0300)]
Merge tag '0.4.0' into develop
Tag leap.common version 0.4.0
drebs [Tue, 2 Jun 2015 18:05:19 +0000 (15:05 -0300)]
[pkg] add pyzmq and txzmq dep versions
Ruben Pollan [Tue, 2 Jun 2015 22:29:13 +0000 (00:29 +0200)]
Merge branch 'shyba/feat/twisted_http_get' into develop
Victor Shyba [Wed, 27 May 2015 20:19:13 +0000 (17:19 -0300)]
[feat] Make it optional to have a dedicated pool
As @meskio pointed out, some cases could need a dedicated pool with
different parameters.
This is a suggested implementation where the pool is reused by default,
creating a dedicated one just if needed/asked. This way we ensure that
resources are under control and special cases are still handled.
Victor Shyba [Wed, 27 May 2015 15:49:44 +0000 (12:49 -0300)]
[bug] Use BrowserLikePolicyForHTTPS for checking
While testing the way that its implemented now, I found out that no check
is being made on certificate attributes against the host.
I found this simple way of creating a BrowserLikePolicyForHTTPS using
a self signed cert and it worked on my test. I used test_https from
Soledad for checking this (which we are fixing on another branch).
Also, we don't want to depend on twisted for other things than
leap.common.http.
Ivan Alejandro [Mon, 1 Jun 2015 18:20:21 +0000 (15:20 -0300)]
[pkg] fold in changes
Victor Shyba [Wed, 27 May 2015 21:51:44 +0000 (18:51 -0300)]
[bug] use dict keys to iterate
We ran into a RuntimeError yesterday on this line, the callback can
modify this dict and make the iteration raise an error. Using keys
method to iterate is safer.
See
http://stackoverflow.com/questions/
11941817/python-runtimeerror-dictionary-changed-size-during-iteration-how-to-avoid-th/
11941855#
11941855
Ruben Pollan [Mon, 18 May 2015 22:31:05 +0000 (00:31 +0200)]
[feat] add initialization of events to BaseLeapTest
This is needed to get the tests working on environments where zmq was
not initalizated.
The environment variable XDG_CONFIG_HOME is set to get the leap
configuration in the temp folder.
drebs [Wed, 4 Feb 2015 17:04:10 +0000 (15:04 -0200)]
[feat] refactor events to use ZMQ
Before this commit, protobuf and protobuf.socketrpc were used to serialize and
transmit messages between events clients. This change implements a simpler ZMQ
client/server events mechanism that uses ZMQ sockets for transmitting messages
from clients to server and to redistribute such messages to subscribed
clients.
Closes: #6359
Ruben Pollan [Tue, 26 May 2015 20:06:20 +0000 (22:06 +0200)]
[refactor] move http twisted code from soledad
Implements an HTTP client the twisted way, with a focus on pinning the
SSL certs.
* Related: #6506
Ivan Alejandro [Wed, 20 May 2015 21:39:10 +0000 (18:39 -0300)]
[bug] get certificate times as UTC, add tests
The certificate validity times were converted to local time and later on
compared with UTC time, which caused the certificate not being updated
at the right times.
Add tests to be sure this is not happenning again.
Add a joint pem file for the existing cert and key files to ease test.
- Resolves: #6994
Ivan Alejandro [Mon, 26 Jan 2015 16:40:47 +0000 (13:40 -0300)]
Fold in changes.
Ivan Alejandro [Mon, 12 Jan 2015 20:13:05 +0000 (17:13 -0300)]
Consider different possibilities for tmpdir.
In some systems the used tmp dir is like '/tmp/leap_tests-asdf' and in
others is like '/tmp/username/leap_tests-asdf'.
With this fix we protect the home dir and consider different possible
temp directories.
Ruben Pollan [Wed, 3 Dec 2014 16:40:38 +0000 (10:40 -0600)]
Add support for deferreds to memoize_method decorator
Ruben Pollan [Wed, 3 Dec 2014 15:42:45 +0000 (09:42 -0600)]
Extract the environment set up and tear down for tests
Using trial there is no setUpClass neither tearDownClass, the setting up
of the environment needs to be in an external class to be able to call
it from inhereted classes.
Ivan Alejandro [Mon, 6 Oct 2014 16:07:59 +0000 (13:07 -0300)]
Merge remote-tracking branch 'meskio/feature/cache_invalidation' into develop
Ruben Pollan [Tue, 16 Sep 2014 15:51:09 +0000 (10:51 -0500)]
Add invalidation timeout to cache
Tomás Touceda [Fri, 18 Jul 2014 13:58:41 +0000 (10:58 -0300)]
Merge branch 'release-0.3.9'
Tomás Touceda [Fri, 18 Jul 2014 13:57:43 +0000 (10:57 -0300)]
Fold in changes
Tomás Touceda [Mon, 14 Jul 2014 20:59:19 +0000 (17:59 -0300)]
Merge remote-tracking branch 'refs/remotes/kali/bug/install-pemfiles-data' into develop
kali [Mon, 14 Jul 2014 20:25:06 +0000 (15:25 -0500)]
include pemfile in the installed package
Ivan Alejandro [Thu, 10 Jul 2014 14:44:49 +0000 (11:44 -0300)]
Merge remote-tracking branch 'chiiph/feature/cacert_osx' into develop
Tomás Touceda [Thu, 10 Jul 2014 14:29:31 +0000 (11:29 -0300)]
Look for cacert.pem in the Resources dir in OSX
Tomás Touceda [Tue, 8 Jul 2014 17:18:53 +0000 (14:18 -0300)]
Merge remote-tracking branch 'refs/remotes/meskio/doc' into develop
Ruben Pollan [Fri, 4 Jul 2014 17:16:33 +0000 (12:16 -0500)]
Update documentation about events/proto
Tomás Touceda [Fri, 6 Jun 2014 16:17:27 +0000 (13:17 -0300)]
Merge branch 'release-0.3.8'
Tomás Touceda [Fri, 6 Jun 2014 16:16:58 +0000 (13:16 -0300)]
Fold in changes
Tomás Touceda [Thu, 29 May 2014 13:44:25 +0000 (10:44 -0300)]
Merge remote-tracking branch 'refs/remotes/drebs/feature/5517_add-soledad-sync-status-signals' into develop
drebs [Fri, 2 May 2014 18:18:02 +0000 (15:18 -0300)]
Add soledad sync status signals (#5517).
Kali Kaneko [Wed, 23 Apr 2014 15:49:37 +0000 (10:49 -0500)]
Merge remote-tracking branch 'chiiph-github/bug/improve_changelog_readability' into develop
Tomás Touceda [Wed, 9 Apr 2014 18:16:27 +0000 (15:16 -0300)]
Update changelog for improved readability
Tomás Touceda [Tue, 8 Apr 2014 20:02:59 +0000 (17:02 -0300)]
Merge remote-tracking branch 'refs/remotes/kali/fix-changelog-year' into develop
Kali Kaneko [Tue, 8 Apr 2014 19:59:03 +0000 (14:59 -0500)]
fix year in changelog
Tomás Touceda [Fri, 4 Apr 2014 19:19:22 +0000 (16:19 -0300)]
Merge branch 'release-0.3.7'
Tomás Touceda [Fri, 4 Apr 2014 19:18:46 +0000 (16:18 -0300)]
Fold in changes
Tomás Touceda [Tue, 18 Mar 2014 18:10:25 +0000 (15:10 -0300)]
Merge remote-tracking branch 'refs/remotes/drebs/feature/5191_add-soledad-invalid-auth-token-event' into develop
drebs [Mon, 17 Mar 2014 20:51:08 +0000 (17:51 -0300)]
Add Soledad invalid auth token event (#5191).
Tomás Touceda [Fri, 17 Jan 2014 18:52:21 +0000 (15:52 -0300)]
Merge remote-tracking branch 'refs/remotes/ivan/feature/support-str-in-charset-detection' into develop
Ivan Alejandro [Fri, 17 Jan 2014 17:40:44 +0000 (14:40 -0300)]
Support str type in email charset detection.
Tomás Touceda [Thu, 19 Dec 2013 17:35:43 +0000 (14:35 -0300)]
Merge remote-tracking branch 'refs/remotes/kali/bug/fix-memoize' into develop
Kali Kaneko [Thu, 19 Dec 2013 16:49:22 +0000 (12:49 -0400)]
add cache invalidation
Kali Kaneko [Thu, 19 Dec 2013 02:31:23 +0000 (22:31 -0400)]
Fix memoize decorator: raise instead of storing None
With this fix, we will re-raise an exception that happens
while evaluating the callable, instead of storing None as value.