Implemented Yihua's proposed changes from Aug 29

pull/19778/head
Matthew Stevenson 5 years ago
parent e60ec01741
commit 99058a2f09
  1. 14
      include/grpcpp/security/tls_credentials_options.h
  2. 8
      src/core/lib/security/credentials/tls/grpc_tls_credentials_options.h

@ -59,6 +59,9 @@ class TlsKeyMaterialsConfig {
/** TLS credential reload arguments, wraps grpc_tls_credential_reload_arg. **/
class TlsCredentialReloadArg {
public:
/** TlsCredentialReloadArg does not take ownership of the C arg that is passed
* to the constructor. One must remember to free any memory allocated to the C
* arg after using the setter functions below. **/
TlsCredentialReloadArg(grpc_tls_credential_reload_arg* arg) : c_arg_(arg) {}
~TlsCredentialReloadArg();
@ -72,6 +75,10 @@ class TlsCredentialReloadArg {
grpc::string error_details() const;
/** Setters for member fields. They modify the fields of the underlying C arg.
* The setters for the key_materials_config and the error_details allocate
* memory when modifying c_arg_, so one must remember to free c_arg_'s
* original key_materials_config or error_details after using the appropriate
* setter function.
* **/
void set_cb_user_data(void* cb_user_data);
void set_key_materials_config(
@ -129,6 +136,9 @@ class TlsCredentialReloadConfig {
class TlsServerAuthorizationCheckArg {
public:
/** TlsServerAuthorizationCheckArg does not take ownership of the C arg passed
* to the constructor. One must remember to free any memory allocated to the
* C arg after using the setter functions below. **/
TlsServerAuthorizationCheckArg(grpc_tls_server_authorization_check_arg* arg)
: c_arg_(arg) {}
~TlsServerAuthorizationCheckArg();
@ -143,6 +153,10 @@ class TlsServerAuthorizationCheckArg {
grpc::string error_details() const;
/** Setters for member fields. They modify the fields of the underlying C arg.
* The setters for target_name, peer_cert, and error_details allocate memory
* when modifying c_arg_, so one must remember to free c_arg_'s original
* target_name, peer_cert, or error_details after using the appropriate setter
* function.
* **/
void set_cb_user_data(void* cb_user_data);
void set_success(int success);

@ -80,6 +80,10 @@ struct grpc_tls_credential_reload_config
}
private:
/** This is a pointer to the wrapped language implementation of
* grpc_tls_credential_reload_config. It is necessary to implement the C
* schedule and cancel functions, given the schedule or cancel function in a
* wrapped language. **/
void* context_;
/** config-specific, read-only user data that works for all channels created
with a credential using the config. */
@ -132,6 +136,10 @@ struct grpc_tls_server_authorization_check_config
}
private:
/** This is a pointer to the wrapped language implementation of
* grpc_tls_server_authorization_check_config. It is necessary to implement
* the C schedule and cancel functions, given the schedule or cancel function
* in a wrapped language. **/
void* context_;
/** config-specific, read-only user data that works for all channels created
with a Credential using the config. */

Loading…
Cancel
Save