arset=utf-8",
CONTENT_TYPE_TXT => "text/plain; charset=utf-8",
CONTENT_TYPE_JSON => "application/json",
# Server
SERVER_UPGRADE_TIMEOUT => 30,
SERVER_TIMEOUT => 60,
AULT_ALGORITHM
/],
'MIME' => [qw/
CONTENT_TYPE_HTML CONTENT_TYPE_TXT CONTENT_TYPE_JSON
/],
'MISC' => [qw/
USERNAME_REGEXP EMAIL_REGEXP
JWT_REGEXP JTI_REGEXP
package WWW::Suffit::JWT;
use strict;
use utf8;
=encoding utf8
=head1 NAME
WWW::Suffit::JWT - JSON Web Token for Suffit authorization
=head1 SYNOPSIS
use WWW::Suffit::JWT;
my $jwt = WWW:
d;
die $jwt->error if $jwt->error;
=head1 DESCRIPTION
JSON Web Token for Suffit authorization
This module based on L<Mojo::JWT>
JSON Web Token is described in L<https://tools.ietf.org/html/rfc
ing new ones
=head2 decode
my $payload = $jwt->decode($token)->payload;
Decode and parse a JSON Web Token string and return the payload hashref (see L</payload>).
=head2 encode
my $token
jo::Util/humanize_bytes>
=head2 json_load
my $hash = json_load( $file );
Loads JSON file and returns data as perl struct
=head2 json_save
my $path = json_save( $file, {foo => [1, 2], bar
=> 'hello!', baz => \1} );
Save perl struct to file as JSON document and returns the L<Mojo::File> object
=head2 md5sum
my $md5 = md5sum( $file );
See L<Digest::MD5>
=head2 parse_expire
Dep
eil strftime /;
use Digest::MD5;
use Mojo::Util qw/ trim monkey_patch /;
use Mojo::JSON qw/ decode_json encode_json /;
use Mojo::File qw/ path /;
use WWW::Suffit::Const qw/ IS_TTY DATE_FORMAT DATETI