]> git.proxmox.com Git - ceph.git/blame - ceph/src/rgw/rgw_crypt_sanitize.h
import ceph 15.2.10
[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
31f18b77
FG
7#include <boost/utility/string_view.hpp>
8
7c673cae
FG
9#include "rgw_common.h"
10
11namespace rgw {
12namespace crypt_sanitize {
13
14/*
15 * Temporary container for suppressing printing if variable contains secret key.
16 */
17struct 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 */
28struct 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 */
38struct 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 */
48struct 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 */
58struct log_content {
31f18b77 59 const boost::string_view buf;
11fdf7f2 60 explicit log_content(const boost::string_view buf)
7c673cae
FG
61 : buf(buf) {}
62};
63
64std::ostream& operator<<(std::ostream& out, const env& e);
65std::ostream& operator<<(std::ostream& out, const x_meta_map& x);
66std::ostream& operator<<(std::ostream& out, const s3_policy& x);
67std::ostream& operator<<(std::ostream& out, const auth& x);
68std::ostream& operator<<(std::ostream& out, const log_content& x);
69}
70}
71#endif /* RGW_RGW_CRYPT_SANITIZE_H_ */