aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/python
diff options
context:
space:
mode:
authorGravatar jboeuf <jboeuf@users.noreply.github.com>2015-07-24 21:30:35 -0700
committerGravatar jboeuf <jboeuf@users.noreply.github.com>2015-07-24 21:30:35 -0700
commit5749a3f467f6ef0a99e05c35d030c86591f2338e (patch)
tree041f62ea7fdb72524dd0210d250471c3393e1624 /src/python
parentbb04ea76f9a2b67671d36b7e8d7f093a5700b68a (diff)
parent52e4de1ea1b2c9b07d53b557bef943d507f5d9c9 (diff)
Merge pull request #2605 from yang-g/fake_transport_security_to_private
Fake transport security to private
Diffstat (limited to 'src/python')
-rw-r--r--src/python/src/grpc/_adapter/_c/types.h4
-rw-r--r--src/python/src/grpc/_adapter/_c/types/client_credentials.c17
-rw-r--r--src/python/src/grpc/_adapter/_c/types/server_credentials.c10
-rw-r--r--src/python/src/grpc/_adapter/_c_test.py12
-rw-r--r--src/python/src/grpc/_cython/_cygrpc/credentials.pyx11
-rw-r--r--src/python/src/grpc/_cython/_cygrpc/grpc.pxd2
-rw-r--r--src/python/src/grpc/_cython/adapter_low.py8
-rw-r--r--src/python/src/grpc/_cython/cygrpc.pyx4
-rw-r--r--src/python/src/grpc/_cython/cygrpc_test.py14
9 files changed, 0 insertions, 82 deletions
diff --git a/src/python/src/grpc/_adapter/_c/types.h b/src/python/src/grpc/_adapter/_c/types.h
index 3449f0643f..4e0da4a28a 100644
--- a/src/python/src/grpc/_adapter/_c/types.h
+++ b/src/python/src/grpc/_adapter/_c/types.h
@@ -63,8 +63,6 @@ ClientCredentials *pygrpc_ClientCredentials_jwt(
PyTypeObject *type, PyObject *args, PyObject *kwargs);
ClientCredentials *pygrpc_ClientCredentials_refresh_token(
PyTypeObject *type, PyObject *args, PyObject *kwargs);
-ClientCredentials *pygrpc_ClientCredentials_fake_transport_security(
- PyTypeObject *type, PyObject *ignored);
ClientCredentials *pygrpc_ClientCredentials_iam(
PyTypeObject *type, PyObject *args, PyObject *kwargs);
extern PyTypeObject pygrpc_ClientCredentials_type;
@@ -81,8 +79,6 @@ typedef struct ServerCredentials {
void pygrpc_ServerCredentials_dealloc(ServerCredentials *self);
ServerCredentials *pygrpc_ServerCredentials_ssl(
PyTypeObject *type, PyObject *args, PyObject *kwargs);
-ServerCredentials *pygrpc_ServerCredentials_fake_transport_security(
- PyTypeObject *type, PyObject *ignored);
extern PyTypeObject pygrpc_ServerCredentials_type;
diff --git a/src/python/src/grpc/_adapter/_c/types/client_credentials.c b/src/python/src/grpc/_adapter/_c/types/client_credentials.c
index 9ea2b39cad..e314c15324 100644
--- a/src/python/src/grpc/_adapter/_c/types/client_credentials.c
+++ b/src/python/src/grpc/_adapter/_c/types/client_credentials.c
@@ -54,9 +54,6 @@ PyMethodDef pygrpc_ClientCredentials_methods[] = {
METH_CLASS|METH_KEYWORDS, ""},
{"refresh_token", (PyCFunction)pygrpc_ClientCredentials_refresh_token,
METH_CLASS|METH_KEYWORDS, ""},
- {"fake_transport_security",
- (PyCFunction)pygrpc_ClientCredentials_fake_transport_security,
- METH_CLASS|METH_NOARGS, ""},
{"iam", (PyCFunction)pygrpc_ClientCredentials_iam,
METH_CLASS|METH_KEYWORDS, ""},
{NULL}
@@ -250,20 +247,6 @@ ClientCredentials *pygrpc_ClientCredentials_refresh_token(
return self;
}
-ClientCredentials *pygrpc_ClientCredentials_fake_transport_security(
- PyTypeObject *type, PyObject *ignored) {
- ClientCredentials *self = (ClientCredentials *)type->tp_alloc(type, 0);
- self->c_creds = grpc_fake_transport_security_credentials_create();
- if (!self->c_creds) {
- Py_DECREF(self);
- PyErr_SetString(PyExc_RuntimeError,
- "couldn't create fake credentials; "
- "something is horribly wrong with the universe");
- return NULL;
- }
- return self;
-}
-
ClientCredentials *pygrpc_ClientCredentials_iam(
PyTypeObject *type, PyObject *args, PyObject *kwargs) {
ClientCredentials *self;
diff --git a/src/python/src/grpc/_adapter/_c/types/server_credentials.c b/src/python/src/grpc/_adapter/_c/types/server_credentials.c
index 2e02c8fe81..f22edbf187 100644
--- a/src/python/src/grpc/_adapter/_c/types/server_credentials.c
+++ b/src/python/src/grpc/_adapter/_c/types/server_credentials.c
@@ -43,9 +43,6 @@
PyMethodDef pygrpc_ServerCredentials_methods[] = {
{"ssl", (PyCFunction)pygrpc_ServerCredentials_ssl,
METH_CLASS|METH_KEYWORDS, ""},
- {"fake_transport_security",
- (PyCFunction)pygrpc_ServerCredentials_fake_transport_security,
- METH_CLASS|METH_NOARGS, ""},
{NULL}
};
const char pygrpc_ServerCredentials_doc[] = "";
@@ -137,10 +134,3 @@ ServerCredentials *pygrpc_ServerCredentials_ssl(
return self;
}
-ServerCredentials *pygrpc_ServerCredentials_fake_transport_security(
- PyTypeObject *type, PyObject *ignored) {
- ServerCredentials *self = (ServerCredentials *)type->tp_alloc(type, 0);
- self->c_creds = grpc_fake_transport_security_server_credentials_create();
- return self;
-}
-
diff --git a/src/python/src/grpc/_adapter/_c_test.py b/src/python/src/grpc/_adapter/_c_test.py
index 133b124072..fe020e2a9c 100644
--- a/src/python/src/grpc/_adapter/_c_test.py
+++ b/src/python/src/grpc/_adapter/_c_test.py
@@ -36,14 +36,6 @@ from grpc._adapter import _types
class CTypeSmokeTest(unittest.TestCase):
- def testClientCredentialsUpDown(self):
- credentials = _c.ClientCredentials.fake_transport_security()
- del credentials
-
- def testServerCredentialsUpDown(self):
- credentials = _c.ServerCredentials.fake_transport_security()
- del credentials
-
def testCompletionQueueUpDown(self):
completion_queue = _c.CompletionQueue()
del completion_queue
@@ -58,10 +50,6 @@ class CTypeSmokeTest(unittest.TestCase):
channel = _c.Channel('[::]:0', [])
del channel
- def testSecureChannelUpDown(self):
- channel = _c.Channel('[::]:0', [], _c.ClientCredentials.fake_transport_security())
- del channel
-
if __name__ == '__main__':
unittest.main(verbosity=2)
diff --git a/src/python/src/grpc/_cython/_cygrpc/credentials.pyx b/src/python/src/grpc/_cython/_cygrpc/credentials.pyx
index 7bb3f798b2..2d74702fbd 100644
--- a/src/python/src/grpc/_cython/_cygrpc/credentials.pyx
+++ b/src/python/src/grpc/_cython/_cygrpc/credentials.pyx
@@ -153,12 +153,6 @@ def client_credentials_refresh_token(json_refresh_token):
credentials.references.append(json_refresh_token)
return credentials
-def client_credentials_fake_transport_security():
- cdef ClientCredentials credentials = ClientCredentials()
- credentials.c_credentials = (
- grpc.grpc_fake_transport_security_credentials_create())
- return credentials
-
def client_credentials_iam(authorization_token, authority_selector):
if isinstance(authorization_token, bytes):
pass
@@ -211,8 +205,3 @@ def server_credentials_ssl(pem_root_certs, pem_key_cert_pairs):
)
return credentials
-def server_credentials_fake_transport_security():
- cdef ServerCredentials credentials = ServerCredentials()
- credentials.c_credentials = (
- grpc.grpc_fake_transport_security_server_credentials_create())
- return credentials
diff --git a/src/python/src/grpc/_cython/_cygrpc/grpc.pxd b/src/python/src/grpc/_cython/_cygrpc/grpc.pxd
index a76ddfc9e1..d065383587 100644
--- a/src/python/src/grpc/_cython/_cygrpc/grpc.pxd
+++ b/src/python/src/grpc/_cython/_cygrpc/grpc.pxd
@@ -317,7 +317,6 @@ cdef extern from "grpc/grpc_security.h":
gpr_timespec token_lifetime)
grpc_credentials *grpc_refresh_token_credentials_create(
const char *json_refresh_token)
- grpc_credentials *grpc_fake_transport_security_credentials_create()
grpc_credentials *grpc_iam_credentials_create(const char *authorization_token,
const char *authority_selector)
void grpc_credentials_release(grpc_credentials *creds)
@@ -334,7 +333,6 @@ cdef extern from "grpc/grpc_security.h":
const char *pem_root_certs,
grpc_ssl_pem_key_cert_pair *pem_key_cert_pairs,
size_t num_key_cert_pairs);
- grpc_server_credentials *grpc_fake_transport_security_server_credentials_create()
void grpc_server_credentials_release(grpc_server_credentials *creds)
int grpc_server_add_secure_http2_port(grpc_server *server, const char *addr,
diff --git a/src/python/src/grpc/_cython/adapter_low.py b/src/python/src/grpc/_cython/adapter_low.py
index 7546dd1599..2bb468eece 100644
--- a/src/python/src/grpc/_cython/adapter_low.py
+++ b/src/python/src/grpc/_cython/adapter_low.py
@@ -72,10 +72,6 @@ class ClientCredentials(object):
raise NotImplementedError()
@staticmethod
- def fake_transport_security():
- raise NotImplementedError()
-
- @staticmethod
def iam():
raise NotImplementedError()
@@ -88,10 +84,6 @@ class ServerCredentials(object):
def ssl():
raise NotImplementedError()
- @staticmethod
- def fake_transport_security():
- raise NotImplementedError()
-
class CompletionQueue(type_interfaces.CompletionQueue):
def __init__(self):
diff --git a/src/python/src/grpc/_cython/cygrpc.pyx b/src/python/src/grpc/_cython/cygrpc.pyx
index dcb06f345c..f4d9661580 100644
--- a/src/python/src/grpc/_cython/cygrpc.pyx
+++ b/src/python/src/grpc/_cython/cygrpc.pyx
@@ -82,12 +82,8 @@ client_credentials_compute_engine = (
credentials.client_credentials_compute_engine)
client_credentials_jwt = credentials.client_credentials_jwt
client_credentials_refresh_token = credentials.client_credentials_refresh_token
-client_credentials_fake_transport_security = (
- credentials.client_credentials_fake_transport_security)
client_credentials_iam = credentials.client_credentials_iam
server_credentials_ssl = credentials.server_credentials_ssl
-server_credentials_fake_transport_security = (
- credentials.server_credentials_fake_transport_security)
CompletionQueue = completion_queue.CompletionQueue
Channel = channel.Channel
diff --git a/src/python/src/grpc/_cython/cygrpc_test.py b/src/python/src/grpc/_cython/cygrpc_test.py
index 838e1e2254..22d210b16b 100644
--- a/src/python/src/grpc/_cython/cygrpc_test.py
+++ b/src/python/src/grpc/_cython/cygrpc_test.py
@@ -76,14 +76,6 @@ class TypeSmokeTest(unittest.TestCase):
timespec = cygrpc.Timespec(now)
self.assertAlmostEqual(now, float(timespec), places=8)
- def testClientCredentialsUpDown(self):
- credentials = cygrpc.client_credentials_fake_transport_security()
- del credentials
-
- def testServerCredentialsUpDown(self):
- credentials = cygrpc.server_credentials_fake_transport_security()
- del credentials
-
def testCompletionQueueUpDown(self):
completion_queue = cygrpc.CompletionQueue()
del completion_queue
@@ -96,12 +88,6 @@ class TypeSmokeTest(unittest.TestCase):
channel = cygrpc.Channel('[::]:0', cygrpc.ChannelArgs([]))
del channel
- def testSecureChannelUpDown(self):
- channel = cygrpc.Channel(
- '[::]:0', cygrpc.ChannelArgs([]),
- cygrpc.client_credentials_fake_transport_security())
- del channel
-
@unittest.skip('TODO(atash): undo skip after #2229 is merged')
def testServerStartNoExplicitShutdown(self):
server = cygrpc.Server()