24 lines
700 B
Python
24 lines
700 B
Python
from decouple import config
|
|
|
|
from chalicelib.utils.s3 import client
|
|
|
|
|
|
def __get_devtools_keys(project_id, session_id):
|
|
params = {
|
|
"sessionId": session_id,
|
|
"projectId": project_id
|
|
}
|
|
return [
|
|
config("DEVTOOLS_MOB_PATTERN", default="%(sessionId)sdevtools") % params
|
|
]
|
|
|
|
|
|
def get_urls(session_id, project_id):
|
|
results = []
|
|
for k in __get_devtools_keys(project_id=project_id, session_id=session_id):
|
|
results.append(client.generate_presigned_url(
|
|
'get_object',
|
|
Params={'Bucket': config("sessions_bucket"), 'Key': k},
|
|
ExpiresIn=config("PRESIGNED_URL_EXPIRATION", cast=int, default=900)
|
|
))
|
|
return results
|