mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-12-26 06:53:37 +00:00
parent
539da30ca0
commit
810e6c7dfc
@ -7,3 +7,23 @@ ADD teamType VARCHAR(64) GENERATED ALWAYS AS (json ->> '$.teamType') NOT NULL;
|
||||
UPDATE dbservice_entity
|
||||
SET json = JSON_REMOVE(json, '$.connection.config.database')
|
||||
WHERE serviceType = 'DynamoDB';
|
||||
|
||||
UPDATE dashboard_service_entity
|
||||
SET json = JSON_INSERT(
|
||||
JSON_REMOVE(json, '$.connection.config.username'),
|
||||
'$.connection.config.clientId',
|
||||
JSON_EXTRACT(json, '$.connection.config.username')
|
||||
)
|
||||
WHERE serviceType = 'Looker';
|
||||
|
||||
UPDATE dashboard_service_entity
|
||||
SET json = JSON_INSERT(
|
||||
JSON_REMOVE(json, '$.connection.config.password'),
|
||||
'$.connection.config.clientSecret',
|
||||
JSON_EXTRACT(json, '$.connection.config.password')
|
||||
)
|
||||
WHERE serviceType = 'Looker';
|
||||
|
||||
UPDATE dashboard_service_entity
|
||||
SET json = JSON_REMOVE(json, '$.connection.config.env')
|
||||
WHERE serviceType = 'Looker';
|
||||
|
||||
@ -7,3 +7,17 @@ ADD teamType VARCHAR(64) GENERATED ALWAYS AS (json ->> 'teamType') STORED NOT NU
|
||||
UPDATE dbservice_entity
|
||||
SET json = json::jsonb #- '{connection,config,database}'
|
||||
where serviceType = 'DynamoDB';
|
||||
|
||||
UPDATE dashboard_service_entity
|
||||
SET json = jsonb_set(json, '{connection,config,clientId}', json#>'{connection,config,username}')
|
||||
WHERE serviceType = 'Looker'
|
||||
and json#>'{connection,config,username}' is not null;
|
||||
|
||||
UPDATE dashboard_service_entity
|
||||
SET json = jsonb_set(json, '{connection,config,clientSecret}', json#>'{connection,config,password}')
|
||||
WHERE serviceType = 'Looker'
|
||||
and json#>'{connection,config,password}' is not null;
|
||||
|
||||
UPDATE dashboard_service_entity
|
||||
SET json = json::jsonb #- '{connection,config,username}' #- '{connection,config,password}' #- '{connection,config,env}'
|
||||
WHERE serviceType = 'Looker';
|
||||
|
||||
@ -20,14 +20,14 @@
|
||||
"$ref": "#/definitions/lookerType",
|
||||
"default": "Looker"
|
||||
},
|
||||
"username": {
|
||||
"title": "Username",
|
||||
"description": "Username to connect to Looker. This user should have privileges to read all the metadata in Looker.",
|
||||
"clientId": {
|
||||
"title": "Client ID",
|
||||
"description": "User's Client ID. This user should have privileges to read all the metadata in Looker.",
|
||||
"type": "string"
|
||||
},
|
||||
"password": {
|
||||
"title": "Password",
|
||||
"description": "Password to connect to Looker.",
|
||||
"clientSecret": {
|
||||
"title": "Client Secret",
|
||||
"description": "User's Client Secret.",
|
||||
"type": "string",
|
||||
"format": "password"
|
||||
},
|
||||
@ -37,16 +37,11 @@
|
||||
"type": "string",
|
||||
"format": "uri"
|
||||
},
|
||||
"env": {
|
||||
"title": "Looker Environment",
|
||||
"description": "Looker Environment",
|
||||
"type": "string"
|
||||
},
|
||||
"supportsMetadataExtraction": {
|
||||
"title": "Supports Metadata Extraction",
|
||||
"$ref": "../connectionBasicType.json#/definitions/supportsMetadataExtraction"
|
||||
}
|
||||
},
|
||||
"additionalProperties": false,
|
||||
"required": ["hostPort", "username"]
|
||||
"required": ["hostPort", "clientId", "clientSecret"]
|
||||
}
|
||||
|
||||
@ -250,8 +250,8 @@ public class DashboardServiceResourceTest extends EntityResourceTest<DashboardSe
|
||||
.withConfig(
|
||||
new LookerConnection()
|
||||
.withHostPort(new URI("http://localhost:8080"))
|
||||
.withUsername("test")
|
||||
.withPassword("test"));
|
||||
.withClientId("test")
|
||||
.withClientSecret("test"));
|
||||
lookerDashboardService.withConnection(lookerConnection);
|
||||
dashboardService = new DashboardServiceResourceTest().createEntity(lookerDashboardService, ADMIN_AUTH_HEADERS);
|
||||
LOOKER_REFERENCE = dashboardService.getEntityReference();
|
||||
|
||||
@ -680,9 +680,11 @@ def _(connection: LookerConnection, verbose: bool = False):
|
||||
import looker_sdk
|
||||
|
||||
if not os.environ.get("LOOKERSDK_CLIENT_ID"):
|
||||
os.environ["LOOKERSDK_CLIENT_ID"] = connection.username
|
||||
os.environ["LOOKERSDK_CLIENT_ID"] = connection.clientId
|
||||
if not os.environ.get("LOOKERSDK_CLIENT_SECRET"):
|
||||
os.environ["LOOKERSDK_CLIENT_SECRET"] = connection.password.get_secret_value()
|
||||
os.environ[
|
||||
"LOOKERSDK_CLIENT_SECRET"
|
||||
] = connection.clientSecret.get_secret_value()
|
||||
if not os.environ.get("LOOKERSDK_BASE_URL"):
|
||||
os.environ["LOOKERSDK_BASE_URL"] = connection.hostPort
|
||||
client = looker_sdk.init40()
|
||||
|
||||
@ -58,7 +58,9 @@ class OMetaChartTest(TestCase):
|
||||
name="test-service-chart",
|
||||
serviceType=DashboardServiceType.Looker,
|
||||
connection=DashboardConnection(
|
||||
config=LookerConnection(hostPort="http://hostPort", username="username")
|
||||
config=LookerConnection(
|
||||
hostPort="http://hostPort", clientId="id", clientSecret="secret"
|
||||
)
|
||||
),
|
||||
)
|
||||
service_type = "dashboardService"
|
||||
|
||||
@ -58,7 +58,9 @@ class OMetaDashboardTest(TestCase):
|
||||
name="test-service-dashboard",
|
||||
serviceType=DashboardServiceType.Looker,
|
||||
connection=DashboardConnection(
|
||||
config=LookerConnection(hostPort="http://hostPort", username="username")
|
||||
config=LookerConnection(
|
||||
hostPort="http://hostPort", clientId="id", clientSecret="secret"
|
||||
)
|
||||
),
|
||||
)
|
||||
service_type = "dashboardService"
|
||||
|
||||
@ -179,8 +179,8 @@ class OMetaServiceTest(TestCase):
|
||||
"serviceConnection": {
|
||||
"config": {
|
||||
"type": "Looker",
|
||||
"username": "looker_user",
|
||||
"password": "looker_pwd",
|
||||
"clientId": "id",
|
||||
"clientSecret": "secret",
|
||||
"hostPort": "http://random:1234",
|
||||
}
|
||||
},
|
||||
@ -195,7 +195,7 @@ class OMetaServiceTest(TestCase):
|
||||
)
|
||||
assert service
|
||||
assert service.serviceType == DashboardServiceType.Looker
|
||||
assert service.connection.config.password.get_secret_value() == "looker_pwd"
|
||||
assert service.connection.config.clientSecret.get_secret_value() == "secret"
|
||||
|
||||
# Check get
|
||||
assert service == self.metadata.get_service_or_create(
|
||||
|
||||
@ -372,10 +372,9 @@ def test_looker():
|
||||
"serviceConnection": {
|
||||
"config": {
|
||||
"type": "Looker",
|
||||
"username": "username",
|
||||
"password": "password",
|
||||
"clientId": "username",
|
||||
"clientSecret": "password",
|
||||
"hostPort": "http://hostPort",
|
||||
"env": "env",
|
||||
}
|
||||
},
|
||||
"sourceConfig": {"config": {}},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user