the queue's exporter asks every request for a login the gateway supplies
This commit is contained in:
parent
9b12532fc1
commit
da53e19636
1 changed files with 488 additions and 133 deletions
|
|
@ -28,4 +28,26 @@ rec {
|
|||
# The Secret the store's pod loads its credentials from
|
||||
# (../k8s/render.nix names it `<service>-credentials`).
|
||||
secretName = store: "swarm-${store}-credentials";
|
||||
|
||||
# The queue's exporter takes the same kind of login, with a difference: its
|
||||
# flag takes no file, so the pod gets the password's bcrypt hash from the
|
||||
# Secret `exporter.secretName` (key `hashKey`, environment variable
|
||||
# `hashEnv`, argument `-http_pass`), and the gateway's `/metrics` location
|
||||
# for the queue sends the password itself in the header `exporter.nginxFile`
|
||||
# sets. The password and the hash are files only root reads. `cost` is NATS's
|
||||
# own default for `nats server passwd`; the exporter compares with
|
||||
# `bcrypt.CompareHashAndPassword`, which reads the cost from the hash, and
|
||||
# only for a value that starts with `$2a$`.
|
||||
exporter = {
|
||||
user = "swarm-exporter";
|
||||
leaf = "swarm/services/nats/exporter-auth";
|
||||
passwordFile = "${dir}/nats.password";
|
||||
nginxFile = "${dir}/nats.conf";
|
||||
hashFile = "${dir}/nats.hash";
|
||||
secretName = "swarm-nats-exporter-auth";
|
||||
hashKey = "hash";
|
||||
hashEnv = "EXPORTER_HASH";
|
||||
cost = 11;
|
||||
hashPrefix = "$2a$";
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue