{"action":"created","comment":{"url":"https://api.github.com/repos/portier/portier-broker/pulls/comments/83812187","pull_request_review_id":4628647,"id":83812187,"diff_hunk":"@@ -45,4 +59,7 @@ pub struct AppConfig {\n     pub token_validity: usize,\n     /// Mapping of Domain -> OIDC Provider\n     pub providers: HashMap<String, Provider>,\n+    /// Template files","path":"src/serde_types.in.rs","position":null,"original_position":32,"commit_id":"b77d4603ab89c814c73a9f9dd8b98c51f8261a80","original_commit_id":"e34b1f99750b29f4ced4e85910e2edfdc9a2251c","user":{"login":"djc","id":158471,"avatar_url":"https://avatars.githubusercontent.com/u/158471?v=3","gravatar_id":"","url":"https://api.github.com/users/djc","html_url":"https://github.com/djc","followers_url":"https://api.github.com/users/djc/followers","following_url":"https://api.github.com/users/djc/following{/other_user}","gists_url":"https://api.github.com/users/djc/gists{/gist_id}","starred_url":"https://api.github.com/users/djc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djc/subscriptions","organizations_url":"https://api.github.com/users/djc/orgs","repos_url":"https://api.github.com/users/djc/repos","events_url":"https://api.github.com/users/djc/events{/privacy}","received_events_url":"https://api.github.com/users/djc/received_events","type":"User","site_admin":false},"body":"I don't quite get what you're going for with this part. It makes sense to me to have a `Templates` struct, and I guess it also makes sense to have an instance of that struct in the `AppConfig`. However, does that necessarily mean we have to use `serde` for all this stuff? `impl Deserialize for Template` should just be a function `compile_template()` that's called once for each template in `default_templates()`.","created_at":"2016-10-18T09:14:08Z","updated_at":"2016-10-18T09:14:08Z","html_url":"https://github.com/portier/portier-broker/pull/40#discussion_r83812187","pull_request_url":"https://api.github.com/repos/portier/portier-broker/pulls/40","_links":{"self":{"href":"https://api.github.com/repos/portier/portier-broker/pulls/comments/83812187"},"html":{"href":"https://github.com/portier/portier-broker/pull/40#discussion_r83812187"},"pull_request":{"href":"https://api.github.com/repos/portier/portier-broker/pulls/40"}}},"pull_request":{"url":"https://api.github.com/repos/portier/portier-broker/pulls/40","id":89611621,"html_url":"https://github.com/portier/portier-broker/pull/40","diff_url":"https://github.com/portier/portier-broker/pull/40.diff","patch_url":"https://github.com/portier/portier-broker/pull/40.patch","issue_url":"https://api.github.com/repos/portier/portier-broker/issues/40","number":40,"state":"open","locked":false,"title":"Response templates and RP redirecting","user":{"login":"stephank","id":89950,"avatar_url":"https://avatars.githubusercontent.com/u/89950?v=3","gravatar_id":"","url":"https://api.github.com/users/stephank","html_url":"https://github.com/stephank","followers_url":"https://api.github.com/users/stephank/followers","following_url":"https://api.github.com/users/stephank/following{/other_user}","gists_url":"https://api.github.com/users/stephank/gists{/gist_id}","starred_url":"https://api.github.com/users/stephank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephank/subscriptions","organizations_url":"https://api.github.com/users/stephank/orgs","repos_url":"https://api.github.com/users/stephank/repos","events_url":"https://api.github.com/users/stephank/events{/privacy}","received_events_url":"https://api.github.com/users/stephank/received_events","type":"User","site_admin":false},"body":"Fixes #17 and #31. Changes:\r\n\r\n - Added a form to the email flow, so the one-time pad from the mail can also be entered in an input. (As an alternative to clicking the link.)\r\n - Created templates for the email itself, in both plain text and HTML.\r\n - Added a template for errors, when we cannot redirect back to the RP.\r\n - Implemented reporting errors to the RP through redirects, following the OAuth2 spec.\r\n\r\nEven though both @djc and I felt strongly keeping templates simple search/replace operations, throughout implementing this I felt that actually be more complicated than just integrating a template engine. Reason is that we need escaping, and probably also partials, sections and assets down the road, if we're going to build a more full-fledged UI.\r\n\r\nI picked Mustache for now, because Liquid doesn't support partials, and Mustache is probably the better known alternative. The Mustache implementation for Rust is also reasonably mature, as used by nickel. The way things are setup, I believe we can easily swap it out for something else if needed.\r\n\r\nRegarding error redirects, I followed RFC 6749 4.1.2.1., but I have a suspicion we may have to follow the response mode? Right now, it does a 303 redirect, which results in a GET request with query params to the RP verify endpoint, but our response mode is always `form_post`.","created_at":"2016-10-17T12:14:00Z","updated_at":"2016-10-18T09:41:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"67405a29c33246a3f66508defef08594889d426b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/portier/portier-broker/pulls/40/commits","review_comments_url":"https://api.github.com/repos/portier/portier-broker/pulls/40/comments","review_comment_url":"https://api.github.com/repos/portier/portier-broker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/portier/portier-broker/issues/40/comments","statuses_url":"https://api.github.com/repos/portier/portier-broker/statuses/b77d4603ab89c814c73a9f9dd8b98c51f8261a80","head":{"label":"stephank:feat/templates","ref":"feat/templates","sha":"b77d4603ab89c814c73a9f9dd8b98c51f8261a80","user":{"login":"stephank","id":89950,"avatar_url":"https://avatars.githubusercontent.com/u/89950?v=3","gravatar_id":"","url":"https://api.github.com/users/stephank","html_url":"https://github.com/stephank","followers_url":"https://api.github.com/users/stephank/followers","following_url":"https://api.github.com/users/stephank/following{/other_user}","gists_url":"https://api.github.com/users/stephank/gists{/gist_id}","starred_url":"https://api.github.com/users/stephank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephank/subscriptions","organizations_url":"https://api.github.com/users/stephank/orgs","repos_url":"https://api.github.com/users/stephank/repos","events_url":"https://api.github.com/users/stephank/events{/privacy}","received_events_url":"https://api.github.com/users/stephank/received_events","type":"User","site_admin":false},"repo":{"id":69276048,"name":"portier-broker","full_name":"stephank/portier-broker","owner":{"login":"stephank","id":89950,"avatar_url":"https://avatars.githubusercontent.com/u/89950?v=3","gravatar_id":"","url":"https://api.github.com/users/stephank","html_url":"https://github.com/stephank","followers_url":"https://api.github.com/users/stephank/followers","following_url":"https://api.github.com/users/stephank/following{/other_user}","gists_url":"https://api.github.com/users/stephank/gists{/gist_id}","starred_url":"https://api.github.com/users/stephank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephank/subscriptions","organizations_url":"https://api.github.com/users/stephank/orgs","repos_url":"https://api.github.com/users/stephank/repos","events_url":"https://api.github.com/users/stephank/events{/privacy}","received_events_url":"https://api.github.com/users/stephank/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stephank/portier-broker","description":"Portier broker reference implementation, written in Rust","fork":true,"url":"https://api.github.com/repos/stephank/portier-broker","forks_url":"https://api.github.com/repos/stephank/portier-broker/forks","keys_url":"https://api.github.com/repos/stephank/portier-broker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stephank/portier-broker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stephank/portier-broker/teams","hooks_url":"https://api.github.com/repos/stephank/portier-broker/hooks","issue_events_url":"https://api.github.com/repos/stephank/portier-broker/issues/events{/number}","events_url":"https://api.github.com/repos/stephank/portier-broker/events","assignees_url":"https://api.github.com/repos/stephank/portier-broker/assignees{/user}","branches_url":"https://api.github.com/repos/stephank/portier-broker/branches{/branch}","tags_url":"https://api.github.com/repos/stephank/portier-broker/tags","blobs_url":"https://api.github.com/repos/stephank/portier-broker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stephank/portier-broker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stephank/portier-broker/git/refs{/sha}","trees_url":"https://api.github.com/repos/stephank/portier-broker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stephank/portier-broker/statuses/{sha}","languages_url":"https://api.github.com/repos/stephank/portier-broker/languages","stargazers_url":"https://api.github.com/repos/stephank/portier-broker/stargazers","contributors_url":"https://api.github.com/repos/stephank/portier-broker/contributors","subscribers_url":"https://api.github.com/repos/stephank/portier-broker/subscribers","subscription_url":"https://api.github.com/repos/stephank/portier-broker/subscription","commits_url":"https://api.github.com/repos/stephank/portier-broker/commits{/sha}","git_commits_url":"https://api.github.com/repos/stephank/portier-broker/git/commits{/sha}","comments_url":"https://api.github.com/repos/stephank/portier-broker/comments{/number}","issue_comment_url":"https://api.github.com/repos/stephank/portier-broker/issues/comments{/number}","contents_url":"https://api.github.com/repos/stephank/portier-broker/contents/{+path}","compare_url":"https://api.github.com/repos/stephank/portier-broker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stephank/portier-broker/merges","archive_url":"https://api.github.com/repos/stephank/portier-broker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stephank/portier-broker/downloads","issues_url":"https://api.github.com/repos/stephank/portier-broker/issues{/number}","pulls_url":"https://api.github.com/repos/stephank/portier-broker/pulls{/number}","milestones_url":"https://api.github.com/repos/stephank/portier-broker/milestones{/number}","notifications_url":"https://api.github.com/repos/stephank/portier-broker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stephank/portier-broker/labels{/name}","releases_url":"https://api.github.com/repos/stephank/portier-broker/releases{/id}","deployments_url":"https://api.github.com/repos/stephank/portier-broker/deployments","created_at":"2016-09-26T17:44:48Z","updated_at":"2016-09-26T17:44:48Z","pushed_at":"2016-10-18T08:26:37Z","git_url":"git://github.com/stephank/portier-broker.git","ssh_url":"git@github.com:stephank/portier-broker.git","clone_url":"https://github.com/stephank/portier-broker.git","svn_url":"https://github.com/stephank/portier-broker","homepage":"http://portier.github.io/","size":161,"stargazers_count":0,"watchers_count":0,"language":"Rust","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":"portier:master","ref":"master","sha":"a1bce4e8cca45bd4ea811bef3637f8f6c690b55c","user":{"login":"portier","id":16453528,"avatar_url":"https://avatars.githubusercontent.com/u/16453528?v=3","gravatar_id":"","url":"https://api.github.com/users/portier","html_url":"https://github.com/portier","followers_url":"https://api.github.com/users/portier/followers","following_url":"https://api.github.com/users/portier/following{/other_user}","gists_url":"https://api.github.com/users/portier/gists{/gist_id}","starred_url":"https://api.github.com/users/portier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/portier/subscriptions","organizations_url":"https://api.github.com/users/portier/orgs","repos_url":"https://api.github.com/users/portier/repos","events_url":"https://api.github.com/users/portier/events{/privacy}","received_events_url":"https://api.github.com/users/portier/received_events","type":"Organization","site_admin":false},"repo":{"id":59147712,"name":"portier-broker","full_name":"portier/portier-broker","owner":{"login":"portier","id":16453528,"avatar_url":"https://avatars.githubusercontent.com/u/16453528?v=3","gravatar_id":"","url":"https://api.github.com/users/portier","html_url":"https://github.com/portier","followers_url":"https://api.github.com/users/portier/followers","following_url":"https://api.github.com/users/portier/following{/other_user}","gists_url":"https://api.github.com/users/portier/gists{/gist_id}","starred_url":"https://api.github.com/users/portier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/portier/subscriptions","organizations_url":"https://api.github.com/users/portier/orgs","repos_url":"https://api.github.com/users/portier/repos","events_url":"https://api.github.com/users/portier/events{/privacy}","received_events_url":"https://api.github.com/users/portier/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/portier/portier-broker","description":"Portier broker reference implementation, written in Rust","fork":false,"url":"https://api.github.com/repos/portier/portier-broker","forks_url":"https://api.github.com/repos/portier/portier-broker/forks","keys_url":"https://api.github.com/repos/portier/portier-broker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/portier/portier-broker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/portier/portier-broker/teams","hooks_url":"https://api.github.com/repos/portier/portier-broker/hooks","issue_events_url":"https://api.github.com/repos/portier/portier-broker/issues/events{/number}","events_url":"https://api.github.com/repos/portier/portier-broker/events","assignees_url":"https://api.github.com/repos/portier/portier-broker/assignees{/user}","branches_url":"https://api.github.com/repos/portier/portier-broker/branches{/branch}","tags_url":"https://api.github.com/repos/portier/portier-broker/tags","blobs_url":"https://api.github.com/repos/portier/portier-broker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/portier/portier-broker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/portier/portier-broker/git/refs{/sha}","trees_url":"https://api.github.com/repos/portier/portier-broker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/portier/portier-broker/statuses/{sha}","languages_url":"https://api.github.com/repos/portier/portier-broker/languages","stargazers_url":"https://api.github.com/repos/portier/portier-broker/stargazers","contributors_url":"https://api.github.com/repos/portier/portier-broker/contributors","subscribers_url":"https://api.github.com/repos/portier/portier-broker/subscribers","subscription_url":"https://api.github.com/repos/portier/portier-broker/subscription","commits_url":"https://api.github.com/repos/portier/portier-broker/commits{/sha}","git_commits_url":"https://api.github.com/repos/portier/portier-broker/git/commits{/sha}","comments_url":"https://api.github.com/repos/portier/portier-broker/comments{/number}","issue_comment_url":"https://api.github.com/repos/portier/portier-broker/issues/comments{/number}","contents_url":"https://api.github.com/repos/portier/portier-broker/contents/{+path}","compare_url":"https://api.github.com/repos/portier/portier-broker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/portier/portier-broker/merges","archive_url":"https://api.github.com/repos/portier/portier-broker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/portier/portier-broker/downloads","issues_url":"https://api.github.com/repos/portier/portier-broker/issues{/number}","pulls_url":"https://api.github.com/repos/portier/portier-broker/pulls{/number}","milestones_url":"https://api.github.com/repos/portier/portier-broker/milestones{/number}","notifications_url":"https://api.github.com/repos/portier/portier-broker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/portier/portier-broker/labels{/name}","releases_url":"https://api.github.com/repos/portier/portier-broker/releases{/id}","deployments_url":"https://api.github.com/repos/portier/portier-broker/deployments","created_at":"2016-05-18T20:10:35Z","updated_at":"2016-10-18T07:43:54Z","pushed_at":"2016-10-18T08:26:38Z","git_url":"git://github.com/portier/portier-broker.git","ssh_url":"git@github.com:portier/portier-broker.git","clone_url":"https://github.com/portier/portier-broker.git","svn_url":"https://github.com/portier/portier-broker","homepage":"http://portier.github.io/","size":203,"stargazers_count":9,"watchers_count":9,"language":"Rust","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":16,"forks":2,"open_issues":16,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/portier/portier-broker/pulls/40"},"html":{"href":"https://github.com/portier/portier-broker/pull/40"},"issue":{"href":"https://api.github.com/repos/portier/portier-broker/issues/40"},"comments":{"href":"https://api.github.com/repos/portier/portier-broker/issues/40/comments"},"review_comments":{"href":"https://api.github.com/repos/portier/portier-broker/pulls/40/comments"},"review_comment":{"href":"https://api.github.com/repos/portier/portier-broker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/portier/portier-broker/pulls/40/commits"},"statuses":{"href":"https://api.github.com/repos/portier/portier-broker/statuses/b77d4603ab89c814c73a9f9dd8b98c51f8261a80"}}}}
{"actor":{"display_login":"djc"}}