1
0
mirror of https://github.com/Yubico/yubikey-val.git synced 2024-11-29 18:24:10 +01:00
Commit Graph

757 Commits

Author SHA1 Message Date
Jean Paul Galea
adf9a7f833 Use echo in all munin php plugins. 2015-09-08 14:34:55 +02:00
Jean Paul Galea
3896a7a72b Modify ykval-munin-queuelength plugin.
- don't auto configure if running a single node cluster.
	(i.e. no queues for sync requests to other servers).
2015-09-08 14:32:47 +02:00
Jean Paul Galea
c80f9adacb Refactor.
- move autoconf block lower down.

- will be taken advantage of in a newer commit.
2015-09-08 14:29:35 +02:00
Jean Paul Galea
ceedda9322 Modify ykval-munin-ksmlatency.
- same as f2604e751a,
	except this is for KSM URLs.
2015-09-08 14:28:32 +02:00
Jean Paul Galea
de5e76b5e4 Add FIXME marker. 2015-09-08 14:22:09 +02:00
Jean Paul Galea
cf40fec026 Modify ykval-munin-vallatency plugin.
- don't auto configure if running a single node cluster.
	(i.e. no other servers to sync to).
2015-09-08 14:19:50 +02:00
Jean Paul Galea
f2604e751a Modify ykval-munin-vallatency plugin.
- use hostname (+ port if any) for graph name.

	i.e. if we have a sync URL:
		https://api.yubico.com:8080/wsapi/2.0/sync

	instead of having "api" as name,
		we have "api.yubico.com:8080".

- also avoid using regex and use parse_url() from php core instead.
2015-09-08 14:18:41 +02:00
Jean Paul Galea
7940d1e6e7 Rename variable.
- $ksms => $urls

- $ksm => $url

- mainly to be closer to vallatency plugin.
2015-09-08 12:46:24 +02:00
Jean Paul Galea
80475b2d7e Cosmetic. 2015-09-08 12:44:46 +02:00
Jean Paul Galea
110afa8526 Rename variable. 2015-09-08 12:43:50 +02:00
Jean Paul Galea
4e49b4b7af Use bracket guards for substitution. 2015-09-08 12:41:18 +02:00
Jean Paul Galea
58ba93d35f Drop half baked functionality in ykval-munin-vallatency.
- plugin assumed URL uses a hostname (no static ips)
	and that hostname resolves to both ipv4 and ipv6.

- if we want to differentiate stats between ipv4 and ipv6,
	we need to re-think this and do it in a smart way.

- for now we prefer to allow cURL to pick whatever IP it resolves,
	and run the latency test on that.

- signed off by Klas Lindfors.
2015-09-08 12:32:27 +02:00
Jean Paul Galea
2272f33659 Refactor include paths.
- use PATH_SEPARATOR everywhere,
	instead of a mix of PATH_SEPARATOR and hard coded colons.

- always include /usr/share/yubikey-val first,
	then /etc/yubico/val.

- should not have any visible affects,
	since no file names are common between the two directories.

- use array+implode to make it easier to add/remove paths,
	and to avoid hardcoded the path separator.
2015-09-08 10:57:26 +02:00
Jean Paul Galea
9aa740d299 Refactor.
- string substitution rather than concatenation.
2015-09-08 09:21:25 +02:00
Jean Paul Galea
69a3c4417c Refactor ykval-munin-ksmlatency plugin.
- depend on libcurl instead of curl binary.

- due to this commit,
	requests sent to KSM URLs will contain a User-Agent header.
2015-09-08 09:19:39 +02:00
Jean Paul Galea
99613cd5f4 Move function into ykval-common.php 2015-09-08 09:17:34 +02:00
Jean Paul Galea
71442e7fd6 Refactor.
- don't depend on external binaries,
	it assumes too much and is dangerous.

- we can depend on libcurl instead,
	since it's already a dependency in core.

- we should do this for other plugins too,
	and move the new function into ykval-common.php

- plugin reports same exact values as before.
2015-09-07 18:01:04 +02:00
Jean Paul Galea
ed6fb6cbb3 Cosmetic changes.
- refactor whitespace for munin plugins written in php.

- change spaces into tabs and fix brackets mostly.
2015-09-07 16:20:58 +02:00
Jean Paul Galea
a0e3715dbb Modify ykval-queue daemon.
- don't run ykval-queue for single node configurations.
2015-08-18 12:09:27 +02:00
Jean Paul Galea
54dfc6edb6 Refactor.
- remove unnecessary else {} wrapper.
2015-08-18 12:04:30 +02:00
Jean Paul Galea
b76ffc313f Cosmetic changes.
- make it easier to understand query construction.
2015-08-18 12:03:58 +02:00
Jean Paul Galea
0c3a48ee63 Don't set a default value for reSync argument.
- reSync() is only called in ykval-queue,
	and that sets an $older_than argument.

