You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: api/v2/apisixconsumer_types.go
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -130,6 +130,11 @@ type ApisixConsumerJwtAuth struct {
130
130
}
131
131
132
132
// ApisixConsumerJwtAuthValue defines configuration for JWT authentication.
133
+
// For asymmetric algorithms (RS*, ES*, PS*, EdDSA), at least one of public_key
134
+
// or private_key must be provided. Symmetric algorithms (HS256, HS384, HS512)
135
+
// and unset algorithm do not require any key field.
136
+
//
137
+
// +kubebuilder:validation:XValidation:rule="!has(self.algorithm) || size(self.algorithm) == 0 || self.algorithm in ['HS256','HS384','HS512'] || (has(self.public_key) && size(self.public_key.trim()) > 0) || (has(self.private_key) && size(self.private_key.trim()) > 0)",message="algorithms other than HS256/HS384/HS512 require at least one non-empty public_key or private_key"
133
138
typeApisixConsumerJwtAuthValuestruct {
134
139
// Key is the unique identifier for the JWT credential.
135
140
Keystring`json:"key" yaml:"key"`
@@ -138,10 +143,9 @@ type ApisixConsumerJwtAuthValue struct {
138
143
// PublicKey is the public key used to verify JWT signatures (for asymmetric algorithms).
Copy file name to clipboardExpand all lines: docs/en/latest/reference/api-reference.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -781,6 +781,9 @@ _Appears in:_
781
781
782
782
783
783
ApisixConsumerJwtAuthValue defines configuration for JWT authentication.
784
+
For asymmetric algorithms (RS*, ES*, PS*, EdDSA), at least one of public_key
785
+
or private_key must be provided. Symmetric algorithms (HS256, HS384, HS512)
786
+
and unset algorithm do not require any key field.
784
787
785
788
786
789
@@ -790,7 +793,7 @@ ApisixConsumerJwtAuthValue defines configuration for JWT authentication.
790
793
|`secret`_string_| Secret is the shared secret used to sign the JWT (for symmetric algorithms). |
791
794
|`public_key`_string_| PublicKey is the public key used to verify JWT signatures (for asymmetric algorithms). |
792
795
|`private_key`_string_| PrivateKey is the private key used to sign the JWT (for asymmetric algorithms). |
793
-
|`algorithm`_string_| Algorithm specifies the signing algorithm. Can be `HS256`, `HS384`, `HS512`, `RS256`, `RS384`, `RS512`, `ES256`, `ES384`, `ES512`, `PS256`, `PS384`, `PS512`, or `EdDSA`. Currently APISIX only supports `HS256`, `HS512`, `RS256`, and `ES256`. API7 Enterprise supports all algorithms. |
796
+
|`algorithm`_string_| Algorithm specifies the signing algorithm. Can be `HS256`, `HS384`, `HS512`, `RS256`, `RS384`, `RS512`, `ES256`, `ES384`, `ES512`, `PS256`, `PS384`, `PS512`, or `EdDSA`. |
794
797
|`exp`_integer_| Exp is the token expiration period in seconds. |
795
798
|`base64_secret`_boolean_| Base64Secret indicates whether the secret is base64-encoded. |
796
799
|`lifetime_grace_period`_integer_| LifetimeGracePeriod is the allowed clock skew in seconds for token expiration. |
0 commit comments