Skip to content

Commit 2261e34

Browse files
committed
Add example for authn policy proto.
1 parent 1d28a6d commit 2261e34

File tree

3 files changed

+112
-4
lines changed

3 files changed

+112
-4
lines changed

authentication/v1alpha1/istio.authentication.v1alpha1.pb.html

+40-4
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,44 @@ <h2 id="Policy">Policy</h2>
7979
For each part, if it&rsquo;s not empty, at least one of those listed credential
8080
must be provided and (successfully) verified for the authentication to pass.</p>
8181

82+
<p>Examples:
83+
Policy to enable mTLS for all services in namespace frod</p>
84+
85+
<pre><code>apiVersion: config.istio.io/v1alpha2
86+
kind: RouteRule
87+
metadata:
88+
name: mTLS-enable
89+
namespace: frod
90+
spec:
91+
match:
92+
peer:
93+
- mtls: {}
94+
</code></pre>
95+
96+
<p>Policy to enable mTLS, and use JWT for productpage:9000</p>
97+
98+
<pre><code>apiVersion: config.istio.io/v1alpha2
99+
kind: RouteRule
100+
metadata:
101+
name: mTLS-enable
102+
namespace: frod
103+
spec:
104+
match:
105+
- name: productpage
106+
ports:
107+
- 9000
108+
peer:
109+
- mtls:
110+
end_user:
111+
- jwt:
112+
issuer: &quot;https://securetoken.google.com&quot;
113+
audiences:
114+
- &quot;productpage&quot;
115+
jwks_uri: &quot;https://www.googleapis.com/oauth2/v1/certs&quot;
116+
locations:
117+
- header: x-goog-iap-jwt-assertion
118+
</code></pre>
119+
82120
<table>
83121
<tr>
84122
<th>Field</th>
@@ -178,8 +216,7 @@ <h2 id="istio.mixer.v1.config.client.JWT">istio.mixer.v1.config.client.JWT</h2>
178216
<td><code>string</code></td>
179217
<td>
180218
<p>URL of the provider&rsquo;s public key set to validate signature of the
181-
JWT. See <a href="https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata">OpenID
182-
Discovery</a>.</p>
219+
JWT. See <a href="https://openid.net/specs/openid-connect-discovery-1_0.html#ProviderMetadata">OpenID Discovery</a>.</p>
183220

184221
<p>Optional if the key set document can either (a) be retrieved from
185222
<a href="https://openid.net/specs/openid-connect-discovery-1_0.html">OpenID Discovery</a>
@@ -195,8 +232,7 @@ <h2 id="istio.mixer.v1.config.client.JWT">istio.mixer.v1.config.client.JWT</h2>
195232
<td><code>bool</code></td>
196233
<td>
197234
<p>If true, forward the entire base64 encoded JWT in the HTTP request.
198-
If false, remove the JWT from the HTTP request and do not forward to the
199-
application.</p>
235+
If false, remove the JWT from the HTTP request and do not forward to the application.</p>
200236

201237
</td>
202238
</tr>

authentication/v1alpha1/policy.pb.go

+36
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

authentication/v1alpha1/policy.proto

+36
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,42 @@ message Destination {
5959
// - end_user: verify end-user credentials.
6060
// For each part, if it's not empty, at least one of those listed credential
6161
// must be provided and (successfully) verified for the authentication to pass.
62+
//
63+
// Examples:
64+
// Policy to enable mTLS for all services in namespace frod
65+
//
66+
// apiVersion: config.istio.io/v1alpha2
67+
// kind: RouteRule
68+
// metadata:
69+
// name: mTLS-enable
70+
// namespace: frod
71+
// spec:
72+
// match:
73+
// peer:
74+
// - mtls: {}
75+
//
76+
// Policy to enable mTLS, and use JWT for productpage:9000
77+
//
78+
// apiVersion: config.istio.io/v1alpha2
79+
// kind: RouteRule
80+
// metadata:
81+
// name: mTLS-enable
82+
// namespace: frod
83+
// spec:
84+
// match:
85+
// - name: productpage
86+
// ports:
87+
// - 9000
88+
// peer:
89+
// - mtls:
90+
// end_user:
91+
// - jwt:
92+
// issuer: "https://securetoken.google.com"
93+
// audiences:
94+
// - "productpage"
95+
// jwks_uri: "https://www.googleapis.com/oauth2/v1/certs"
96+
// locations:
97+
// - header: x-goog-iap-jwt-assertion
6298
message Policy {
6399
// List of destinations (workloads) that the policy should be applied on.
64100
// If empty, policy will be used on all destinations in the same namespace.

0 commit comments

Comments
 (0)