- additionally, the defaults did not match.

- the value in ykval-queue (via ykval-config) is 10 seconds,
	and the value in reSync($older_than=) was 60 seconds.

- no functional change, just makes things less confusing.
2015-08-18 11:25:15 +02:00
Jean Paul Galea
02f2e056b1 FIXME marker. 2015-08-12 11:02:40 +02:00
Jean Paul Galea
c8bf5216d2 Fix failing tests.
- bug introduced in 382cfc2ab5.

- travis perl server test should use port 8002 to simulate ksm server.
2015-08-12 10:50:08 +02:00
Jean Paul Galea
eabdfd2503 FIXME markers. 2015-07-28 17:11:47 +00:00
Jean Paul Galea
382cfc2ab5 Modify default KSM URL.
- our ksm daemon listens on port 8002 by default,
	so ykval should also have the same default.
2015-07-28 17:09:36 +00:00
Jean Paul Galea
b106789217 Fix.
- fix bug introduced in 6181abee14.

- essentially, strftime() uses different format than date()
2015-07-24 14:50:02 +02:00
Jean Paul Galea
9704cf7ae1 Refactor.
- avoid unnecessary strtotime() call.

- instead of:
		strtotime(date('Y-m-d H:i:s', $timestamp))

	use:
		$timestamp

	since:
		$timestamp === strtotime(date('Y-m-d H:i:s', $timestamp))
2015-07-24 14:45:41 +02:00
Jean Paul Galea
6181abee14 Refactor.
- strftime -> date.

- strftime is same as date, but with locales.

- date format doesn't output names (January, March, etc.),
	so locale doesn't matter.

- also, would we really want locale in logs?
2015-07-24 14:35:30 +02:00
Jean Paul Galea
342ceac544 Modify log write.
- Log::log() internally support array implode,
	so no need to duplicate functionality.

- however, the internal implode uses two consecutive spaces as separator,
	so this will change the log format slightly.

	e.g. "delta=x now=y" becomes "delta=x  now=y"
2015-07-24 14:01:22 +02:00
Jean Paul Galea
c05a505b9c Refactor. 2015-07-24 13:54:49 +02:00
Jean Paul Galea
a6ad2e7d4b Cosmetic changes. 2015-07-24 10:55:34 +02:00
Jean Paul Galea
231c1ad0c5 Refactor. 2015-07-24 10:54:21 +02:00
Jean Paul Galea
1341227342 Refactor. 2015-07-24 10:50:21 +02:00
Jean Paul Galea
17378733af Refactor.
- rename $curlopts -> $opts.
2015-07-22 19:48:43 +00:00
Jean Paul Galea
5fc6c1c37d Refactor. 2015-07-22 19:44:35 +00:00
Jean Paul Galea
6246aa5ab4 Refactor.
- rename $handle -> $ch.
2015-07-22 19:43:06 +00:00
Jean Paul Galea
9dfb9b9302 Refactor. 2015-07-22 19:41:25 +00:00
Jean Paul Galea
4c2d4414a0 Cosmetic changes. 2015-07-22 19:38:32 +00:00
Jean Paul Galea
bef2c0cd4a Cosmetic changes. 2015-07-22 19:21:45 +00:00
Jean Paul Galea
424fbdf962 FIXME markers. 2015-07-21 21:45:07 +00:00
Jean Paul Galea
da689f7de4 Cosmetic changes. 2015-07-21 21:38:46 +00:00
Jean Paul Galea
ca5e787452 Refactor. 2015-07-21 21:38:37 +00:00
Jean Paul Galea
3572410b30 Better grouping.
- same as 1e799aa6e5.

- group $timeout filtering and validation.

- this commit might change replies sent to clients,
	since the validation check is done eaerlier now,
	and we might return S_MISSING_PARAM before S_BAD_OTP for example.

- this should really not cause any issues though,
	the order of which error is raised first should not matter to clients.
2015-07-21 21:27:33 +00:00
Jean Paul Galea
1e799aa6e5 Better grouping.
- group $sl filtering and validation.

- this commit might change replies sent to clients,
	since the validation check is done eaerlier now,
	and we might return S_MISSING_PARAM before S_BAD_OTP for example.

- this should really not cause any issues though,
	the order of which error is raised first should not matter to clients.
2015-07-21 21:17:59 +00:00
Jean Paul Galea
1e4453ccdf Refactor and unset after use. 2015-07-21 21:12:21 +00:00
Jean Paul Galea
82d5796245 Refactor. 2015-07-21 21:09:17 +00:00
Jean Paul Galea
262671f50b Refactor.
- single quotes.

- unset after use.

- don't wrap.
2015-07-21 21:05:16 +00:00
Jean Paul Galea
847f288cf5 Refactor. 2015-07-21 21:03:03 +00:00
Jean Paul Galea
11c160b05c Cosmetic changes. 2015-07-21 21:02:50 +00:00