Skip to content
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

feat(entities-plugins): support service-protection plugin #1796

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -693,10 +693,10 @@ const buildFormSchema = (parentKey: string, response: Record<string, any>, initi
// pass the referenceable flag from elements to the parent
initialFormSchema[field].referenceable = elements.referenceable

if ((elements.type === 'string' || elements.type === 'integer') && !elements.one_of) {
if (['string', 'integer', 'number'].includes(elements.type) && !elements.one_of) {
const { id, help, label, hint, values, referenceable } = initialFormSchema[field]
const { inputAttributes, ...overrides } = JSON.parse(JSON.stringify(ArrayInputFieldSchema))
inputAttributes.type = elements.type === 'integer' ? 'number' : 'text'
inputAttributes.type = elements.type === 'string' ? 'text' : 'number'
initialFormSchema[field] = { id, help, label, hint, values, referenceable, inputAttributes, ...overrides }
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -755,6 +755,13 @@ export const PLUGIN_METADATA: Record<string, Omit<PluginMetaData<I18nMessageSour
nameKey: 'plugins.meta.confluent.name',
scope: [PluginScope.GLOBAL, PluginScope.SERVICE, PluginScope.ROUTE, PluginScope.CONSUMER],
},
'service-protection': {
descriptionKey: 'plugins.meta.service-protection.description',
group: PluginGroup.TRAFFIC_CONTROL,
isEnterprise: true,
nameKey: 'plugins.meta.service-protection.name',
scope: [PluginScope.GLOBAL, PluginScope.SERVICE],
},
}

/**
Expand Down
4 changes: 4 additions & 0 deletions packages/entities/entities-plugins/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,10 @@
"confluent": {
"name": "Confluent",
"description": "Streamlines integration with Confluent Cloud and transforms requests into messages published to a Confluent topic."
},
"service-protection": {
"name": "Service Protection",
"description": "Prevent abuse and protect services with absolute limits on the number of requests reaching the service."
}
},
"fields": {
Expand Down
Loading