-
Notifications
You must be signed in to change notification settings - Fork 18
Authorization Model Metadata #228
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -1537,8 +1537,25 @@ message WriteAuthorizationModelRequest { | |||||||||||||||||||||
(validate.rules).map.max_pairs = 25, | ||||||||||||||||||||||
(validate.rules).map.keys.string = {pattern: "^[^:#@\\s]{1,50}$"} | ||||||||||||||||||||||
]; | ||||||||||||||||||||||
} | ||||||||||||||||||||||
|
||||||||||||||||||||||
// Labels and metadata for the authorization model (similar to Kubernetes labels) | ||||||||||||||||||||||
map<string, string> metadata = 5 [ | ||||||||||||||||||||||
json_name = "metadata", | ||||||||||||||||||||||
(validate.rules).map.max_pairs = 20, | ||||||||||||||||||||||
(validate.rules).map.keys.string = { | ||||||||||||||||||||||
pattern: "^[a-z0-9]([a-z0-9\\-\\.]*[a-z0-9])?$" | ||||||||||||||||||||||
max_bytes: 63 | ||||||||||||||||||||||
ignore_empty: true | ||||||||||||||||||||||
}, | ||||||||||||||||||||||
Comment on lines
+1545
to
+1549
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Empty metadata keys slip through here as well Same issue as in - (validate.rules).map.keys.string = {
- pattern: "^[a-z0-9]([a-z0-9\\-\\.]*[a-z0-9])?$"
- max_bytes: 63
- ignore_empty: true
- },
+ (validate.rules).map.keys.string = {
+ pattern: "^[a-z0-9]([a-z0-9\\-\\.]*[a-z0-9])?$"
+ max_bytes: 63
+ ignore_empty: false
+ }, 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
|
||||||||||||||||||||||
(validate.rules).map.values.string = { | ||||||||||||||||||||||
max_bytes: 256 | ||||||||||||||||||||||
ignore_empty: true | ||||||||||||||||||||||
}, | ||||||||||||||||||||||
(grpc.gateway.protoc_gen_openapiv2.options.openapiv2_field) = { | ||||||||||||||||||||||
example: "{\"environment\": \"production\", \"team\": \"platform\", \"version\": \"v1.2.3\"}" | ||||||||||||||||||||||
} | ||||||||||||||||||||||
]; | ||||||||||||||||||||||
} | ||||||||||||||||||||||
message WriteAuthorizationModelResponse { | ||||||||||||||||||||||
string authorization_model_id = 1 [ | ||||||||||||||||||||||
json_name = "authorization_model_id", | ||||||||||||||||||||||
|
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ignore_empty: true
makes empty metadata keys valid – violates the RFCignore_empty: true
bypasses the regex when the key is the empty string, yet the spec explicitly says “keys cannot be empty”.Flip the flag to
false
(or omit it – default isfalse
) to enforce the requirement.📝 Committable suggestion
🤖 Prompt for AI Agents