Skip to content

Commit

Permalink
Return token expiry with presigned URLs (#6337)
Browse files Browse the repository at this point in the history
* Add "ExpiresAt" to S3 clients

* Log expiry time of clients when fetching from cache

* Add expiry time to presigned URLs to adaptors

Only S3 works, the others just return a zero time.Time for "not implemented".

* Add presigned URL expiry to API

* Return expiry time on presigned URLs

* Lint fixes

* Report physical address expiry in `lakectl fs stat --pre-signed`

Useful, and also lets me test that a deployment on lakeFS.Cloud staging
works! >:-)

* Select good golden file for `lakectl fs stat --pre-sign` test

Some lakeFS block adaptors report expiry, others do not.  Test lakectl
using an appropriate golden file

* [CR] Add TODO to support expiry on Azure & GCS

Also fix tpyo.
  • Loading branch information
arielshaqed authored Aug 8, 2023
1 parent 1255b6e commit accced2
Show file tree
Hide file tree
Showing 28 changed files with 338 additions and 51 deletions.
19 changes: 19 additions & 0 deletions api/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,16 @@ components:
The location of the object on the underlying object store.
Formatted as a native URI with the object store type as scheme ("s3://...", "gs://...", etc.)
Or, in the case of presign=true, will be an HTTP URL to be consumed via regular HTTP GET
physical_address_expiry:
type: integer
format: int64
description: |
If present and nonzero, physical_address is a presigned URL and
will expire at this Unix Epoch time. This will be shorter than
the presigned URL lifetime if an authentication token is about
to expire.
This field is *optional*.
checksum:
type: string
size_bytes:
Expand Down Expand Up @@ -1139,7 +1149,16 @@ components:
type: string
nullable: true
description: if presign=true is passed in the request, this field will contain a presigned URL to use when uploading
presigned_url_expiry:
type: integer
format: int64
description: |
If present and nonzero, physical_address is a presigned URL and
will expire at this Unix Epoch time. This will be shorter than
the presigned URL lifetime if an authentication token is about
to expire.
This field is *optional*.
StagingMetadata:
type: object
Expand Down
37 changes: 31 additions & 6 deletions clients/java/api/openapi.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions clients/java/docs/ObjectStats.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions clients/java/docs/StagingLocation.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions clients/python/docs/ObjectStats.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions clients/python/docs/StagingApi.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions clients/python/docs/StagingLocation.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions clients/python/lakefs_client/model/object_stats.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions clients/python/lakefs_client/model/staging_location.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit accced2

Please sign in to comment.