-
Notifications
You must be signed in to change notification settings - Fork 2
US1094711:- Add httpMethods field to L7Api PortalMeta for per-API HTTP method restriction #100
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| // Copyright (c) 2025 Broadcom Inc. and its subsidiaries. All Rights Reserved. | ||
| // Copyright (c) 2026 Broadcom Inc. and its subsidiaries. All Rights Reserved. | ||
| // AI assistance has been used to generate some or all contents of this file. That includes, but is not limited to, new code, modifying existing code, stylistic edits. | ||
|
|
||
| package v1alpha1 | ||
|
|
||
|
|
@@ -74,13 +75,27 @@ type PortalMeta struct { | |
| CreateTs int `json:"createTs,omitempty"` | ||
| ModifyTs int `json:"modifyTs,omitempty"` | ||
| SsgServiceType string `json:"ssgServiceType,omitempty"` | ||
| HttpMethods []HttpMethod `json:"httpMethods,omitempty"` | ||
| PolicyTemplates []PolicyTemplate `json:"policyEntities,omitempty"` | ||
| CustomFields []CustomField `json:"customFieldValues,omitempty"` | ||
| SecurePasswords []SecurePassword `json:"securePasswords,omitempty"` | ||
| SecurePasswordIdsForUndeployment []string `json:"securePasswordIdsForUndeployment,omitempty"` | ||
| Checksum string `json:"checksum,omitempty"` | ||
| } | ||
|
|
||
| type HttpMethod string | ||
|
|
||
| const ( | ||
| HttpMethodGet HttpMethod = "GET" | ||
| HttpMethodPost HttpMethod = "POST" | ||
| HttpMethodPut HttpMethod = "PUT" | ||
| HttpMethodPatch HttpMethod = "PATCH" | ||
| HttpMethodDelete HttpMethod = "DELETE" | ||
| HttpMethodHead HttpMethod = "HEAD" | ||
| HttpMethodOptions HttpMethod = "OPTIONS" | ||
| HttpMethodOther HttpMethod = "OTHER" | ||
|
Contributor
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. [Question] ❓
Author
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.
|
||
| ) | ||
|
|
||
| type PolicyTemplate struct { | ||
| Uuid string `json:"policyEntityUuid"` | ||
| ApiPolicyTemplateArguments []PolicyTemplateArg `json:"policyTemplateArguments"` | ||
|
|
||
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.
[Suggestion] ❌ No
+kubebuilder:validation:Enummarker onHttpMethods []HttpMethod, even thoughHttpMethodis defined as a closed enum type below with 8 named consts. As generated, the CRD schema only enforcestype: arrayoftype: string(seehttpMethods:inconfig/crd/bases/security.brcmlabs.com_l7apis.yaml) — any string value passes admission and flows straight into the Graphman bundle's<l7:Verb>elements via the qtpl template.✅ Consider adding
// +kubebuilder:validation:Enum=GET;POST;PUT;PATCH;DELETE;HEAD;OPTIONS;OTHERabove the field so the API server rejects typos/invalid verbs at admission time rather than letting them reach the Gateway.(Noting the rest of this file doesn't use Enum markers elsewhere, so this is a suggestion rather than a blocking pattern violation.)
Uh oh!
There was an error while loading. Please reload this page.
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.
Intentional — mirrors
StateStoreType/RedisTypeinl7statestore_types.go, which also has no enum marker.