{"action":"opened","number":32,"pull_request":{"url":"https://api.github.com/repos/trifork/riack/pulls/32","id":81509995,"html_url":"https://github.com/trifork/riack/pull/32","diff_url":"https://github.com/trifork/riack/pull/32.diff","patch_url":"https://github.com/trifork/riack/pull/32.patch","issue_url":"https://api.github.com/repos/trifork/riack/issues/32","number":32,"state":"open","locked":false,"title":"Support for Riak security","user":{"login":"tomhel","id":1685308,"avatar_url":"https://avatars.githubusercontent.com/u/1685308?v=3","gravatar_id":"","url":"https://api.github.com/users/tomhel","html_url":"https://github.com/tomhel","followers_url":"https://api.github.com/users/tomhel/followers","following_url":"https://api.github.com/users/tomhel/following{/other_user}","gists_url":"https://api.github.com/users/tomhel/gists{/gist_id}","starred_url":"https://api.github.com/users/tomhel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomhel/subscriptions","organizations_url":"https://api.github.com/users/tomhel/orgs","repos_url":"https://api.github.com/users/tomhel/repos","events_url":"https://api.github.com/users/tomhel/events{/privacy}","received_events_url":"https://api.github.com/users/tomhel/received_events","type":"User","site_admin":false},"body":"This patch adds support for Riak security/authentication using passwords or certificates. To support TLS connections WolfSSL is used. Building with TLS/security support is optional.\r\n\r\nBesides Riak security this patch also does the following:\r\n- fix ints.h include problem on Linux.\r\n- set NOSIGPIPE on socket write.\r\n\r\nBuild example:\r\n\r\n```\r\ncmake -DBUILD_SHARED_LIBS=1 -DWITH_WOLFSSL=1 src/\r\n```\r\n\r\nTo connect to Riak securely, do this:\r\n\r\n1. create riack security options\r\n2. initialize riack security options\r\n3. connect to Riak\r\n4. start TLS\r\n5. perform authentication\r\n\r\nCode example, connect to Riak securely using username and password:\r\n\r\n```c\r\nriack_init();\r\nriack_security_options security;\r\nriack_init_security_options(&security);\r\nriack_client *client = riack_new_client(0);\r\nriack_connect(client, \"127.0.0.1\", 8087, 0);\r\n\r\nriack_start_tls(client, &security);\r\nriack_string user;\r\nriack_string pw;\r\nuser.value = \"riakuser\";\r\nuser.len = strlen(user.value);\r\npw.value = \"pass\";\r\npw.len = strlen(pw.value);\r\nriack_auth(client, &user, &pw);\r\n\r\nif (riack_ping(client) == RIACK_SUCCESS)\r\n    printf(\"pong\");\r\n}\r\n\r\nriack_free(client);\r\nriack_cleanup();\r\n```\r\n\r\nMore examples are available in _README.md_.\r\n\r\nSecurity options are set on the _riack_security_options_ struct (in _riack_defines.h_):\r\n\r\n```c\r\n/* Riack security options */\r\ntypedef struct _riack_security_options {\r\n    /* Limit available ciphers, colon delimited list */\r\n\tchar* ciphers;\r\n    /* Load from file, PEM format */\r\n\tchar* ca_file;\r\n\tchar* cert_file;\r\n\tchar* key_file;\r\n    /* Load from memory, PEM format */\r\n\tunsigned char* ca_buffer;\r\n\tunsigned char* cert_buffer;\r\n\tunsigned char* key_buffer;\r\n    /* Size of memory buffers */\r\n\tsize_t ca_size;\r\n\tsize_t cert_size;\r\n\tsize_t key_size;\r\n    /* SSL/TLS session timeout in seconds */\r\n\tunsigned int session_timeout;\r\n} riack_security_options;\r\n```\r\n","created_at":"2016-08-16T17:16:27Z","updated_at":"2016-08-16T17:16:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/trifork/riack/pulls/32/commits","review_comments_url":"https://api.github.com/repos/trifork/riack/pulls/32/comments","review_comment_url":"https://api.github.com/repos/trifork/riack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/trifork/riack/issues/32/comments","statuses_url":"https://api.github.com/repos/trifork/riack/statuses/1931c0d6fcce89e77f5e0de978e1f0eb8d52f351","head":{"label":"tomhel:tls","ref":"tls","sha":"1931c0d6fcce89e77f5e0de978e1f0eb8d52f351","user":{"login":"tomhel","id":1685308,"avatar_url":"https://avatars.githubusercontent.com/u/1685308?v=3","gravatar_id":"","url":"https://api.github.com/users/tomhel","html_url":"https://github.com/tomhel","followers_url":"https://api.github.com/users/tomhel/followers","following_url":"https://api.github.com/users/tomhel/following{/other_user}","gists_url":"https://api.github.com/users/tomhel/gists{/gist_id}","starred_url":"https://api.github.com/users/tomhel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomhel/subscriptions","organizations_url":"https://api.github.com/users/tomhel/orgs","repos_url":"https://api.github.com/users/tomhel/repos","events_url":"https://api.github.com/users/tomhel/events{/privacy}","received_events_url":"https://api.github.com/users/tomhel/received_events","type":"User","site_admin":false},"repo":{"id":54266864,"name":"riack","full_name":"tomhel/riack","owner":{"login":"tomhel","id":1685308,"avatar_url":"https://avatars.githubusercontent.com/u/1685308?v=3","gravatar_id":"","url":"https://api.github.com/users/tomhel","html_url":"https://github.com/tomhel","followers_url":"https://api.github.com/users/tomhel/followers","following_url":"https://api.github.com/users/tomhel/following{/other_user}","gists_url":"https://api.github.com/users/tomhel/gists{/gist_id}","starred_url":"https://api.github.com/users/tomhel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomhel/subscriptions","organizations_url":"https://api.github.com/users/tomhel/orgs","repos_url":"https://api.github.com/users/tomhel/repos","events_url":"https://api.github.com/users/tomhel/events{/privacy}","received_events_url":"https://api.github.com/users/tomhel/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tomhel/riack","description":"C client library for Riak. This is a fork of Riack that adds TLS and authentication support","fork":true,"url":"https://api.github.com/repos/tomhel/riack","forks_url":"https://api.github.com/repos/tomhel/riack/forks","keys_url":"https://api.github.com/repos/tomhel/riack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tomhel/riack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tomhel/riack/teams","hooks_url":"https://api.github.com/repos/tomhel/riack/hooks","issue_events_url":"https://api.github.com/repos/tomhel/riack/issues/events{/number}","events_url":"https://api.github.com/repos/tomhel/riack/events","assignees_url":"https://api.github.com/repos/tomhel/riack/assignees{/user}","branches_url":"https://api.github.com/repos/tomhel/riack/branches{/branch}","tags_url":"https://api.github.com/repos/tomhel/riack/tags","blobs_url":"https://api.github.com/repos/tomhel/riack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tomhel/riack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tomhel/riack/git/refs{/sha}","trees_url":"https://api.github.com/repos/tomhel/riack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tomhel/riack/statuses/{sha}","languages_url":"https://api.github.com/repos/tomhel/riack/languages","stargazers_url":"https://api.github.com/repos/tomhel/riack/stargazers","contributors_url":"https://api.github.com/repos/tomhel/riack/contributors","subscribers_url":"https://api.github.com/repos/tomhel/riack/subscribers","subscription_url":"https://api.github.com/repos/tomhel/riack/subscription","commits_url":"https://api.github.com/repos/tomhel/riack/commits{/sha}","git_commits_url":"https://api.github.com/repos/tomhel/riack/git/commits{/sha}","comments_url":"https://api.github.com/repos/tomhel/riack/comments{/number}","issue_comment_url":"https://api.github.com/repos/tomhel/riack/issues/comments{/number}","contents_url":"https://api.github.com/repos/tomhel/riack/contents/{+path}","compare_url":"https://api.github.com/repos/tomhel/riack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tomhel/riack/merges","archive_url":"https://api.github.com/repos/tomhel/riack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tomhel/riack/downloads","issues_url":"https://api.github.com/repos/tomhel/riack/issues{/number}","pulls_url":"https://api.github.com/repos/tomhel/riack/pulls{/number}","milestones_url":"https://api.github.com/repos/tomhel/riack/milestones{/number}","notifications_url":"https://api.github.com/repos/tomhel/riack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tomhel/riack/labels{/name}","releases_url":"https://api.github.com/repos/tomhel/riack/releases{/id}","deployments_url":"https://api.github.com/repos/tomhel/riack/deployments","created_at":"2016-03-19T13:17:04Z","updated_at":"2016-05-01T10:31:02Z","pushed_at":"2016-08-16T13:29:08Z","git_url":"git://github.com/tomhel/riack.git","ssh_url":"git@github.com:tomhel/riack.git","clone_url":"https://github.com/tomhel/riack.git","svn_url":"https://github.com/tomhel/riack","homepage":"","size":5091,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":true,"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":"trifork:master","ref":"master","sha":"973f546e0039816e127e07aebc5556b5e2cdd6f2","user":{"login":"trifork","id":321052,"avatar_url":"https://avatars.githubusercontent.com/u/321052?v=3","gravatar_id":"","url":"https://api.github.com/users/trifork","html_url":"https://github.com/trifork","followers_url":"https://api.github.com/users/trifork/followers","following_url":"https://api.github.com/users/trifork/following{/other_user}","gists_url":"https://api.github.com/users/trifork/gists{/gist_id}","starred_url":"https://api.github.com/users/trifork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trifork/subscriptions","organizations_url":"https://api.github.com/users/trifork/orgs","repos_url":"https://api.github.com/users/trifork/repos","events_url":"https://api.github.com/users/trifork/events{/privacy}","received_events_url":"https://api.github.com/users/trifork/received_events","type":"Organization","site_admin":false},"repo":{"id":4903530,"name":"riack","full_name":"trifork/riack","owner":{"login":"trifork","id":321052,"avatar_url":"https://avatars.githubusercontent.com/u/321052?v=3","gravatar_id":"","url":"https://api.github.com/users/trifork","html_url":"https://github.com/trifork","followers_url":"https://api.github.com/users/trifork/followers","following_url":"https://api.github.com/users/trifork/following{/other_user}","gists_url":"https://api.github.com/users/trifork/gists{/gist_id}","starred_url":"https://api.github.com/users/trifork/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trifork/subscriptions","organizations_url":"https://api.github.com/users/trifork/orgs","repos_url":"https://api.github.com/users/trifork/repos","events_url":"https://api.github.com/users/trifork/events{/privacy}","received_events_url":"https://api.github.com/users/trifork/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/trifork/riack","description":"","fork":false,"url":"https://api.github.com/repos/trifork/riack","forks_url":"https://api.github.com/repos/trifork/riack/forks","keys_url":"https://api.github.com/repos/trifork/riack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/trifork/riack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/trifork/riack/teams","hooks_url":"https://api.github.com/repos/trifork/riack/hooks","issue_events_url":"https://api.github.com/repos/trifork/riack/issues/events{/number}","events_url":"https://api.github.com/repos/trifork/riack/events","assignees_url":"https://api.github.com/repos/trifork/riack/assignees{/user}","branches_url":"https://api.github.com/repos/trifork/riack/branches{/branch}","tags_url":"https://api.github.com/repos/trifork/riack/tags","blobs_url":"https://api.github.com/repos/trifork/riack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/trifork/riack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/trifork/riack/git/refs{/sha}","trees_url":"https://api.github.com/repos/trifork/riack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/trifork/riack/statuses/{sha}","languages_url":"https://api.github.com/repos/trifork/riack/languages","stargazers_url":"https://api.github.com/repos/trifork/riack/stargazers","contributors_url":"https://api.github.com/repos/trifork/riack/contributors","subscribers_url":"https://api.github.com/repos/trifork/riack/subscribers","subscription_url":"https://api.github.com/repos/trifork/riack/subscription","commits_url":"https://api.github.com/repos/trifork/riack/commits{/sha}","git_commits_url":"https://api.github.com/repos/trifork/riack/git/commits{/sha}","comments_url":"https://api.github.com/repos/trifork/riack/comments{/number}","issue_comment_url":"https://api.github.com/repos/trifork/riack/issues/comments{/number}","contents_url":"https://api.github.com/repos/trifork/riack/contents/{+path}","compare_url":"https://api.github.com/repos/trifork/riack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/trifork/riack/merges","archive_url":"https://api.github.com/repos/trifork/riack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/trifork/riack/downloads","issues_url":"https://api.github.com/repos/trifork/riack/issues{/number}","pulls_url":"https://api.github.com/repos/trifork/riack/pulls{/number}","milestones_url":"https://api.github.com/repos/trifork/riack/milestones{/number}","notifications_url":"https://api.github.com/repos/trifork/riack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/trifork/riack/labels{/name}","releases_url":"https://api.github.com/repos/trifork/riack/releases{/id}","deployments_url":"https://api.github.com/repos/trifork/riack/deployments","created_at":"2012-07-05T10:17:24Z","updated_at":"2015-08-01T04:41:43Z","pushed_at":"2015-10-06T14:27:36Z","git_url":"git://github.com/trifork/riack.git","ssh_url":"git@github.com:trifork/riack.git","clone_url":"https://github.com/trifork/riack.git","svn_url":"https://github.com/trifork/riack","homepage":null,"size":5432,"stargazers_count":16,"watchers_count":16,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":5,"forks":13,"open_issues":5,"watchers":16,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/trifork/riack/pulls/32"},"html":{"href":"https://github.com/trifork/riack/pull/32"},"issue":{"href":"https://api.github.com/repos/trifork/riack/issues/32"},"comments":{"href":"https://api.github.com/repos/trifork/riack/issues/32/comments"},"review_comments":{"href":"https://api.github.com/repos/trifork/riack/pulls/32/comments"},"review_comment":{"href":"https://api.github.com/repos/trifork/riack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/trifork/riack/pulls/32/commits"},"statuses":{"href":"https://api.github.com/repos/trifork/riack/statuses/1931c0d6fcce89e77f5e0de978e1f0eb8d52f351"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":9,"additions":490,"deletions":31,"changed_files":16}}
{"actor":{"display_login":"tomhel"}}