diff options
author | Nathaniel Manista <nathaniel@google.com> | 2015-08-27 19:25:41 +0000 |
---|---|---|
committer | Nathaniel Manista <nathaniel@google.com> | 2015-08-27 20:08:42 +0000 |
commit | 7dc25d3ca6fd5233906567d7b0592894c762d44e (patch) | |
tree | 236ea1839f6481e8cb0a8ac54a4146e0de9b7ded /src | |
parent | b17ad5562ff373435f6a0d757699a138accb7e35 (diff) |
Add force_client_auth to _low.ServerCredentials
Diffstat (limited to 'src')
-rw-r--r-- | src/python/grpcio/grpc/_adapter/_c/types/server_credentials.c | 13 | ||||
-rw-r--r-- | src/python/grpcio/grpc/_adapter/_intermediary_low.py | 3 |
2 files changed, 8 insertions, 8 deletions
diff --git a/src/python/grpcio/grpc/_adapter/_c/types/server_credentials.c b/src/python/grpcio/grpc/_adapter/_c/types/server_credentials.c index 2ba855e76c..df51a99b6a 100644 --- a/src/python/grpcio/grpc/_adapter/_c/types/server_credentials.c +++ b/src/python/grpcio/grpc/_adapter/_c/types/server_credentials.c @@ -99,11 +99,13 @@ ServerCredentials *pygrpc_ServerCredentials_ssl( const char *root_certs; PyObject *py_key_cert_pairs; grpc_ssl_pem_key_cert_pair *key_cert_pairs; + int force_client_auth; size_t num_key_cert_pairs; size_t i; - static char *keywords[] = {"root_certs", "key_cert_pairs", NULL}; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "zO:ssl", keywords, - &root_certs, &py_key_cert_pairs)) { + static char *keywords[] = { + "root_certs", "key_cert_pairs", "force_client_auth", NULL}; + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "zOi:ssl", keywords, + &root_certs, &py_key_cert_pairs, &force_client_auth)) { return NULL; } if (!PyList_Check(py_key_cert_pairs)) { @@ -128,11 +130,8 @@ ServerCredentials *pygrpc_ServerCredentials_ssl( } self = (ServerCredentials *)type->tp_alloc(type, 0); - /* TODO: Add a force_client_auth parameter in the python object and pass it - here as the last arg. */ self->c_creds = grpc_ssl_server_credentials_create( - root_certs, key_cert_pairs, num_key_cert_pairs, 0, NULL); + root_certs, key_cert_pairs, num_key_cert_pairs, force_client_auth, NULL); gpr_free(key_cert_pairs); return self; } - diff --git a/src/python/grpcio/grpc/_adapter/_intermediary_low.py b/src/python/grpcio/grpc/_adapter/_intermediary_low.py index e7bf9dc462..1fb6a2b27d 100644 --- a/src/python/grpcio/grpc/_adapter/_intermediary_low.py +++ b/src/python/grpcio/grpc/_adapter/_intermediary_low.py @@ -256,4 +256,5 @@ class ServerCredentials(object): """Adapter from old _low.ServerCredentials interface to new _low.ServerCredentials.""" def __init__(self, root_credentials, pair_sequence): - self._internal = _low.ServerCredentials.ssl(root_credentials, list(pair_sequence)) + self._internal = _low.ServerCredentials.ssl( + root_credentials, list(pair_sequence), False) |