object

# `jwt_claims`

Reusable JWT registered-claim validation helpers.

Availability:
`logtalk_load(jwt(loader))`
Author: Paulo Moura
Version: 1:0:0
Date: 2026-06-26
Compilation flags:
`static, context_switching_calls`
Imports:
`public` jwt_helpers
Uses:
list
os
Remarks:
(none)
Inherited public predicates:
check_option/1 check_options/1 default_option/1 default_options/1 option/2 option/3 valid_option/1 valid_options/1

## Public predicates

### `validate_claims/3`

Validates JWT claims using registered-claim defaults, a policy list, and options.

Compilation flags:
`static`
Template:
`validate_claims(Claims,Policy,Options)`
Mode and number of proofs:
`validate_claims(+term,+list(compound),+list(compound))` - `one_or_error`
Exceptions:
`Options` is a variable or a partial list:
`instantiation_error`
`Options` is neither a variable nor a list:
`type_error(list,Options)`
An element `Option` of the list `Options` is neither a variable nor a compound term:
`type_error(compound,Option)`
An element `Option` of the list `Options` is a compound term but not a valid option:
`domain_error(option,Option)`
A required claim is missing:
`domain_error(jwt_claims,missing(Name))`
A claim has an invalid value:
`domain_error(jwt_claim(Name),Value)`
`Policy` contains an invalid claim policy:
`domain_error(jwt_claim_policy,Policy)`
A time claim value is not a number:
`type_error(time_number,Name-Time)`
`Policy` contains an invalid time-claim kind:
`domain_error(jwt_time_claim_kind,Kind)`

### `validate_claim/3`

Validates a single JWT claim policy against a claims JSON term.

Compilation flags:
`static`
Template:
`validate_claim(Claims,ClaimPolicy,Options)`
Meta-predicate template:
`validate_claim(*,*,*)`
Mode and number of proofs:
`validate_claim(+term,+compound,+list(compound))` - `one_or_error`
Exceptions:
A required claim is missing:
`domain_error(jwt_claims,missing(Name))`
A claim has an invalid value:
`domain_error(jwt_claim(Name),Value)`
`ClaimPolicy` is not a valid claim policy:
`domain_error(jwt_claim_policy,ClaimPolicy)`
A time claim value is not a number:
`type_error(time_number,Name-Time)`
`ClaimPolicy` contains an invalid time-claim kind:
`domain_error(jwt_time_claim_kind,Kind)`

### `claim/3`

Looks up a claim value by name in a claims JSON term.

Compilation flags:
`static`
Template:
`claim(Claims,Name,Value)`
Mode and number of proofs:
`claim(+term,+atom,-term)` - `zero_or_one`

## Protected predicates

(no local declarations; see entity ancestors if any)

## Private predicates

(no local declarations; see entity ancestors if any)

## Operators

(none)