]> git.proxmox.com Git - ceph.git/blob - ceph/src/rgw/rgw_crypt_sanitize.h
update source to Ceph Pacific 16.2.2
[ceph.git] / 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 ft=cpp
3
4 #ifndef RGW_RGW_CRYPT_SANITIZE_H_
5 #define RGW_RGW_CRYPT_SANITIZE_H_
6
7 #include <string_view>
8 #include "rgw_common.h"
9
10 namespace rgw {
11 namespace crypt_sanitize {
12
13 /*
14 * Temporary container for suppressing printing if variable contains secret key.
15 */
16 struct env {
17 std::string_view name;
18 std::string_view value;
19
20 env(std::string_view name, std::string_view value)
21 : name(name), value(value) {}
22 };
23
24 /*
25 * Temporary container for suppressing printing if aws meta attributes contains secret key.
26 */
27 struct x_meta_map {
28 std::string_view name;
29 std::string_view value;
30 x_meta_map(std::string_view name, std::string_view value)
31 : name(name), value(value) {}
32 };
33
34 /*
35 * Temporary container for suppressing printing if s3_policy calculation variable contains secret key.
36 */
37 struct s3_policy {
38 std::string_view name;
39 std::string_view value;
40 s3_policy(std::string_view name, std::string_view value)
41 : name(name), value(value) {}
42 };
43
44 /*
45 * Temporary container for suppressing printing if auth string contains secret key.
46 */
47 struct auth {
48 const req_state* const s;
49 std::string_view value;
50 auth(const req_state* const s, std::string_view value)
51 : s(s), value(value) {}
52 };
53
54 /*
55 * Temporary container for suppressing printing if log made from civetweb may contain secret key.
56 */
57 struct log_content {
58 const std::string_view buf;
59 explicit log_content(const std::string_view buf)
60 : buf(buf) {}
61 };
62
63 std::ostream& operator<<(std::ostream& out, const env& e);
64 std::ostream& operator<<(std::ostream& out, const x_meta_map& x);
65 std::ostream& operator<<(std::ostream& out, const s3_policy& x);
66 std::ostream& operator<<(std::ostream& out, const auth& x);
67 std::ostream& operator<<(std::ostream& out, const log_content& x);
68 }
69 }
70 #endif /* RGW_RGW_CRYPT_SANITIZE_H_ */