{"action":"created","comment":{"url":"https://api.github.com/repos/artefactual/archivematica-storage-service/pulls/comments/27704144","id":27704144,"diff_hunk":"@@ -0,0 +1,167 @@\n+# stdlib, alphabetical\n+import logging\n+import os\n+\n+# Core Django, alphabetical\n+from django.db import models\n+\n+# Third party dependencies, alphabetical\n+import swiftclient\n+\n+# This project, alphabetical\n+from common import utils\n+\n+# This module, alphabetical\n+from . import StorageException\n+from location import Location\n+\n+LOGGER = logging.getLogger(__name__)\n+\n+\n+class Swift(models.Model):\n+    space = models.OneToOneField('Space', to_field='uuid')\n+    auth_url = models.CharField(max_length=256,\n+        help_text='URL to authenticate against')\n+    auth_version = models.CharField(max_length=8, default='2',\n+        help_text='OpenStack auth version')\n+    username = models.CharField(max_length=64,\n+        help_text='Username to authenticate as')\n+    # HELP how do I store the password?  Has to be plaintext to send to Swift, but that seems like a bad idea","path":"storage_service/locations/models/swift.py","position":29,"original_position":29,"commit_id":"915a69e63c7e135e54eb62d846aa2335bb7b12be","original_commit_id":"915a69e63c7e135e54eb62d846aa2335bb7b12be","user":{"login":"mistydemeo","id":780485,"avatar_url":"https://avatars.githubusercontent.com/u/780485?v=3","gravatar_id":"","url":"https://api.github.com/users/mistydemeo","html_url":"https://github.com/mistydemeo","followers_url":"https://api.github.com/users/mistydemeo/followers","following_url":"https://api.github.com/users/mistydemeo/following{/other_user}","gists_url":"https://api.github.com/users/mistydemeo/gists{/gist_id}","starred_url":"https://api.github.com/users/mistydemeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mistydemeo/subscriptions","organizations_url":"https://api.github.com/users/mistydemeo/orgs","repos_url":"https://api.github.com/users/mistydemeo/repos","events_url":"https://api.github.com/users/mistydemeo/events{/privacy}","received_events_url":"https://api.github.com/users/mistydemeo/received_events","type":"User","site_admin":false},"body":"Not immediately practical since this isn't being executed in the context of a user, but an interesting idea: http://stackoverflow.com/a/8036765 Use a user's password as the encryption key for the password, so the password never has to be stored in plaintext, while making it decodeable.","created_at":"2015-04-02T22:43:22Z","updated_at":"2015-04-02T22:43:22Z","html_url":"https://github.com/artefactual/archivematica-storage-service/pull/33#discussion_r27704144","pull_request_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/pulls/33","_links":{"self":{"href":"https://api.github.com/repos/artefactual/archivematica-storage-service/pulls/comments/27704144"},"html":{"href":"https://github.com/artefactual/archivematica-storage-service/pull/33#discussion_r27704144"},"pull_request":{"href":"https://api.github.com/repos/artefactual/archivematica-storage-service/pulls/33"}}},"pull_request":{"url":"https://api.github.com/repos/artefactual/archivematica-storage-service/pulls/33","id":21519268,"html_url":"https://github.com/artefactual/archivematica-storage-service/pull/33","diff_url":"https://github.com/artefactual/archivematica-storage-service/pull/33.diff","patch_url":"https://github.com/artefactual/archivematica-storage-service/pull/33.patch","issue_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/issues/33","number":33,"state":"open","locked":false,"title":"Add Swift","user":{"login":"Hwesta","id":3166226,"avatar_url":"https://avatars.githubusercontent.com/u/3166226?v=3","gravatar_id":"","url":"https://api.github.com/users/Hwesta","html_url":"https://github.com/Hwesta","followers_url":"https://api.github.com/users/Hwesta/followers","following_url":"https://api.github.com/users/Hwesta/following{/other_user}","gists_url":"https://api.github.com/users/Hwesta/gists{/gist_id}","starred_url":"https://api.github.com/users/Hwesta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hwesta/subscriptions","organizations_url":"https://api.github.com/users/Hwesta/orgs","repos_url":"https://api.github.com/users/Hwesta/repos","events_url":"https://api.github.com/users/Hwesta/events{/privacy}","received_events_url":"https://api.github.com/users/Hwesta/received_events","type":"User","site_admin":false},"body":"Add Swift as a Space.\r\n\r\nThis requires #31 ","created_at":"2014-09-19T19:42:04Z","updated_at":"2015-04-02T22:43:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"60e7445c7e74918ac277e3df7b50425c54856156","assignee":null,"milestone":{"url":"https://api.github.com/repos/artefactual/archivematica-storage-service/milestones/1","html_url":"https://github.com/artefactual/archivematica-storage-service/milestones/0.7.0","labels_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/milestones/1/labels","id":1049588,"number":1,"title":"0.7.0","description":null,"creator":{"login":"jhsimpson","id":3083997,"avatar_url":"https://avatars.githubusercontent.com/u/3083997?v=3","gravatar_id":"","url":"https://api.github.com/users/jhsimpson","html_url":"https://github.com/jhsimpson","followers_url":"https://api.github.com/users/jhsimpson/followers","following_url":"https://api.github.com/users/jhsimpson/following{/other_user}","gists_url":"https://api.github.com/users/jhsimpson/gists{/gist_id}","starred_url":"https://api.github.com/users/jhsimpson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jhsimpson/subscriptions","organizations_url":"https://api.github.com/users/jhsimpson/orgs","repos_url":"https://api.github.com/users/jhsimpson/repos","events_url":"https://api.github.com/users/jhsimpson/events{/privacy}","received_events_url":"https://api.github.com/users/jhsimpson/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":7,"state":"open","created_at":"2015-04-01T23:12:40Z","updated_at":"2015-04-01T23:29:29Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/pulls/33/commits","review_comments_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/pulls/33/comments","review_comment_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/pulls/comments{/number}","comments_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/issues/33/comments","statuses_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/statuses/915a69e63c7e135e54eb62d846aa2335bb7b12be","head":{"label":"artefactual:dev/issue-6938-swift","ref":"dev/issue-6938-swift","sha":"915a69e63c7e135e54eb62d846aa2335bb7b12be","user":{"login":"artefactual","id":1163545,"avatar_url":"https://avatars.githubusercontent.com/u/1163545?v=3","gravatar_id":"","url":"https://api.github.com/users/artefactual","html_url":"https://github.com/artefactual","followers_url":"https://api.github.com/users/artefactual/followers","following_url":"https://api.github.com/users/artefactual/following{/other_user}","gists_url":"https://api.github.com/users/artefactual/gists{/gist_id}","starred_url":"https://api.github.com/users/artefactual/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artefactual/subscriptions","organizations_url":"https://api.github.com/users/artefactual/orgs","repos_url":"https://api.github.com/users/artefactual/repos","events_url":"https://api.github.com/users/artefactual/events{/privacy}","received_events_url":"https://api.github.com/users/artefactual/received_events","type":"Organization","site_admin":false},"repo":{"id":12164369,"name":"archivematica-storage-service","full_name":"artefactual/archivematica-storage-service","owner":{"login":"artefactual","id":1163545,"avatar_url":"https://avatars.githubusercontent.com/u/1163545?v=3","gravatar_id":"","url":"https://api.github.com/users/artefactual","html_url":"https://github.com/artefactual","followers_url":"https://api.github.com/users/artefactual/followers","following_url":"https://api.github.com/users/artefactual/following{/other_user}","gists_url":"https://api.github.com/users/artefactual/gists{/gist_id}","starred_url":"https://api.github.com/users/artefactual/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artefactual/subscriptions","organizations_url":"https://api.github.com/users/artefactual/orgs","repos_url":"https://api.github.com/users/artefactual/repos","events_url":"https://api.github.com/users/artefactual/events{/privacy}","received_events_url":"https://api.github.com/users/artefactual/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/artefactual/archivematica-storage-service","description":"Archivematica storage service","fork":false,"url":"https://api.github.com/repos/artefactual/archivematica-storage-service","forks_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/forks","keys_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/keys{/key_id}","collaborators_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/teams","hooks_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/hooks","issue_events_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/issues/events{/number}","events_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/events","assignees_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/assignees{/user}","branches_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/branches{/branch}","tags_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/tags","blobs_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/git/refs{/sha}","trees_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/git/trees{/sha}","statuses_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/statuses/{sha}","languages_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/languages","stargazers_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/stargazers","contributors_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/contributors","subscribers_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/subscribers","subscription_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/subscription","commits_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/commits{/sha}","git_commits_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/git/commits{/sha}","comments_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/comments{/number}","issue_comment_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/issues/comments{/number}","contents_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/contents/{+path}","compare_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/compare/{base}...{head}","merges_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/merges","archive_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/downloads","issues_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/issues{/number}","pulls_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/pulls{/number}","milestones_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/milestones{/number}","notifications_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/labels{/name}","releases_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/releases{/id}","created_at":"2013-08-16T17:41:44Z","updated_at":"2015-04-02T01:17:09Z","pushed_at":"2015-04-01T19:24:05Z","git_url":"git://github.com/artefactual/archivematica-storage-service.git","ssh_url":"git@github.com:artefactual/archivematica-storage-service.git","clone_url":"https://github.com/artefactual/archivematica-storage-service.git","svn_url":"https://github.com/artefactual/archivematica-storage-service","homepage":"http://www.archivematica.org","size":5869,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":4,"forks":4,"open_issues":4,"watchers":3,"default_branch":"stable/0.6.x"}},"base":{"label":"artefactual:qa/0.x","ref":"qa/0.x","sha":"3f35c6f011a34f9775f2710484cc9f4e9c906db0","user":{"login":"artefactual","id":1163545,"avatar_url":"https://avatars.githubusercontent.com/u/1163545?v=3","gravatar_id":"","url":"https://api.github.com/users/artefactual","html_url":"https://github.com/artefactual","followers_url":"https://api.github.com/users/artefactual/followers","following_url":"https://api.github.com/users/artefactual/following{/other_user}","gists_url":"https://api.github.com/users/artefactual/gists{/gist_id}","starred_url":"https://api.github.com/users/artefactual/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artefactual/subscriptions","organizations_url":"https://api.github.com/users/artefactual/orgs","repos_url":"https://api.github.com/users/artefactual/repos","events_url":"https://api.github.com/users/artefactual/events{/privacy}","received_events_url":"https://api.github.com/users/artefactual/received_events","type":"Organization","site_admin":false},"repo":{"id":12164369,"name":"archivematica-storage-service","full_name":"artefactual/archivematica-storage-service","owner":{"login":"artefactual","id":1163545,"avatar_url":"https://avatars.githubusercontent.com/u/1163545?v=3","gravatar_id":"","url":"https://api.github.com/users/artefactual","html_url":"https://github.com/artefactual","followers_url":"https://api.github.com/users/artefactual/followers","following_url":"https://api.github.com/users/artefactual/following{/other_user}","gists_url":"https://api.github.com/users/artefactual/gists{/gist_id}","starred_url":"https://api.github.com/users/artefactual/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artefactual/subscriptions","organizations_url":"https://api.github.com/users/artefactual/orgs","repos_url":"https://api.github.com/users/artefactual/repos","events_url":"https://api.github.com/users/artefactual/events{/privacy}","received_events_url":"https://api.github.com/users/artefactual/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/artefactual/archivematica-storage-service","description":"Archivematica storage service","fork":false,"url":"https://api.github.com/repos/artefactual/archivematica-storage-service","forks_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/forks","keys_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/keys{/key_id}","collaborators_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/teams","hooks_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/hooks","issue_events_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/issues/events{/number}","events_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/events","assignees_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/assignees{/user}","branches_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/branches{/branch}","tags_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/tags","blobs_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/git/refs{/sha}","trees_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/git/trees{/sha}","statuses_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/statuses/{sha}","languages_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/languages","stargazers_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/stargazers","contributors_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/contributors","subscribers_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/subscribers","subscription_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/subscription","commits_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/commits{/sha}","git_commits_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/git/commits{/sha}","comments_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/comments{/number}","issue_comment_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/issues/comments{/number}","contents_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/contents/{+path}","compare_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/compare/{base}...{head}","merges_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/merges","archive_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/downloads","issues_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/issues{/number}","pulls_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/pulls{/number}","milestones_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/milestones{/number}","notifications_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/labels{/name}","releases_url":"https://api.github.com/repos/artefactual/archivematica-storage-service/releases{/id}","created_at":"2013-08-16T17:41:44Z","updated_at":"2015-04-02T01:17:09Z","pushed_at":"2015-04-01T19:24:05Z","git_url":"git://github.com/artefactual/archivematica-storage-service.git","ssh_url":"git@github.com:artefactual/archivematica-storage-service.git","clone_url":"https://github.com/artefactual/archivematica-storage-service.git","svn_url":"https://github.com/artefactual/archivematica-storage-service","homepage":"http://www.archivematica.org","size":5869,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":4,"forks":4,"open_issues":4,"watchers":3,"default_branch":"stable/0.6.x"}},"_links":{"self":{"href":"https://api.github.com/repos/artefactual/archivematica-storage-service/pulls/33"},"html":{"href":"https://github.com/artefactual/archivematica-storage-service/pull/33"},"issue":{"href":"https://api.github.com/repos/artefactual/archivematica-storage-service/issues/33"},"comments":{"href":"https://api.github.com/repos/artefactual/archivematica-storage-service/issues/33/comments"},"review_comments":{"href":"https://api.github.com/repos/artefactual/archivematica-storage-service/pulls/33/comments"},"review_comment":{"href":"https://api.github.com/repos/artefactual/archivematica-storage-service/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/artefactual/archivematica-storage-service/pulls/33/commits"},"statuses":{"href":"https://api.github.com/repos/artefactual/archivematica-storage-service/statuses/915a69e63c7e135e54eb62d846aa2335bb7b12be"}}}}