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

885 Commits

Author SHA1 Message Date
Jean Paul Galea
06bf821555 Refactor.
- make it easier to follow,
	create prefix first, then suffix.
2015-09-10 20:30:00 +02:00
Jean Paul Galea
2c5d0a6efa Refactor.
- build separate string from $extra array,
	and append it in syslog call.
2015-09-10 20:28:37 +02:00
Jean Paul Galea
d6433c81ab Rename variable. 2015-09-10 20:25:20 +02:00
Jean Paul Galea
a3421284e1 Refactor. 2015-09-10 20:24:23 +02:00
Jean Paul Galea
f71b81fe6b Refactor.
- init variables as class property,
	no need to init in construct.

- set scopes on private properties,
	and public methods.
2015-09-10 20:17:22 +02:00
Jean Paul Galea
7503d42699 Refactor.
- get rid of log_format() function.

- was only used in one place and it just complicates things.
2015-09-10 20:02:07 +02:00
Jean Paul Galea
4b79e45683 Documentation. 2015-09-10 19:59:11 +02:00
Jean Paul Galea
bc660a1f34 Cosmetic. 2015-09-10 19:55:14 +02:00
Jean Paul Galea
4a8eeacf7a Refactor.
- $urls is already checked prior to invoking function.
2015-09-10 19:54:45 +02:00
Jean Paul Galea
3f3ffaf493 Bump versions. 2015-09-10 11:30:10 +02:00
Jean Paul Galea
b05998aba4 Cosmetic fix. 2015-09-10 11:17:16 +02:00
Jean Paul Galea
94021e6398 NEWS for 2.31 2015-09-10 11:14:50 +02:00
Jean Paul Galea
e6e379762a Fix bug.
- fix fatal error when an empty sync request is sent to the server.

- logging boilerplate must be initiated before we start validating the request.
2015-09-09 15:17:01 +02:00
Jean Paul Galea
eec70dad47 Fix bug.
- argument to sprintf, not concat to first argument!
2015-09-09 15:11:08 +02:00
Jean Paul Galea
c99fdb2129 Bump versions. 2015-09-09 10:52:35 +02:00
Jean Paul Galea
9e3efc267e NEWS for 2.30 2015-09-09 09:58:06 +02:00
Jean Paul Galea
88707ec442 Fix.
- add newline for munin error message.
2015-09-09 09:55:21 +02:00
Jean Paul Galea
5381074a73 Refactor out function into library. 2015-09-08 17:45:37 +02:00
Jean Paul Galea
f2483a6ff9 Rewrote ykval-munin-queuelength plugin.
- bring in line with ksm and val latency plugin.
2015-09-08 17:10:31 +02:00
Jean Paul Galea
f566a75dcd Rewrite ykval-munin-ksmlatency plugin.
- same as 1e4da5dac6,
	but for ksm latency plugin.
2015-09-08 16:47:16 +02:00
Jean Paul Galea
1e4da5dac6 Rewrite ykval-munin-vallatency plugin.
- avoid having to use the same internal and label name,
	as it's problematic.

- internal name has a lot of restrictions:
	s/^[^A-Za-z_]/_/
	s/[^A-Za-z0-9_]/_/g

- which doesn't allow us to show proper label names,
	the names that users will see.

- label displays :80 or :443 depending on scheme.

- avoid ugliness with shortname() and instead use endpoints().
2015-09-08 16:41:15 +02:00
Jean Paul Galea
d6e7f317c3 Cosmetic. 2015-09-08 14:57:39 +02:00
Jean Paul Galea
446d1c58ee Use underscore instead of colon for host/port.
- munin plugin only supports a-zA-Z0-9_ so colon will probably give us problems.
2015-09-08 14:56:02 +02:00
Jean Paul Galea
780b0eff13 Fix.
- import common, required for shortname function.
2015-09-08 14:51:20 +02:00
Jean Paul Galea
b8e98e6049 Add shortname failure checks for munin plugins. 2015-09-08 14:47:34 +02:00
Jean Paul Galea
21b795b852 Rename function 2015-09-08 14:42:11 +02:00
Jean Paul Galea
0fdff26403 Modify ykval-munin-queuelength plugin.
- use host (and port if any) for graph title.
2015-09-08 14:40:24 +02:00
Jean Paul Galea
d6d4e3e58a Use single quotes where possible. 2015-09-08 14:39:49 +02:00
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