@xuda.io/drive_module 1.1.790 → 1.1.792
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +10 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -499,8 +499,7 @@ exports.get_drive_files = async function (req) {
|
|
|
499
499
|
|
|
500
500
|
exports.get_drive_file_info = async function (req, job_id, headers) {
|
|
501
501
|
try {
|
|
502
|
-
const { type, drive_type, uid, app_id,
|
|
503
|
-
var { file_path } = req;
|
|
502
|
+
const { type, drive_type, uid, app_id, file_path } = req;
|
|
504
503
|
|
|
505
504
|
let doc = await get_drive_doc(drive_type, app_id, uid, file_path, headers);
|
|
506
505
|
|
|
@@ -2667,11 +2666,20 @@ const get_drive_doc = async function (
|
|
|
2667
2666
|
|
|
2668
2667
|
case "workspace": {
|
|
2669
2668
|
const app_id_reference = await _common.get_project_app_id(app_id);
|
|
2669
|
+
|
|
2670
2670
|
doc_ret = await db_module.get_app_couch_doc(
|
|
2671
2671
|
app_id_reference,
|
|
2672
2672
|
check_existing_file_ret.duplicates[0]._id
|
|
2673
2673
|
);
|
|
2674
2674
|
|
|
2675
|
+
if (
|
|
2676
|
+
doc_ret?.data?.type === "file" &&
|
|
2677
|
+
!file_path.includes(app_id) &&
|
|
2678
|
+
!file_path.includes(app_id_master)
|
|
2679
|
+
) {
|
|
2680
|
+
throw new Error("file_path unauthorized");
|
|
2681
|
+
}
|
|
2682
|
+
|
|
2675
2683
|
break;
|
|
2676
2684
|
}
|
|
2677
2685
|
default:
|