gjwt/claim

Types

pub type Claim =
  #(String, dynamic.Dynamic)
pub type Claims =
  List(#(String, dynamic.Dynamic))
pub type Error {
  NoClaim
  ClaimDecode(errors: dynamic.DecodeErrors)
}

Constructors

  • NoClaim
  • ClaimDecode(errors: dynamic.DecodeErrors)

Constants

pub const audience_key: String
pub const expiration_time_key: String
pub const issued_at_key: String
pub const issuer_key: String
pub const jwt_id_key: String
pub const not_before_key: String
pub const subject_key: String

Functions

pub fn add_claim(
  claims: List(#(String, Dynamic)),
  claim: #(String, Dynamic),
) -> List(#(String, Dynamic))
pub fn audience(audience: List(String)) -> #(String, Dynamic)
pub fn expiration_time(
  expiration_time: Time,
) -> #(String, Dynamic)
pub fn get_audience(
  claims: List(#(String, Dynamic)),
) -> Result(List(String), Error)
pub fn get_claim(
  claims: List(#(String, Dynamic)),
  key: String,
  decoder: fn(Dynamic) -> Result(a, List(DecodeError)),
) -> Result(a, Error)
pub fn get_expiration_time(
  claims: List(#(String, Dynamic)),
) -> Result(Time, Error)
pub fn get_issued_at(
  claims: List(#(String, Dynamic)),
) -> Result(Time, Error)
pub fn get_issuer(
  claims: List(#(String, Dynamic)),
) -> Result(String, Error)
pub fn get_jwt_id(
  claims: List(#(String, Dynamic)),
) -> Result(String, Error)
pub fn get_not_before(
  claims: List(#(String, Dynamic)),
) -> Result(Time, Error)
pub fn get_subject(
  claims: List(#(String, Dynamic)),
) -> Result(String, Error)
pub fn issued_at(issued_at: Time) -> #(String, Dynamic)
pub fn issuer(issuer: String) -> #(String, Dynamic)
pub fn jwt_id(jwt_id: String) -> #(String, Dynamic)
pub fn not_before(not_before: Time) -> #(String, Dynamic)
pub fn remove_claim(
  claims: List(#(String, Dynamic)),
  key: String,
) -> List(#(String, Dynamic))
pub fn set_claim(
  claims: List(#(String, Dynamic)),
  key: String,
  value: Dynamic,
) -> List(#(String, Dynamic))
pub fn subject(subject: String) -> #(String, Dynamic)
Search Document