{"action":"created","comment":{"url":"https://api.github.com/repos/ubuntu-core/snappy/pulls/comments/55727776","id":55727776,"diff_hunk":"@@ -76,12 +93,20 @@ func (s *SecuritySuite) TestAppArmorPlugPermissions(c *C) {\n \t// Ensure that plug-side security profile looks correct.\n \tblobs, err := s.repo.SecurityFilesForSnap(s.plug.Snap)\n \tc.Assert(err, IsNil)\n-\tc.Check(blobs, DeepEquals, map[string][]byte{\n-\t\t\"/run/snappy/security/apparmor/producer/hook.profile\": []byte(\"\" +\n-\t\t\t\"fake \\\"/snaps/producer/current/hook\\\" {\\n\" +\n-\t\t\t\"producer snippet\\n\" +\n-\t\t\t\"}\\n\"),\n-\t})\n+\tc.Check(blobs[\"/var/lib/snappy/apparmor/profiles/producer.origin_hook_version\"], DeepEquals, []byte(`\n+# Specified profile variables\n+@{APP_APPNAME}=\"hook\"\n+@{APP_ID_DBUS}=\"producer_2eorigin_5fhook_5fversion\"\n+@{APP_PKGNAME_DBUS}=\"producer_2eorigin\"\n+@{APP_PKGNAME}=\"producer.origin\"\n+@{APP_VERSION}=\"version\"\n+@{INSTALL_DIR}=\"{/snaps,/gadget}\"\n+# Deprecated:\n+@{CLICK_DIR}=\"{/snaps,/gadget}\"","path":"interfaces/security_test.go","position":54,"original_position":54,"commit_id":"e70421c9c20ad1e6d67acca8da9a1f8a479b12c1","original_commit_id":"e70421c9c20ad1e6d67acca8da9a1f8a479b12c1","user":{"login":"jdstrand","id":1663079,"avatar_url":"https://avatars.githubusercontent.com/u/1663079?v=3","gravatar_id":"","url":"https://api.github.com/users/jdstrand","html_url":"https://github.com/jdstrand","followers_url":"https://api.github.com/users/jdstrand/followers","following_url":"https://api.github.com/users/jdstrand/following{/other_user}","gists_url":"https://api.github.com/users/jdstrand/gists{/gist_id}","starred_url":"https://api.github.com/users/jdstrand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdstrand/subscriptions","organizations_url":"https://api.github.com/users/jdstrand/orgs","repos_url":"https://api.github.com/users/jdstrand/repos","events_url":"https://api.github.com/users/jdstrand/events{/privacy}","received_events_url":"https://api.github.com/users/jdstrand/received_events","type":"User","site_admin":false},"body":"Likewise for this CLICK_DIR","created_at":"2016-03-10T18:42:04Z","updated_at":"2016-03-10T18:42:04Z","html_url":"https://github.com/ubuntu-core/snappy/pull/617#discussion_r55727776","pull_request_url":"https://api.github.com/repos/ubuntu-core/snappy/pulls/617","_links":{"self":{"href":"https://api.github.com/repos/ubuntu-core/snappy/pulls/comments/55727776"},"html":{"href":"https://github.com/ubuntu-core/snappy/pull/617#discussion_r55727776"},"pull_request":{"href":"https://api.github.com/repos/ubuntu-core/snappy/pulls/617"}}},"pull_request":{"url":"https://api.github.com/repos/ubuntu-core/snappy/pulls/617","id":62196953,"html_url":"https://github.com/ubuntu-core/snappy/pull/617","diff_url":"https://github.com/ubuntu-core/snappy/pull/617.diff","patch_url":"https://github.com/ubuntu-core/snappy/pull/617.patch","issue_url":"https://api.github.com/repos/ubuntu-core/snappy/issues/617","number":617,"state":"open","locked":false,"title":"interfaces: generate real security file content","user":{"login":"zyga","id":784262,"avatar_url":"https://avatars.githubusercontent.com/u/784262?v=3","gravatar_id":"","url":"https://api.github.com/users/zyga","html_url":"https://github.com/zyga","followers_url":"https://api.github.com/users/zyga/followers","following_url":"https://api.github.com/users/zyga/following{/other_user}","gists_url":"https://api.github.com/users/zyga/gists{/gist_id}","starred_url":"https://api.github.com/users/zyga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zyga/subscriptions","organizations_url":"https://api.github.com/users/zyga/orgs","repos_url":"https://api.github.com/users/zyga/repos","events_url":"https://api.github.com/users/zyga/events{/privacy}","received_events_url":"https://api.github.com/users/zyga/received_events","type":"User","site_admin":false},"body":"This patch builds on the existing foundation to generate non-fake\r\ncontent of all the files related to security.\r\n\r\nThe internal security helper interface is extended to contain additional\r\ndata for any snap (version, origin and list of apps). This is required\r\nto construct correct content and to locate it in the right directories.\r\n\r\nThe \"xmanager\" (read as cross-manager) file is a temporary helper before\r\nall of this moves to the state engine and we can query the state\r\ndirectly from there. It only exists so that we can ask about the\r\nversion, origin and list of apps in a given snap.\r\n\r\nTests are somewhat tweaked since now the real contents of the security\r\nfiles is very long, a set of mocking functions is provided to replace\r\nthe real (very long) seccomp and apparmor header with a shorter version\r\nthat is easier to analyze and compare.\r\n\r\nFinally, the repository method that writes all the security files (which\r\nis also supposed to move to the interface manager) is extended to pass\r\nthe new arguments.\r\n\r\nSigned-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>","created_at":"2016-03-09T08:55:25Z","updated_at":"2016-03-10T18:42:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7ce4b8e7869fc70db56a4c5c5574676b8f48c27a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ubuntu-core/snappy/pulls/617/commits","review_comments_url":"https://api.github.com/repos/ubuntu-core/snappy/pulls/617/comments","review_comment_url":"https://api.github.com/repos/ubuntu-core/snappy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ubuntu-core/snappy/issues/617/comments","statuses_url":"https://api.github.com/repos/ubuntu-core/snappy/statuses/e70421c9c20ad1e6d67acca8da9a1f8a479b12c1","head":{"label":"zyga:real-security-files","ref":"real-security-files","sha":"e70421c9c20ad1e6d67acca8da9a1f8a479b12c1","user":{"login":"zyga","id":784262,"avatar_url":"https://avatars.githubusercontent.com/u/784262?v=3","gravatar_id":"","url":"https://api.github.com/users/zyga","html_url":"https://github.com/zyga","followers_url":"https://api.github.com/users/zyga/followers","following_url":"https://api.github.com/users/zyga/following{/other_user}","gists_url":"https://api.github.com/users/zyga/gists{/gist_id}","starred_url":"https://api.github.com/users/zyga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zyga/subscriptions","organizations_url":"https://api.github.com/users/zyga/orgs","repos_url":"https://api.github.com/users/zyga/repos","events_url":"https://api.github.com/users/zyga/events{/privacy}","received_events_url":"https://api.github.com/users/zyga/received_events","type":"User","site_admin":false},"repo":{"id":45263078,"name":"snappy","full_name":"zyga/snappy","owner":{"login":"zyga","id":784262,"avatar_url":"https://avatars.githubusercontent.com/u/784262?v=3","gravatar_id":"","url":"https://api.github.com/users/zyga","html_url":"https://github.com/zyga","followers_url":"https://api.github.com/users/zyga/followers","following_url":"https://api.github.com/users/zyga/following{/other_user}","gists_url":"https://api.github.com/users/zyga/gists{/gist_id}","starred_url":"https://api.github.com/users/zyga/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zyga/subscriptions","organizations_url":"https://api.github.com/users/zyga/orgs","repos_url":"https://api.github.com/users/zyga/repos","events_url":"https://api.github.com/users/zyga/events{/privacy}","received_events_url":"https://api.github.com/users/zyga/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zyga/snappy","description":"Snappy is the software at the heart of Ubuntu Core.","fork":true,"url":"https://api.github.com/repos/zyga/snappy","forks_url":"https://api.github.com/repos/zyga/snappy/forks","keys_url":"https://api.github.com/repos/zyga/snappy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zyga/snappy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zyga/snappy/teams","hooks_url":"https://api.github.com/repos/zyga/snappy/hooks","issue_events_url":"https://api.github.com/repos/zyga/snappy/issues/events{/number}","events_url":"https://api.github.com/repos/zyga/snappy/events","assignees_url":"https://api.github.com/repos/zyga/snappy/assignees{/user}","branches_url":"https://api.github.com/repos/zyga/snappy/branches{/branch}","tags_url":"https://api.github.com/repos/zyga/snappy/tags","blobs_url":"https://api.github.com/repos/zyga/snappy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zyga/snappy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zyga/snappy/git/refs{/sha}","trees_url":"https://api.github.com/repos/zyga/snappy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zyga/snappy/statuses/{sha}","languages_url":"https://api.github.com/repos/zyga/snappy/languages","stargazers_url":"https://api.github.com/repos/zyga/snappy/stargazers","contributors_url":"https://api.github.com/repos/zyga/snappy/contributors","subscribers_url":"https://api.github.com/repos/zyga/snappy/subscribers","subscription_url":"https://api.github.com/repos/zyga/snappy/subscription","commits_url":"https://api.github.com/repos/zyga/snappy/commits{/sha}","git_commits_url":"https://api.github.com/repos/zyga/snappy/git/commits{/sha}","comments_url":"https://api.github.com/repos/zyga/snappy/comments{/number}","issue_comment_url":"https://api.github.com/repos/zyga/snappy/issues/comments{/number}","contents_url":"https://api.github.com/repos/zyga/snappy/contents/{+path}","compare_url":"https://api.github.com/repos/zyga/snappy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zyga/snappy/merges","archive_url":"https://api.github.com/repos/zyga/snappy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zyga/snappy/downloads","issues_url":"https://api.github.com/repos/zyga/snappy/issues{/number}","pulls_url":"https://api.github.com/repos/zyga/snappy/pulls{/number}","milestones_url":"https://api.github.com/repos/zyga/snappy/milestones{/number}","notifications_url":"https://api.github.com/repos/zyga/snappy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zyga/snappy/labels{/name}","releases_url":"https://api.github.com/repos/zyga/snappy/releases{/id}","deployments_url":"https://api.github.com/repos/zyga/snappy/deployments","created_at":"2015-10-30T16:30:25Z","updated_at":"2016-03-09T07:58:32Z","pushed_at":"2016-03-10T18:39:28Z","git_url":"git://github.com/zyga/snappy.git","ssh_url":"git@github.com:zyga/snappy.git","clone_url":"https://github.com/zyga/snappy.git","svn_url":"https://github.com/zyga/snappy","homepage":null,"size":25887,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ubuntu-core:master","ref":"master","sha":"152011a063ff4924e212f8e9ed8d4f85c542c079","user":{"login":"ubuntu-core","id":15022473,"avatar_url":"https://avatars.githubusercontent.com/u/15022473?v=3","gravatar_id":"","url":"https://api.github.com/users/ubuntu-core","html_url":"https://github.com/ubuntu-core","followers_url":"https://api.github.com/users/ubuntu-core/followers","following_url":"https://api.github.com/users/ubuntu-core/following{/other_user}","gists_url":"https://api.github.com/users/ubuntu-core/gists{/gist_id}","starred_url":"https://api.github.com/users/ubuntu-core/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ubuntu-core/subscriptions","organizations_url":"https://api.github.com/users/ubuntu-core/orgs","repos_url":"https://api.github.com/users/ubuntu-core/repos","events_url":"https://api.github.com/users/ubuntu-core/events{/privacy}","received_events_url":"https://api.github.com/users/ubuntu-core/received_events","type":"Organization","site_admin":false},"repo":{"id":44672744,"name":"snappy","full_name":"ubuntu-core/snappy","owner":{"login":"ubuntu-core","id":15022473,"avatar_url":"https://avatars.githubusercontent.com/u/15022473?v=3","gravatar_id":"","url":"https://api.github.com/users/ubuntu-core","html_url":"https://github.com/ubuntu-core","followers_url":"https://api.github.com/users/ubuntu-core/followers","following_url":"https://api.github.com/users/ubuntu-core/following{/other_user}","gists_url":"https://api.github.com/users/ubuntu-core/gists{/gist_id}","starred_url":"https://api.github.com/users/ubuntu-core/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ubuntu-core/subscriptions","organizations_url":"https://api.github.com/users/ubuntu-core/orgs","repos_url":"https://api.github.com/users/ubuntu-core/repos","events_url":"https://api.github.com/users/ubuntu-core/events{/privacy}","received_events_url":"https://api.github.com/users/ubuntu-core/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ubuntu-core/snappy","description":"Snappy is the software at the heart of Ubuntu Core.","fork":false,"url":"https://api.github.com/repos/ubuntu-core/snappy","forks_url":"https://api.github.com/repos/ubuntu-core/snappy/forks","keys_url":"https://api.github.com/repos/ubuntu-core/snappy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ubuntu-core/snappy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ubuntu-core/snappy/teams","hooks_url":"https://api.github.com/repos/ubuntu-core/snappy/hooks","issue_events_url":"https://api.github.com/repos/ubuntu-core/snappy/issues/events{/number}","events_url":"https://api.github.com/repos/ubuntu-core/snappy/events","assignees_url":"https://api.github.com/repos/ubuntu-core/snappy/assignees{/user}","branches_url":"https://api.github.com/repos/ubuntu-core/snappy/branches{/branch}","tags_url":"https://api.github.com/repos/ubuntu-core/snappy/tags","blobs_url":"https://api.github.com/repos/ubuntu-core/snappy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ubuntu-core/snappy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ubuntu-core/snappy/git/refs{/sha}","trees_url":"https://api.github.com/repos/ubuntu-core/snappy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ubuntu-core/snappy/statuses/{sha}","languages_url":"https://api.github.com/repos/ubuntu-core/snappy/languages","stargazers_url":"https://api.github.com/repos/ubuntu-core/snappy/stargazers","contributors_url":"https://api.github.com/repos/ubuntu-core/snappy/contributors","subscribers_url":"https://api.github.com/repos/ubuntu-core/snappy/subscribers","subscription_url":"https://api.github.com/repos/ubuntu-core/snappy/subscription","commits_url":"https://api.github.com/repos/ubuntu-core/snappy/commits{/sha}","git_commits_url":"https://api.github.com/repos/ubuntu-core/snappy/git/commits{/sha}","comments_url":"https://api.github.com/repos/ubuntu-core/snappy/comments{/number}","issue_comment_url":"https://api.github.com/repos/ubuntu-core/snappy/issues/comments{/number}","contents_url":"https://api.github.com/repos/ubuntu-core/snappy/contents/{+path}","compare_url":"https://api.github.com/repos/ubuntu-core/snappy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ubuntu-core/snappy/merges","archive_url":"https://api.github.com/repos/ubuntu-core/snappy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ubuntu-core/snappy/downloads","issues_url":"https://api.github.com/repos/ubuntu-core/snappy/issues{/number}","pulls_url":"https://api.github.com/repos/ubuntu-core/snappy/pulls{/number}","milestones_url":"https://api.github.com/repos/ubuntu-core/snappy/milestones{/number}","notifications_url":"https://api.github.com/repos/ubuntu-core/snappy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ubuntu-core/snappy/labels{/name}","releases_url":"https://api.github.com/repos/ubuntu-core/snappy/releases{/id}","deployments_url":"https://api.github.com/repos/ubuntu-core/snappy/deployments","created_at":"2015-10-21T11:51:46Z","updated_at":"2016-03-06T01:14:59Z","pushed_at":"2016-03-10T18:39:28Z","git_url":"git://github.com/ubuntu-core/snappy.git","ssh_url":"git@github.com:ubuntu-core/snappy.git","clone_url":"https://github.com/ubuntu-core/snappy.git","svn_url":"https://github.com/ubuntu-core/snappy","homepage":null,"size":26736,"stargazers_count":57,"watchers_count":57,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":28,"mirror_url":null,"open_issues_count":10,"forks":28,"open_issues":10,"watchers":57,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ubuntu-core/snappy/pulls/617"},"html":{"href":"https://github.com/ubuntu-core/snappy/pull/617"},"issue":{"href":"https://api.github.com/repos/ubuntu-core/snappy/issues/617"},"comments":{"href":"https://api.github.com/repos/ubuntu-core/snappy/issues/617/comments"},"review_comments":{"href":"https://api.github.com/repos/ubuntu-core/snappy/pulls/617/comments"},"review_comment":{"href":"https://api.github.com/repos/ubuntu-core/snappy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ubuntu-core/snappy/pulls/617/commits"},"statuses":{"href":"https://api.github.com/repos/ubuntu-core/snappy/statuses/e70421c9c20ad1e6d67acca8da9a1f8a479b12c1"}}}}