]> git.proxmox.com Git - ceph.git/blame - ceph/src/rgw/rgw_crypt_sanitize.h
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / rgw / rgw_crypt_sanitize.h
CommitLineData
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
10namespace rgw {
11namespace crypt_sanitize {
12
13/*
14 * Temporary container for suppressing printing if variable contains secret key.
15 */
16struct 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 */
27struct 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 */
37struct 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 */
47struct 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 */
57struct 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
63std::ostream& operator<<(std::ostream& out, const env& e);
64std::ostream& operator<<(std::ostream& out, const x_meta_map& x);
65std::ostream& operator<<(std::ostream& out, const s3_policy& x);
66std::ostream& operator<<(std::ostream& out, const auth& x);
67std::ostream& operator<<(std::ostream& out, const log_content& x);
68}
69}
70#endif /* RGW_RGW_CRYPT_SANITIZE_H_ */