Passwd-Keyring-KDEWallet
view release on metacpan or search on metacpan
0.2005 2012-11-15
Fixed bugs in package dependencies and metadata (wrong homepage
and repository page links etc)
0.2004 2012-11-11
Added example
0.2003 2012-11-11
Skipping tests if not running under desktop session, so the
module can be installed from root shell etc.
0.2002 2012-11-09
Documentation updates.
0.2001 2012-11-08
Small documentation fixes, more info in CPAN metadata
0.20 2012-11-08
First version (working, functionality equivalent to Passwd::Keyring::Gnome)
Passwd::Keyring::KDEWallet
Passwd::Keyring is about using secure storage for passwords
and other credentials used in perl scripts and applications.
Passwd::Keyring::KDEWallet uses KDE KWallet API to securely
preserve passwords and is available to people using KDE
desktop environment (or at least with installed kwallet).
INSTALLATION
To install this module, run the following commands:
perl Build.PL
./Build
./Build test
./Build install
lib/Passwd/Keyring/KDEWallet.pm view on Meta::CPAN
}
# Called from the constructor, setups self->{kwallet} attribute (top level
# service object)
sub _init_kwallet {
my $self = shift;
# get_service may fail by itself, if kwalletd is down, in some
# cases it fails with
#
# org.freedesktop.DBus.Error.ServiceUnknown: The name org.kde.kwalletd was not provided by any .service files
my $kwallet_svc;
my $error;
try {
$kwallet_svc = $self->{bus}->get_service($self->{service_name});
} catch {
$error = $_;
chomp($error);
};
unless($kwallet_svc) {
# Mayhaps we are allowed to start kwalletd?
if(! $self->{dont_start_daemon}
&& $error =~ /^org\.freedesktop\.DBus\.Error\.ServiceUnknown:/) {
print STDERR "KWallet service not available, attempting to start $self->{kwalletd_path}\n";
# spawn kwalletd
my $pid = sync_exec
sub {
# Without this prove (tests) hang
close (STDOUT);
return 1;
},
$self->{kwalletd_path};
unless($pid) {
t/01-set-and-get.t view on Meta::CPAN
#!perl
use strict;
use warnings;
use Test::More;
if($ENV{DESKTOP_SESSION} || $ENV{DBUS_SESSION_BUS_ADDRESS}) {
plan tests => 9;
} else {
plan skip_all => "Keyring not available (not running under KDE/Gnome/other desktop session), skipping tests";
}
use Passwd::Keyring::KDEWallet;
SKIP: {
my $ring;
eval {
$ring = Passwd::Keyring::KDEWallet->new;
}; if($@) {
t/02-is-persistent.t view on Meta::CPAN
#!perl
use strict;
use warnings;
use Test::More;
use Passwd::Keyring::KDEWallet;
if($ENV{DESKTOP_SESSION} || $ENV{DBUS_SESSION_BUS_ADDRESS}) {
plan tests => 2;
} else {
plan skip_all => "Keyring not available (not running under KDE/Gnome/other desktop session), skipping tests";
}
SKIP: {
my $ring;
eval {
$ring = Passwd::Keyring::KDEWallet->new;
}; if($@) {
if($@ =~ /^KWallet not available/) {
skip "KWallet not available ($@)", 2;
} else {
t/03-many-sets-and-gets.t view on Meta::CPAN
#!perl
use strict;
use warnings;
use Test::More;
use Passwd::Keyring::KDEWallet;
if($ENV{DESKTOP_SESSION} || $ENV{DBUS_SESSION_BUS_ADDRESS}) {
plan tests => 11;
} else {
plan skip_all => "Keyring not available (not running under KDE/Gnome/other desktop session), skipping tests";
}
my $SOME_REALM = 'my@@realm';
my $OTHER_REALM = 'other realm';
SKIP: {
my $ring;
eval {
$ring = Passwd::Keyring::KDEWallet->new(app=>"Passwd::Keyring::KDEWallet", group=>"Unit tests");
t/04-recovering-in-sep-prog.t view on Meta::CPAN
#!perl
use strict;
use warnings;
use Test::More;
use Passwd::Keyring::KDEWallet;
if($ENV{DESKTOP_SESSION} || $ENV{DBUS_SESSION_BUS_ADDRESS}) {
plan tests => 13;
} else {
plan skip_all => "Keyring not available (not running under KDE/Gnome/other desktop session), skipping tests";
}
SKIP: {
my $SOME_REALM = 'my@@realm';
my $OTHER_REALM = 'other realm';
my $ring;
eval {
t/05-many-sets-and-gets-with-name.t view on Meta::CPAN
#!perl
use strict;
use warnings;
use Test::More;
if($ENV{DESKTOP_SESSION} || $ENV{DBUS_SESSION_BUS_ADDRESS}) {
plan tests => 20;
} else {
plan skip_all => "Keyring not available (not running under KDE/Gnome/other desktop session), skipping tests";
}
use Passwd::Keyring::KDEWallet;
my $REALM_A = 'my@@realm';
my $REALM_B = 'bum trala la';
my $REALM_C = 'other realm';
my $USER1 = "Paul Anton";
t/06-recovering-with-app-change.t view on Meta::CPAN
eval { Passwd::Keyring::KDEWallet->new() };
unless($@) {
plan tests => 16;
} elsif($@ =~ /^KWallet not available/) {
plan skip_all => "KWallet not available ($@)";
} else {
plan tests => 16;
die $@;
}
} else {
plan skip_all => "Keyring not available (not running under KDE/Gnome/other desktop session), skipping tests";
}
my $USER = "Herakliusz";
my $REALM = "test realm";
my $PWD = "arcytajne haslo";
my $PWD2 = "inny sekret";
my $APP1 = "Passwd::Keyring::Unit tests (1)";
my $APP2 = "Passwd::Keyring::Unit tests (2)";
t/07-ugly-chars.t view on Meta::CPAN
#!perl
use strict;
use warnings;
use Test::More;
if($ENV{DESKTOP_SESSION} || $ENV{DBUS_SESSION_BUS_ADDRESS}) {
plan tests => 4;
} else {
plan skip_all => "Keyring not available (not running under KDE/Gnome/other desktop session), skipping tests";
}
use Passwd::Keyring::KDEWallet;
my $UGLY_NAME = "Joh ## no ^^ Ȁ
ÄÄÅóÅż«";
my $UGLY_PWD = "«tajne hasÅo»";
my $UGLY_REALM = '«do»âmain';
SKIP: {
t/08-verylong-params.t view on Meta::CPAN
use strict;
use warnings;
use Test::More;
use Passwd::Keyring::KDEWallet;
if($ENV{DESKTOP_SESSION} || $ENV{DBUS_SESSION_BUS_ADDRESS}) {
plan tests => 4;
} else {
plan skip_all => "Keyring not available (not running under KDE/Gnome/other desktop session), skipping tests";
}
my $APP = "Passwd::KDEWallet::Keyring unit test 08 ";
$APP .= "X" x (256 - length($APP));
my $GROUP = "Passwd::KDEWallet::Keyring unit tests ";
$GROUP .= "X" x (256 - length($GROUP));
my $USER = "A" x 256;
my $PWD = "B" x 256;
( run in 0.754 second using v1.01-cache-2.11-cpan-299005ec8e3 )