Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

176
Vistas
boto s3 Bucket versus get_bucket

I try to access a key inside a bucket, for which I don't have permissions, though I do for the key. In order to be able to do get_key('this/is/my_key'), I need the bucket object:

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

yields S3ResponseError: S3ResponseError: 403 Forbidden.

On the other hand, the following works

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

Question: What is the difference between creating the object Bucket and using the get_bucket method? Checking the docu I only see the check for validation. Anything else?

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Validation (validate=True default) in the get_bucket checks for bucket's existence when called. Since you don't have access to the bucket, your request is turned down (403). In the other case, the class instantiation doesn't seem to do the validation, hence the get_key method works as intended.

over 4 years ago · Santiago Trujillo Denunciar

0

get_bucket() need s3:listObject permission

get_key() only need s3:GetObject permission

Thus following line DOES NOT create any bucket.

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

It just create a python object class pointing to the bucket. There is no error as long as you didn't perform any bucket related task. If you can do a get_key() without error, it's mean you are given the s3:GetObject permission to the bucket.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda