Artifactory-Client

 view release on metacpan or  search on metacpan

Changes  view on Meta::CPAN

0.8.10  2015/2/10
        Added calculate_debian_repository_metadata call

0.8.9   2015/2/9
        Added calculate_npm_repository_metadata call and extracted a helper method

0.8.8   2015/2/6
        Added set_gpg_pass_phrase call

0.8.7   2015/2/5
        Added set_gpg_private_key call and refactored methods

0.8.6   2015/2/4
        Added get_gpg_public_key call

0.8.5   2015/2/3
        Added set_gpg_public_key call

0.8.4   2015/2/2
        Added deactivate_master_key_encryption call

lib/Artifactory/Client.pm  view on Meta::CPAN


Gets the public key that Artifactory provides to Debian clients to verify packages

=cut

sub get_gpg_public_key {
    my $self = shift;
    return $self->_handle_gpg_key( 'public', 'get' );
}

=head2 set_gpg_private_key( key => $string )

Sets the private key that Artifactory will use to sign Debian packages

=cut

sub set_gpg_private_key {
    my ( $self, %args ) = @_;
    my $key = $args{key};
    return $self->_handle_gpg_key( 'private', 'put', content => $key );
}

=head2 set_gpg_pass_phrase( $passphrase )

Sets the pass phrase required signing Debian packages using the private key

=cut

t/01_unit.t  view on Meta::CPAN

                )
            },
            'HTTP::Response'
        );
    };
    my $resp            = $client->get_gpg_public_key();
    my $url_in_response = $resp->request->uri;
    like( $url_in_response, qr|/api/gpg/key/public|, 'requsted URL looks sane' );
};

subtest 'set_gpg_private_key', sub {
    my $client = setup();

    local *{'LWP::UserAgent::put'} = sub {
        return bless(
            {
                '_request' => bless(
                    {
                        '_uri' => bless(
                            do { \( my $o = "http://example.com:7777/artifactory/api/gpg/key/private" ) }, 'URI::http'
                        ),
                    },
                    'HTTP::Request'
                )
            },
            'HTTP::Response'
        );
    };
    my $resp            = $client->set_gpg_private_key();
    my $url_in_response = $resp->request->uri;
    like( $url_in_response, qr|/api/gpg/key/private|, 'requsted URL looks sane' );
};

subtest 'set_gpg_pass_phrase', sub {
    my $client = setup();

    local *{'LWP::UserAgent::put'} = sub {
        return bless(
            {



( run in 0.253 second using v1.01-cache-2.11-cpan-4d50c553e7e )