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.
ZING_JWT_ALGO
ZING_JWT_SECRET
This package uses type constraints from:
Zing::Types
This package implements the following methods:
decode(Str $data) : HashRef
The decode method decodes the data provided.
# given: synopsis $encoder->decode('eyJhbGciOiJIUzI1NiJ9.eyJzdGF0dXMiOiJva2F5In0.tXdQmMPi25VOJZaOySFS-hM2ofIxbyFBVTA7I-GI_lU');
encode(HashRef $data) : Str
The encode method encodes the data provided.
# given: synopsis $encoder->encode({ status => 'okay' });
Al Newkirk, awncorp@cpan.org
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".
Wiki
Project
Initiatives
Milestones
Contributing
Issues
To install Zing::Encoder::Jwt, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Zing::Encoder::Jwt
CPAN shell
perl -MCPAN -e shell install Zing::Encoder::Jwt
For more information on module installation, please visit the detailed CPAN module installation guide.