Google APIs Client Library for C++
HttpScribeCensor Class Reference

Determines what is appropriate for scribes to record. More...

#include "client/transport/http_scribe.h"

List of all members.

Public Member Functions

 HttpScribeCensor ()
 Standard constructor.
virtual ~HttpScribeCensor ()
 Standard destructor.
virtual string GetCensoredUrl (const HttpRequest &request, bool *censored) const
 Returns a scribbed url for the request.
virtual string GetCensoredRequestContent (const HttpRequest &request, int64 max_len, int64 *original_size, bool *censored) const
 Returns a scrubbed request payload.
virtual string GetCensoredResponseBody (const HttpRequest &request, int64 max_len, int64 *original_size, bool *censored) const
 Returns a scrubbed responze payload.
virtual string GetCensoredRequestHeaderValue (const HttpRequest &request, const StringPiece &name, const StringPiece &value, bool *censored) const
 Returns a censored request header value.
virtual string GetCensoredResponseHeaderValue (const HttpRequest &request, const StringPiece &name, const StringPiece &value, bool *censored) const
 Returns a censored response header value.
const set< string > & censored_url_prefixes () const
 Returns the set of censored URL prefixes.
set< string > * mutable_censored_url_prefixes ()
 Returns a mutable set of censored URL prefixes.
const set< string > & censored_query_param_names () const
 Returns a set of censored query parameter names.
set< string > * mutable_censored_query_param_names ()
 Returns a mutable set of censored URL query parameters.
const set< string > & censored_request_header_names () const
 Returns a set of censored HTTP request header names.
set< string > * mutable_censored_request_header_names ()
 Returns a mutable set of censored HTTP request header names.
const set< string > & censored_response_header_names () const
 Returns a set of censored HTTP response header names.
set< string > * mutable_censored_response_header_names ()
 Returns a mutable set of censored HTTP reponse header names.

Protected Member Functions

string GetCensoredUrlQuery (const ParsedUrl &parsed_url, bool *censored) const
 Censor the query part of a URL.

Detailed Description

Determines what is appropriate for scribes to record.

The base class performs standard censoring

  • Authorization headers are scrubbed

Constructor & Destructor Documentation

Standard constructor.

virtual ~HttpScribeCensor ( ) [virtual]

Standard destructor.


Member Function Documentation

const set<string>& censored_query_param_names ( ) const [inline]

Returns a set of censored query parameter names.

const set<string>& censored_request_header_names ( ) const [inline]

Returns a set of censored HTTP request header names.

const set<string>& censored_response_header_names ( ) const [inline]

Returns a set of censored HTTP response header names.

const set<string>& censored_url_prefixes ( ) const [inline]

Returns the set of censored URL prefixes.

These include the protocol (e.g. https://accounts.google.com)

virtual string GetCensoredRequestContent ( const HttpRequest request,
int64  max_len,
int64 *  original_size,
bool *  censored 
) const [virtual]

Returns a scrubbed request payload.

The method should reset request->content_reader after reading the contents.

Parameters:
[in]requestThe request to censor.
[in]max_lenThe maximum length of body to keep.
[out]original_sizeThe original uncensored size.
[out]censoredSet to true if the result was censored.
Returns:
The censored request payload. TODO(ewiseblatt): 20130520 Really this should return a DataReader of either the original reader or censored content but ownership cases are tricky and is more vulnerable to rewind bugs so am leaving this as a string for now.
virtual string GetCensoredRequestHeaderValue ( const HttpRequest request,
const StringPiece &  name,
const StringPiece &  value,
bool *  censored 
) const [virtual]

Returns a censored request header value.

Parameters:
[in]requestThe request with the header.
[in]nameThe request header name.
[in]valueThe original value.
[out]censoredTrue if the value was censored.
Returns:
The censored header value.
virtual string GetCensoredResponseBody ( const HttpRequest request,
int64  max_len,
int64 *  original_size,
bool *  censored 
) const [virtual]

Returns a scrubbed responze payload.

The method should reset response->body_reader after reading the contents.

Parameters:
[in]requestThe request with the response to censor.
[in]max_lenThe maximum length of body to keep.
[out]original_sizeThe original uncensored size.
[out]censoredSet to true if the result was censored.
Returns:
The censored response payload. TODO(ewiseblatt): 20130520 Really this should return a DataReader of either the original reader or censored content but ownership cases are tricky and is more vulnerable to rewind bugs so am leaving this as a string for now.
virtual string GetCensoredResponseHeaderValue ( const HttpRequest request,
const StringPiece &  name,
const StringPiece &  value,
bool *  censored 
) const [virtual]

Returns a censored response header value.

Parameters:
[in]requestThe request with response having the header.
[in]nameThe response header name.
[in]valueThe original value.
[out]censoredTrue if the value was censored.
Returns:
The censored header value.
virtual string GetCensoredUrl ( const HttpRequest request,
bool *  censored 
) const [virtual]

Returns a scribbed url for the request.

string GetCensoredUrlQuery ( const ParsedUrl parsed_url,
bool *  censored 
) const [protected]

Censor the query part of a URL.

Parameters:
[in]parsed_urlThe parsed url to extract from.
[out]censoredSet to true if some values were censored.
Returns:
censored query string.
set<string>* mutable_censored_query_param_names ( ) [inline]

Returns a mutable set of censored URL query parameters.

You can add additional query parameter names into the set.

set<string>* mutable_censored_request_header_names ( ) [inline]

Returns a mutable set of censored HTTP request header names.

You can add additional request header names into the set.

set<string>* mutable_censored_response_header_names ( ) [inline]

Returns a mutable set of censored HTTP reponse header names.

You can add additional response header names into the set.

set<string>* mutable_censored_url_prefixes ( ) [inline]

Returns a mutable set of censored URL prefixes.

These include the protocol (e.g. https://accounts.google.com). You can add additional prefixes into the set.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines