"""Utilities for pre-signed URLs.
A pre-signed URL lets a client that owns an Ed25519 keypair hand out a
time-limited URL that authorizes a specific request, without the recipient
needing an auth token.
Experimental: pre-signed URLs are an experimental feature and this API may
change in a future release.
See ``objectstore-types/src/presign.rs`` for details on the scheme.
"""
from datetime import timedelta
# Query parameter carrying the RFC 3339 time at which the request was signed.
PARAM_TIMESTAMP = "os_timestamp"
# Query parameter carrying the validity duration, in seconds.
PARAM_DURATION = "os_duration"
# Query parameter naming the key ID used to sign the request.
PARAM_KID = "os_kid"
# Query parameter carrying the base64url-encoded signature.
PARAM_SIG = "os_sig"
# Maximum validity accepted by the server for a pre-signed URL.
MAX_PRESIGN_DURATION = timedelta(days=7)
# HTTP methods that may be pre-signed. The server rejects all others.
SUPPORTED_METHODS = ("GET", "HEAD")