equest

default allow = false

token = {&#34;valid&#34;: valid, &#34;payload&#34;: payload} {
    [_, encoded] := split(http_request.headers.authorization, &#34; &#34;)
    [valid, _, payload] := io.jwt.decode_verify(encoded, {&#34;secret&#34;: &#34;secret&#34;})
}

allow {
    is_token_valid
    action_allowed
}

is_token_valid {
  token.valid
  now := time.now_ns() / 1000000000
  token.payload.nbf &lt;= now
  now &lt; token.payload.exp
}

action_allowed {
  startswith(http_request.path, base64url.decode(t