File Coverage

blib/lib/Protocol/ACME/Challenge/Manual.pm
Criterion Covered Total %
statement 15 36 41.6
branch n/a
condition n/a
subroutine 5 8 62.5
pod 2 2 100.0
total 22 46 47.8


line stmt bran cond sub pod time code
1             package Protocol::ACME::Challenge::Manual;
2              
3             =head1 NAME
4              
5             Protocol::ACME::Challenge::Manual - Challenge handler for simpleHttp via manual setup
6              
7             =head1 SYNOPSIS
8              
9             use Protocol::ACME::Challenge::Manual;
10              
11             my $challenge = Protocol::ACME::Challenge::Manual->new();
12              
13             ...
14              
15             $acme->handle_challenge( $challenge );
16              
17             =head1 DESCRIPTION
18              
19             The C class is a handler intended
20             to be run interactively. It will return the challenge and fingerprint
21             to the user and wait until the user has taken care of the required
22             conditions.
23              
24             =head1 CONSTRUCTOR METHODS
25              
26             The following constructor methods are available:
27              
28             =over 4
29              
30             =item $acme = Protcol::ACME::Challenge::Manual->new()
31              
32             This method constructs a new C object
33             and returns it.
34              
35             =back
36              
37             =head2 METHODS
38              
39             =over
40              
41             =item handle( $challenge, $fingerprint )
42              
43             This is intended to be called indirectly via the ACME driver class.
44             C will prompt the user with the challenge and fingerprint and
45             wait for the user to indicate that challenge conditions are met.
46              
47             =back
48              
49             =cut
50              
51 1     1   808 use strict;
  1         1  
  1         22  
52 1     1   3 use warnings;
  1         1  
  1         21  
53              
54 1     1   3 use parent qw ( Protocol::ACME::Challenge );
  1         1  
  1         3  
55 1     1   39 use Carp;
  1         4  
  1         43  
56 1     1   3 use IO::File;
  1         1  
  1         236  
57              
58             our $VERSION = '0.16';
59              
60             sub new
61             {
62 0     0 1   my $class = shift;
63 0           my $self = {};
64 0           bless $self, $class;
65 0           $self->_init( @_ );
66 0           return $self;
67             }
68              
69             sub _init
70             {
71 0     0     my $self = shift;
72             }
73              
74              
75             sub handle
76             {
77 0     0 1   my $self = shift;
78 0           my $challenge = shift;
79 0           my $fingerprint = shift;
80              
81 0           my $filename = $challenge;
82 0           my $content = "$challenge.$fingerprint";
83              
84 0           print "Challenge filename: $challenge\n";
85 0           print "Challenge text: $content\n";
86 0           print "\n";
87 0           print "Create a file with the above filename and content under /.well-known/acme-challenge\n";
88 0           print "where is your web server's document root. Let's Encrypt will make an HTTP request\n";
89 0           print "for this file and confirm that it has the correct content.";
90 0           print "\n";
91 0           print "Hit return when the file is in place: ";
92              
93 0           my $x = ;
94              
95 0           return 0;
96             }
97              
98             =head1 AUTHOR
99              
100             Stephen Ludin, C<< >>
101              
102             =head1 BUGS
103              
104             Please report any bugs or feature requests to C, or through
105             the web interface at L. I will be notified, and then you'll
106             automatically be notified of progress on your bug as I make changes.
107              
108             =head1 ACKNOWLEDGEMENTS
109              
110              
111             =head1 LICENSE AND COPYRIGHT
112              
113             Copyright 2015 Stephen Ludin.
114              
115             This program is free software; you can redistribute it and/or modify it
116             under the terms of the the Artistic License (2.0). You may obtain a
117             copy of the full license at:
118              
119             L
120              
121             Any use, modification, and distribution of the Standard or Modified
122             Versions is governed by this Artistic License. By using, modifying or
123             distributing the Package, you accept this license. Do not use, modify,
124             or distribute the Package, if you do not accept this license.
125              
126             If your Modified Version has been derived from a Modified Version made
127             by someone other than you, you are nevertheless required to ensure that
128             your Modified Version complies with the requirements of this license.
129              
130             This license does not grant you the right to use any trademark, service
131             mark, tradename, or logo of the Copyright Holder.
132              
133             This license includes the non-exclusive, worldwide, free-of-charge
134             patent license to make, have made, use, offer to sell, sell, import and
135             otherwise transfer the Package with respect to any patent claims
136             licensable by the Copyright Holder that are necessarily infringed by the
137             Package. If you institute patent litigation (including a cross-claim or
138             counterclaim) against any party alleging that the Package constitutes
139             direct or contributory patent infringement, then this Artistic License
140             to you shall terminate on the date that such litigation is filed.
141              
142             Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER
143             AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
144             THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
145             PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY
146             YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR
147             CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR
148             CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE,
149             EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
150              
151              
152             =cut
153              
154              
155             1;