Skip to content

feat: storage wi - #172

Merged
ErikFerrari merged 7 commits into
mainfrom
feat/storage-wi
Aug 28, 2026
Merged

feat: storage wi#172
ErikFerrari merged 7 commits into
mainfrom
feat/storage-wi

Conversation

@ErikFerrari

@ErikFerrari ErikFerrari commented Aug 18, 2026

Copy link
Copy Markdown
Member
  • use v4 singing url
  • enable Workload Identity for gcp
  • fix near expiration cache urls

@ErikFerrari
ErikFerrari requested a review from a team as a code owner August 18, 2026 17:19
Replace Auth.signer/0 and the public private_key/1 with a single
Auth.sign/1 returning raw signature bytes. Service account credentials
still sign locally; metadata credentials now sign through
iamcredentials signBlob, and gcloud user credentials can too when
:storage_signer_account names the account to sign as.

Signing moves from local cpu to a network call, so that one request
retries on transient failures. Every other call keeps retry: false.

BREAKING CHANGE: Arke.Utils.Gcp.Auth.signer/0 and private_key/1 are removed in favour of sign/1, which returns raw signature bytes rather than a PEM.
V2 is legacy. The signature is now hex over a canonical request, so the
signer's email has to be known before there is a payload — hence
Auth.signer_email/0 alongside sign/1, rather than a throwaway signature
to read the email back off.

Object paths are escaped per segment: URI.encode/1 left reserved
characters like ? untouched, which V4 rejects as a mismatch.
:expires_in per call, config :arke, :signed_url_ttl as the default, one
hour otherwise. Rejects anything past the v4 seven day ceiling here
rather than letting GCS fail the request with an opaque error.
valid_data? accepted any entry with a future expiration, including one
second away, so a browser could start a download and get a 403 partway
through. Entries now need five minutes of life left.

get_signed_url/2 also forwards opts, and treats an entry shorter than a
requested :expires_in as a miss rather than silently handing back a
shorter url.
Where the signing key comes from in each credential source, and the two
config keys the new behaviour reads.
@ErikFerrari
ErikFerrari merged commit e876b2f into main Aug 28, 2026
5 checks passed
@ErikFerrari
ErikFerrari deleted the feat/storage-wi branch August 28, 2026 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant