Skip to content

Commit

Permalink
refactor(proto): remove validation rules from JWT config
Browse files Browse the repository at this point in the history
- Remove validation rules for SigningMethod, Key, AccessTokenLifetime, RefreshTokenLifetime, Issuer, Audience, and TokenType fields
- Update config.pb.go and config.pb.validate.go files to reflect the changes
  • Loading branch information
godcong committed Dec 20, 2024
1 parent e2f86e0 commit 49fba10
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 134 deletions.
109 changes: 53 additions & 56 deletions gen/go/security/jwt/v1/config.pb.go

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

77 changes: 6 additions & 71 deletions gen/go/security/jwt/v1/config.pb.validate.go

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

7 changes: 0 additions & 7 deletions proto/security/jwt/v1/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ option php_namespace = "OrigAdmin\\Runtime\\Security\\JWT\\V1";
message Config {
string signing_method = 1 [
json_name = "signing_method",
(validate.rules).string.min_len = 1,
(gnostic.openapi.v3.property) = {description: "The signing method used for the token (e.g., HS256, RS256)."}
];
string key = 2 [
json_name = "key",
(validate.rules).string.min_len = 1,
(gnostic.openapi.v3.property) = {description: "The key used for signing the token."}
];
string key2 = 3 [
Expand All @@ -34,27 +32,22 @@ message Config {
];
int64 access_token_lifetime = 5 [
json_name = "access_token_lifetime",
(validate.rules).int64.gt = 0,
(gnostic.openapi.v3.property) = {description: "The lifetime of the token."}
];
int64 refresh_token_lifetime = 6 [
json_name = "refresh_token_lifetime",
(validate.rules).int64.gt = 0,
(gnostic.openapi.v3.property) = {description: "The lifetime of the refresh token."}
];
string issuer = 7 [
json_name = "issuer",
(validate.rules).string.min_len = 1,
(gnostic.openapi.v3.property) = {description: "The issuer of the token."}
];
repeated string audience = 8 [
json_name = "audience",
(validate.rules).repeated.min_items = 1,
(gnostic.openapi.v3.property) = {description: "The audience for which the token is intended."}
]; // Audience
string token_type = 9 [
json_name = "token_type",
(validate.rules).string.min_len = 1,
(gnostic.openapi.v3.property) = {description: "The type of the token (e.g., Bearer)."}
];
}

0 comments on commit 49fba10

Please sign in to comment.