[Rt-commit] r10663 - in rt/branches/3.999-DANGEROUS: . html/Ticket/Elements lib/RT/Crypt lib/RT/Interface lib/RT/Interface/Email/Auth lib/RT/Model t/mail
jesse at bestpractical.com
jesse at bestpractical.com
Fri Feb 1 19:28:47 EST 2008
Author: jesse
Date: Fri Feb 1 19:28:47 2008
New Revision: 10663
Modified:
rt/branches/3.999-DANGEROUS/ (props changed)
rt/branches/3.999-DANGEROUS/html/Ticket/Elements/ShowGnuPGStatus
rt/branches/3.999-DANGEROUS/lib/RT/Crypt/GnuPG.pm
rt/branches/3.999-DANGEROUS/lib/RT/Interface/Email.pm
rt/branches/3.999-DANGEROUS/lib/RT/Interface/Email/Auth/GnuPG.pm
rt/branches/3.999-DANGEROUS/lib/RT/Model/Transaction.pm
rt/branches/3.999-DANGEROUS/t/delegation/cleanup_stalled.t
rt/branches/3.999-DANGEROUS/t/mail/crypt-gnupg.t
Log:
r76078 at pinglin: jesse | 2008-02-01 19:19:59 -0500
fix test count
r76079 at pinglin: jesse | 2008-02-01 19:27:55 -0500
Entity, Bounce => entity, bounce
Fix for "outgoing mail not recorded"
Modified: rt/branches/3.999-DANGEROUS/html/Ticket/Elements/ShowGnuPGStatus
==============================================================================
--- rt/branches/3.999-DANGEROUS/html/Ticket/Elements/ShowGnuPGStatus (original)
+++ rt/branches/3.999-DANGEROUS/html/Ticket/Elements/ShowGnuPGStatus Fri Feb 1 19:28:47 2008
@@ -104,7 +104,7 @@
}
use RT::Interface::Email::Auth::GnuPG;
- my ($status, @res) = RT::Interface::Email::Auth::GnuPG::verify_decrypt( Entity => $entity );
+ my ($status, @res) = RT::Interface::Email::Auth::GnuPG::verify_decrypt( entity => $entity );
if ( $status && !@res ) {
# imposible in this situation
return (0, "Content of attachment #". $original->id ." is not signed and/or encrypted");
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Crypt/GnuPG.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Crypt/GnuPG.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Crypt/GnuPG.pm Fri Feb 1 19:28:47 2008
@@ -383,7 +383,7 @@
return shift->();
}
-=head2 sign_encrypt Entity => MIME::Entity, [ encrypt => 1, sign => 1, ... ]
+=head2 sign_encrypt entity => MIME::Entity, [ encrypt => 1, sign => 1, ... ]
Signs and/or encrypts an email message with GnuPG utility.
@@ -418,7 +418,7 @@
sub sign_encrypt {
my %args = (@_);
- my $entity = $args{'Entity'};
+ my $entity = $args{'entity'};
if ( $args{'sign'} && !defined $args{'Signer'} ) {
$args{'Signer'} = use_key_for_signing()
|| ( Mail::Address->parse( $entity->head->get('From') ) )[0]
@@ -613,13 +613,13 @@
sub sign_encrypt_inline {
my %args = (@_);
- my $entity = $args{'Entity'};
+ my $entity = $args{'entity'};
my %res;
$entity->make_singlepart;
if ( $entity->is_multipart ) {
foreach ( $entity->parts ) {
- %res = sign_encrypt_inline( @_, Entity => $_ );
+ %res = sign_encrypt_inline( @_, entity => $_ );
return %res if $res{'exit_code'};
}
return %res;
@@ -1070,19 +1070,19 @@
};
}
- push @res, find_protected_parts( Entity => $_ )
+ push @res, find_protected_parts( entity => $_ )
foreach grep !$skip{"$_"}, $entity->parts;
return @res;
}
-=head2 verify_decrypt Entity => undef, [ Detach => 1, Passphrase => undef ]
+=head2 verify_decrypt entity => undef, [ Detach => 1, Passphrase => undef ]
=cut
sub verify_decrypt {
my %args = ( entity => undef, detach => 1, @_ );
- my @protected = find_protected_parts( Entity => $args{'entity'} );
+ my @protected = find_protected_parts( entity => $args{'entity'} );
my @res;
# XXX: detaching may brake nested signatures
@@ -2399,7 +2399,7 @@
my %res = sign_encrypt(
sign => 1,
encrypt => 0,
- Entity => $mime,
+ entity => $mime,
Signer => $from,
);
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Interface/Email.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Interface/Email.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Interface/Email.pm Fri Feb 1 19:28:47 2008
@@ -289,10 +289,10 @@
}
- send_email( entity => $entity, Bounce => 1 );
+ send_email( entity => $entity, bounce => 1 );
}
-=head2 send_email entity => undef, [ Bounce => 0, ticket => undef, transaction => undef ]
+=head2 send_email entity => undef, [ bounce => 0, ticket => undef, transaction => undef ]
Sends an email (passed as a L<MIME::Entity> object C<ENTITY>) using
RT's outgoing mail configuration. If C<BOUNCE> is passed, and is a
@@ -334,12 +334,6 @@
transaction => undef,
@_,
);
- foreach my $arg (qw(Entity Bounce)) {
- next unless defined $args{ lc $arg };
-
- Jifty->log->warn( "'" . lc($arg) . "' argument is deprecated, use '$arg' instead" );
- $args{$arg} = delete $args{ lc $arg };
- }
unless ( $args{'entity'} ) {
Jifty->log->fatal("Could not send mail without 'entity' object");
@@ -406,7 +400,7 @@
my $path = RT->config->get('SendmailPath');
my $args = RT->config->get('SendmailArguments');
$args .= ' ' . RT->config->get('SendmailBounceArguments')
- if $args{'Bounce'};
+ if $args{'bounce'};
# VERP
if ( $args{'transaction'}
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Interface/Email/Auth/GnuPG.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Interface/Email/Auth/GnuPG.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Interface/Email/Auth/GnuPG.pm Fri Feb 1 19:28:47 2008
@@ -80,7 +80,7 @@
my $msg = $args{'Message'}->dup;
- my ( $status, @res ) = verify_decrypt( Entity => $args{'Message'} );
+ my ( $status, @res ) = verify_decrypt( entity => $args{'Message'} );
if ( $status && !@res ) {
$args{'Message'}
->head->add( 'X-RT-Incoming-Encryption' => 'Not encrypted' );
@@ -244,7 +244,7 @@
sub verify_decrypt {
my %args = (
- Entity => undef,
+ entity => undef,
@_
);
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/Transaction.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/Transaction.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/Transaction.pm Fri Feb 1 19:28:47 2008
@@ -295,10 +295,11 @@
@_
);
- $args{object_id} ||= $args{Ticket};
+ $args{object_id} ||= $args{ticket};
#if we didn't specify a ticket, we need to bail
unless ( $args{'object_id'} && $args{'object_type'} ) {
+ Carp::cluck();
return (
0,
_( "Transaction->create couldn't, as you didn't specify an object type and id"
Modified: rt/branches/3.999-DANGEROUS/t/delegation/cleanup_stalled.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/delegation/cleanup_stalled.t (original)
+++ rt/branches/3.999-DANGEROUS/t/delegation/cleanup_stalled.t Fri Feb 1 19:28:47 2008
@@ -14,7 +14,7 @@
use RT::Test;
use Test::More;
-plan tests => 98;
+plan tests => 99;
use RT;
Modified: rt/branches/3.999-DANGEROUS/t/mail/crypt-gnupg.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/mail/crypt-gnupg.t (original)
+++ rt/branches/3.999-DANGEROUS/t/mail/crypt-gnupg.t Fri Feb 1 19:28:47 2008
@@ -34,7 +34,7 @@
Subject => 'test',
Data => ['test'],
);
- my %res = RT::Crypt::GnuPG::sign_encrypt( Entity => $entity, encrypt => 0, Passphrase => 'test' );
+ my %res = RT::Crypt::GnuPG::sign_encrypt( entity => $entity, encrypt => 0, Passphrase => 'test' );
ok( $entity, 'signed entity');
ok( !$res{'logger'}, "log is here as well" );
warn $res{'logger'};
@@ -49,13 +49,13 @@
ok( $entity->is_multipart, 'signed message is multipart' );
is( $entity->parts, 2, 'two parts' );
- my @parts = RT::Crypt::GnuPG::find_protected_parts( Entity => $entity );
+ my @parts = RT::Crypt::GnuPG::find_protected_parts( entity => $entity );
is( scalar @parts, 1, 'one protected part' );
is( $parts[0]->{'type'}, 'signed', "have signed part" );
is( $parts[0]->{'format'}, 'RFC3156', "RFC3156 format" );
is( $parts[0]->{'Top'}, $entity, "it's the same entity" );
- my @res = RT::Crypt::GnuPG::verify_decrypt( Entity => $entity );
+ my @res = RT::Crypt::GnuPG::verify_decrypt( entity => $entity );
is scalar @res, 1, 'one operation';
@status = RT::Crypt::GnuPG::parse_status( $res[0]{'status'} );
is( scalar @status, 1, 'one record');
@@ -71,7 +71,7 @@
Subject => 'test',
Data => ['test'],
);
- my %res = RT::Crypt::GnuPG::sign_encrypt( Entity => $entity, encrypt => 0, Passphrase => '' );
+ my %res = RT::Crypt::GnuPG::sign_encrypt( entity => $entity, encrypt => 0, Passphrase => '' );
ok( $res{'exit_code'}, "couldn't sign without passphrase");
ok( $res{'error'}, "error is here" );
ok( $res{'logger'}, "log is here as well" );
@@ -89,7 +89,7 @@
Subject => 'test',
Data => ['test'],
);
- my %res = RT::Crypt::GnuPG::sign_encrypt( Entity => $entity, encrypt => 0, Passphrase => 'wrong' );
+ my %res = RT::Crypt::GnuPG::sign_encrypt( entity => $entity, encrypt => 0, Passphrase => 'wrong' );
ok( $res{'exit_code'}, "couldn't sign with bad passphrase");
ok( $res{'error'}, "error is here" );
ok( $res{'logger'}, "log is here as well" );
@@ -108,7 +108,7 @@
Subject => 'test',
Data => ['test'],
);
- my %res = RT::Crypt::GnuPG::sign_encrypt( Entity => $entity, sign => 0 );
+ my %res = RT::Crypt::GnuPG::sign_encrypt( entity => $entity, sign => 0 );
ok( !$res{'exit_code'}, "successful encryption" );
ok( !$res{'logger'}, "no records in logger" );
@@ -119,7 +119,7 @@
ok($entity, 'get an encrypted part');
- my @parts = RT::Crypt::GnuPG::find_protected_parts( Entity => $entity );
+ my @parts = RT::Crypt::GnuPG::find_protected_parts( entity => $entity );
is( scalar @parts, 1, 'one protected part' );
is( $parts[0]->{'type'}, 'encrypted', "have encrypted part" );
is( $parts[0]->{'format'}, 'RFC3156', "RFC3156 format" );
@@ -134,7 +134,7 @@
Subject => 'test',
Data => ['test'],
);
- my %res = RT::Crypt::GnuPG::sign_encrypt( Entity => $entity, sign => 0 );
+ my %res = RT::Crypt::GnuPG::sign_encrypt( entity => $entity, sign => 0 );
ok( $res{'exit_code'}, 'no way to encrypt without keys of recipients');
ok( $res{'logger'}, "errors are in logger" );
@@ -151,7 +151,7 @@
Subject => 'test',
Data => ['test'],
);
- my %res = RT::Crypt::GnuPG::sign_encrypt( Entity => $entity, Passphrase => 'test' );
+ my %res = RT::Crypt::GnuPG::sign_encrypt( entity => $entity, Passphrase => 'test' );
ok( !$res{'exit_code'}, "successful encryption with signing" );
ok( !$res{'logger'}, "no records in logger" );
@@ -166,7 +166,7 @@
ok($entity, 'get an encrypted and signed part');
- my @parts = RT::Crypt::GnuPG::find_protected_parts( Entity => $entity );
+ my @parts = RT::Crypt::GnuPG::find_protected_parts( entity => $entity );
is( scalar @parts, 1, 'one protected part' );
is( $parts[0]->{'type'}, 'encrypted', "have encrypted part" );
is( $parts[0]->{'format'}, 'RFC3156', "RFC3156 format" );
@@ -181,14 +181,14 @@
Subject => 'test',
Data => ['test'],
);
- my %res = RT::Crypt::GnuPG::sign_encrypt( Entity => $entity, sign => 0 );
+ my %res = RT::Crypt::GnuPG::sign_encrypt( entity => $entity, sign => 0 );
ok( !$res{'exit_code'}, 'successful encryption' );
ok( !$res{'logger'}, "no records in logger" );
- %res = RT::Crypt::GnuPG::sign_encrypt( Entity => $entity, encrypt => 0, Passphrase => 'test' );
+ %res = RT::Crypt::GnuPG::sign_encrypt( entity => $entity, encrypt => 0, Passphrase => 'test' );
ok( !$res{'exit_code'}, 'successful signing' );
ok( !$res{'logger'}, "no records in logger" );
- my @parts = RT::Crypt::GnuPG::find_protected_parts( Entity => $entity );
+ my @parts = RT::Crypt::GnuPG::find_protected_parts( entity => $entity );
is( scalar @parts, 1, 'one protected part, top most' );
is( $parts[0]->{'type'}, 'signed', "have signed part" );
is( $parts[0]->{'format'}, 'RFC3156', "RFC3156 format" );
@@ -203,7 +203,7 @@
Subject => 'test',
Data => ['test'],
);
- my %res = RT::Crypt::GnuPG::sign_encrypt( Entity => $entity, sign => 0 );
+ my %res = RT::Crypt::GnuPG::sign_encrypt( entity => $entity, sign => 0 );
ok( !$res{'exit_code'}, "success" );
$entity->make_multipart( 'mixed', Force => 1 );
$entity->attach(
@@ -211,7 +211,7 @@
Data => ['-'x76, 'this is mailing list'],
);
- my @parts = RT::Crypt::GnuPG::find_protected_parts( Entity => $entity );
+ my @parts = RT::Crypt::GnuPG::find_protected_parts( entity => $entity );
is( scalar @parts, 1, 'one protected part' );
is( $parts[0]->{'type'}, 'encrypted', "have encrypted part" );
is( $parts[0]->{'format'}, 'RFC3156', "RFC3156 format" );
@@ -226,11 +226,11 @@
Subject => 'test',
Data => ['test'],
);
- my %res = RT::Crypt::GnuPG::sign_encrypt( Entity => $entity, sign => 0 );
+ my %res = RT::Crypt::GnuPG::sign_encrypt( entity => $entity, sign => 0 );
ok( !$res{'exit_code'}, 'success' );
$entity->head->mime_attr( 'Content-Type.protocol' => undef );
- my @parts = RT::Crypt::GnuPG::find_protected_parts( Entity => $entity );
+ my @parts = RT::Crypt::GnuPG::find_protected_parts( entity => $entity );
is( scalar @parts, 0, 'no protected parts' );
}
@@ -242,11 +242,11 @@
Subject => 'test',
Data => ['test'],
);
- my %res = RT::Crypt::GnuPG::sign_encrypt( Entity => $entity, sign => 0 );
+ my %res = RT::Crypt::GnuPG::sign_encrypt( entity => $entity, sign => 0 );
ok( !$res{'exit_code'}, 'success' );
$entity->parts([ $entity->parts(0) ]);
- my @parts = RT::Crypt::GnuPG::find_protected_parts( Entity => $entity );
+ my @parts = RT::Crypt::GnuPG::find_protected_parts( entity => $entity );
is( scalar @parts, 0, 'no protected parts' );
}
@@ -258,11 +258,11 @@
Subject => 'test',
Data => ['test'],
);
- my %res = RT::Crypt::GnuPG::sign_encrypt( Entity => $entity, sign => 0 );
+ my %res = RT::Crypt::GnuPG::sign_encrypt( entity => $entity, sign => 0 );
ok( !$res{'exit_code'}, 'success' );
$entity->head->mime_attr( 'Content-Type.protocol' => 'application/bad-proto' );
- my @parts = RT::Crypt::GnuPG::find_protected_parts( Entity => $entity );
+ my @parts = RT::Crypt::GnuPG::find_protected_parts( entity => $entity );
is( scalar @parts, 0, 'no protected parts' );
}
@@ -274,11 +274,11 @@
Subject => 'test',
Data => ['test'],
);
- my %res = RT::Crypt::GnuPG::sign_encrypt( Entity => $entity, encrypt => 0, Passphrase => 'test' );
+ my %res = RT::Crypt::GnuPG::sign_encrypt( entity => $entity, encrypt => 0, Passphrase => 'test' );
ok( !$res{'exit_code'}, 'success' );
$entity->head->mime_attr( 'Content-Type.protocol' => 'application/bad-proto' );
- my @parts = RT::Crypt::GnuPG::find_protected_parts( Entity => $entity );
+ my @parts = RT::Crypt::GnuPG::find_protected_parts( entity => $entity );
is( scalar @parts, 0, 'no protected parts' );
}
@@ -288,7 +288,7 @@
my $parser = new MIME::Parser;
my $entity = $parser->parse( $fh );
- my @parts = RT::Crypt::GnuPG::find_protected_parts( Entity => $entity );
+ my @parts = RT::Crypt::GnuPG::find_protected_parts( entity => $entity );
is( scalar @parts, 2, 'two protected parts' );
is( $parts[1]->{'type'}, 'signed', "have signed part" );
is( $parts[1]->{'format'}, 'Inline', "inline format" );
@@ -299,7 +299,7 @@
is( $parts[0]->{'Data'}, $entity->parts(1), "data in second part" );
is( $parts[0]->{'Signature'}, $entity->parts(2), "file's signature in third part" );
- my @res = RT::Crypt::GnuPG::verify_decrypt( Entity => $entity );
+ my @res = RT::Crypt::GnuPG::verify_decrypt( entity => $entity );
my @status = RT::Crypt::GnuPG::parse_status( $res[0]->{'status'} );
is( scalar @status, 1, 'one record');
is( $status[0]->{'Operation'}, 'Verify', 'operation is correct');
More information about the Rt-commit
mailing list