summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Kanashiro <kanashiro.duarte@gmail.com>2015-10-14 11:30:52 -0300
committerLucas Kanashiro <kanashiro.duarte@gmail.com>2015-10-14 11:30:52 -0300
commit9b479bc3fbc4fd502f0b7ddf211e425b7d1de137 (patch)
treec86eef71480c9512ffc52cd37040ceea03ef1aea
Import original source of Config-Identity 0.0018
-rw-r--r--Changes28
-rw-r--r--MANIFEST24
-rw-r--r--META.yml21
-rw-r--r--Makefile.PL60
-rw-r--r--README114
-rw-r--r--lib/Config/Identity.pm256
-rw-r--r--lib/Config/Identity/GitHub.pm34
-rw-r--r--lib/Config/Identity/PAUSE.pm36
-rw-r--r--t/.01-basic.t.swpbin0 -> 12288 bytes
-rw-r--r--t/01-basic.t84
-rw-r--r--t/assets/github/.githubbin0 -> 616 bytes
-rw-r--r--t/assets/gpg/pubring.gpgbin0 -> 1146 bytes
-rw-r--r--t/assets/gpg/random_seedbin0 -> 600 bytes
-rw-r--r--t/assets/gpg/secring.gpgbin0 -> 1219 bytes
-rw-r--r--t/assets/gpg/trustdb.gpgbin0 -> 1280 bytes
-rw-r--r--t/assets/h0/.test0
-rw-r--r--t/assets/h0/.test-identity0
-rw-r--r--t/assets/h1/.test0
-rw-r--r--t/assets/pause-username/.pause-identity2
-rw-r--r--t/assets/pause/.pause-alternate2
-rw-r--r--t/assets/pause/.pause-identity18
-rw-r--r--t/assets/test.asc18
-rw-r--r--t/assets/test.gpg3
23 files changed, 700 insertions, 0 deletions
diff --git a/Changes b/Changes
new file mode 100644
index 0000000..a27b920
--- /dev/null
+++ b/Changes
@@ -0,0 +1,28 @@
+TODO:
+ - Trying GPG on empty file
+
+0.0018 Saturday March 01 13:40:31 PST 2014:
+ - Be more sane with how we interact with gpg
+
+0.0017 Saturday March 01 11:12:09 PST 2014:
+ - Use IPC::Run instead of IPC::Open3
+
+0.0016 Wednesday June 16 23:26:25 PDT 2010:
+ - Added CI_PAUSE_STUB/CI_GITHUB_STUB override
+
+0.0015 Tuesday June 08 15:57:29 PDT 2010:
+ - Added username/user aliasing to the PAUSE format (and loader)
+
+0.0014 Wednesday June 02 20:23:51 PDT 2010:
+ - Changed load_best to try_best and added a stricter load_best
+
+0.0013 2010-06-12:
+ - Surpress secmem warning during testing
+ - Added documentation about CI_{GPG/CI_GPG_ARGUMENTS}
+ - Put in information about using gpg-agent
+
+0.0012 Tuesday May 11 23:59:01 PDT 2010:
+ - Updated documentation
+
+0.0010 Tuesday May 11 18:32:09 PDT 2010:
+ - Initial release
diff --git a/MANIFEST b/MANIFEST
new file mode 100644
index 0000000..b537f87
--- /dev/null
+++ b/MANIFEST
@@ -0,0 +1,24 @@
+# This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.013.
+Changes
+MANIFEST
+META.yml
+Makefile.PL
+README
+lib/Config/Identity.pm
+lib/Config/Identity/GitHub.pm
+lib/Config/Identity/PAUSE.pm
+t/.01-basic.t.swp
+t/01-basic.t
+t/assets/github/.github
+t/assets/gpg/pubring.gpg
+t/assets/gpg/random_seed
+t/assets/gpg/secring.gpg
+t/assets/gpg/trustdb.gpg
+t/assets/h0/.test
+t/assets/h0/.test-identity
+t/assets/h1/.test
+t/assets/pause-username/.pause-identity
+t/assets/pause/.pause-alternate
+t/assets/pause/.pause-identity
+t/assets/test.asc
+t/assets/test.gpg
diff --git a/META.yml b/META.yml
new file mode 100644
index 0000000..8ff083a
--- /dev/null
+++ b/META.yml
@@ -0,0 +1,21 @@
+---
+abstract: 'Load (and optionally decrypt via GnuPG) user/pass identity information '
+author:
+ - 'Robert Krimen <robertkrimen@gmail.com>'
+build_requires:
+ Test::Most: 0
+configure_requires:
+ ExtUtils::MakeMaker: 6.30
+dynamic_config: 0
+generated_by: 'Dist::Zilla version 5.013, CPAN::Meta::Converter version 2.130880'
+license: perl
+meta-spec:
+ url: http://module-build.sourceforge.net/META-spec-v1.4.html
+ version: 1.4
+name: Config-Identity
+requires:
+ File::HomeDir: 0
+ File::Spec: 0
+ File::Which: 0
+ IPC::Run: 0
+version: 0.0018
diff --git a/Makefile.PL b/Makefile.PL
new file mode 100644
index 0000000..e081493
--- /dev/null
+++ b/Makefile.PL
@@ -0,0 +1,60 @@
+
+# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.013.
+use strict;
+use warnings;
+
+
+
+use ExtUtils::MakeMaker 6.30;
+
+
+
+my %WriteMakefileArgs = (
+ "ABSTRACT" => "Load (and optionally decrypt via GnuPG) user/pass identity information ",
+ "AUTHOR" => "Robert Krimen <robertkrimen\@gmail.com>",
+ "BUILD_REQUIRES" => {},
+ "CONFIGURE_REQUIRES" => {
+ "ExtUtils::MakeMaker" => "6.30"
+ },
+ "DISTNAME" => "Config-Identity",
+ "EXE_FILES" => [],
+ "LICENSE" => "perl",
+ "NAME" => "Config::Identity",
+ "PREREQ_PM" => {
+ "File::HomeDir" => 0,
+ "File::Spec" => 0,
+ "File::Which" => 0,
+ "IPC::Run" => 0
+ },
+ "TEST_REQUIRES" => {
+ "Test::Most" => 0
+ },
+ "VERSION" => "0.0018",
+ "test" => {
+ "TESTS" => "t/*.t"
+ }
+);
+
+
+my %FallbackPrereqs = (
+ "File::HomeDir" => 0,
+ "File::Spec" => 0,
+ "File::Which" => 0,
+ "IPC::Run" => 0,
+ "Test::Most" => 0
+);
+
+
+unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
+ delete $WriteMakefileArgs{TEST_REQUIRES};
+ delete $WriteMakefileArgs{BUILD_REQUIRES};
+ $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
+}
+
+delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
+ unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
+
+WriteMakefile(%WriteMakefileArgs);
+
+
+
diff --git a/README b/README
new file mode 100644
index 0000000..68b9c9a
--- /dev/null
+++ b/README
@@ -0,0 +1,114 @@
+NAME
+ Config::Identity - Load (and optionally decrypt via GnuPG) user/pass
+ identity information
+
+VERSION
+ version 0.0018
+
+SYNOPSIS
+ PAUSE:
+
+ use Config::Identity::PAUSE;
+
+ # 1. Find either $HOME/.pause-identity or $HOME/.pause
+ # 2. Decrypt the found file (if necessary), read, and parse it
+ # 3. Throw an exception unless %identity has 'user' and 'password' defined
+
+ my %identity = Config::Identity::PAUSE->load;
+ print "user: $identity{user} password: $identity{password}\n";
+
+ GitHub API:
+
+ use Config::Identity::GitHub;
+
+ # 1. Find either $HOME/.github-identity or $HOME/.github
+ # 2. Decrypt the found file (if necessary) read, and parse it
+ # 3. Throw an exception unless %identity has 'login' and 'token' defined
+
+ my %identity = Config::Identity::PAUSE->load;
+ print "login: $identity{login} token: $identity{token}\n";
+
+DESCRIPTION
+ Config::Identity is a tool for loadiing (and optionally decrypting via
+ GnuPG) user/pass identity information
+
+ For GitHub API access, an identity is a "login"/"token" pair
+
+ For PAUSE access, an identity is a "user"/"password" pair
+
+USAGE
+ %identity = Config::Identity->load_best( <stub> )
+ First attempt to load an identity from $HOME/.<stub>-identity
+
+ If that file does not exist, then attempt to load an identity from
+ $HOME/.<stub>
+
+ The file may be optionally GnuPG encrypted
+
+ %identity will be populated like so:
+
+ <key> <value>
+
+ For example:
+
+ username alice
+ password hunter2
+
+Using a custom "gpg" or passing custom arguments
+ You can specify a custom "gpg" executable by setting the CI_GPG
+ environment variable
+
+ export CI_GPG="$HOME/bin/gpg"
+
+ You can pass custom arguments by setting the CI_GPG_ARGUMENTS
+ environment variable
+
+ export CI_GPG_ARGUMENTS="--no-secmem-warning"
+
+Encrypting your identity information with GnuPG
+ If you've never used GnuPG before, first initialize it:
+
+ # Follow the prompts to create a new key for yourself
+ gpg --gen-key
+
+ To encrypt your GitHub identity with GnuPG using the above key:
+
+ # Follow the prompts, using the above key as the "recipient"
+ # Use ^D once you've finished typing out your authentication information
+ gpg -ea > $HOME/.github
+
+Caching your GnuPG secret key via gpg-agent
+ Put the following in your .*rc
+
+ if which gpg-agent 1>/dev/null
+ then
+ if test -f $HOME/.gpg-agent-info && \
+ kill -0 `cut -d: -f 2 $HOME/.gpg-agent-info` 2>/dev/null
+ then
+ . "${HOME}/.gpg-agent-info"
+ export GPG_AGENT_INFO
+ else
+ eval `gpg-agent --daemon --write-env-file "${HOME}/.gpg-agent-info"`
+ fi
+ else
+ fi
+
+PAUSE identity format
+ user <user>
+ password <password>
+
+ "username" can also be used as alias for "user"
+
+GitHub identity format
+ login <login>
+ token <token>
+
+AUTHOR
+ Robert Krimen <robertkrimen@gmail.com>
+
+COPYRIGHT AND LICENSE
+ This software is copyright (c) 2014 by Robert Krimen.
+
+ This is free software; you can redistribute it and/or modify it under
+ the same terms as the Perl 5 programming language system itself.
+
diff --git a/lib/Config/Identity.pm b/lib/Config/Identity.pm
new file mode 100644
index 0000000..527069a
--- /dev/null
+++ b/lib/Config/Identity.pm
@@ -0,0 +1,256 @@
+package Config::Identity;
+# ABSTRACT: Load (and optionally decrypt via GnuPG) user/pass identity information
+$Config::Identity::VERSION = '0.0018';
+
+use strict;
+use warnings;
+
+use Carp;
+use IPC::Run qw/ start finish /;
+use File::HomeDir();
+use File::Spec;
+
+our $home = File::HomeDir->home;
+{
+ my $gpg;
+ sub GPG() { $ENV{CI_GPG} || ( $gpg ||= do {
+ require File::Which;
+ $gpg = File::Which::which( $_ ) and last for qw/ gpg gpg2 /;
+ $gpg;
+ } ) }
+}
+sub GPG_ARGUMENTS() { $ENV{CI_GPG_ARGUMENTS} || '' }
+
+# TODO Do not even need to do this, since the file is on disk already...
+sub decrypt {
+ my $self = shift;
+ my $file = shift;
+
+ my $gpg = GPG or croak "Missing gpg";
+ my $gpg_arguments = GPG_ARGUMENTS;
+ my $run;
+ # Old versions, please ignore
+ #$run = "$gpg $gpg_arguments -qd --no-tty --command-fd 0 --status-fd 1";
+ #$run = "$gpg $gpg_arguments -qd --no-tty --command-fd 0";
+ $run = "$gpg $gpg_arguments -qd --no-tty";
+ my @run = split m/\s+/, $run;
+ push @run, $file;
+ my $process = start( \@run, '>pipe', \*OUT, '2>pipe', \*ERR );
+ my $output = join '', <OUT>;
+ my $_error = join '', <ERR>;
+ finish $process;
+ return ( $output, $_error );
+}
+
+sub best {
+ my $self = shift;
+ my $stub = shift;
+ my $base = shift;
+ $base = $home unless defined $base;
+
+ croak "Missing stub" unless defined $stub && length $stub;
+
+ for my $i0 ( ".$stub-identity", ".$stub" ) {
+ for my $i1 ( "." ) {
+ my $path = File::Spec->catfile( $base, $i1, $i0 );
+ return $path if -f $path;
+ }
+ }
+
+ return '';
+}
+
+sub read {
+ my $self = shift;
+ my $file = shift;
+
+ croak "Missing file" unless -f $file;
+ croak "Cannot read file ($file)" unless -r $file;
+
+ my $binary = -B $file;
+
+ open my $handle, $file or croak $!;
+ binmode $handle if $binary;
+ local $/ = undef;
+ my $content = <$handle>;
+ close $handle or warn $!;
+
+ if ( $binary || $content =~ m/----BEGIN PGP MESSAGE----/ ) {
+ my ( $_content, $error ) = $self->decrypt( $file );
+ if ( $error ) {
+ carp "Error during decryption of content" . $binary ? '' : "\n$content";
+ croak "Error during decryption of $file:\n$error";
+ }
+ $content = $_content;
+ }
+
+ return $content;
+}
+
+sub parse {
+ my $self = shift;
+ my $content = shift;
+
+ return unless $content;
+ my %content;
+ for ( split m/\n/, $content ) {
+ next if /^\s*#/;
+ next unless m/\S/;
+ next unless my ($key, $value) = /^\s*(\w+)\s+(.+)$/;
+ $content{$key} = $value;
+ }
+ return %content;
+}
+
+sub load_best {
+ my $self = shift;
+ my $stub = shift;
+
+ die "Unable to find .$stub-identity or .$stub" unless my $path = $self->best( $stub );
+ return $self->load( $path );
+}
+
+sub try_best {
+ my $self = shift;
+ my $stub = shift;
+
+ return unless my $path = $self->best( $stub );
+ return $self->load( $path );
+}
+
+sub load {
+ my $self = shift;
+ my $file = shift;
+
+ return $self->parse( $self->read( $file ) );
+}
+
+1;
+
+__END__
+
+=pod
+
+=head1 NAME
+
+Config::Identity - Load (and optionally decrypt via GnuPG) user/pass identity information
+
+=head1 VERSION
+
+version 0.0018
+
+=head1 SYNOPSIS
+
+PAUSE:
+
+ use Config::Identity::PAUSE;
+
+ # 1. Find either $HOME/.pause-identity or $HOME/.pause
+ # 2. Decrypt the found file (if necessary), read, and parse it
+ # 3. Throw an exception unless %identity has 'user' and 'password' defined
+
+ my %identity = Config::Identity::PAUSE->load;
+ print "user: $identity{user} password: $identity{password}\n";
+
+GitHub API:
+
+ use Config::Identity::GitHub;
+
+ # 1. Find either $HOME/.github-identity or $HOME/.github
+ # 2. Decrypt the found file (if necessary) read, and parse it
+ # 3. Throw an exception unless %identity has 'login' and 'token' defined
+
+ my %identity = Config::Identity::PAUSE->load;
+ print "login: $identity{login} token: $identity{token}\n";
+
+=head1 DESCRIPTION
+
+Config::Identity is a tool for loadiing (and optionally decrypting via GnuPG) user/pass identity information
+
+For GitHub API access, an identity is a C<login>/C<token> pair
+
+For PAUSE access, an identity is a C<user>/C<password> pair
+
+=head1 USAGE
+
+=head2 %identity = Config::Identity->load_best( <stub> )
+
+First attempt to load an identity from $HOME/.<stub>-identity
+
+If that file does not exist, then attempt to load an identity from $HOME/.<stub>
+
+The file may be optionally GnuPG encrypted
+
+%identity will be populated like so:
+
+ <key> <value>
+
+For example:
+
+ username alice
+ password hunter2
+
+=head1 Using a custom C<gpg> or passing custom arguments
+
+You can specify a custom C<gpg> executable by setting the CI_GPG environment variable
+
+ export CI_GPG="$HOME/bin/gpg"
+
+You can pass custom arguments by setting the CI_GPG_ARGUMENTS environment variable
+
+ export CI_GPG_ARGUMENTS="--no-secmem-warning"
+
+=head1 Encrypting your identity information with GnuPG
+
+If you've never used GnuPG before, first initialize it:
+
+ # Follow the prompts to create a new key for yourself
+ gpg --gen-key
+
+To encrypt your GitHub identity with GnuPG using the above key:
+
+ # Follow the prompts, using the above key as the "recipient"
+ # Use ^D once you've finished typing out your authentication information
+ gpg -ea > $HOME/.github
+
+=head1 Caching your GnuPG secret key via gpg-agent
+
+Put the following in your .*rc
+
+ if which gpg-agent 1>/dev/null
+ then
+ if test -f $HOME/.gpg-agent-info && \
+ kill -0 `cut -d: -f 2 $HOME/.gpg-agent-info` 2>/dev/null
+ then
+ . "${HOME}/.gpg-agent-info"
+ export GPG_AGENT_INFO
+ else
+ eval `gpg-agent --daemon --write-env-file "${HOME}/.gpg-agent-info"`
+ fi
+ else
+ fi
+
+=head1 PAUSE identity format
+
+ user <user>
+ password <password>
+
+C<username> can also be used as alias for C<user>
+
+=head1 GitHub identity format
+
+ login <login>
+ token <token>
+
+=head1 AUTHOR
+
+Robert Krimen <robertkrimen@gmail.com>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2014 by Robert Krimen.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+=cut
diff --git a/lib/Config/Identity/GitHub.pm b/lib/Config/Identity/GitHub.pm
new file mode 100644
index 0000000..eeff91d
--- /dev/null
+++ b/lib/Config/Identity/GitHub.pm
@@ -0,0 +1,34 @@
+package Config::Identity::GitHub;
+
+use strict;
+use warnings;
+
+use Config::Identity;
+use Carp;
+
+our $STUB = 'github';
+sub STUB { defined $_ and return $_ for $ENV{CI_GITHUB_STUB}, $STUB }
+
+sub load {
+ my $self = shift;
+ return Config::Identity->try_best( $self->STUB );
+}
+
+sub check {
+ my $self = shift;
+ my %identity = @_;
+ my @missing;
+ defined $identity{$_} && length $identity{$_}
+ or push @missing, $_ for qw/ login token /;
+ croak "Missing ", join ' and ', @missing if @missing;
+}
+
+sub load_check {
+ my $self = shift;
+ my %identity = $self->load;
+ $self->check( %identity );
+ return %identity;
+}
+
+1;
+
diff --git a/lib/Config/Identity/PAUSE.pm b/lib/Config/Identity/PAUSE.pm
new file mode 100644
index 0000000..e3e762d
--- /dev/null
+++ b/lib/Config/Identity/PAUSE.pm
@@ -0,0 +1,36 @@
+package Config::Identity::PAUSE;
+
+use strict;
+use warnings;
+
+use Config::Identity;
+use Carp;
+
+our $STUB = 'pause';
+sub STUB { defined $_ and return $_ for $ENV{CI_PAUSE_STUB}, $STUB }
+
+sub load {
+ my $self = shift;
+ my %identity = Config::Identity->try_best( $self->STUB );
+ $identity{user} = $identity{username} if exists $identity{username} && ! exists $identity{user};
+ $identity{username} = $identity{user} if exists $identity{user} && ! exists $identity{username};
+ return %identity;
+}
+
+sub check {
+ my $self = shift;
+ my %identity = @_;
+ my @missing;
+ defined $identity{$_} && length $identity{$_}
+ or push @missing, $_ for qw/ user password /;
+ croak "Missing ", join ' and ', @missing if @missing;
+}
+
+sub load_check {
+ my $self = shift;
+ my %identity = $self->load;
+ $self->check( %identity );
+ return %identity;
+}
+
+1;
diff --git a/t/.01-basic.t.swp b/t/.01-basic.t.swp
new file mode 100644
index 0000000..b4d8a9f
--- /dev/null
+++ b/t/.01-basic.t.swp
Binary files differ
diff --git a/t/01-basic.t b/t/01-basic.t
new file mode 100644
index 0000000..63c570d
--- /dev/null
+++ b/t/01-basic.t
@@ -0,0 +1,84 @@
+#!/usr/bin/env perl
+
+use strict;
+use warnings;
+
+use Test::Most;
+plan 'no_plan';
+
+use Config::Identity;
+use Config::Identity::GitHub;
+use Config::Identity::PAUSE;
+
+my $h0 = File::Spec->catdir(qw/ t assets h0 /);
+my $h1 = File::Spec->catdir(qw/ t assets h1 /);
+
+is( Config::Identity->best( 'test' => $h0 ), File::Spec->catfile( $h0, '.test-identity' ) );
+is( Config::Identity->best( 'test' => $h1 ), File::Spec->catfile( $h1, '.test' ) );
+
+my ( %cfg );
+
+%cfg = Config::Identity->parse( <<'_END_' );
+ # Xyzzy
+apple a1
+banana b2
+
+
+
+_END_
+
+cmp_deeply( \%cfg, {qw/ apple a1 banana b2 /} );
+
+{
+ local $ENV{CI_PAUSE_STUB} = 'pause-alternate';
+ local $Config::Identity::home = File::Spec->catfile(qw/ t assets pause /);
+ my %identity = Config::Identity::PAUSE->load_check;
+ cmp_deeply( \%identity, {qw/ username alternate user alternate password xyzzy /} );
+}
+
+SKIP: {
+ skip 'GnuPG not available' unless Config::Identity->GPG;
+
+ $ENV{CI_GPG_ARGUMENTS} =
+ '--no-secmem-warning ' .
+ '--no-permission-warning ' .
+ '--homedir ' . File::Spec->catfile(qw/ t assets gpg /)
+ ;
+
+ is( Config::Identity->read( File::Spec->catfile(qw/ t assets test.asc /) ), <<_END_ );
+1234567890xyzzy
+
+# 123
+_END_
+
+ if ($ENV{RELEASE_TESTING}) {
+ is( Config::Identity->read( File::Spec->catfile(qw/ t assets test.gpg /) ), <<_END_ );
+ABCDEFGHIJKLMNOPQRSTUVWXYZ
+
+1 2 3 4 5 6 7 8 9 0
+
+.
+_END_
+ }
+
+ use Config::Identity::GitHub;
+ {
+ local $Config::Identity::home = File::Spec->catfile(qw/ t assets github /);
+ my %identity = Config::Identity::GitHub->load_check;
+ cmp_deeply( \%identity, {qw/ login alice token hunter2 /} );
+ }
+
+ use Config::Identity::PAUSE;
+ {
+ local $Config::Identity::home = File::Spec->catfile(qw/ t assets pause /);
+ my %identity = Config::Identity::PAUSE->load_check;
+ cmp_deeply( \%identity, {qw/ username alice user alice password hunter2 /} );
+ }
+ {
+ local $Config::Identity::home = File::Spec->catfile(qw/ t assets pause-username /);
+ my %identity = Config::Identity::PAUSE->load_check;
+ cmp_deeply( \%identity, {qw/ username alice user alice password hunter3 /} );
+ }
+}
+
+1;
diff --git a/t/assets/github/.github b/t/assets/github/.github
new file mode 100644
index 0000000..85ab9aa
--- /dev/null
+++ b/t/assets/github/.github
Binary files differ
diff --git a/t/assets/gpg/pubring.gpg b/t/assets/gpg/pubring.gpg
new file mode 100644
index 0000000..ebc85e0
--- /dev/null
+++ b/t/assets/gpg/pubring.gpg
Binary files differ
diff --git a/t/assets/gpg/random_seed b/t/assets/gpg/random_seed
new file mode 100644
index 0000000..13bad1e
--- /dev/null
+++ b/t/assets/gpg/random_seed
Binary files differ
diff --git a/t/assets/gpg/secring.gpg b/t/assets/gpg/secring.gpg
new file mode 100644
index 0000000..fa732b6
--- /dev/null
+++ b/t/assets/gpg/secring.gpg
Binary files differ
diff --git a/t/assets/gpg/trustdb.gpg b/t/assets/gpg/trustdb.gpg
new file mode 100644
index 0000000..faaa930
--- /dev/null
+++ b/t/assets/gpg/trustdb.gpg
Binary files differ
diff --git a/t/assets/h0/.test b/t/assets/h0/.test
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/t/assets/h0/.test
diff --git a/t/assets/h0/.test-identity b/t/assets/h0/.test-identity
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/t/assets/h0/.test-identity
diff --git a/t/assets/h1/.test b/t/assets/h1/.test
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/t/assets/h1/.test
diff --git a/t/assets/pause-username/.pause-identity b/t/assets/pause-username/.pause-identity
new file mode 100644
index 0000000..19d995a
--- /dev/null
+++ b/t/assets/pause-username/.pause-identity
@@ -0,0 +1,2 @@
+username alice
+password hunter3
diff --git a/t/assets/pause/.pause-alternate b/t/assets/pause/.pause-alternate
new file mode 100644
index 0000000..88d760d
--- /dev/null
+++ b/t/assets/pause/.pause-alternate
@@ -0,0 +1,2 @@
+username alternate
+password xyzzy
diff --git a/t/assets/pause/.pause-identity b/t/assets/pause/.pause-identity
new file mode 100644
index 0000000..e80edc2
--- /dev/null
+++ b/t/assets/pause/.pause-identity
@@ -0,0 +1,18 @@
+-----BEGIN PGP MESSAGE-----
+Version: GnuPG v1.4.9 (GNU/Linux)
+
+hQIOAzJ5xAPA+8MREAf/ZaZR+uyQFApZ3XXHc2910Hjat3v3P6TPVaZwWOr0Pp9g
+2RUO+ea4tWtzOSWig3UziMUa5UVQk/EMflcPJODNwZyTPuCT59FB3oIiieb5TkOB
+Bjzi2svdqiFExf6SN/i7eLBUG7/rB3/jImlXmLFt83Tx+H4QWoe4IlHMHAD05Ahl
+rH9qxYnoVAzzN4Fya/6cDzFDZscci6o81njdf4Kuvdfubvm7beVeQK3xJwrM7vA8
+SSELOTgkW2iL6eqO+7ItRs1e6tRKlbl1tGBwS7kZzMlVhTgnrubEKIOEJx8D/czR
+2UpDxNn0ITYxj6UBz7Ik9Sh3iF89xx4urg5UFLKc9Qf/eE+TBb0fWy/Hw9PCHDiu
+vjWWTT/KWyuEF6q9YRjaQgHoKrvcNhiiP/SsLDoFTbfpdynDR3GgxlTre8LKVby8
+Ary5xXGBcQZ5DboZ/GESgSU5ny4bxH6Uj3hznkq3pPwCrd2rPZawuKdfbST8gCiV
+w5Sv7tOblPlRUXKsz5OhP8hP6A3pCQrH36H1q8pyh10Iifyx//cYWsouu++UvZaX
+TAPUVStaE1+PbsK7gIoPQk/gLrXb8cZi1TyXPeT9PrlkerX07Po1wea8lvPUyYLD
+luBuY1/M6izgtnceTnYHcGS+YIsWxL/wio2/VDZL1oE3ab6mwlsZOoJN7/eB+CDf
+AdJXAW0vuDsBSvai8t7rlb0QHWu+5iBYUGKwkG3lLDc2gQfjTwJUgyhIap0NlWYO
+fOKPlNlUMC+khGafOIgoE5gWpX444jlZ7N8flJvjFEzW1I9vT7xXIJAP
+=zjZL
+-----END PGP MESSAGE-----
diff --git a/t/assets/test.asc b/t/assets/test.asc
new file mode 100644
index 0000000..694b8d5
--- /dev/null
+++ b/t/assets/test.asc
@@ -0,0 +1,18 @@
+-----BEGIN PGP MESSAGE-----
+Version: GnuPG v1.4.9 (GNU/Linux)
+
+hQIOAzJ5xAPA+8MREAf/b6zAnwr/BL0h1q8h24Wk6c8CUTif9Vy69yMhL13diTjn
+wak1ixeCmCP9q1BWfxaS076R1jXAC1yDTuTbmd2n7fzUETQwSvP97Pq6WR8QuZze
+BojuPYfvzZA7gbgsIt4pQ3wzd2Uf+IUtc0adpt1MyPmZU2ar1Fe8PABiNnwpDhTq
+tpfglw5UvaQJzOyT1XAxY6lk28iobmdu5DloYMWRP++Avg68HuN7ZzwLOJzms75V
+rjTtduuxoHrPQYzTokSsciPxWZ2EAyDQuMID3xxmffkX5kJySv4J6H8yavBIHApO
+ipab52j65zu0fKO718DJnKzNyZa2/x7tA8K/ZMPROwf8CQ2QsN8pJA11mhgONbqb
+ceL0XUD97ZirQnDJegkg/HLca562yNPlnHgGNVqlF2tGFKIdtBoVue/M3lKVuDow
+kExuY9KTG1tkinvaYV61MnHhlDdVBMolB2ZmTgHL0INtwq18hnYJ8iBJ9o2wHxJZ
+ZrbuSDS+kMQ8F/fEaAmF4Rkc33+6PbgT/pj1BptSBehXwOmA8vgsOpI93Jz8hqvy
+xsH7oCoWdj3Plf0gQj393lDBDc3HsJKMrQ+4yzA74rr1Dr+ux7f4vhHGtv6tmzM0
+q5nnDsTrK4FXuOXQ8Z4oY12ylQ5l4hNR5vsrszdD609eupl6EPVamtrG4f3FRLJg
+7NJRAfBUN8FxY/6Mi+ric8qxqJ6+56nC39bZs7a2Lz07PC71EJxBk5/0Oa+nJhkG
+L/6dRLKJLWNA6AFFIX56WKn72I/pZirhCiOQc02ptl7BNgO5
+=hzYK
+-----END PGP MESSAGE-----
diff --git a/t/assets/test.gpg b/t/assets/test.gpg
new file mode 100644
index 0000000..7814b85
--- /dev/null
+++ b/t/assets/test.gpg
@@ -0,0 +1,3 @@
+2yI_
+'vya}97QYw$@6FC8͉cwnM-|dsƈtem ޞsÕ&=sN)];D/]Vu>U>E pe YaV|֦4%`[0ciRm1dRD% 'ehAe"j}J$*gdim64)nH2c:u˳|v9!Y$ _8Gi|U1?.B=Glܼ`ydk>t[3T˕CwzUg>&n3Ob9ts8+U-qpQW(5oߪ;o{a  ϰ4\B ǀA&jϞ-II_(N}+j_OI.y{F
+ [4ycNm`2 &[&MHm# 9R=xEn P, OjɊ<sf]&o$9bLrCA=jC)D:TWfX(*d>TƐYFN2qfcl\c7) \ No newline at end of file