def fetch

bend-kit-jwt@0.11.0.1 · jwt.bend:825

import bend-kit-jwt@0.11.0.1/jwt.bend as Jwt
import Base
import bend-kit-hairpin@0.13.0.1/hairpin.bend as Hairpin
import bend-kit-http@0.38.1.1/http.bend as Http

825# GET the set now. On any failure the client and the old keys come back, with only tried moved to now.
826def fetch(c: Hairpin.Client, s: Jwks, +now: U32) -> IO(Hairpin.Client & Jwks & Result<&1, &1, Err, Unit>):
827  Jwks{+url, ttl, live, at, old, ks} = s
828  do IO<Hairpin.Client & Jwks & Result<&1, &1, Err, Unit>>:
829    x : Hairpin.Client & Result<&1, &1, Hairpin.Err, Http.Res> <- Hairpin.get(c, url)
830    return fetch.done(Jwks{url, ttl, live, at, Some{now}, ks}, now, x)

Uses (15)

Used by (1)