Backblaze-B2V4
view release on metacpan or search on metacpan
script/b2_client view on Meta::CPAN
return "ERROR: Please provide both the APPLICATION_KEY_ID and APPLICATION_KEY arguments for 'save_tokens'\n";
}
# test them before saving
my $b2 = get_b2_session([ $args[0], $args[1] ]);
# get_b2_session() will test those for us
my $obfuscated_content = unpack "h*", $args[0].':::'.$args[1];
my $file_location = '~/.b2_tokens';
path($file_location)->spew_raw( $obfuscated_content );
chmod 0600, $file_location;
return "B2 API Tokens saved to $file_location\n";
}
# subroutine to actually log into B2 with their tokens
sub get_b2_session {
my ($tokens) = @_;
# if no tokens provided, try to load them
if (!$$tokens[0]) {
( run in 1.110 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )