1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# JWT authorization example
# Run with `cargo run -p htsget-axum --all-features -- --config htsget-config/docs/examples/auth.toml`
= "127.0.0.1:8080"
= "127.0.0.1:8081"
= "file://data"
# JWT authentication and authorization configuration.
[]
# The JWT signing key source, either a JWKS endpoint or a static PEM public key.
= { = "jwks", = "https://www.example.com/jwks" }
## Alternatively, validate against a static public key:
#jwt = { kind = "public_key", path = "/path/to/jwt-public-key.pem" }
# Optional JWT claim validation.
= ["htsget-server"]
= ["https://www.example.com"]
= "htsget"
## HTTP client options for the JWKS endpoint. These can be set under any callout, e.g. `jwt` or `authorization`.
#[auth.jwt.http]
#cert = "cert.pem"
#key = "key.pem"
#root_store = "root.crt"
#use_cache = false
# Authorization restrictions from a remote callout service.
[]
= "callout"
= "https://www.example.com/authorize"
## Alternatively, load static restrictions from a JSON file:
#[auth.authorization]
#kind = "static"
#path = "/path/to/restrictions.json"
# What to forward from the client request to the authorization callout.
[]
## Header name patterns to forward to the callout, which supports `*` and `?` wildcards.
## Forwarded headers keep their original names.
= ["Authorization"]
## Header name patterns to never forward.
#headers.deny = ["X-Internal-*"]
# Htsget-specific context to add to the callout request. These are added with a `Htsget-Context-` header prefix.
[]
## Forward the endpoint type, i.e. `reads` or `variants` as `Htsget-Context-Endpoint-Type`.
= true
## Forward the request id as `Htsget-Context-Id`.
= true
## Derive extra context headers from request extensions using JSONPath. When `name` is
## omitted it is derived from the path, e.g. `$.user.id` becomes `Htsget-Context-User-Id`.
#extensions = [{ json_path = "$.user.id" }]
# HTTP response caching
#[auth.authorization.http]
#use_cache = true
#cache.ttl_ceiling_secs = 3600
#cache.store.kind = "in_memory"
#cache.store.capacity = 10000
## Auth can also be set individually for the ticket and data servers instead of globally:
#[ticket_server.auth]
#[data_server.auth]