Acme-JWT

 view release on metacpan or  search on metacpan

META.yml  view on Meta::CPAN

  version: 1.4
name: Acme-JWT
no_index:
  directory:
    - inc
    - t
    - xt
requires:
  Crypt::OpenSSL::RSA: 0.28
  Digest::SHA: 5.63
  JSON: 2.53
  MIME::Base64: 3.13
  Try::Tiny: 0.09
resources:
  license: http://dev.perl.org/licenses/
  repository: git://github.com/clairvy/p5-Acme-JWT.git
version: 0.04

Makefile.PL  view on Meta::CPAN

use inc::Module::Install;
name 'Acme-JWT';
all_from 'lib/Acme/JWT.pm';

requires 'Crypt::OpenSSL::RSA' => '0.28';
requires 'JSON' => '2.53';
requires 'MIME::Base64' => '3.13';
requires 'Try::Tiny' => '0.09';
requires 'Digest::SHA' => '5.63';

tests 't/*.t';
author_tests 'xt';

test_requires 'Test::More' => '0.87_01';
auto_set_repository;
auto_include;

inc/Module/Install/Metadata.pm  view on Meta::CPAN

	my $meta = $self->_write_mymeta_data or return 1;

	# Save as the MYMETA.yml file
	print "Writing MYMETA.yml\n";
	YAML::Tiny::DumpFile('MYMETA.yml', $meta);
}

sub write_mymeta_json {
	my $self = shift;

	# We need JSON to write the MYMETA.json file
	unless ( eval { require JSON; 1; } ) {
		return 1;
	}

	# Generate the data
	my $meta = $self->_write_mymeta_data or return 1;

	# Save as the MYMETA.yml file
	print "Writing MYMETA.json\n";
	Module::Install::_write(
		'MYMETA.json',
		JSON->new->pretty(1)->canonical->encode($meta),
	);
}

sub _write_mymeta_data {
	my $self = shift;

	# If there's no existing META.yml there is nothing we can do
	return undef unless -f 'META.yml';

	# We need Parse::CPAN::Meta to load the file

inc/Module/Install/WriteAll.pm  view on Meta::CPAN

	}

	# The Makefile write process adds a couple of dependencies,
	# so write the META.yml files after the Makefile.
	if ( $args{meta} ) {
		$self->Meta->write;
	}

	# Experimental support for MYMETA
	if ( $ENV{X_MYMETA} ) {
		if ( $ENV{X_MYMETA} eq 'JSON' ) {
			$self->Meta->write_mymeta_json;
		} else {
			$self->Meta->write_mymeta_yaml;
		}
	}

	return 1;
}

1;

lib/Acme/JWT.pm  view on Meta::CPAN

package Acme::JWT;
use strict;
use warnings;
our $VERSION = '0.04';

use JSON qw/decode_json encode_json/;
use MIME::Base64 qw/encode_base64url decode_base64url/;
use Try::Tiny;
use Digest::SHA qw/hmac_sha256 hmac_sha384 hmac_sha512/;
use Crypt::OpenSSL::RSA;

our $has_sha2;
BEGIN {
    $has_sha2 = 0;
    if (UNIVERSAL::can('Crypt::OpenSSL::RSA', 'use_sha512_hash')) {
        $has_sha2 = 1;

lib/Acme/JWT.pm  view on Meta::CPAN


Acme::JWT - JWT utilities.

=head1 SYNOPSIS

  use Acme::JWT;

=head1 DESCRIPTION

Acme::JWT is provided JWT method.
JWT is JSON Web Token
see http://self-issued.info/docs/draft-jones-json-web-token-06.html

rewrite from ruby version.

=head1 AUTHOR

NAGAYA Shinichiro E<lt>clairvy@gmail.comE<gt>

=head1 SEE ALSO

xt/01_podspell.t  view on Meta::CPAN

use Test::More;
eval q{ use Test::Spelling };
plan skip_all => "Test::Spelling is not installed." if $@;
add_stopwords(map { split /[\s\:\-]/ } <DATA>);
$ENV{LANG} = 'C';
all_pod_files_spelling_ok('lib');
__DATA__
NAGAYA Shinichiro
clairvy@gmail.com
Acme::JWT
JSON



( run in 0.797 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )