object

paseto_claims

PASETO JSON claims lookup and validation predicates.

Availability:
logtalk_load(paseto(loader))
Author: Paulo Moura
Version: 1:0:0
Date: 2026-08-08
Compilation flags:
static, context_switching_calls
Imports:
Uses:
Remarks:
(none)

Public predicates

validate_claims/3

Validates 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:
Claims is not a JSON object or contains duplicate members:
domain_error(paseto_json_object,Claims)
Claims is missing a required claim Name:
domain_error(paseto_claims,missing(Name))
Policy contains an invalid claim policy:
domain_error(paseto_claim_policy,ClaimPolicy)
A time claim has a non-numeric value:
type_error(time_number,Name-Value)
Options is a variable:
instantiation_error
Options is neither a variable nor a list:
type_error(list,Options)
An element Option of the list Options is a variable:
instantiation_error
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)

validate_claim/3

Validates one claim policy against a claims object.

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:
Claims is missing the required claim Name:
domain_error(paseto_claims,missing(Name))
The value of claim Name does not satisfy the policy:
domain_error(paseto_claim(Name),Value)
ClaimPolicy is not a supported claim policy:
domain_error(paseto_claim_policy,ClaimPolicy)
A time claim has an unknown validation kind:
domain_error(paseto_time_claim_kind,Kind)
A time claim has a non-numeric value:
type_error(time_number,Name-Value)
Options is a variable:
instantiation_error
Options is neither a variable nor a list:
type_error(list,Options)
An element Option of the list Options is a variable:
instantiation_error
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)

claim/3

Looks up a claim value by name.

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)