{"action":"created","issue":{"url":"https://api.github.com/repos/django-cumulus/django-cumulus/issues/73","repository_url":"https://api.github.com/repos/django-cumulus/django-cumulus","labels_url":"https://api.github.com/repos/django-cumulus/django-cumulus/issues/73/labels{/name}","comments_url":"https://api.github.com/repos/django-cumulus/django-cumulus/issues/73/comments","events_url":"https://api.github.com/repos/django-cumulus/django-cumulus/issues/73/events","html_url":"https://github.com/django-cumulus/django-cumulus/issues/73","id":11293098,"node_id":"MDU6SXNzdWUxMTI5MzA5OA==","number":73,"title":"Add support for tempurls","user":{"login":"rasca","id":79235,"node_id":"MDQ6VXNlcjc5MjM1","avatar_url":"https://avatars3.githubusercontent.com/u/79235?v=4","gravatar_id":"","url":"https://api.github.com/users/rasca","html_url":"https://github.com/rasca","followers_url":"https://api.github.com/users/rasca/followers","following_url":"https://api.github.com/users/rasca/following{/other_user}","gists_url":"https://api.github.com/users/rasca/gists{/gist_id}","starred_url":"https://api.github.com/users/rasca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rasca/subscriptions","organizations_url":"https://api.github.com/users/rasca/orgs","repos_url":"https://api.github.com/users/rasca/repos","events_url":"https://api.github.com/users/rasca/events{/privacy}","received_events_url":"https://api.github.com/users/rasca/received_events","type":"User","site_admin":false},"labels":[{"id":145180976,"node_id":"MDU6TGFiZWwxNDUxODA5NzY=","url":"https://api.github.com/repos/django-cumulus/django-cumulus/labels/0%20-%20Backlog","name":"0 - Backlog","color":"CCCCCC","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2013-02-22T16:39:58Z","updated_at":"2018-09-27T12:47:24Z","closed_at":"2018-09-27T12:47:24Z","author_association":"CONTRIBUTOR","body":"This is my story with tempurls:\n\nThe rackspace docs are: http://docs.rackspace.com/files/api/v1/cf-devguide/content/TempURL-d1a4450.html\n\nFor getting the public URL and Tenant ID use:\n\n```\ncurl -X POST https://lon.auth.api.rackspacecloud.com/v2.0/tokens -d \n\"{\\\"auth\\\":{\\\"RAX-KSKEY:apiKeyCredentials\\\":{\\\"username\\\": \n\\\"$username\\\",\\\"apiKey\\\": \\\"$apiKey\\\",\\\"tenantName\\\": \n\\\"10013520\\\"}}}\" -H \"Content-Type: application/json\" -H \"Accept: \napplication/json\"\n```\n\nI added two new settings for cumulus:\n\n```\nCUMULUS = {\n    'USERNAME': 'xx',\n    'API_KEY': 'xxx',\n    'CONTAINER': 'xxx',\n    'AUTH_URL': 'uk_authurl',\n    'TIMEOUT': 15,\n    'TEMPURL_KEY': 'xxx_created_for_this_xxx',\n    'CONTAINERS_PUBLIC_URL': 'https://storage101.lon3.clouddrive.com/v1/MossoCloudFS_xxx_your_TenantID_xxx',\n}\n```\n\nThen the code used is:\n\n```\nimport hmac\nfrom hashlib import sha1\nfrom time import time\n\nseconds = 60\n\n# get the model file field from somewhere\nfile_field = i.image\n\ncontainer_name, file_name = (file_field.storage.container.name, file_field.name)\n\nkey = CUMULUS['TEMPURL_KEY']\npublic_url = CUMULUS['CONTAINERS_PUBLIC_URL']\nmethod = 'GET'\nexpires = int(time() + seconds)\n\nurl = '%s/%s/%s' % (public_url, container_name, file_name)\nbase_url, object_path = url.split('/v1/')\nobject_path = '/v1/' + object_path\n\nhmac_body = '%s\\n%s\\n%s' % (method, expires, object_path)\nsig = hmac.new(key, hmac_body, sha1).hexdigest()\nprint '%s%s?temp_url_sig=%s&temp_url_expires=%s' % (base_url, object_path, sig, expires)\n```\n\nSomething like `model_instance.file_field.temp_url` would be really nice :) What do you think?\n\n<!---\n@huboard:{\"order\":38.5,\"milestone_order\":73,\"custom_state\":\"\"}\n-->\n"},"comment":{"url":"https://api.github.com/repos/django-cumulus/django-cumulus/issues/comments/425077411","html_url":"https://github.com/django-cumulus/django-cumulus/issues/73#issuecomment-425077411","issue_url":"https://api.github.com/repos/django-cumulus/django-cumulus/issues/73","id":425077411,"node_id":"MDEyOklzc3VlQ29tbWVudDQyNTA3NzQxMQ==","user":{"login":"rasca","id":79235,"node_id":"MDQ6VXNlcjc5MjM1","avatar_url":"https://avatars3.githubusercontent.com/u/79235?v=4","gravatar_id":"","url":"https://api.github.com/users/rasca","html_url":"https://github.com/rasca","followers_url":"https://api.github.com/users/rasca/followers","following_url":"https://api.github.com/users/rasca/following{/other_user}","gists_url":"https://api.github.com/users/rasca/gists{/gist_id}","starred_url":"https://api.github.com/users/rasca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rasca/subscriptions","organizations_url":"https://api.github.com/users/rasca/orgs","repos_url":"https://api.github.com/users/rasca/repos","events_url":"https://api.github.com/users/rasca/events{/privacy}","received_events_url":"https://api.github.com/users/rasca/received_events","type":"User","site_admin":false},"created_at":"2018-09-27T12:47:24Z","updated_at":"2018-09-27T12:47:24Z","author_association":"CONTRIBUTOR","body":"This has been merged! Closing the issue :)"}}
{"actor":{"display_login":"rasca"}}