From d2e762436de52b6f2ecc315bd82eb30a0333e2ad Mon Sep 17 00:00:00 2001 From: atye Date: Thu, 20 Apr 2023 13:16:56 -0400 Subject: [PATCH] update generate token --- content/docs/authorization/cli.md | 12 ++++++------ .../configuration/proxy-server/_index.md | 12 +++++++----- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/content/docs/authorization/cli.md b/content/docs/authorization/cli.md index 4dd5a1bbd7..37ff6258a7 100644 --- a/content/docs/authorization/cli.md +++ b/content/docs/authorization/cli.md @@ -185,23 +185,23 @@ karavictl generate token [flags] ##### Output ``` -$ karavictl generate token --shared-secret supersecret +$ karavictl generate token --tenant Alice apiVersion: v1 +data: + access: + refresh: kind: Secret metadata: + creationTimestamp: null name: proxy-authz-tokens - namespace: vxflexos type: Opaque -data: - access: - refresh: ``` Usually, you will want to pipe the output to kubectl to apply the secret ``` -$ karavictl generate token --shared-secret supersecret | kubectl apply -f - +$ karavictl generate token --tenant Alice | kubectl apply -f - ``` diff --git a/content/docs/authorization/configuration/proxy-server/_index.md b/content/docs/authorization/configuration/proxy-server/_index.md index 007eba14f6..1bc10ef1ad 100644 --- a/content/docs/authorization/configuration/proxy-server/_index.md +++ b/content/docs/authorization/configuration/proxy-server/_index.md @@ -105,23 +105,25 @@ After creating the role bindings, the next logical step is to generate the acces ```yaml # RPM Deployment -karavictl generate token --tenant Finance --insecure --addr DNS-hostname | sed -e 's/"Token": //' -e 's/[{}"]//g' -e 's/\\n/\n/g' > token.yaml +karavictl generate token --tenant Finance --insecure --addr DNS-hostname > token.yaml # Helm/Operator Deployment -karavictl generate token --tenant Finance --insecure --addr csm-authorization.com: | sed -e 's/"Token": //' -e 's/[{}"]//g' -e 's/\\n/\n/g' > token.yaml +karavictl generate token --tenant Finance --insecure --addr csm-authorization.com: > token.yaml ``` `token.yaml` will have a Kubernetes secret manifest that looks like this: ``` apiVersion: v1 +data: + access: ZXlKaGJHY2lPaUpJVXpJMU5pSXNJblI1Y0NJNklrcFhWQ0o5LmV5SmhkV1FpT2lKamMyMGlMQ0psZUhBaU9qRTJPREl3TVRBeU5UTXNJbWR5YjNWd0lqb2labTl2SWl3aWFYTnpJam9pWTI5dExtUmxiR3d1WTNOdElpd2ljbTlzWlhNaU9pSmlZWElpTENKemRXSWlPaUpqYzIwdGRHVnVZVzUwSW4wLjlSYkJISzJUS2dZbVdDX0paazBoSXV0N0daSDV4NGVjQVk2ekdaUDNvUWs= + refresh: ZXlKaGJHY2lPaUpJVXpJMU5pSXNJblI1Y0NJNklrcFhWQ0o5LmV5SmhkV1FpT2lKamMyMGlMQ0psZUhBaU9qRTJPRFEyTURJeE9UTXNJbWR5YjNWd0lqb2labTl2SWl3aWFYTnpJam9pWTI5dExtUmxiR3d1WTNOdElpd2ljbTlzWlhNaU9pSmlZWElpTENKemRXSWlPaUpqYzIwdGRHVnVZVzUwSW4wLkxQcDQzbXktSVJudTFjdmZRcko4M0pMdTR2NXlWQlRDV2NjWFpfWjROQkU= kind: Secret metadata: + creationTimestamp: null name: proxy-authz-tokens type: Opaque -data: - access: ZXlKaGJHY2lPaUpJVXpJMU5pSXNJblI1Y0NJNklrcFhWQ0o5LmV5SmhkV1FpT2lKcllYSmhkbWtpTENKbGVIQWlPakUyTlRNek1qUTFOekVzSW1keWIzVndJam9pWm05dklpd2lhWE56SWpvaVkyOXRMbVJsYkd3dWEyRnlZWFpwSWl3aWNtOXNaWE1pT2lKaVlYSWlMQ0p6ZFdJaU9pSnJZWEpoZG1rdGRHVnVZVzUwSW4wLk4tNE42Q1pPbUptcVQtRDF5ZkNGdEZqSmRDRjcxNlh1SXlNVFVyckNOS1U= - refresh: ZXlKaGJHY2lPaUpJVXpJMU5pSXNJblI1Y0NJNklrcFhWQ0o5LmV5SmhkV1FpT2lKcllYSmhkbWtpTENKbGVIQWlPakUyTlRVNU1UWTFNVEVzSW1keWIzVndJam9pWm05dklpd2lhWE56SWpvaVkyOXRMbVJsYkd3dWEyRnlZWFpwSWl3aWNtOXNaWE1pT2lKaVlYSWlMQ0p6ZFdJaU9pSnJZWEpoZG1rdGRHVnVZVzUwSW4wLkVxb3lXNld5ZEFLdU9mSmtkMkZaMk9TVThZMzlKUFc0YmhfNHc5R05ZNmM= + ``` This secret must be applied in the driver namespace.