Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

177
Views
cubo boto s3 versus get_bucket

Intento acceder a una clave dentro de un depósito, para el cual no tengo permisos, aunque sí para la clave. Para poder hacer get_key('this/is/my_key') , necesito el objeto del depósito:

 conn = boto.connect_s3(key, secret_key) my_bucket = conn.get_bucket('a_bucket')

produce S3ResponseError: S3ResponseError: 403 Forbidden .

Por otro lado, los siguientes trabajos

 my_bucket = boto.s3.bucket.Bucket(conn, 'a_bucket') my_bucket.get_key('this/is/my_key')

Pregunta: ¿Cuál es la diferencia entre crear el objeto Bucket y usar el método get_bucket ? Verificando el docu solo veo el cheque para validación. ¿Algo más?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

La validación ( validate=True default) en get_bucket verifica la existencia del depósito cuando se le llama. Dado que no tiene acceso al depósito, se rechazó su solicitud (403). En el otro caso, la creación de instancias de clase no parece hacer la validación, por lo tanto, el método get_key funciona según lo previsto.

over 4 years ago · Santiago Trujillo Report

0

get_bucket() necesita el permiso s3:listObject

get_key() solo necesita el permiso s3:GetObject

Por lo tanto, la siguiente línea NO crea ningún depósito.

 my_bucket = boto.s3.bucket.Bucket(conn, 'a_bucket')

Simplemente crea una clase de objeto python que apunta al depósito. No hay ningún error siempre que no haya realizado ninguna tarea relacionada con el depósito. Si puede hacer un get_key() sin error, significa que tiene el permiso s3:GetObject para el depósito.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!