{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/custom-script-extension-linux/issues/3","repository_url":"https://api.github.com/repos/Azure/custom-script-extension-linux","labels_url":"https://api.github.com/repos/Azure/custom-script-extension-linux/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/Azure/custom-script-extension-linux/issues/3/comments","events_url":"https://api.github.com/repos/Azure/custom-script-extension-linux/issues/3/events","html_url":"https://github.com/Azure/custom-script-extension-linux/pull/3","id":164195422,"number":3,"title":"download: utils to download files and blobs","user":{"login":"ahmetalpbalkan","id":159209,"avatar_url":"https://avatars.githubusercontent.com/u/159209?v=3","gravatar_id":"","url":"https://api.github.com/users/ahmetalpbalkan","html_url":"https://github.com/ahmetalpbalkan","followers_url":"https://api.github.com/users/ahmetalpbalkan/followers","following_url":"https://api.github.com/users/ahmetalpbalkan/following{/other_user}","gists_url":"https://api.github.com/users/ahmetalpbalkan/gists{/gist_id}","starred_url":"https://api.github.com/users/ahmetalpbalkan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahmetalpbalkan/subscriptions","organizations_url":"https://api.github.com/users/ahmetalpbalkan/orgs","repos_url":"https://api.github.com/users/ahmetalpbalkan/repos","events_url":"https://api.github.com/users/ahmetalpbalkan/events{/privacy}","received_events_url":"https://api.github.com/users/ahmetalpbalkan/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-06T23:09:10Z","updated_at":"2016-07-07T07:58:02Z","closed_at":"2016-07-07T07:35:22Z","pull_request":{"url":"https://api.github.com/repos/Azure/custom-script-extension-linux/pulls/3","html_url":"https://github.com/Azure/custom-script-extension-linux/pull/3","diff_url":"https://github.com/Azure/custom-script-extension-linux/pull/3.diff","patch_url":"https://github.com/Azure/custom-script-extension-linux/pull/3.patch"},"body":"This one is fairly simple:\r\n\r\n```\r\n\r\npackage download\r\n\r\nFUNCTIONS\r\n\r\nfunc Download(d Downloader) (io.ReadCloser, error)\r\n    Download retrieves a response body and checks the response status code\r\n    to see if it is 200 OK and then returns the response body. It issues a\r\n    new request every time called. It is caller's responsibility to close\r\n    the response body.\r\n\r\nTYPES\r\n\r\ntype Downloader interface {\r\n    // GetRequest returns a new GET request for the resource.\r\n    GetRequest() (*http.Request, error)\r\n}\r\n    Downloader describes a method to download files.\r\n\r\nfunc NewBlobDownload(accountName, accountKey string, blob blobutil.AzureBlobRef) Downloader\r\n    NewBlobDownload creates a new Downloader for a blob hosted in Azure Blob\r\n    Storage.\r\n\r\nfunc NewURLDownload(url string) Downloader\r\n    NewURLDownload creates a new downloader with the provided URL\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/Azure/custom-script-extension-linux/issues/comments/231009192","html_url":"https://github.com/Azure/custom-script-extension-linux/pull/3#issuecomment-231009192","issue_url":"https://api.github.com/repos/Azure/custom-script-extension-linux/issues/3","id":231009192,"user":{"login":"ahmetalpbalkan","id":159209,"avatar_url":"https://avatars.githubusercontent.com/u/159209?v=3","gravatar_id":"","url":"https://api.github.com/users/ahmetalpbalkan","html_url":"https://github.com/ahmetalpbalkan","followers_url":"https://api.github.com/users/ahmetalpbalkan/followers","following_url":"https://api.github.com/users/ahmetalpbalkan/following{/other_user}","gists_url":"https://api.github.com/users/ahmetalpbalkan/gists{/gist_id}","starred_url":"https://api.github.com/users/ahmetalpbalkan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ahmetalpbalkan/subscriptions","organizations_url":"https://api.github.com/users/ahmetalpbalkan/orgs","repos_url":"https://api.github.com/users/ahmetalpbalkan/repos","events_url":"https://api.github.com/users/ahmetalpbalkan/events{/privacy}","received_events_url":"https://api.github.com/users/ahmetalpbalkan/received_events","type":"User","site_admin":false},"created_at":"2016-07-07T07:58:02Z","updated_at":"2016-07-07T07:58:02Z","body":"@boumenot actually one thing to note is, in this rewrite I switched from authenticating to blob storage and getting the blob (via the Authorization header crafted by the storage client) to downloading the blob from a SAS URL (crafted by the storage client) that is generated freshly every time and is good 30 minutes. I do not foresee any issues with this, let me know if you can think of any. They should work the same."}}
{"actor":{"display_login":"ahmetalpbalkan"}}