Verify inbound SigV4 presigned URLs (query-string auth) in resolve_identity
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bien especificado
- Estado de actividad
- Tranquilo
- Stack tecnológico
- aws, rust
- Área
- api, authentication
Línea de trabajo
Empieza con crates/core/src/auth/identity.rs::resolve_identity y crates/core/src/auth/sigv4.rs::verify_sigv4_signature; después, lee los vectores existentes en crates/core/src/auth/tests.rs. Añade la verificación de consultas presigned con comprobaciones de expiración y de tokens temporales, y amplía las pruebas para incluir requests válidos, manipulados, expirados y autenticados mediante token. El trabajo se considera completo cuando también se haya publicado la minor release solicitada para los consumidores posteriores.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
Add support for verifying inbound SigV4 presigned URLs (signature carried in the query string) in the auth layer. Today resolve_identity only authenticates requests whose SigV4 material is in the Authorization header; presigned requests are treated as anonymous.
This unblocks presigned-URL support in the Source Cooperative data proxy — see downstream issue: source-cooperative/data.source.coop#136. The proxy wants to issue standard AWS SigV4 presigned GET URLs (generated with STS temp creds) that browser data-viewers can fetch directly, while the proxy still streams the bytes.
Current behavior (the gap)
crates/core/src/auth/identity.rs::resolve_identity:
- Returns
ResolvedIdentity::Anonymouswhenever there is noAuthorizationheader. - Reads the session token (
x-amz-security-token) and payload hash (x-amz-content-sha256) from headers.
For a presigned URL, all SigV4 material is in the query string (X-Amz-Algorithm, X-Amz-Credential, X-Amz-Date, X-Amz-Expires, X-Amz-SignedHeaders, X-Amz-Security-Token, X-Amz-Signature), and the canonical request is constructed differently. So presigned requests currently fail to authenticate.
Much of the machinery already exists and is reusable: crates/core/src/auth/sigv4.rs::verify_sigv4_signature already takes a query_string and canonicalize_query_string already sorts it; the SigV4Auth struct, signing-key derivation, and constant_time_eq can all be shared.
Proposed change
In crates/core/src/auth/sigv4.rs + crates/core/src/auth/identity.rs:
- Detect presigned requests in
resolve_identity— if the query containsX-Amz-Algorithm=AWS4-HMAC-SHA256(orX-Amz-Signature), take a presigned branch before theAnonymousearly-return. - Parse SigV4 from the query — new
parse_sigv4_presigned(query)producing aSigV4Auth(reuse the existing credential-scope split) plusexpiresand the security token. PullX-Amz-Credential,X-Amz-SignedHeaders,X-Amz-Signature,X-Amz-Date,X-Amz-Expires,X-Amz-Security-Token. - Presigned canonical-request variant — either parameterize
verify_sigv4_signatureor add a sibling:- Canonical query = all query params except
X-Amz-Signature, sorted/encoded (strip it, thencanonicalize_query_string). - Payload hash = the literal string
UNSIGNED-PAYLOAD. string_to_signdate comes from theX-Amz-Datequery param (not thex-amz-dateheader).- Reuse the existing signing-key derivation and
constant_time_eq.
- Canonical query = all query params except
- Enforce expiry — reject when
X-Amz-Date + X-Amz-Expires < now(small clock-skew allowance). - Session token — resolve
X-Amz-Security-Tokenthrough the existingcredential_resolver(TemporaryCredentialResolver), keep the access-key↔token match check, and return the sameResolvedIdentity::Authenticated. Everything downstream (authorize → presign-backend → stream) is unchanged.
Tests
Add AWS SigV4 presigned test vectors alongside the existing header-auth vectors in crates/core/src/auth/tests.rs:
- A known presigned canonical request → expected signature (positive).
- Tampered query param → signature mismatch.
X-Amz-Date + X-Amz-Expiresin the past → expired/denied.- With
X-Amz-Security-Tokenresolved via a stubTemporaryCredentialResolver→Authenticated.
Release
Cut a minor release so downstream consumers (the data proxy, currently on 0.4.0) can bump.
Filed alongside source-cooperative/data.source.coop#136.
- Lenguaje dominante
- Rust
- Estrellas
- 20
- Forks
- 1
- Merge medio
- 1 d 8 h
- PR fusionados (30 d)
- 10
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de developmentseed/multistore
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
developmentseed/multistore#160 ·
Los mantenedores suelen responder en 1 día
-
List of a prefix 503s when a single object key contains an empty path segment (//)Posiblemente ocupada @alukach la tomó hace 99 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
developmentseed/multistore#116 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 68/100
developmentseed/multistore#89 ·
Los mantenedores suelen responder en 1 día
-
oidc-provider: optional `oidc_session_name` backend-option to override RoleSessionName derivationAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
developmentseed/multistore#84 ·
Los mantenedores suelen responder en 1 día
-
Credential cache key (role ARN) doesn't capture the full minted identity (subject + extra_claims)Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
developmentseed/multistore#81 ·
Los mantenedores suelen responder en 1 día
Todos los issues de developmentseed/multistore
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
FalkorDB/FalkorDB#3597 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
needs triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
mozilla-services/syncstorage-rs#2715 ·
Los mantenedores suelen responder en 1 día