Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 0 additions & 19 deletions appengine/standard/endpoints-frameworks-v2/echo/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,25 +81,6 @@ def echo_path_parameter(self, request):
def echo_api_key(self, request):
key, key_type = request.get_unrecognized_field_info('key')
return EchoResponse(message=key)

@endpoints.method(
# This method takes an empty request body.
message_types.VoidMessage,
# This method returns an Echo message.
EchoResponse,
path='echo/email',
http_method='GET',
# Require auth tokens to have the following scopes to access this API.
scopes=[endpoints.EMAIL_SCOPE],
# OAuth2 audiences allowed in incoming tokens.
audiences=['your-oauth-client-id.com'])
def get_user_email(self, request):
user = endpoints.get_current_user()
# If there's no user defined, the request was unauthenticated, so we
# raise 401 Unauthorized.
if not user:
raise endpoints.UnauthorizedException
return EchoResponse(message=user.email())
# [END echo_api_class]


Expand Down