Authorized requests to #s3 bucket
▻https://hackernoon.com/authorized-requests-to-s3-bucket-6c64ba02f60c?source=rss----3a8144eabfe3
Protected S3 buckets, protected filesThis notebook shows the finished product of adding basic permissioning to an S3 bucketWe use basic auth which is an HTTP protocol for simple auth on web-accessible files. ▻https://en.wikipedia.org/wiki/Basic_access_authenticationBasic auth isn’t very secure — however, we pair this with HTTPS and restrict access to the s3 bucket.Set up some python stuffIn [1]:import requests; import jsonAccess secure endpoint without authfirst were gonna try to access this file without any credentialsIn [2]:url = ’▻https://d17nii79zr8aom.cloudfront.net/success.json'resp = requests.get(url)resp.contentOut[2]:’Unauthorized’Next we add basic auth paramsAccess secure endpoint with auth!In [3]:user, password = ’user’, ’pass’resp = requests.get(url, (...)