mirror of https://github.com/istio/istio.io.git
Automator: update istio.io@ reference docs (#10401)
This commit is contained in:
parent
78559247ff
commit
cf38cac32b
|
@ -340,12 +340,7 @@ spec:
|
|||
name: my-wasm-extension # This must match the name above
|
||||
config_discovery:
|
||||
config_source:
|
||||
api_config_source:
|
||||
api_type: GRPC
|
||||
transport_api_version: V3
|
||||
grpc_services:
|
||||
- envoy_grpc:
|
||||
cluster_name: xds-grpc
|
||||
ads: {}
|
||||
type_urls: ["envoy.extensions.filters.http.wasm.v3.Wasm"]
|
||||
</code></pre>
|
||||
|
||||
|
|
|
@ -146,6 +146,71 @@ spec:
|
|||
paths: ["/healthz"]
|
||||
</code></pre>
|
||||
|
||||
<ul>
|
||||
<li>When applied on a Gateway, you can also use the special header name <code>x-jwt-claim</code> for matching JWT claims in
|
||||
the VirtualService. Claims of type string or list of string are supported and nested claims are also supported using
|
||||
<code>.</code> as a separator for claim names. Examples: <code>x-jwt-claim.admin</code> matches the claim “admin” and <code>x-jwt-claim.group.id</code>
|
||||
matches the nested claims “group” and “id”.</li>
|
||||
</ul>
|
||||
|
||||
<p>The following example creates the request authentication and authorization policies for JWT validation on ingress
|
||||
gateway and routes requests based on the “version” claim in the validated JWT.</p>
|
||||
|
||||
<pre><code class="language-yaml">apiVersion: security.istio.io/v1beta1
|
||||
kind: RequestAuthentication
|
||||
metadata:
|
||||
name: jwt-on-ingress
|
||||
namespace: istio-system
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: istio-ingressgateway
|
||||
jwtRules:
|
||||
- issuer: "issuer-foo"
|
||||
jwksUri: https://example.com/.well-known/jwks.json
|
||||
---
|
||||
apiVersion: security.istio.io/v1beta1
|
||||
kind: AuthorizationPolicy
|
||||
metadata:
|
||||
name: require-jwt
|
||||
namespace: istio-system
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
app: istio-ingressgateway
|
||||
rules:
|
||||
- from:
|
||||
- source:
|
||||
requestPrincipals: ["*"]
|
||||
---
|
||||
apiVersion: networking.istio.io/v1alpha3
|
||||
kind: VirtualService
|
||||
metadata:
|
||||
name: route-jwt
|
||||
spec:
|
||||
hosts:
|
||||
- foo.prod.svc.cluster.local
|
||||
gateways:
|
||||
- istio-ingressgateway
|
||||
http:
|
||||
- name: "v2-route"
|
||||
match:
|
||||
- headers:
|
||||
x-jwt-claim.version:
|
||||
exact: "v2"
|
||||
route:
|
||||
- destination:
|
||||
host: foo.prod.svc.cluster.local
|
||||
subset: v2
|
||||
- name: "default-route"
|
||||
route:
|
||||
- destination:
|
||||
host: foo.prod.svc.cluster.local
|
||||
subset: v1
|
||||
</code></pre>
|
||||
|
||||
<p><strong>Note:</strong> This routing is only supported on Gateways and proper request authentication must first be applied to validate the JWT.</p>
|
||||
|
||||
<table class="message-fields">
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
Loading…
Reference in New Issue