You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by GitBox <gi...@apache.org> on 2022/05/09 08:49:46 UTC

[GitHub] [apisix-ingress-controller] AlinsRan opened a new pull request, #1009: feat: add jwt-auth authorized

AlinsRan opened a new pull request, #1009:
URL: https://github.com/apache/apisix-ingress-controller/pull/1009

   <!-- Please answer these questions before submitting a pull request -->
   
   ### Type of change:
   
   <!-- Please delete options that are not relevant. -->
   
   - [ ] Bugfix
   - [ ] New feature provided
   - [ ] Improve performance
   - [ ] Backport patches
   
   ### What this PR does / why we need it:
   <!--- Why is this change required? What problem does it solve? -->
   <!--- If it fixes an open issue, please link to the issue here. -->
   
   ### Pre-submission checklist:
   
   <!--
   Please follow the requirements:
   1. Use Draft if the PR is not ready to be reviewed
   2. Test is required for the feat/fix PR, unless you have a good reason
   3. Doc is required for the feat PR
   4. Use a new commit to resolve review instead of `push -f`
   5. Use "request review" to notify the reviewer once you have resolved the review
   -->
   
   * [ ] Did you explain what problem does this PR solve? Or what new features have been added?
   * [ ] Have you added corresponding test cases?
   * [ ] Have you modified the corresponding document?
   * [ ] Is this PR backward compatible? **If it is not backward compatible, please discuss on the [mailing list](https://github.com/apache/apisix-ingress-controller#community) first**
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] tao12345666333 commented on pull request #1009: feat: add jwt-auth authorized

Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on PR #1009:
URL: https://github.com/apache/apisix-ingress-controller/pull/1009#issuecomment-1122113206

   ping @sff0219


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] codecov-commenter commented on pull request #1009: feat: add jwt-auth authorized

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #1009:
URL: https://github.com/apache/apisix-ingress-controller/pull/1009#issuecomment-1122031053

   # [Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1009?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1009](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1009?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (5c42905) into [master](https://codecov.io/gh/apache/apisix-ingress-controller/commit/92b89b37d2f63eab6f5c6deb6e3d2a5ccae975aa?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (92b89b3) will **increase** coverage by `0.31%`.
   > The diff coverage is `78.18%`.
   
   ```diff
   @@            Coverage Diff             @@
   ##           master    #1009      +/-   ##
   ==========================================
   + Coverage   31.91%   32.23%   +0.31%     
   ==========================================
     Files          73       73              
     Lines        7953     8008      +55     
   ==========================================
   + Hits         2538     2581      +43     
   - Misses       5139     5150      +11     
   - Partials      276      277       +1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1009?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [pkg/kube/translation/apisix\_route.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1009/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGtnL2t1YmUvdHJhbnNsYXRpb24vYXBpc2l4X3JvdXRlLmdv) | `21.07% <0.00%> (-0.36%)` | :arrow_down: |
   | [pkg/kube/translation/apisix\_consumer.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1009/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGtnL2t1YmUvdHJhbnNsYXRpb24vYXBpc2l4X2NvbnN1bWVyLmdv) | `71.42% <60.00%> (-3.58%)` | :arrow_down: |
   | [pkg/kube/translation/plugin.go](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1009/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cGtnL2t1YmUvdHJhbnNsYXRpb24vcGx1Z2luLmdv) | `100.00% <100.00%> (ø)` | |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1009?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1009?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [795be22...5c42905](https://codecov.io/gh/apache/apisix-ingress-controller/pull/1009?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] tao12345666333 commented on pull request #1009: feat: add jwt-auth authorization method

Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on PR #1009:
URL: https://github.com/apache/apisix-ingress-controller/pull/1009#issuecomment-1127475021

   Let's move forward, docs can be tracked with #1018
   
   cc @tokers 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] tao12345666333 commented on pull request #1009: feat: add jwt-auth authorized

Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on PR #1009:
URL: https://github.com/apache/apisix-ingress-controller/pull/1009#issuecomment-1125117957

   I don't think we need to write a separate document.
   Content can be added to this document. https://github.com/apache/apisix-ingress-controller/blob/master/docs/en/latest/practices/enable-authentication-and-restriction.md


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] AlinsRan commented on a diff in pull request #1009: feat: add jwt-auth authorized

Posted by GitBox <gi...@apache.org>.
AlinsRan commented on code in PR #1009:
URL: https://github.com/apache/apisix-ingress-controller/pull/1009#discussion_r868945768


##########
pkg/kube/apisix/apis/config/v2/types.go:
##########
@@ -355,6 +365,23 @@ type ApisixConsumerKeyAuthValue struct {
 	Key string `json:"key" yaml:"key"`
 }
 
+// ApisixConsumerJwtAuth defines the configuration for the jwt auth.
+type ApisixConsumerJwtAuth struct {
+	SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty" yaml:"secretRef,omitempty"`
+	Value     *ApisixConsumerJwtAuthValue  `json:"value,omitempty" yaml:"value,omitempty"`
+}
+
+// ApisixConsumerJwtAuthValue defines the in-place configuration for jwt auth.
+type ApisixConsumerJwtAuthValue struct {
+	Key          string `json:"key" yaml:"key"`
+	Secret       string `json:"secret,omitempty" yaml:"secret,omitempty"`
+	PublicKey    string `json:"public_key,omitempty" yaml:"public_key,omitempty"`
+	PrivateKey   string `json:"private_key" yaml:"private_key,omitempty"`
+	Algorithm    string `json:"algorithm,omitempty" yaml:"algorithm,omitempty"`
+	Exp          int64  `json:"exp,omitempty" yaml:"exp,omitempty"`

Review Comment:
   Solved!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] lingsamuel commented on a diff in pull request #1009: feat: add jwt-auth authorized

