]>
Commit | Line | Data |
---|---|---|
7c673cae | 1 | // -*- mode:C; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
9f95a23c | 2 | // vim: ts=8 sw=2 smarttab ft=cpp |
7c673cae FG |
3 | |
4 | #ifndef RGW_RGW_CRYPT_SANITIZE_H_ | |
5 | #define RGW_RGW_CRYPT_SANITIZE_H_ | |
6 | ||
f67539c2 | 7 | #include <string_view> |
7c673cae FG |
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 { | |
f67539c2 TL |
17 | std::string_view name; |
18 | std::string_view value; | |
7c673cae | 19 | |
f67539c2 | 20 | env(std::string_view name, std::string_view value) |
7c673cae FG |
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 { | |
f67539c2 TL |
28 | std::string_view name; |
29 | std::string_view value; | |
30 | x_meta_map(std::string_view name, std::string_view value) | |
7c673cae FG |
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 { | |
f67539c2 TL |
38 | std::string_view name; |
39 | std::string_view value; | |
40 | s3_policy(std::string_view name, std::string_view value) | |
7c673cae FG |
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; | |
f67539c2 TL |
49 | std::string_view value; |
50 | auth(const req_state* const s, std::string_view value) | |
7c673cae FG |
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 { | |
f67539c2 TL |
58 | const std::string_view buf; |
59 | explicit log_content(const std::string_view buf) | |
7c673cae FG |
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_ */ |