Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support specify jwt requirement #2733

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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