mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-26 15:10:05 +00:00
Fix#11216: Use Enum for SASL Mechanism for Kafka and Redpanda connections (#11385)
* Fix#11216: Use ENUM for SASL Mechanism for Kafka and Redpanda connections * Minor change * Address PR comments * Fix postgres migration
This commit is contained in:
parent
27637119dd
commit
b22192575d
@ -0,0 +1,6 @@
|
||||
-- Updating the value of SASL Mechanism for Kafka and Redpanda connections
|
||||
UPDATE messaging_service_entity
|
||||
SET json = JSON_REPLACE(json, '$.connection.config.saslMechanism', 'PLAIN')
|
||||
WHERE (serviceType = 'Kafka' OR serviceType = 'Redpanda')
|
||||
AND JSON_EXTRACT(json, '$.connection.config.saslMechanism') IS NOT NULL
|
||||
AND JSON_EXTRACT(json, '$.connection.config.saslMechanism') NOT IN ('GSSAPI', 'PLAIN', 'SCRAM-SHA-256', 'SCRAM-SHA-512', 'OAUTHBEARER');
|
||||
@ -0,0 +1,6 @@
|
||||
-- Updating the value of SASL Mechanism for Kafka and Redpanda connections
|
||||
UPDATE messaging_service_entity
|
||||
SET json = JSONB_SET(json::jsonb, '{connection,config,saslMechanism}', '"PLAIN"')
|
||||
WHERE (servicetype = 'Kafka' OR serviceType = 'Redpanda')
|
||||
AND json#>'{connection,config,saslMechanism}' IS NOT NULL
|
||||
AND json#>'{connection,config,saslMechanism}' NOT IN ('"GSSAPI"', '"PLAIN"', '"SCRAM-SHA-256"', '"SCRAM-SHA-512"', '"OAUTHBEARER"');
|
||||
@ -58,7 +58,7 @@ def get_connection(
|
||||
"sasl.password"
|
||||
] = connection.saslPassword.get_secret_value()
|
||||
if connection.saslMechanism:
|
||||
connection.consumerConfig["sasl.mechanism"] = connection.saslMechanism
|
||||
connection.consumerConfig["sasl.mechanism"] = connection.saslMechanism.value
|
||||
|
||||
if connection.basicAuthUserInfo:
|
||||
connection.schemaRegistryConfig = connection.schemaRegistryConfig or {}
|
||||
|
||||
@ -45,7 +45,8 @@
|
||||
"saslMechanism": {
|
||||
"title": "SASL Mechanism",
|
||||
"description": "sasl.mechanism Consumer Config property",
|
||||
"type": "string"
|
||||
"$ref": "saslMechanismType.json",
|
||||
"default": "PLAIN"
|
||||
},
|
||||
"basicAuthUserInfo": {
|
||||
"title": "Basic Auth User Info",
|
||||
|
||||
@ -45,7 +45,8 @@
|
||||
"saslMechanism": {
|
||||
"title": "SASL Mechanism",
|
||||
"description": "sasl.mechanism Consumer Config property",
|
||||
"type": "string"
|
||||
"$ref": "saslMechanismType.json",
|
||||
"default": "PLAIN"
|
||||
},
|
||||
"basicAuthUserInfo": {
|
||||
"title": "Basic Auth User Info",
|
||||
|
||||
@ -0,0 +1,12 @@
|
||||
{
|
||||
"$id": "https://open-metadata.org/schema/entity/services/connections/messaging/saslMechanismType.json",
|
||||
"$schema": "http://json-schema.org/draft-07/schema#",
|
||||
"title": "SaslMechanismType",
|
||||
"javaType": "org.openmetadata.schema.services.connections.messaging.SaslMechanismType",
|
||||
"description": "SASL Mechanism consumer config property",
|
||||
"type": "string",
|
||||
"enum": ["PLAIN", "GSSAPI", "SCRAM-SHA-256", "SCRAM-SHA-512", "OAUTHBEARER"],
|
||||
"default": "PLAIN"
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user