tanishqgandhi1908 commented on code in PR #6869:
URL: https://github.com/apache/texera/pull/6869#discussion_r3808195404


##########
common/workflow-core/src/main/scala/org/apache/texera/amber/core/storage/model/LakeFSFileDocument.scala:
##########
@@ -36,21 +37,51 @@ object LakeFSFileDocument {
   // In the local development or other architectures, this token can be empty.
   lazy val userJwtToken: String =
     sys.env.getOrElse(EnvironmentalVariable.ENV_USER_JWT_TOKEN, "").trim
+
+  private lazy val datasetPresignEndpoint: String =
+    sys.env
+      .getOrElse(
+        
EnvironmentalVariable.ENV_FILE_SERVICE_GET_DATASET_PRESIGNED_URL_ENDPOINT,
+        "http://localhost:9092/api/dataset/presign-download";
+      )
+      .trim
+
+  private lazy val modelPresignEndpoint: String =
+    sys.env
+      .getOrElse(
+        
EnvironmentalVariable.ENV_FILE_SERVICE_GET_MODEL_PRESIGNED_URL_ENDPOINT,
+        "http://localhost:9092/api/model/presign-download";
+      )
+      .trim
+
+  /**
+    * The file-service presign-download endpoint serving this resource type. 
Each resource type
+    * owns an endpoint because they enforce different access control (a 
dataset grant does not
+    * grant a model).
+    */
+  def presignEndpointOf(resourceType: ResourceType.Value): String =
+    resourceType match {
+      case ResourceType.Datasets => datasetPresignEndpoint
+      case ResourceType.Models   => modelPresignEndpoint

Review Comment:
   Both real, but different. The model presign endpoint lands with the 
version-upload PR, where model file reads actually exist — there's no caller 
for it yet. The fallback-on-any-error is pre-existing on main and identical for 
datasets; I agree it shouldn't fall back on 401/403, but that changes dataset 
behaviour so I'd rather do it separately.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to