Backblaze-B2V2Client

 view release on metacpan or  search on metacpan

script/b2_client  view on Meta::CPAN

		die "ERROR: Please provide both the APPLICATION_KEY_ID and APPLICATION_KEY arguments for 'save_tokens'\n";
	}
	
	# test them before saving
	my $b2client = 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;	
	
	print "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 0.237 second using v1.01-cache-2.11-cpan-496ff517765 )