-
-
21 May 2020 11:28:35 UTC
- Distribution: String-Secret
- Module version: 0.01
- Source (raw)
- Browse (raw)
- Changes
- Homepage
- How to Contribute
- Repository
- Issues (0)
- Testers (369 / 8 / 0)
- Kwalitee
Bus factor: 1- 66.09% Coverage
- License: perl_5
- Perl: v5.8.1
- Activity
24 month- Tools
- Download (10.47KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- parent
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
String::Secret - secret string wrapper to mask secret from logger
SYNOPSIS
use String::Secret; use String::Compare::ConstantTime; use JSON::PP (); my $secret = String::Secret->new('mysecret'); # safe secret for logging MyLogger->warn("invalid secret: $secret"); # oops! but the secret is hidden: "invalid secret: ********" # and safe secret for serialization # MyLogger->warn("invalid secret: ".JSON::PP->new->allow_tags->encode({ secret => $secret })); # oops! but the secret is hidden: invalid secret: {"secret":"********"} unless (String::Compare::ConstantTime::equals($secret->unwrap, SECRET)) { die "secret mis-match"; } # and can it convert to serializable MyDB->credentials->new( id => 'some id', secret => $secret->to_serializable, # or $secret->unwrap )->save();
DESCRIPTION
String::Secret is a secret string wrapper to mask secret from logger.
LICENSE
Copyright (C) karupanerura.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
AUTHOR
karupanerura <karupa@cpan.org>
Module Install Instructions
To install String::Secret, copy and paste the appropriate command in to your terminal.
cpanm String::Secret
perl -MCPAN -e shell install String::Secret
For more information on module installation, please visit the detailed CPAN module installation guide.