Skip to content

Commit 183a618

Browse files
lookuptableJon Wayne Parrott
authored and
Jon Wayne Parrott
committed
Fix various issuers in appengine/flexible/endpoints/README.md (#495)
* Use three back-ticks to indicate code block (It seems indentation-based code block doesn't work if it's right after a list) * Fix IAM link * Avoid surrounding project id placeholders with angle brackets
1 parent 470d0dc commit 183a618

File tree

1 file changed

+45
-32
lines changed

1 file changed

+45
-32
lines changed

appengine/flexible/endpoints/README.md

Lines changed: 45 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,25 @@ This sample consists of two parts:
1414
For more info on running Flexible applications locally, see [the getting started documentation](https://cloud.google.com/python/getting-started/hello-world).
1515

1616
Install all the dependencies:
17-
18-
$ virtualenv env
19-
$ source env/bin/activate
20-
$ pip install -r requirements.txt
17+
```bash
18+
$ virtualenv env
19+
$ source env/bin/activate
20+
$ pip install -r requirements.txt
21+
```
2122

2223
Run the application:
23-
24-
$ python main.py
24+
```bash
25+
$ python main.py
26+
```
2527

2628
In your web browser, go to the following address: http://localhost:8080.
2729

2830
### Using the echo client
2931

3032
With the app running locally, you can execute the simple echo client using:
31-
32-
$ python clients/echo-client.py http://localhost:8080 APIKEY helloworld
33+
```bash
34+
$ python clients/echo-client.py http://localhost:8080 APIKEY helloworld
35+
```
3336

3437
The `APIKEY` doesn't matter as the endpoint proxy is not running to do authentication.
3538

@@ -39,8 +42,9 @@ Open the `swagger.yaml` file and in the `host` property, replace
3942
`YOUR-PROJECT-ID` with your project's ID.
4043

4144
Then, deploy the sample using `gcloud`:
42-
43-
gcloud beta app deploy
45+
```bash
46+
$ gcloud beta app deploy
47+
```
4448

4549
Once deployed, you can access the application at https://YOUR-PROJECT-ID.appspot.com/.
4650

@@ -54,8 +58,9 @@ With the project deployed, you'll need to create an API key to access the API.
5458
4. Choose 'Server Key'
5559

5660
With the API key, you can use the echo client to access the API:
57-
58-
$ python clients/echo-client.py https://YOUR-PROJECT-ID.appspot.com YOUR-API-KEY helloworld
61+
```bash
62+
$ python clients/echo-client.py https://YOUR-PROJECT-ID.appspot.com YOUR-API-KEY helloworld
63+
```
5964

6065
### Using the JWT client (with key file)
6166

@@ -73,8 +78,9 @@ To use the service account for authentication:
7378
2. Redeploy your application.
7479

7580
Now you can use the JWT client to make requests to the API:
76-
77-
$ python clients/google-jwt-client.py https://YOUR-PROJECT-ID.appspot.com YOUR-API-KEY /path/to/service-account.json
81+
```bash
82+
$ python clients/google-jwt-client.py https://YOUR-PROJECT-ID.appspot.com YOUR-API-KEY /path/to/service-account.json
83+
```
7884

7985
### Using the ID Token client (with key file)
8086

@@ -91,8 +97,9 @@ To use the client ID for authentication:
9197
2. Redeploy your application.
9298

9399
Now you can use the client ID to make requests to the API:
94-
95-
$ python clients/google-id-token-client.py https://YOUR-PROJECT-ID.appspot.com YOUR-API-KEY /path/to/client-id.json
100+
```bash
101+
$ python clients/google-id-token-client.py https://YOUR-PROJECT-ID.appspot.com YOUR-API-KEY /path/to/client-id.json
102+
```
96103

97104
### Using the App Engine default service account client (no key file needed)
98105

@@ -104,11 +111,12 @@ To use the App Engine default service account for authentication:
104111
1. Update the `gae_default_service_account`'s `x-issuer` and `x-jwks_uri` in `swagger.yaml` with your client project ID.
105112
2. Redeploy your server application.
106113
3. Update clients/service_to_service_gae_default/main.py, replace 'YOUR-CLIENT-PROJECT-ID' and 'YOUR-SERVER-PROJECT-ID' with your client project ID and your server project ID.
107-
4. Upload your application to Google App Engine by invoking the following command. Note that you need to provide project ID in the command because there are two projects (server and client projects) here and gcloud needs to know which project to pick.
114+
4. Upload your application to Google App Engine by invoking the following command. Note that you need to provide project ID in the command because there are two projects (server and client projects) here and gcloud needs to know which project to pick.
115+
```bash
116+
$ gcloud app deploy app.yaml --project=YOUR-CLIENT-PROJECT-ID
117+
```
108118

109-
gcloud app deploy app.yaml --project=<YOUR-CLIENT-PROJECT-ID>
110-
111-
Your client app is now deployed at https://<YOUR-CLIENT-PROJECT-ID>.appspot.com. When you access https://<YOUR-CLIENT-PROJECT-ID>.appspot.com, your client calls your server project API using
119+
Your client app is now deployed at https://YOUR-CLIENT-PROJECT-ID.appspot.com. When you access https://YOUR-CLIENT-PROJECT-ID.appspot.com, your client calls your server project API using
112120
the client's service account.
113121

114122
### Using the service account client (no key file needed)
@@ -120,7 +128,8 @@ The client project is running Google App Engine standard application.
120128
In the example, we use Google Cloud Identity and Access Management (IAM) API to create a JSON Web Token (JWT) for a service account, and use it to call an Endpoints API.
121129

122130
To use the client, you will need to enable "Service Account Actor" role for App Engine default service account:
123-
1. Go to [IAM page] of your client project (https://console.cloud.google.com/iam-admin/iam).
131+
132+
1. Go to [IAM page](https://console.cloud.google.com/iam-admin/iam) of your client project.
124133
2. For App Engine default service account, from “Role(s)” drop-down menu, select “Project”-“Service Account Actor”, and Save.
125134

126135
You also need to install Google API python library because the client code (main.py) uses googleapiclient,
@@ -129,15 +138,17 @@ Google API python client library should have already been installed under 'lib'
129138
[here](https://cloud.google.com/appengine/docs/python/tools/using-libraries-python-27#requesting_a_library).
130139

131140
To use the client for authentication:
141+
132142
1. Update the `google_service_account`'s `x-issuer` and `x-jwks_uri` in `swagger.yaml` with your service account email.
133143
2. Redeploy your server application.
134-
3. Update clients/service_to_service_non_default/main.py, replace 'YOUR-SERVICE-ACCOUNT-EMAIL', 'YOUR-SERVER-PROJECT-ID' and 'YOUR-CLIENT-PROJECT-ID'
135-
with your service account email, your server project ID, and your client project ID.
136-
4. Upload your application to Google App Engine by invoking the following command. Note that you need to provide project ID in the command because there are two projects (server and client projects) here and gcloud needs to know which project to pick.
137-
138-
gcloud app deploy app.yaml --project=<YOUR-CLIENT-PROJECT-ID>
139-
140-
Your client app is now deployed at https://<YOUR-CLIENT-PROJECT-ID>.appspot.com. When you access https://<YOUR-CLIENT-PROJECT-ID>.appspot.com, your client calls your server project API using
144+
3. Update clients/service_to_service_non_default/main.py by replacing 'YOUR-SERVICE-ACCOUNT-EMAIL', 'YOUR-SERVER-PROJECT-ID' and 'YOUR-CLIENT-PROJECT-ID'
145+
with your service account email, your server project ID, and your client project ID, respectively.
146+
4. Upload your application to Google App Engine by invoking the following command. Note that you need to provide project ID in the command because there are two projects (server and client projects) here and gcloud needs to know which project to pick.
147+
```bash
148+
$ gcloud app deploy app.yaml --project=YOUR-CLIENT-PROJECT-ID
149+
```
150+
151+
Your client app is now deployed at https://YOUR-CLIENT-PROJECT-ID.appspot.com. When you access https://YOUR-CLIENT-PROJECT-ID.appspot.com, your client calls your server project API using
141152
the client's service account.
142153

143154
### Using the ID token client (no key file needed)
@@ -150,12 +161,14 @@ We refer to the project that serves API requests as the server project. You also
150161
The client project is running Google App Engine standard application.
151162

152163
To use the client for authentication:
164+
153165
1. Update the `google_id_token`'s audiences, replace `YOUR-SERVER-PROJECT-ID` with your server project ID.
154166
2. Redeploy your server application.
155167
3. Update clients/service_to_service_google_id_token/main.py, replace 'YOUR-CLIENT-PROJECT-ID' and 'YOUR-SERVER-PROJECT-ID' with your client project ID and your server project ID.
156-
4. Upload your application to Google App Engine by invoking the following command. Note that you need to provide project ID in the command because there are two projects (server and client projects) here and gcloud needs to know which project to pick.
157-
158-
gcloud app deploy app.yaml --project=<YOUR-CLIENT-PROJECT-ID>
168+
4. Upload your application to Google App Engine by invoking the following command. Note that you need to provide project ID in the command because there are two projects (server and client projects) here and gcloud needs to know which project to pick.
169+
```bash
170+
$ gcloud app deploy app.yaml --project=YOUR-CLIENT-PROJECT-ID
171+
```
159172

160-
Your client app is now deployed at https://<YOUR-CLIENT-PROJECT-ID>.appspot.com. When you access https://<YOUR-CLIENT-PROJECT-ID>.appspot.com, your client calls your server project API from
173+
Your client app is now deployed at https://YOUR-CLIENT-PROJECT-ID.appspot.com. When you access https://YOUR-CLIENT-PROJECT-ID.appspot.com, your client calls your server project API from
161174
the client's service account using Google ID token.

0 commit comments

Comments
 (0)