Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

Don't fetch the data source info in fetchDatabaseListByEnvironmentId as that may expose ungranted data source to the current user.

天舟98807b3c1be0
diff --git a/frontend/src/store/modules/database.ts b/frontend/src/store/modules/database.ts
index 744a194651..c49aaa84fb 100644
--- a/frontend/src/store/modules/database.ts
+++ b/frontend/src/store/modules/database.ts
@@ -208,9 +208,13 @@ const actions = {
{ commit, rootGetters }: any,
environmentId: EnvironmentId
) {
+ // Don't fetch the data source info as the current user may not have access to the
+ // database of this particular environment.
+ // We need to fetch the instance info because we need it to populate the instance
+ // environment field and that's how the client code gets environment from the database object
const data = (
await axios.get(
- `/api/database?environment=${environmentId}&include=instance,dataSource`
+ `/api/database?environment=${environmentId}&include=instance`
)
).data;
const databaseList = data.data.map((database: ResourceObject) => {