diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
commit | 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch) | |
tree | e5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/rgw/rgw_crypt_sanitize.h | |
parent | Initial commit. (diff) | |
download | ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.tar.xz ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.zip |
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/rgw/rgw_crypt_sanitize.h')
-rw-r--r-- | src/rgw/rgw_crypt_sanitize.h | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/src/rgw/rgw_crypt_sanitize.h b/src/rgw/rgw_crypt_sanitize.h new file mode 100644 index 00000000..548c1240 --- /dev/null +++ b/src/rgw/rgw_crypt_sanitize.h @@ -0,0 +1,71 @@ +// -*- mode:C; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab + +#ifndef RGW_RGW_CRYPT_SANITIZE_H_ +#define RGW_RGW_CRYPT_SANITIZE_H_ + +#include <boost/utility/string_view.hpp> + +#include "rgw_common.h" + +namespace rgw { +namespace crypt_sanitize { + +/* + * Temporary container for suppressing printing if variable contains secret key. + */ +struct env { + boost::string_ref name; + boost::string_ref value; + + env(boost::string_ref name, boost::string_ref value) + : name(name), value(value) {} +}; + +/* + * Temporary container for suppressing printing if aws meta attributes contains secret key. + */ +struct x_meta_map { + boost::string_ref name; + boost::string_ref value; + x_meta_map(boost::string_ref name, boost::string_ref value) + : name(name), value(value) {} +}; + +/* + * Temporary container for suppressing printing if s3_policy calculation variable contains secret key. + */ +struct s3_policy { + boost::string_ref name; + boost::string_ref value; + s3_policy(boost::string_ref name, boost::string_ref value) + : name(name), value(value) {} +}; + +/* + * Temporary container for suppressing printing if auth string contains secret key. + */ +struct auth { + const req_state* const s; + boost::string_ref value; + auth(const req_state* const s, boost::string_ref value) + : s(s), value(value) {} +}; + +/* + * Temporary container for suppressing printing if log made from civetweb may contain secret key. + */ +struct log_content { + const boost::string_view buf; + explicit log_content(const boost::string_view buf) + : buf(buf) {} +}; + +std::ostream& operator<<(std::ostream& out, const env& e); +std::ostream& operator<<(std::ostream& out, const x_meta_map& x); +std::ostream& operator<<(std::ostream& out, const s3_policy& x); +std::ostream& operator<<(std::ostream& out, const auth& x); +std::ostream& operator<<(std::ostream& out, const log_content& x); +} +} +#endif /* RGW_RGW_CRYPT_SANITIZE_H_ */ |