michaeljmarshall commented on issue #19771:
URL: https://github.com/apache/pulsar/issues/19771#issuecomment-1478690347

   For future reference, I checked out some implementations, and below are the 
claims sections of the JWT created when you specify the expiration and not the 
audience.
   
   They all appear the same, which is good. I haven't found any k8s 
documentation that they will appear this way, but it makes sense. One challenge 
we'll face by integrating with k8s is making sure that we only give permission 
to the correct pods. This might be challenging. I'll be thinking about this 
some more.
   
   A sample token from Azure Kubernetes service:
   
   ```json
   {
     "aud": [
       "https://some.info.azmk8s.io";,
       "\"some.info.azmk8s.io\""
     ],
     "exp": 1679444659,
     "iat": 1679437459,
     "iss": "https://some.info.azmk8s.io";,
     "kubernetes.io": {
       "namespace": "michael-test",
       "pod": {
         "name": "nginx",
         "uid": "6ad4f05d-64a9-44c7-9acd-fa2f34eb6c96"
       },
       "serviceaccount": {
         "name": "default",
         "uid": "4e618f02-2ce3-45a4-b623-fcc806a16cdf"
       }
     },
     "nbf": 1679437459,
     "sub": "system:serviceaccount:michael-test:default"
   }
   ```
   
   Sample from EKS:
   
   ```json
   {
     "aud": [
       "https://kubernetes.default.svc";
     ],
     "exp": 1710969822,
     "iat": 1679433822,
     "iss": "https://oidc.eks.us-east-2.amazonaws.com/id/some-id";,
     "kubernetes.io": {
       "namespace": "astra-streaming-cp",
       "pod": {
         "name": "nginx",
         "uid": "fbac8f9e-a47d-4ad7-a8f0-cc9a65d1331c"
       },
       "serviceaccount": {
         "name": "default",
         "uid": "5964f9d3-3dce-467c-8dbe-d0f463063d7a"
       },
       "warnafter": 1679437429
     },
     "nbf": 1679433822,
     "sub": "system:serviceaccount:michael-test:default"
   }
   ```
   
   GKE:
   
   ```json
   {
     "aud": [
       "https://container.googleapis.com/v1/projects/some-info";
     ],
     "exp": 1710973269,
     "iat": 1679437269,
     "iss": "https://container.googleapis.com/v1/projects/some-info";,
     "kubernetes.io": {
       "namespace": "pulsar",
       "pod": {
         "name": "nginx",
         "uid": "b75e88ae-753b-4eb8-854e-488c04fc12bc"
       },
       "serviceaccount": {
         "name": "default",
         "uid": "32732d79-3203-4f4a-a343-69215edf1a2a"
       },
       "warnafter": 1679440876
     },
     "nbf": 1679437269,
     "sub": "system:serviceaccount:michael-test:default"
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to