Skip to content

Commit

Permalink
Changes based on comments
Browse files Browse the repository at this point in the history
  • Loading branch information
XuanWang-Amos committed Jan 8, 2024
1 parent 33f2a31 commit 6f49bf2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/python/auth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,4 @@ google_credentials, unused_project_id = google.auth.default()
call_credentials = grpc.access_token_call_credentials(google_credentials.token)
```

After obtain the token, the rest of the flow is documented in `token_based_auth_client` and `token_based_auth_server`.
After obtaining the token, the rest of the flow is documented in [token_based_auth_client.py](https://github.com/grpc/grpc/tree/master/examples/python/auth/token_based_auth_client.py) and [token_based_auth_server.py](https://github.com/grpc/grpc/tree/master/examples/python/auth/token_based_auth_server.py).
4 changes: 2 additions & 2 deletions examples/python/auth/token_based_auth_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def __init__(self):
def abort(ignored_request, context):
context.abort(grpc.StatusCode.UNAUTHENTICATED, "Invalid signature")

self._abortion = grpc.unary_unary_rpc_method_handler(abort)
self._abort_handler = grpc.unary_unary_rpc_method_handler(abort)

def intercept_service(self, continuation, handler_call_details):
# Example HandlerCallDetails object:
Expand All @@ -49,7 +49,7 @@ def intercept_service(self, continuation, handler_call_details):
if expected_metadata in handler_call_details.invocation_metadata:
return continuation(handler_call_details)
else:
return self._abortion
return self._abort_handler


class SimpleGreeter(helloworld_pb2_grpc.GreeterServicer):
Expand Down

0 comments on commit 6f49bf2

Please sign in to comment.