From 37a13dcf822b03cbf761df615181bc198f5885c4 Mon Sep 17 00:00:00 2001 From: Jeff Boruszak <104028618+boruszak@users.noreply.github.com> Date: Mon, 12 Jun 2023 15:46:25 -0700 Subject: [PATCH] docs: minor fixes to JWT auth docs (#17680) * Fixes * service intentions fixes --- .../connect/config-entries/jwt-provider.mdx | 162 +++++++++--------- .../config-entries/service-intentions.mdx | 102 +++++------ 2 files changed, 132 insertions(+), 132 deletions(-) diff --git a/website/content/docs/connect/config-entries/jwt-provider.mdx b/website/content/docs/connect/config-entries/jwt-provider.mdx index 3ad00483c6c2..5fc75da4d300 100644 --- a/website/content/docs/connect/config-entries/jwt-provider.mdx +++ b/website/content/docs/connect/config-entries/jwt-provider.mdx @@ -108,53 +108,53 @@ Kind = "jwt-provider" # required Name = "" # required Issuer = "" # required JSONWebKeySet = { # required - Local = { # cannot specify with JWKS{}.Remote - JWKS = "" # cannot specify with JWKS{}.Local{}.Filename - Filename = "" # cannot specify with JWKS{}.Local{}.String - } + Local = { # cannot specify with JWKS{}.Remote + JWKS = "" # cannot specify with JWKS{}.Local{}.Filename + Filename = "" # cannot specify with JWKS{}.Local{}.String + } } JSONWebKeySet = { - Remote = { # cannot specify with JWKS{}.Local - URI = "" - RequestTimeoutMs = 1500 - CacheDuration = "5m" - FetchAsynchronously = false - RetryPolicy = { - NumRetries = 0 - RetryPolicyBackoff = { - BaseInterval = "1s" - MaxInterval = "10s" - } - } - } + Remote = { # cannot specify with JWKS{}.Local + URI = "" + RequestTimeoutMs = 1500 + CacheDuration = "5m" + FetchAsynchronously = false + RetryPolicy = { + NumRetries = 0 + RetryPolicyBackoff = { + BaseInterval = "1s" + MaxInterval = "10s" } + } + } +} Audiences = [""] Locations = [ - { - Header = { - Name = "" - ValuePrefix = "" - Forward = false - } - }, - { - QueryParam = { - Name = "" - } - }, - { - Cookie = { - Name = "" - } + { + Header = { + Name = "" + ValuePrefix = "" + Forward = false + } + }, + { + QueryParam = { + Name = "" + } + }, + { + Cookie = { + Name = "" } + } ] Forwarding = { - HeaderName = "" - PadForwardPayloadHeader = false + HeaderName = "" + PadForwardPayloadHeader = false } ClockSkewSeconds = 30 CacheConfig = { - Size = 0 + Size = 0 } ``` @@ -164,58 +164,58 @@ CacheConfig = { ```json { -"Kind": "jwt-provider", // required -"Name": "", // required -"Issuer": "", // required -"JSONWebKeySet": { // required - "Local": { // cannot specify with JWKS.Remote - "JWKS": "", // cannot specify with JWKS.Local.Filename - "Filename": "" // cannot specify with JWKS.Local.String + "Kind": "jwt-provider", // required + "Name": "", // required + "Issuer": "", // required + "JSONWebKeySet": { // required + "Local": { // cannot specify with JWKS.Remote + "JWKS": "", // cannot specify with JWKS.Local.Filename + "Filename": "" // cannot specify with JWKS.Local.String } -}, -"JSONWebKeySet": { - "Remote": { // cannot specify with JWKS.Local - "URI": "", - "RequestTimeoutMs": "1500", - "CacheDuration": "5m", - "FetchAsynchronously": "false", - "RetryPolicy": { - "NumRetries": "0", - "RetryPolicyBackOff": { - "BaseInterval": "1s", - "MaxInterval": "10s" - } - } + }, + "JSONWebKeySet": { + "Remote": { // cannot specify with JWKS.Local + "URI": "", + "RequestTimeoutMs": "1500", + "CacheDuration": "5m", + "FetchAsynchronously": "false", + "RetryPolicy": { + "NumRetries": "0", + "RetryPolicyBackOff": { + "BaseInterval": "1s", + "MaxInterval": "10s" } -}, -"Audiences": [""], -"Locations": [ + } + } + }, + "Audiences": [""], + "Locations": [ { - "Header": { - "Name": "", - "ValuePrefix": "", - "Forward": "false" - } + "Header": { + "Name": "", + "ValuePrefix": "", + "Forward": "false" + } }, { - "QueryParam": { - "Name":"", - } + "QueryParam": { + "Name":"", + } }, { - "Cookie": { - "Name": "" - } + "Cookie": { + "Name": "" + } } -], -"Forwarding": { - "HeaderName": "", - "PadForwardPayloadHeader": "false" -}, -"ClockSkewSeconds": "30", -"CacheConfig": { + ], + "Forwarding": { + "HeaderName": "", + "PadForwardPayloadHeader": "false" + }, + "ClockSkewSeconds": "30", + "CacheConfig": { "Size": "0" -} + } } ``` @@ -233,7 +233,7 @@ spec: # required issuer: jsonWebKeySet: local: # cannot specify with spec.jsonWebKeySet.remote - jwks: # cannot specify with spec.jsonWebKeySet.local.filename + jwks: # cannot specify with spec.jsonWebKeySet.local.filename filename: # cannot specify with spec.jsonWebKeySet.local.string jsonWebKeySet: remote: # cannot specify with spec.jsonWebKeySet.local @@ -1014,7 +1014,7 @@ metadata: name: okta spec: issuer: okta - jsonwebkeyset: + jsonWebKeySet: remote: uri: https://.okta.com/oauth2/default/v1/keys cacheDuration: 30m diff --git a/website/content/docs/connect/config-entries/service-intentions.mdx b/website/content/docs/connect/config-entries/service-intentions.mdx index 180e3aaabd96..f8afda6e41da 100644 --- a/website/content/docs/connect/config-entries/service-intentions.mdx +++ b/website/content/docs/connect/config-entries/service-intentions.mdx @@ -1506,64 +1506,64 @@ Sources = [ ``` ```yaml - apiVersion: consul.hashicorp.com/v1alpha1 - kind: ServiceIntentions - metadata: - name: backend - spec: - sources: - name: frontend - permissions: - http: - pathExact: /admin - jwt: - providers: - name: okta - verifyClaims: - path: - - perms - - role - value: admin - action: allow +apiVersion: consul.hashicorp.com/v1alpha1 +kind: ServiceIntentions +metadata: + name: backend +spec: + sources: + name: frontend + permissions: http: - pathPrefix: / + pathExact: /admin + jwt: + providers: + name: okta + verifyClaims: + path: + - perms + - role + value: admin + action: allow + http: + pathPrefix: / ``` ```json { -"Kind": "service-intentions", -"Name": "backend", -"Sources": [ - { - "Name": "frontend", - "Permissions": [ - { - "HTTP": { - "PathExact": "/admin" + "Kind": "service-intentions", + "Name": "backend", + "Sources": [ + { + "Name": "frontend", + "Permissions": [ + { + "HTTP": { + "PathExact": "/admin" + }, + "JWT": { + "Providers": [ + { + "Name": "okta", + "VerifyClaims": [ + { + "Path": ["perms", "role"], + "Value": "admin" + } + ] + } + ] + } }, - "JWT": { - "Providers": [ - { - "Name": "okta", - "VerifyClaims": [ - { - "Path": ["perms", "role"], - "Value": "admin" - } - ] - } - ] - } - }, - { - "Action": "allow", - "HTTP": { - "PathPrefix": "/" + { + "Action": "allow", + "HTTP": { + "PathPrefix": "/" + } } - } - ] - } -] + ] + } + ] } ```