refactor: simplify image handling in _resolve_images function
- Removed the image storage handling from the `_resolve_images` function, which now only decodes images and returns them as inline bytes. - Updated the function's docstring to clarify that image persistence is managed by the Go App, and the return value for `image_dir_path` is always empty. - Adjusted related gRPC and protobuf files to remove the `ConvertToPDF` method and its associated types, streamlining the API. - Enhanced security measures in the frontend by implementing a placeholder for provider images and ensuring proper hydration of protected file images. These changes improve the clarity and efficiency of image processing and API interactions within the application.
This commit is contained in:
@@ -90,9 +90,9 @@ func CheckMinioConnectivity(ctx context.Context, endpoint, accessKeyID, secretAc
|
||||
return svc.CheckConnectivity(ctx)
|
||||
}
|
||||
|
||||
// parseMinioFilePath extracts the object name from a "minio://bucket/key" path,
|
||||
// validates the bucket matches this service instance, and checks for path traversal.
|
||||
// parseMinioFilePath extracts the object name from a provider scheme: minio://{bucket}/{objectKey}
|
||||
func (s *minioFileService) parseMinioFilePath(filePath string) (string, error) {
|
||||
// Provider scheme format: minio://{bucket}/{objectKey}
|
||||
const prefix = "minio://"
|
||||
if !strings.HasPrefix(filePath, prefix) {
|
||||
return "", fmt.Errorf("invalid MinIO file path: %s", filePath)
|
||||
@@ -134,7 +134,6 @@ func (s *minioFileService) SaveFile(ctx context.Context,
|
||||
return "", fmt.Errorf("failed to upload file to MinIO: %w", err)
|
||||
}
|
||||
|
||||
// Return the complete path to the object
|
||||
return fmt.Sprintf("minio://%s/%s", s.bucketName, objectName), nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user