Zing::Encoder::Jwt - JWT Serialization Abstraction
JWT Data Serialization Abstraction
use Zing::Encoder::Jwt;
my $encoder = Zing::Encoder::Jwt->new(
secret => '...',
);
# $encoder->encode({ status => 'okay' });
This package provides a Crypt::JWT data serialization abstraction for use
with Zing::Store stores. The JWT encoding algorithm can be set using the
ZING_JWT_ALGO
environment variable or the algo attribute, and defaults to
HS256. The JWT secret can be set using the ZING_JWT_SECRET
environment
variable or the secret attribute.
This package uses type constraints from:
This package implements the following methods:
decode(Str $data) : HashRef
The decode method decodes the data provided.
-
decode example #1
# given: synopsis $encoder->decode('eyJhbGciOiJIUzI1NiJ9.eyJzdGF0dXMiOiJva2F5In0.tXdQmMPi25VOJZaOySFS-hM2ofIxbyFBVTA7I-GI_lU');
encode(HashRef $data) : Str
The encode method encodes the data provided.
-
encode example #1
# given: synopsis $encoder->encode({ status => 'okay' });
Al Newkirk, awncorp@cpan.org
Copyright (C) 2011-2019, Al Newkirk, et al.
This is free software; you can redistribute it and/or modify it under the terms of the The Apache License, Version 2.0, as elucidated in the "license file".