Posted by GitBox <gi...@apache.org>.
lingsamuel commented on code in PR #1009:
URL: https://github.com/apache/apisix-ingress-controller/pull/1009#discussion_r870048959


##########
pkg/kube/apisix/apis/config/v2beta2/types.go:
##########
@@ -140,6 +141,14 @@ type ApisixRouteAuthenticationKeyAuth struct {
 	Header string `json:"header,omitempty" yaml:"header,omitempty"`
 }
 
+// ApisixRouteAuthenticationJwtAuth is the jwtAuth-related
+// configuration in ApisixRouteAuthentication.
+type ApisixRouteAuthenticationJwtAuth struct {

Review Comment:
   we are going to add new feature to v2beta2? @tao12345666333 is it by design?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] AlinsRan commented on a diff in pull request #1009: feat: add jwt-auth authorized

Posted by GitBox <gi...@apache.org>.
AlinsRan commented on code in PR #1009:
URL: https://github.com/apache/apisix-ingress-controller/pull/1009#discussion_r871177537


##########
pkg/kube/apisix/apis/config/v2beta2/types.go:
##########
@@ -140,6 +141,14 @@ type ApisixRouteAuthenticationKeyAuth struct {
 	Header string `json:"header,omitempty" yaml:"header,omitempty"`
 }
 
+// ApisixRouteAuthenticationJwtAuth is the jwtAuth-related
+// configuration in ApisixRouteAuthentication.
+type ApisixRouteAuthenticationJwtAuth struct {

Review Comment:
   OK.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] tao12345666333 commented on a diff in pull request #1009: feat: add jwt-auth authorized

Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on code in PR #1009:
URL: https://github.com/apache/apisix-ingress-controller/pull/1009#discussion_r868969751


