File Coverage

blib/lib/WebService/HashiCorp/Vault/Secret/LeasableBase.pm
Criterion Covered Total %
statement 6 9 66.6
branch 0 2 0.0
condition n/a
subroutine 2 3 66.6
pod 1 1 100.0
total 9 15 60.0


line stmt bran cond sub pod time code
1             #!perl
2             # vim: softtabstop=4 tabstop=4 shiftwidth=4 ft=perl expandtab smarttab
3             # ABSTRACT: Perl API for HashiCorp's Vault (Secret)
4              
5             # See also https://github.com/hashicorp/vault-ruby
6             # And https://github.com/ianunruh/hvac
7             # And https://www.vaultproject.io/api/index.html
8              
9             package WebService::HashiCorp::Vault::Secret::LeasableBase;
10              
11 2     2   1060 use Moo;
  2         5  
  2         14  
12             our $VERSION = '0.03'; # VERSION
13 2     2   605 use namespace::clean;
  2         4  
  2         29  
14              
15             extends 'WebService::HashiCorp::Vault::Base';
16              
17             has 'path' => ( is => 'ro' );
18             has 'auth' => ( is => 'ro' );
19              
20              
21             sub creds {
22 0     0 1   my $self = shift;
23 0 0         my $name = shift or return;
24 0           return $self->get( $self->_mkuri($self->path, $name) );
25             }
26              
27              
28             1;
29              
30             __END__