From 8bbc3b680e855d48571638f9801bd6c56a27b758 Mon Sep 17 00:00:00 2001 From: Arka Bhattacharya <21124287+find-arka@users.noreply.github.com> Date: Sat, 14 Sep 2024 16:05:28 -0400 Subject: [PATCH 1/2] edited base64 decode command Edited sincle it's failing with message- base64: invalid argument - --- .../en/docs/tasks/security/authorization/authz-jwt/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/en/docs/tasks/security/authorization/authz-jwt/index.md b/content/en/docs/tasks/security/authorization/authz-jwt/index.md index c50d145c7ff52..962cd6348920f 100644 --- a/content/en/docs/tasks/security/authorization/authz-jwt/index.md +++ b/content/en/docs/tasks/security/authorization/authz-jwt/index.md @@ -112,7 +112,7 @@ Caching and propagation can cause a delay. This causes Istio to generate the attribute `requestPrincipal` with the value `testing@secure.istio.io/testing@secure.istio.io`: {{< text syntax="bash" expandlinks="false" >}} - $ TOKEN=$(curl {{< github_file >}}/security/tools/jwt/samples/demo.jwt -s) && echo "$TOKEN" | cut -d '.' -f2 - | base64 --decode - + $ TOKEN=$(curl {{< github_file >}}/security/tools/jwt/samples/demo.jwt -s) && echo "$TOKEN" | cut -d '.' -f2 - | base64 --decode {"exp":4685989700,"foo":"bar","iat":1532389700,"iss":"testing@secure.istio.io","sub":"testing@secure.istio.io"} {{< /text >}} @@ -162,7 +162,7 @@ Caching and propagation can cause a delay. 1. Get the JWT that sets the `groups` claim to a list of strings: `group1` and `group2`: {{< text syntax="bash" expandlinks="false" >}} - $ TOKEN_GROUP=$(curl {{< github_file >}}/security/tools/jwt/samples/groups-scope.jwt -s) && echo "$TOKEN_GROUP" | cut -d '.' -f2 - | base64 --decode - + $ TOKEN_GROUP=$(curl {{< github_file >}}/security/tools/jwt/samples/groups-scope.jwt -s) && echo "$TOKEN_GROUP" | cut -d '.' -f2 - | base64 --decode {"exp":3537391104,"groups":["group1","group2"],"iat":1537391104,"iss":"testing@secure.istio.io","scope":["scope1","scope2"],"sub":"testing@secure.istio.io"} {{< /text >}} From a4af8c93785ca092875fac927a54b4c6aa17ec3d Mon Sep 17 00:00:00 2001 From: Arka Bhattacharya Date: Sat, 14 Sep 2024 16:17:29 -0400 Subject: [PATCH 2/2] make gen changes --- .../en/docs/tasks/security/authorization/authz-jwt/snips.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/en/docs/tasks/security/authorization/authz-jwt/snips.sh b/content/en/docs/tasks/security/authorization/authz-jwt/snips.sh index 9f92c228609c6..57bf94db44e34 100644 --- a/content/en/docs/tasks/security/authorization/authz-jwt/snips.sh +++ b/content/en/docs/tasks/security/authorization/authz-jwt/snips.sh @@ -87,7 +87,7 @@ EOF } snip_allow_requests_with_valid_jwt_and_listtyped_claims_5() { -TOKEN=$(curl https://raw.githubusercontent.com/istio/istio/master/security/tools/jwt/samples/demo.jwt -s) && echo "$TOKEN" | cut -d '.' -f2 - | base64 --decode - +TOKEN=$(curl https://raw.githubusercontent.com/istio/istio/master/security/tools/jwt/samples/demo.jwt -s) && echo "$TOKEN" | cut -d '.' -f2 - | base64 --decode } ! IFS=$'\n' read -r -d '' snip_allow_requests_with_valid_jwt_and_listtyped_claims_5_out <<\ENDSNIP @@ -133,7 +133,7 @@ EOF } snip_allow_requests_with_valid_jwt_and_listtyped_claims_9() { -TOKEN_GROUP=$(curl https://raw.githubusercontent.com/istio/istio/master/security/tools/jwt/samples/groups-scope.jwt -s) && echo "$TOKEN_GROUP" | cut -d '.' -f2 - | base64 --decode - +TOKEN_GROUP=$(curl https://raw.githubusercontent.com/istio/istio/master/security/tools/jwt/samples/groups-scope.jwt -s) && echo "$TOKEN_GROUP" | cut -d '.' -f2 - | base64 --decode } ! IFS=$'\n' read -r -d '' snip_allow_requests_with_valid_jwt_and_listtyped_claims_9_out <<\ENDSNIP