Skip to content

Commit 20f6afd

Browse files
c-thielFokko
andauthored
Update fsspec.pyto respect s3.signer.uri property (#741)
* Update fsspec.py to respect s3.signer.uri property * Add S3_SIGNER_URI constant, add docs --------- Co-authored-by: Fokko Driesprong <[email protected]>
1 parent 8d79664 commit 20f6afd

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

mkdocs/docs/configuration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ For the FileIO there are several configuration options available:
8989
| s3.access-key-id | admin | Configure the static secret access key used to access the FileIO. |
9090
| s3.secret-access-key | password | Configure the static session token used to access the FileIO. |
9191
| s3.signer | bearer | Configure the signature version of the FileIO. |
92+
| s3.signer.uri | http://my.signer:8080/s3 | Configure the remote signing uri if it differs from the catalog uri. Remote signing is only implemented for `FsspecFileIO`. The final request is sent to `<s3.singer.uri>/v1/aws/s3/sign`. |
9293
| s3.region | us-west-2 | Sets the region of the bucket |
9394
| s3.proxy-uri | http://my.proxy.com:8080 | Configure the proxy server to be used by the FileIO. |
9495
| s3.connect-timeout | 60.0 | Configure socket connection timeout, in seconds. |

pyiceberg/io/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
S3_REGION = "s3.region"
5454
S3_PROXY_URI = "s3.proxy-uri"
5555
S3_CONNECT_TIMEOUT = "s3.connect-timeout"
56+
S3_SIGNER_URI = "s3.signer.uri"
5657
HDFS_HOST = "hdfs.host"
5758
HDFS_PORT = "hdfs.port"
5859
HDFS_USER = "hdfs.user"

pyiceberg/io/fsspec.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
S3_REGION,
6464
S3_SECRET_ACCESS_KEY,
6565
S3_SESSION_TOKEN,
66+
S3_SIGNER_URI,
6667
ADLFS_ClIENT_SECRET,
6768
FileIO,
6869
InputFile,
@@ -79,7 +80,7 @@ def s3v4_rest_signer(properties: Properties, request: AWSRequest, **_: Any) -> A
7980
if TOKEN not in properties:
8081
raise SignError("Signer set, but token is not available")
8182

82-
signer_url = properties["uri"].rstrip("/")
83+
signer_url = properties.get(S3_SIGNER_URI, properties["uri"]).rstrip("/")
8384
signer_headers = {"Authorization": f"Bearer {properties[TOKEN]}"}
8485
signer_body = {
8586
"method": request.method,

0 commit comments

Comments
 (0)