##########
pkg/kube/translation/plugin.go:
##########
@@ -115,6 +116,9 @@ func (t *translator) translateConsumerBasicAuthPlugin(consumerNamespace string,
 
 func (t *translator) translateConsumerJwtAuthPlugin(consumerNamespace string, cfg *configv2beta3.ApisixConsumerJwtAuth) (*apisixv1.JwtAuthConsumerConfig, error) {
 	if cfg.Value != nil {
+		if cfg.Value.Exp < 0 {

Review Comment:
   https://github.com/apache/apisix/blob/ab7a7675d2a1abb1f0299a8fd44e5f80435c2158/apisix/plugins/jwt-auth.lua#L66
   
   the minimum is 1



##########
pkg/kube/translation/plugin.go:
##########
@@ -141,6 +145,9 @@ func (t *translator) translateConsumerJwtAuthPlugin(consumerNamespace string, cf
 	}
 	expRaw := sec.Data["exp"]
 	exp, _ := strconv.ParseInt(string(expRaw), 10, 64)
+	if exp < 0 {

Review Comment:
   ditto



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] tao12345666333 commented on a diff in pull request #1009: feat: add jwt-auth authorized

Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on code in PR #1009:
URL: https://github.com/apache/apisix-ingress-controller/pull/1009#discussion_r871122830


##########
pkg/kube/apisix/apis/config/v2beta2/types.go:
##########
@@ -140,6 +141,14 @@ type ApisixRouteAuthenticationKeyAuth struct {
 	Header string `json:"header,omitempty" yaml:"header,omitempty"`
 }
 
+// ApisixRouteAuthenticationJwtAuth is the jwtAuth-related
+// configuration in ApisixRouteAuthentication.
+type ApisixRouteAuthenticationJwtAuth struct {

Review Comment:
   no, we don't need add any feature to v2beta2.  I missed.
    @AlinsRan please remove `v2beta2` related code. we only need add feature to `v2beta3` and `v2` 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] AlinsRan commented on a diff in pull request #1009: feat: add jwt-auth authorized

Posted by GitBox <gi...@apache.org>.
AlinsRan commented on code in PR #1009:
URL: https://github.com/apache/apisix-ingress-controller/pull/1009#discussion_r871474504


##########
pkg/kube/apisix/apis/config/v2/types.go:
##########
@@ -180,6 +181,14 @@ type ApisixRouteAuthenticationKeyAuth struct {
 	Header string `json:"header,omitempty" yaml:"header,omitempty"`
 }
 
+// ApisixRouteAuthenticationJwtAuth is the jwtAuth-related

Review Comment:
   Thanks.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] AlinsRan commented on pull request #1009: feat: add jwt-auth authorized

Posted by GitBox <gi...@apache.org>.
AlinsRan commented on PR #1009:
URL: https://github.com/apache/apisix-ingress-controller/pull/1009#issuecomment-1126932000

   > Missing docs to:
   > 
   > 1. JWT Auth Config Reference
   > 2. How to use it?
   
   doc: #1018 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] AlinsRan commented on pull request #1009: feat: add jwt-auth authorized

Posted by GitBox <gi...@apache.org>.
AlinsRan commented on PR #1009:
URL: https://github.com/apache/apisix-ingress-controller/pull/1009#issuecomment-1125565093

   > I don't think we need to write a separate document. Content can be added to this document. https://github.com/apache/apisix-ingress-controller/blob/master/docs/en/latest/practices/enable-authentication-and-restriction.md
   
   I agree.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] tao12345666333 merged pull request #1009: feat: add jwt-auth authorization method

Posted by GitBox <gi...@apache.org>.
tao12345666333 merged PR #1009:
URL: https://github.com/apache/apisix-ingress-controller/pull/1009


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] tokers commented on a diff in pull request #1009: feat: add jwt-auth authorized

Posted by GitBox <gi...@apache.org>.
tokers commented on code in PR #1009:
URL: https://github.com/apache/apisix-ingress-controller/pull/1009#discussion_r871188540


##########
pkg/kube/apisix/apis/config/v2/types.go:
##########
@@ -180,6 +181,14 @@ type ApisixRouteAuthenticationKeyAuth struct {
 	Header string `json:"header,omitempty" yaml:"header,omitempty"`
 }
 
+// ApisixRouteAuthenticationJwtAuth is the jwtAuth-related

Review Comment:
   ```suggestion
   // ApisixRouteAuthenticationJwtAuth is the jwt auth related
   ```



##########
pkg/kube/apisix/apis/config/v2/types.go:
##########
@@ -330,6 +339,7 @@ type ApisixConsumerSpec struct {
 type ApisixConsumerAuthParameter struct {
 	BasicAuth *ApisixConsumerBasicAuth `json:"basicAuth,omitempty" yaml:"basicAuth"`
 	KeyAuth   *ApisixConsumerKeyAuth   `json:"keyAuth,omitempty" yaml:"keyAuth"`
+	JwtAuht   *ApisixConsumerJwtAuth   `json:"jwtAuth,omitempty" yaml:"jwtAuth"`

Review Comment:
   ```suggestion
   	JwtAuth   *ApisixConsumerJwtAuth   `json:"jwtAuth,omitempty" yaml:"jwtAuth"`
   ```



##########
pkg/kube/apisix/apis/config/v2/types.go:
##########
@@ -330,6 +339,7 @@ type ApisixConsumerSpec struct {
 type ApisixConsumerAuthParameter struct {
 	BasicAuth *ApisixConsumerBasicAuth `json:"basicAuth,omitempty" yaml:"basicAuth"`
 	KeyAuth   *ApisixConsumerKeyAuth   `json:"keyAuth,omitempty" yaml:"keyAuth"`
+	JwtAuht   *ApisixConsumerJwtAuth   `json:"jwtAuth,omitempty" yaml:"jwtAuth"`

Review Comment:
   ```suggestion
   	JwtAuth   *ApisixConsumerJwtAuth   `json:"jwtAuth,omitempty" yaml:"jwtAuth"`
   ```



##########
pkg/types/apisix/v1/plugin_types.go:
##########
@@ -70,6 +70,19 @@ type BasicAuthConsumerConfig struct {
 	Password string `json:"password"`
 }
 
+// JwtAuthConsumerConfig is the rule config for basic-auth plugin

Review Comment:
   ```suggestion
   // JwtAuthConsumerConfig is the rule config for jwt-auth plugin
   ```



##########
samples/deploy/crd/v1/ApisixConsumer.yaml:
##########
@@ -98,3 +99,37 @@ spec:
                               minLength: 1
                           required:
                             - name
+                    jwtAuth:
+                      type: object
+                      oneOf:
+                        - required: ["value"]
+                        - required: ["secretRef"]
+                      properties:
+                        value:
+                          type: object
+                          properties:
+                            key:
+                              type: string
+                              minLength: 1
+                            secret:
+                              type: string
+                            public_key:
+                              type: string
+                            private_key:
+                              type: string
+                            algorithm:
+                              type: string
+                            exp:
+                              type: integer
+                            base64_secret: 
+                              type: boolean
+                          required:
+                            - key
+                        secretRef:
+                          type: object
+                          properties:
+                            name:
+                              type: string
+                              minLength: 1
+                          required:
+                            - name

Review Comment:
   Add the EOL symbol.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] tao12345666333 commented on a diff in pull request #1009: feat: add jwt-auth authorized

Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on code in PR #1009:
URL: https://github.com/apache/apisix-ingress-controller/pull/1009#discussion_r868854008


##########
pkg/kube/apisix/apis/config/v2/types.go:
##########
@@ -355,6 +365,23 @@ type ApisixConsumerKeyAuthValue struct {
 	Key string `json:"key" yaml:"key"`
 }
 
+// ApisixConsumerJwtAuth defines the configuration for the jwt auth.
+type ApisixConsumerJwtAuth struct {
+	SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty" yaml:"secretRef,omitempty"`
+	Value     *ApisixConsumerJwtAuthValue  `json:"value,omitempty" yaml:"value,omitempty"`
+}
+
+// ApisixConsumerJwtAuthValue defines the in-place configuration for jwt auth.
+type ApisixConsumerJwtAuthValue struct {
+	Key          string `json:"key" yaml:"key"`
+	Secret       string `json:"secret,omitempty" yaml:"secret,omitempty"`
+	PublicKey    string `json:"public_key,omitempty" yaml:"public_key,omitempty"`
+	PrivateKey   string `json:"private_key" yaml:"private_key,omitempty"`
+	Algorithm    string `json:"algorithm,omitempty" yaml:"algorithm,omitempty"`
+	Exp          int64  `json:"exp,omitempty" yaml:"exp,omitempty"`

Review Comment:
   exp is a positive number, I think you should add a check



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [apisix-ingress-controller] tao12345666333 commented on a diff in pull request #1009: feat: add jwt-auth authorized

Posted by GitBox <gi...@apache.org>.
tao12345666333 commented on code in PR #1009:
URL: https://github.com/apache/apisix-ingress-controller/pull/1009#discussion_r868854182


##########
pkg/kube/apisix/apis/config/v2/types.go:
##########
@@ -355,6 +365,23 @@ type ApisixConsumerKeyAuthValue struct {
 	Key string `json:"key" yaml:"key"`
 }
 
+// ApisixConsumerJwtAuth defines the configuration for the jwt auth.
+type ApisixConsumerJwtAuth struct {
+	SecretRef *corev1.LocalObjectReference `json:"secretRef,omitempty" yaml:"secretRef,omitempty"`
+	Value     *ApisixConsumerJwtAuthValue  `json:"value,omitempty" yaml:"value,omitempty"`
+}
+
+// ApisixConsumerJwtAuthValue defines the in-place configuration for jwt auth.
+type ApisixConsumerJwtAuthValue struct {
+	Key          string `json:"key" yaml:"key"`
+	Secret       string `json:"secret,omitempty" yaml:"secret,omitempty"`
+	PublicKey    string `json:"public_key,omitempty" yaml:"public_key,omitempty"`
+	PrivateKey   string `json:"private_key" yaml:"private_key,omitempty"`
+	Algorithm    string `json:"algorithm,omitempty" yaml:"algorithm,omitempty"`
+	Exp          int64  `json:"exp,omitempty" yaml:"exp,omitempty"`

Review Comment:
   exp is a positive number, I think you should add a check



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org