100 Commits

Author SHA1 Message Date
Thomas Waldmann
8738b135fc add tests for update/delete api with invalid IPs 2014-09-02 23:50:39 +02:00
Thomas Waldmann
9bd09b6008 on travis do not run tests that require sequential execution (can not run in parallel) 2014-09-02 00:14:24 +02:00
Thomas Waldmann
3d91f9bf81 found why other service test has issues on travis-ci, removed sleep again (didn't help anyway) 2014-08-31 18:31:03 +02:00
Thomas Waldmann
f1b8a76906 increase sleep time for other service test, last try ... 2014-08-31 18:03:45 +02:00
Thomas Waldmann
4ef30e4fb8 try to avoid race condition in other service updater test, increasing sleep time 2014-08-31 17:44:01 +02:00
Thomas Waldmann
26c48ea93b try to avoid race condition in other service updater test 2014-08-31 17:36:47 +02:00
Thomas Waldmann
cf2c46e612 use FQDN typed params in api, remove unused parse_name (which was problematic anyway) 2014-08-30 18:27:21 +02:00
Thomas Waldmann
dd3cd6139f sync code between _update and _delete 2014-08-27 17:35:10 +02:00
Thomas Waldmann
56bddb83b6 fix broken api test
as we first check for a nochg update, we couldn't always get the expected dnserr here as the dns update is tried after the  nochg check.
so, if the address did not change, the test failed. fixed by making sure it is not a nochg update.
2014-08-27 16:45:05 +02:00
Thomas Waldmann
8dbbd0cad0 catch UnicodeError exceptions caused by ip addr string that can't be decoded by ascii decoder 2014-08-16 21:58:19 +02:00
Thomas Waldmann
070a1445be s/ssl/secure/g
SSL is the old/outdated name. Since 1999, it's called TLS.

Changed some API params.
2014-05-30 01:28:34 +02:00
Thomas Waldmann
46008bf2cd s/SSL/TLS/g (almost)
SSL is the old/outdated name. Since 1999, it's called TLS.

In this changeset, I did the mostly harmless changes (UI, logs, docs).
2014-05-30 01:10:33 +02:00
Thomas Waldmann
9341df05bb optimize filter_by_fqdn(), rename to get_by_fqdn()
as we precisely expect 1 result (0 or more than 1 are error cases), use .get() instead of .filter().
avoid usage of len().
maybe this is a little more efficient than before.
2014-05-29 15:25:38 +02:00
Thomas Waldmann
93b54ab479 handle myip == '' (?myip= in url) - just get ip from REMOTE_ADDR 2014-04-28 01:08:00 +02:00
Thomas Waldmann
36c3c8d314 implement delete API
Very similar to /nic/update and /nic/update_authorized, /nic/delete and /nic/delete_authorized delete
 the A or AAAA record, depending in the kind of IP address given.

 As this is a delete, the specific ip address value is ignored.
2014-01-21 17:50:01 +01:00
Thomas Waldmann
5d2ee03e02 if we get an invalid ip address string with an update (e.g. via myip=... param), return result code 'dnserr'
note: I did not find a better matching result code, seems like dyndns2 api is rather incomplete. :-(
2014-01-21 14:21:35 +01:00
Thomas Waldmann
0203fdb856 make api tests also use a random hostname (but constant throughout the test session) 2013-12-25 04:42:40 +01:00
Thomas Waldmann
852e541778 make the tests use a test zone
for the dnstools tests, tests were already changed to use a random test host in the test zone,
so parallel tests runs should not use the same hostnames.

test_api tests still use same host names, though
2013-12-25 03:38:08 +01:00
Thomas Waldmann
bf2f5bbe7e fix py3 compatibility 2013-12-24 21:44:11 +01:00
Thomas Waldmann
ba977193ce Merge branch 'master' into py3-port
Conflicts:
	nsupdate/main/_tests/test_main.py
2013-12-24 21:31:40 +01:00
Thomas Waldmann
b317837f58 add a test for dnserr api response
and also fix dnserr api response - should not contain additional info, but just "dnserr"
2013-12-18 04:08:18 +01:00
Thomas Waldmann
14b9407ab5 remove unused imports 2013-12-15 18:27:59 +01:00
Thomas Waldmann
807fcaca5a _update: remove unused agent param 2013-12-15 18:12:10 +01:00
Thomas Waldmann
cf6629a0a8 add/fix more docstrings 2013-12-15 17:29:55 +01:00
Thomas Waldmann
0df4efce1c add/fix some module-level docstrings 2013-12-15 17:09:22 +01:00
Thomas Waldmann
711aba237f python 3.3 port
not much tested yet, be careful
2013-12-14 00:35:29 +01:00
Thomas Waldmann
866ddf3bea add available, abuse and abuse_blocked flags to Host, show on UI, script to reset flags
there is an issue with south and sqlite - it doesn't handle migrations that add BooleanField columns with defaults.
just use the faults script to set the flags to their correct default after migrating with south.
2013-11-30 12:32:03 +01:00
Thomas Waldmann
2aeb2a61f8 service updater (host configs): add (give|accept)_(ipv4|ipv6) fields 2013-11-29 02:11:55 +01:00
Thomas Waldmann
6b9c7e9511 add reverse dns lookup results for viewer's current IPs to session, show on hosts overview view (see panel at lower right)
not showing it in home view's jumbotron due to potential cosmetic issues
2013-11-27 08:16:49 +01:00
Thomas Waldmann
aa610e9c3a implement "update other services", with tests, no ui yet
(can be used when adding the records via django admin)
2013-11-26 08:10:05 +01:00
Thomas Waldmann
e9605535b8 add counters for client and server faults (per host) 2013-11-24 11:42:59 +01:00
Thomas Waldmann
1447b670f5 avoid double lookup of the host object
as we have to look it up for auth anyway, return it, so we can continue using it.
2013-11-24 11:09:38 +01:00
Thomas Waldmann
087c1d2c93 deduplicated fqdn lookup uniqueness check, fixed _update return values (must be Response objects, not bool) 2013-11-24 10:43:15 +01:00
Thomas Waldmann
ce83e293bb support notfqdn api result code
we do not really need it as far as the service is concerned (we would give some other valid failure result code),
but it might help to user to more quickly find the mistake in his client configuration.
2013-11-24 06:42:55 +01:00
Thomas Waldmann
e0c83b78b7 clarify hostname in querystring must by same as username used for http basic auth 2013-11-24 06:20:23 +01:00
Thomas Waldmann
1a02925bfa minor changes: fix typo, move comment to right place 2013-11-21 04:10:04 +01:00
Thomas Waldmann
ae9c2f29d0 more tests, better coverage 2013-11-21 04:02:16 +01:00
Thomas Waldmann
5fb721d112 more api tests, add another user and another host so we can test separation 2013-11-16 07:51:04 +01:00
Thomas Waldmann
08d8ce472b added test for nic_update_session 2013-11-16 07:23:44 +01:00
Thomas Waldmann
925ad20405 update api: there is no "noauth" return value, it must be "badauth" 2013-11-16 06:09:56 +01:00
Thomas Waldmann
d6b5041573 a real nic update api test, using basic auth
generate_secret was modified to support giving a secret (not generating a random one), so it matches the test database

add a User and a Host to the test db
2013-11-16 01:25:05 +01:00
Thomas Waldmann
b1ef5ed6b4 api / session ip updates: reorder evaluation, is a bit faster for failures 2013-11-15 13:22:06 +01:00
Thomas Waldmann
4c46c30d25 more api tests (mostly triggering execution of some code)
it's hard to test anything without a user / http auth / login / session.
2013-11-15 13:00:57 +01:00
Thomas Waldmann
1f28cb3ed0 name api views, use reverse() in unit tests 2013-11-15 12:14:36 +01:00
Thomas Waldmann
f6fb8b67bd try to not write into session unless there is really a change or a refresh needed, reduce code duplication
move code from HomeView to context processor
2013-11-14 02:11:44 +01:00
Thomas Waldmann
f1cdf2ec45 dnstools logging levels improved 2013-11-10 13:59:40 +01:00
Thomas Waldmann
9da1fe95b6 better logging for mismatching username/hostname 2013-11-10 08:12:22 +01:00
Thomas Waldmann
50bdf58398 fix typo 2013-11-10 08:03:36 +01:00
Thomas Waldmann
367bc70f56 security fix: authenticating is not enough, hostname qs param (if given) also needs to match the username 2013-11-10 07:57:40 +01:00
Thomas Waldmann
24b687960e deal with "nameserver not available" and "peer bad signature" in same way as with dns update errors, 2013-11-10 07:04:46 +01:00