Skip to content

Commit

Permalink
Merge pull request #478 from saicheems/master
Browse files Browse the repository at this point in the history
Temporarily remove some sample features
  • Loading branch information
waprin authored Aug 24, 2016
2 parents c8cfbe2 + 0961032 commit 06b5e91
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 23 deletions.
15 changes: 1 addition & 14 deletions appengine/standard/endpoints-frameworks-v2/echo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@

This demonstrates how to use Google Cloud Endpoints Frameworks v2 on Google App Engine Standard Environment using Python.

This sample consists of two parts:

1. The backend
2. The clients

## Setup

Create a `lib` directory in which to install the Endpoints Frameworks v2 library. For more info, see [Installing a library](https://cloud.google.com/appengine/docs/python/tools/using-libraries-python-27#installing_a_library).
Expand All @@ -28,15 +23,7 @@ In your web browser, go to the following address: http://localhost:8080/\_ah/api

## Deploying to Google App Engine

Generate a swagger file by running: `endpointscfg.py get_swagger_spec main.EchoApi --hostname your-service.appspot.com`

To set up OAuth2, replace `your-oauth-client-id.com` under the `x-security` section in `echo-v1_swagger.json` with your OAuth2 client ID. If you want to use Google OAuth2 Playground, use `407408718192.apps.googleusercontent.com` as your audience. To generate a JWT, go to the following address: `https://developers.google.com/oauthplayground`.

Deploy the generated swagger spec to Google Cloud Service Management: `gcloud alpha service-management deploy echo-v1_swagger.json`

Open the `app.yaml` file and in the `env_variables` section, replace `your-service.appspot.com` with your service name, and `2016-08-01r0` with your uploaded service management configuration.

Then, deploy the sample using `gcloud`:
Deploy the sample using `gcloud`:

$ gcloud beta app deploy

Expand Down
6 changes: 0 additions & 6 deletions appengine/standard/endpoints-frameworks-v2/echo/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,3 @@ libraries:
version: 2.6
- name: ssl
version: 2.7.11

env_variables:
# Replace with your endpoints service name.
ENDPOINTS_SERVICE_NAME: your-service.appspot.com
# Replace with the version Id of your uploaded Endpoints service.
ENDPOINTS_SERVICE_VERSION: 2016-08-01r0
4 changes: 1 addition & 3 deletions appengine/standard/endpoints-frameworks-v2/echo/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ def echo(self, request):
path='echo/getUserEmail',
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'])
scopes=[endpoints.EMAIL_SCOPE])
def get_user_email(self, request):
user = endpoints.get_current_user()
# If there's no user defined, the request was unauthenticated, so we
Expand Down

0 comments on commit 06b5e91

Please sign in to comment.