Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / rgw / rgw_crypt_sanitize.h
1 // -*- mode:C; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3
4 #ifndef RGW_RGW_CRYPT_SANITIZE_H_
5 #define RGW_RGW_CRYPT_SANITIZE_H_
6
7 #include <boost/utility/string_view.hpp>
8
9 #include "rgw_common.h"
10
11 namespace rgw {
12 namespace crypt_sanitize {
13
14 /*
15  * Temporary container for suppressing printing if variable contains secret key.
16  */
17 struct env {
18   boost::string_ref name;
19   boost::string_ref value;
20
21   env(boost::string_ref name, boost::string_ref value)
22   : name(name), value(value) {}
23 };
24
25 /*
26  * Temporary container for suppressing printing if aws meta attributes contains secret key.
27  */
28 struct x_meta_map {
29   boost::string_ref name;
30   boost::string_ref value;
31   x_meta_map(boost::string_ref name, boost::string_ref value)
32   : name(name), value(value) {}
33 };
34
35 /*
36  * Temporary container for suppressing printing if s3_policy calculation variable contains secret key.
37  */
38 struct s3_policy {
39   boost::string_ref name;
40   boost::string_ref value;
41   s3_policy(boost::string_ref name, boost::string_ref value)
42   : name(name), value(value) {}
43 };
44
45 /*
46  * Temporary container for suppressing printing if auth string contains secret key.
47  */
48 struct auth {
49   const req_state* const s;
50   boost::string_ref value;
51   auth(const req_state* const s, boost::string_ref value)
52   : s(s), value(value) {}
53 };
54
55 /*
56  * Temporary container for suppressing printing if log made from civetweb may contain secret key.
57  */
58 struct log_content {
59   const boost::string_view buf;
60   log_content(const boost::string_view buf)
61   : buf(buf) {}
62 };
63
64 std::ostream& operator<<(std::ostream& out, const env& e);
65 std::ostream& operator<<(std::ostream& out, const x_meta_map& x);
66 std::ostream& operator<<(std::ostream& out, const s3_policy& x);
67 std::ostream& operator<<(std::ostream& out, const auth& x);
68 std::ostream& operator<<(std::ostream& out, const log_content& x);
69 }
70 }
71 #endif /* RGW_RGW_CRYPT_SANITIZE_H_ */