CDS
view release on metacpan or search on metacpan
},
"runtime" : {
"requires" : {
"Carp::Always" : "0",
"Cwd" : "0",
"Digest::SHA" : "0",
"Encode" : "0",
"Fcntl" : "0",
"HTTP::Date" : "0",
"HTTP::Headers" : "0",
"HTTP::Request" : "0",
"HTTP::Server::Simple" : "0",
"LWP::UserAgent" : "0",
"Time::Local" : "0"
}
}
},
"release_status" : "stable",
"version" : "0.31",
"x_serialization_backend" : "JSON::PP version 4.04"
}
- t
- inc
requires:
Carp::Always: '0'
Cwd: '0'
Digest::SHA: '0'
Encode: '0'
Fcntl: '0'
HTTP::Date: '0'
HTTP::Headers: '0'
HTTP::Request: '0'
HTTP::Server::Simple: '0'
LWP::UserAgent: '0'
Time::Local: '0'
version: '0.31'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
Makefile.PL view on Meta::CPAN
NAME => 'CDS',
VERSION_FROM => 'lib/CDS.pm',
PREREQ_PM => {
'Carp::Always' => 0,
'Cwd' => 0,
'Digest::SHA' => 0,
'Encode' => 0,
'Fcntl' => 0,
'HTTP::Date' => 0,
'HTTP::Headers' => 0,
'HTTP::Request' => 0,
'HTTP::Server::Simple' => 0,
'LWP::UserAgent' => 0,,
'Time::Local' => 0,
},
ABSTRACT => 'Condensation Data System (condensation.io), support for folder and HTTP stores, command line interface',
AUTHOR => 'Thomas Lochmatter <thomas.lochmatter@viereck.ch>',
LICENSE => 'mit',
EXE_FILES => ['scripts/cds'],
postamble => {
inline => {
DEPENDENCIES
This module depends on the following Perl modules:
Carp::Always
Cwd
Digest::SHA
Encode
Fcntl
HTTP::Date
HTTP::Headers
HTTP::Request
HTTP::Server::Simple
LWP::UserAgent
Time::Local
On Debian/Ubuntu systems, you can install the following packages:
libcarp-always-perl
libdigest-sha-perl
libencode-perl
libhttp-date-perl
libhttp-message-perl
More information is available on L<condensation.io|https://condensation.io>.
=cut
use Cwd;
use Digest::SHA;
use Encode;
use Fcntl;
use HTTP::Date;
use HTTP::Headers;
use HTTP::Request;
use HTTP::Server::Simple;
use LWP::UserAgent;
use Time::Local;
use utf8;
package CDS;
our $VERSION = '0.31';
our $edition = 'cli';
our $releaseDate = '2022-12-08';
my $date = CDS::ISODate->millisecondString;
my $bytesToSign = $date."\0".uc($method)."\0".$hostAndPath;
$bytesToSign .= "\0".$data if $signData;
my $hashBytesToSign = Digest::SHA::sha256($bytesToSign);
my $signature = $keyPair->sign($hashBytesToSign);
$headers->header('Condensation-Date' => $date);
$headers->header('Condensation-Actor' => $keyPair->publicKey->hash->hex);
$headers->header('Condensation-Signature' => unpack('H*', $signature));
}
return LWP::UserAgent->new->request(HTTP::Request->new($method, $url, $headers, $data));
}
# Models a hash, and offers binary and hexadecimal representation.
package CDS::Hash;
sub fromBytes {
my $class = shift;
my $hashBytes = shift // return;
return if length $hashBytes != 32;
( run in 0.540 second using v1.01-cache-2.11-cpan-de7293f3b23 )