Skip to content

Commit

Permalink
support specify jwt requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
wulianglongrd committed Mar 12, 2024
1 parent c6ba867 commit 0ad71b5
Show file tree
Hide file tree
Showing 7 changed files with 354 additions and 53 deletions.
20 changes: 20 additions & 0 deletions kubernetes/customresourcedefinitions.gen.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions releasenotes/notes/2733.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: release-notes/v2
kind: feature
area: security
issue:
- https://github.com/istio/istio/issues/43982

releaseNotes:
- |
**Added** a `failure_mode` field to specify a Jwt requirement. This is optional, the default value is `PERMISSIVE`.
134 changes: 109 additions & 25 deletions security/v1/jwt.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 26 additions & 1 deletion security/v1/jwt.proto
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,15 @@ option go_package="istio.io/api/security/v1";
// fromHeaders:
// - "x-goog-iap-jwt-assertion"
// ```
//
// The following example specifies that the JWT must be presented and verification successful.
//
// ```yaml
// - issuer: issuer-foo
// jwksUri: https://example.com/.well-known/jwks.json
// failureMode: STRICT
// ```
//
message JWTRule {
// Identifies the issuer that issued the JWT. See
// [issuer](https://tools.ietf.org/html/rfc7519#section-4.1.1)
Expand Down Expand Up @@ -183,8 +192,24 @@ message JWTRule {
// will spend waiting for the JWKS to be fetched. Default is 5s.
google.protobuf.Duration timeout = 13;

// FailureMode specifies a Jwt requirement.
enum FailureMode {
// The requirement is satisfied if JWT is missing, but failed if JWT is presented but invalid.
// This is the default behavior.
PERMISSIVE = 0;

// The requirement is always satisfied even if JWT is missing or the JWT verification fails.
IGNORE = 1;

// The requirement is satisfied only if JWT is presented and verification successful.
STRICT = 2;
}

// This field specifies a Jwt requirement. This is optional, the default value is `PERMISSIVE`.
FailureMode failure_mode = 14;

// $hide_from_docs
// Next available field number: 14
// Next available field number: 15
}

// This message specifies a header location to extract JWT token.
Expand Down
Loading

0 comments on commit 0ad71b5

Please sign in to comment.