@@ -209,24 +209,22 @@ scopes. This section demonstrates how to leverage the Authservice to relay the a
209
209
1. Patch ` productpage` to forward authorization headers to other services.
210
210
1. Clone https://github.com/istio/istio.
211
211
1. Make the changes below and build the image using ` /samples/bookinfo/src/productpage/Dockerfile` .
212
-
213
- ` ` ` diff
214
- diff --git a/samples/bookinfo/src/productpage/productpage.py b/samples/bookinfo/src/productpage/productpage.py
215
- index af5a411ea..722434405 100755
216
- --- a/samples/bookinfo/src/productpage/productpage.py
217
- +++ b/samples/bookinfo/src/productpage/productpage.py
218
- @@ -182,7 +182,9 @@ def getForwardHeaders(request):
219
- if ' user' in session:
220
- headers[' end-user' ] = session[' user' ]
221
-
222
- - incoming_headers = [' x-request-id' , ' x-datadog-trace-id' , ' x-datadog-parent-id' , ' x-datadog-sampled' ]
223
- + incoming_headers = [' x-request-id' ,
224
- + ' x-datadog-trace-id' , ' x-datadog-parent-id' , ' x-datadog-sampled' ,
225
- + ' authorization' ]
212
+ ` ` ` diff
213
+ --- a/samples/bookinfo/src/productpage/productpage.py
214
+ +++ b/samples/bookinfo/src/productpage/productpage.py
215
+ @@ -182,7 +182,9 @@ def getForwardHeaders(request):
216
+ if ' user' in session:
217
+ headers[' end-user' ] = session[' user' ]
218
+
219
+ - incoming_headers = [' x-request-id' , ' x-datadog-trace-id' , ' x-datadog-parent-id' , ' x-datadog-sampled' ]
220
+ + incoming_headers = [' x-request-id' ,
221
+ + ' x-datadog-trace-id' , ' x-datadog-parent-id' , ' x-datadog-sampled' ,
222
+ + ' authorization' ]
223
+
224
+ # Add user-agent to headers manually
225
+ if ' user-agent' in request.headers:
226
+ ` ` `
226
227
227
- # Add user-agent to headers manually
228
- if ' user-agent' in request.headers:
229
- ` ` `
230
228
1. Tag and push the image created to an accessible registry.
231
229
1. Replace the ` productpage` image in ` config/bookinfo-with-authservice-template.yaml` with the image built above.
232
230
1. Reapply the deployment file.
0 commit comments