# Configuring lakeFS to use presigned URLs

With lakeFS, you can access data directly from the storage and not through lakeFS using a presigned URL. Based on the user's access to an object in the object store, the presigned URL will get read or write access.

The presign support is enabled for block adapter that supports it (AWS, GCP, Azure), and can be disabled by the [configuration](<https://docs.lakefs.io/reference/configuration/index.md>) (`blockstore.<blockstore_type>.disable_pre_signed`). Note that the UI support is disabled by default.

It is possible to override the default pre-signed URL endpoint in **AWS** by setting the [configuration](<https://docs.lakefs.io/reference/configuration/index.md>) (`blockstore.s3.pre_signed_endpoint`). This is useful, for example, when you wish to define a [VPC endpoint](<https://docs.aws.amazon.com/AmazonS3/latest/userguide/privatelink-interface-endpoints.html#accessing-s3-interface-endpoints>) access for the pre-signed URL.

## Using presigned URLs in the UI

To use presigned URLs in the UI:

1. Enable the presigned URL support UI in the lakeFS [configuration](<https://docs.lakefs.io/reference/configuration/index.md>):  
   set `blockstore.<blockstore_type>.disable_pre_signed_ui=false`.
2. Add CORS (Cross-Origin Resource Sharing) permissions to the bucket for the UI to fetch objects using a presigned URL (instead of through lakeFS).

> [!WARNING]
>
> Currently DuckDB fetching data from lakeFS does not support fetching data using presigned URL.

### Examples

> [!NOTE]
>
> **[AWS S3](<https://docs.aws.amazon.com/AmazonS3/latest/userguide/enabling-cors-examples.html>)**
>
> ```json
>   [
>     {
>         "AllowedHeaders": [
>             "*"
>         ],
>         "AllowedMethods": [
>             "GET",
>             "PUT",
>             "HEAD"
>         ],
>         "AllowedOrigins": [
>             "lakefs.endpoint"
>         ],
>         "ExposeHeaders": [
>             "ETag"
>         ]
>     }
>   ]
> ```

> [!NOTE]
>
> **[Google Storage](<https://cloud.google.com/storage/docs/using-cors>)**
>
> ```json
>   [
>     {
>         "origin": ["lakefs.endpoint"],
>         "responseHeader": ["ETag"],
>         "method": ["PUT", "GET", "HEAD"],
>         "maxAgeSeconds": 3600
>     }
>   ]
> ```

> [!NOTE]
>
> **[Azure blob storage](<https://learn.microsoft.com/en-us/rest/api/storageservices/cross-origin-resource-sharing--cors--support-for-the-azure-storage-services>)**
>
> ```xml
>   <Cors>
>       <CorsRule>  
>           <AllowedOrigins>lakefs.endpoint</AllowedOrigins>  
>           <AllowedMethods>PUT,GET,HEAD</AllowedMethods>  
>           <AllowedHeaders>*</AllowedHeaders>  
>           <ExposedHeaders>ETag,x-ms-*</ExposedHeaders>  
>           <MaxAgeInSeconds>3600</MaxAgeInSeconds>  
>       </CorsRule>  
>   </Cors>
> ```

## Client-side multipart upload on S3

> [!NOTE]
>
> **Available in lakeFS Team and lakeFS Enterprise from v1.107.0, on S3 only. [Start a free trial](<https://lakefs.io/try/>) or [contact us](<https://lakefs.io/book-a-demo/>).**

With client-side multipart upload, the client sends every request of a large upload directly to S3, including the requests that create, complete and abort it. lakeFS only signs those requests and records the finished object on the branch.

[`lakectl fs upload`](<https://docs.lakefs.io/reference/cli/enterprise/index.md#lakectl-fs-upload>) and [`lakectl local commit`](<https://docs.lakefs.io/reference/cli/enterprise/index.md#lakectl-local-commit>) use it automatically for files of 5 MiB or more when presigned URLs are in use and the server supports it. Otherwise they fall back to other upload methods.

It is enabled by default on the S3 blockstore. To turn it off, set `blockstore.s3.disable_pre_signed_multipart` in the [configuration](<https://docs.lakefs.io/reference/configuration/index.md>).
