MCPcopy Create free account
hub / github.com/pydio/cells / main

Function main

python/test.py:83–178  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

81
82
83def main():
84 server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
85 # cells_auth_pb2_grpc.add_PasswordCredentialsCodeServicer_to_server()
86 health_servicer = health.HealthServicer(
87 experimental_non_blocking=True,
88 experimental_thread_pool=futures.ThreadPoolExecutor(max_workers=10))
89 health_pb2_grpc.add_HealthServicer_to_server(health_servicer, server)
90
91 cells_auth_pb2_grpc.add_PasswordCredentialsCodeServicer_to_server(PasswordCredentialsCodeProvider(), server)
92 cells_auth_pb2_grpc.add_PasswordCredentialsTokenServicer_to_server(PasswordCredentialsTokenProvider(), server)
93 cells_auth_pb2_grpc.add_AuthTokenVerifierServicer_to_server(VerifyProvider(), server)
94 cells_auth_pb2_grpc.add_AuthTokenRefresherServicer_to_server(RefreshProvider(), server)
95 cells_idm_pb2_grpc.add_UserServiceServicer_to_server(UserProvider(), server)
96
97 channel = grpc.insecure_channel('localhost:8002')
98 stub = cells_registry_pb2_grpc.RegistryStub(channel)
99
100 srv = cells_registry_pb2.Item(
101 id="python-oauth-server",
102 name="grpc",
103 metadata={
104 "status": "ready",
105 },
106 server=cells_registry_pb2.Server(
107 protocol="grpc",
108 ),
109 )
110 stub.Register(srv)
111
112 address = cells_registry_pb2.Item(
113 id="python-oauth-address",
114 name="127.0.0.1:50051",
115 generic=cells_registry_pb2.Generic(
116 type=cells_registry_pb2.ItemType.ADDRESS
117 )
118 )
119 stub.Register(address)
120
121 authService = cells_registry_pb2.Item(
122 id="python-oauth-service",
123 name="pydio.grpc.oauth",
124 metadata={
125 "status": "ready",
126 },
127 service=cells_registry_pb2.Service(
128 version="1",
129 )
130 )
131
132 authService.service.tags.append("tag-idm")
133 stub.Register(authService)
134
135 userService = cells_registry_pb2.Item(
136 id="python-user-service",
137 name="pydio.grpc.user",
138 metadata={
139 "status": "ready",
140 },

Callers 1

test.pyFile · 0.70

Calls 8

VerifyProviderClass · 0.85
RefreshProviderClass · 0.85
UserProviderClass · 0.85
ServerMethod · 0.65
RegisterMethod · 0.65
startMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…