Fix: remove 'audience' field from OM metadata service security config (#10624)

* Fix: remove 'audience' field from OM metadata service security config

* Remove extra space

* Update bootstrap/sql/com.mysql.cj.jdbc.Driver/v009__create_db_connection_info.sql

Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com>

* Update bootstrap/sql/org.postgresql.Driver/v009__create_db_connection_info.sql

Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com>

---------

Co-authored-by: Pere Miquel Brull <peremiquelbrull@gmail.com>
This commit is contained in:
Nahuel 2023-03-16 14:11:44 +01:00 committed by GitHub
parent cd6ece1cf4
commit 6b2babadde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -111,3 +111,8 @@ DELETE FROM entity_extension WHERE id IN
(SELECT DISTINCT tableId FROM temp_query_migration) AND extension = "table.tableQueries";
DROP Table temp_query_migration;
-- remove the audience if it was wrongfully sent from the UI after editing the OM service
UPDATE metadata_service_entity
SET json = JSON_REMOVE(json, '$.connection.config.securityConfig.audience')
WHERE name = 'OpenMetadata' AND JSON_EXTRACT(json, '$.connection.config.authProvider') != 'google';

View File

@ -112,3 +112,10 @@ DELETE FROM entity_extension WHERE id in
(SELECT DISTINCT tableId FROM temp_query_migration) AND extension = 'table.tableQueries';
DROP TABLE temp_query_migration;
-- remove the audience if it was wrongfully sent from the UI after editing the OM service
UPDATE metadata_service_entity
SET json = json::jsonb #- '{connection,config,securityConfig,audience}'
WHERE name = 'OpenMetadata'
AND json#>'{connection,config,authProvider}' IS NOT NULL
AND json -> 'connection' -> 'config' ->> 'authProvider' != 'google';