{"action":"created","comment":{"url":"https://api.github.com/repos/auth0/wp-auth0/pulls/comments/198236139","pull_request_review_id":132130526,"id":198236139,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5ODIzNjEzOQ==","diff_hunk":"@@ -0,0 +1,92 @@\n+<?php\n+use PHPUnit\\Framework\\TestCase;\n+\n+/**\n+ * Class testWPAuth0Options\n+ */\n+class testWPAuth0Options extends TestCase\n+{\n+\tconst FILTER_TEST_STRING = '__filter_test__';\n+\n+\t/**\n+\t * Test the basic options functionality.\n+\t */\n+\tpublic function testDefaultOptionsBehavior()\n+\t{\n+\t\t$opts = new WP_Auth0_Options();\n+\n+\t\t// Make sure the settings name did not change.\n+\t\t$this->assertEquals( 'wp_auth0_settings', $opts->get_options_name() );\n+\n+\t\t// Make sure the number of options has not changed unintentionally.\n+\t\t$this->assertEquals( 67, count( $opts->get_options() ) );\n+\n+\t\t// Make sure there are no constant overrides.\n+\t\t$this->assertEmpty( $opts->get_all_constant_keys() );\n+\n+\t\t// Test constant name building.\n+\t\t$this->assertEquals( 'AUTH0_ENV_TEST_GET_CONSTANT_NAME', $opts->get_constant_name( 'Test_Get_Constant_Name' ) );\n+\t}\n+\n+\t/**\n+\t *\n+\t */\n+\tpublic function testThatDefaultsWork() {\n+\t\t$opts = new WP_Auth0_Options();\n+\t\tforeach ( array_keys( $opts->get_options() ) as $opt_name ) {\n+\t\t\t$test_msg = 'Testing option: \"' . $opt_name . '\"';\n+\t\t\t$this->assertEquals( $opts->get_default( $opt_name ), $opts->get( $opt_name ), $test_msg );\n+\t\t}\n+\t}\n+\n+\t/**\n+\t *\n+\t */\n+\tpublic function testThatConstructorStoresConstants()\n+\t{\n+\t\t// Set a few constant overrides.\n+\t\tdefine( 'AUTH0_ENV_DOMAIN', rand() );","path":"tests/testWPAuth0Options.php","position":48,"original_position":48,"commit_id":"57a9c1f4290bcc29298bc1a0292a39085d543403","original_commit_id":"5f77ac11b9fb5d597ba3d7b1c4e473fe0eeeab54","user":{"login":"lbalmaceda","id":3900123,"node_id":"MDQ6VXNlcjM5MDAxMjM=","avatar_url":"https://avatars3.githubusercontent.com/u/3900123?v=4","gravatar_id":"","url":"https://api.github.com/users/lbalmaceda","html_url":"https://github.com/lbalmaceda","followers_url":"https://api.github.com/users/lbalmaceda/followers","following_url":"https://api.github.com/users/lbalmaceda/following{/other_user}","gists_url":"https://api.github.com/users/lbalmaceda/gists{/gist_id}","starred_url":"https://api.github.com/users/lbalmaceda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lbalmaceda/subscriptions","organizations_url":"https://api.github.com/users/lbalmaceda/orgs","repos_url":"https://api.github.com/users/lbalmaceda/repos","events_url":"https://api.github.com/users/lbalmaceda/events{/privacy}","received_events_url":"https://api.github.com/users/lbalmaceda/received_events","type":"User","site_admin":false},"body":"YEAH. (Sorry caps lock on). In fact, tests values should look (and be validated!) like the actual expected values. No rush on this, but good to take note 👍 ","created_at":"2018-06-26T17:37:45Z","updated_at":"2018-06-26T17:37:45Z","html_url":"https://github.com/auth0/wp-auth0/pull/488#discussion_r198236139","pull_request_url":"https://api.github.com/repos/auth0/wp-auth0/pulls/488","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/auth0/wp-auth0/pulls/comments/198236139"},"html":{"href":"https://github.com/auth0/wp-auth0/pull/488#discussion_r198236139"},"pull_request":{"href":"https://api.github.com/repos/auth0/wp-auth0/pulls/488"}},"in_reply_to_id":197970749},"pull_request":{"url":"https://api.github.com/repos/auth0/wp-auth0/pulls/488","id":195976834,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1OTc2ODM0","html_url":"https://github.com/auth0/wp-auth0/pull/488","diff_url":"https://github.com/auth0/wp-auth0/pull/488.diff","patch_url":"https://github.com/auth0/wp-auth0/pull/488.patch","issue_url":"https://api.github.com/repos/auth0/wp-auth0/issues/488","number":488,"state":"open","locked":false,"title":"Add env settings support","user":{"login":"joshcanhelp","id":855223,"node_id":"MDQ6VXNlcjg1NTIyMw==","avatar_url":"https://avatars2.githubusercontent.com/u/855223?v=4","gravatar_id":"","url":"https://api.github.com/users/joshcanhelp","html_url":"https://github.com/joshcanhelp","followers_url":"https://api.github.com/users/joshcanhelp/followers","following_url":"https://api.github.com/users/joshcanhelp/following{/other_user}","gists_url":"https://api.github.com/users/joshcanhelp/gists{/gist_id}","starred_url":"https://api.github.com/users/joshcanhelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshcanhelp/subscriptions","organizations_url":"https://api.github.com/users/joshcanhelp/orgs","repos_url":"https://api.github.com/users/joshcanhelp/repos","events_url":"https://api.github.com/users/joshcanhelp/events{/privacy}","received_events_url":"https://api.github.com/users/joshcanhelp/received_events","type":"User","site_admin":false},"body":"Add support for defining settings in a constant. Closes #480.\r\n\r\nThis will allow for sensitive data like the client secret, API token, and migration token to be stored in constants. The options class now looks for constants of a specific name being defined, like so:\r\n\r\n```\r\n// Storing the client secret in a constant.\r\n// Add to wp-config.php or anywhere before WP_Auth0_Options_Generic is instantiated.\r\n// Constant name is \"AUTH0_ENV_\" + option key in caps.\r\ndefine( 'AUTH0_ENV_CLIENT_SECRET', 'YOUR_CLIENT_SECRET_HERE' );\r\n```\r\n\r\nOnce that it set, `WP_Auth0_Options_Generic::get_options()` will look for values before loading all options. `WP_Auth0_Options_Generic::get()` will pull from this adjusted array. \r\n\r\nThe settings field will change display based on this new value and show the constant being used:\r\n\r\n![screenshot 2018-06-20 08 51 02](https://user-images.githubusercontent.com/855223/41669635-1b334178-7467-11e8-938c-4b3ce3a2f9c8.png)\r\n\r\nSaving the settings page after setting a constant value will delete that value from the options array being saved to the database (important to mention that in upcoming docs).\r\n","created_at":"2018-06-19T22:34:43Z","updated_at":"2018-06-26T17:37:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cb5b818fdadbc73700d71b68deb70a055eb6a623","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":626439262,"node_id":"MDU6TGFiZWw2MjY0MzkyNjI=","url":"https://api.github.com/repos/auth0/wp-auth0/labels/CH:%20Security","name":"CH: Security","color":"5319e7","default":false},{"id":889157989,"node_id":"MDU6TGFiZWw4ODkxNTc5ODk=","url":"https://api.github.com/repos/auth0/wp-auth0/labels/Ready%20for%20Review","name":"Ready for Review","color":"0e8a16","default":false}],"milestone":{"url":"https://api.github.com/repos/auth0/wp-auth0/milestones/17","html_url":"https://github.com/auth0/wp-auth0/milestone/17","labels_url":"https://api.github.com/repos/auth0/wp-auth0/milestones/17/labels","id":3408362,"node_id":"MDk6TWlsZXN0b25lMzQwODM2Mg==","number":17,"title":"v3-Next","description":"","creator":{"login":"joshcanhelp","id":855223,"node_id":"MDQ6VXNlcjg1NTIyMw==","avatar_url":"https://avatars2.githubusercontent.com/u/855223?v=4","gravatar_id":"","url":"https://api.github.com/users/joshcanhelp","html_url":"https://github.com/joshcanhelp","followers_url":"https://api.github.com/users/joshcanhelp/followers","following_url":"https://api.github.com/users/joshcanhelp/following{/other_user}","gists_url":"https://api.github.com/users/joshcanhelp/gists{/gist_id}","starred_url":"https://api.github.com/users/joshcanhelp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joshcanhelp/subscriptions","organizations_url":"https://api.github.com/users/joshcanhelp/orgs","repos_url":"https://api.github.com/users/joshcanhelp/repos","events_url":"https://api.github.com/users/joshcanhelp/events{/privacy}","received_events_url":"https://api.github.com/users/joshcanhelp/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":6,"state":"open","created_at":"2018-06-07T16:22:21Z","updated_at":"2018-06-26T00:41:26Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/auth0/wp-auth0/pulls/488/commits","review_comments_url":"https://api.github.com/repos/auth0/wp-auth0/pulls/488/comments","review_comment_url":"https://api.github.com/repos/auth0/wp-auth0/pulls/comments{/number}","comments_url":"https://api.github.com/repos/auth0/wp-auth0/issues/488/comments","statuses_url":"https://api.github.com/repos/auth0/wp-auth0/statuses/57a9c1f4290bcc29298bc1a0292a39085d543403","head":{"label":"auth0:add-env-settings-support","ref":"add-env-settings-support","sha":"57a9c1f4290bcc29298bc1a0292a39085d543403","user":{"login":"auth0","id":2824157,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4MjQxNTc=","avatar_url":"https://avatars1.githubusercontent.com/u/2824157?v=4","gravatar_id":"","url":"https://api.github.com/users/auth0","html_url":"https://github.com/auth0","followers_url":"https://api.github.com/users/auth0/followers","following_url":"https://api.github.com/users/auth0/following{/other_user}","gists_url":"https://api.github.com/users/auth0/gists{/gist_id}","starred_url":"https://api.github.com/users/auth0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/auth0/subscriptions","organizations_url":"https://api.github.com/users/auth0/orgs","repos_url":"https://api.github.com/users/auth0/repos","events_url":"https://api.github.com/users/auth0/events{/privacy}","received_events_url":"https://api.github.com/users/auth0/received_events","type":"Organization","site_admin":false},"repo":{"id":16893279,"node_id":"MDEwOlJlcG9zaXRvcnkxNjg5MzI3OQ==","name":"wp-auth0","full_name":"auth0/wp-auth0","owner":{"login":"auth0","id":2824157,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4MjQxNTc=","avatar_url":"https://avatars1.githubusercontent.com/u/2824157?v=4","gravatar_id":"","url":"https://api.github.com/users/auth0","html_url":"https://github.com/auth0","followers_url":"https://api.github.com/users/auth0/followers","following_url":"https://api.github.com/users/auth0/following{/other_user}","gists_url":"https://api.github.com/users/auth0/gists{/gist_id}","starred_url":"https://api.github.com/users/auth0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/auth0/subscriptions","organizations_url":"https://api.github.com/users/auth0/orgs","repos_url":"https://api.github.com/users/auth0/repos","events_url":"https://api.github.com/users/auth0/events{/privacy}","received_events_url":"https://api.github.com/users/auth0/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/auth0/wp-auth0","description":"Wordpress Plugin for Auth0","fork":false,"url":"https://api.github.com/repos/auth0/wp-auth0","forks_url":"https://api.github.com/repos/auth0/wp-auth0/forks","keys_url":"https://api.github.com/repos/auth0/wp-auth0/keys{/key_id}","collaborators_url":"https://api.github.com/repos/auth0/wp-auth0/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/auth0/wp-auth0/teams","hooks_url":"https://api.github.com/repos/auth0/wp-auth0/hooks","issue_events_url":"https://api.github.com/repos/auth0/wp-auth0/issues/events{/number}","events_url":"https://api.github.com/repos/auth0/wp-auth0/events","assignees_url":"https://api.github.com/repos/auth0/wp-auth0/assignees{/user}","branches_url":"https://api.github.com/repos/auth0/wp-auth0/branches{/branch}","tags_url":"https://api.github.com/repos/auth0/wp-auth0/tags","blobs_url":"https://api.github.com/repos/auth0/wp-auth0/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/auth0/wp-auth0/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/auth0/wp-auth0/git/refs{/sha}","trees_url":"https://api.github.com/repos/auth0/wp-auth0/git/trees{/sha}","statuses_url":"https://api.github.com/repos/auth0/wp-auth0/statuses/{sha}","languages_url":"https://api.github.com/repos/auth0/wp-auth0/languages","stargazers_url":"https://api.github.com/repos/auth0/wp-auth0/stargazers","contributors_url":"https://api.github.com/repos/auth0/wp-auth0/contributors","subscribers_url":"https://api.github.com/repos/auth0/wp-auth0/subscribers","subscription_url":"https://api.github.com/repos/auth0/wp-auth0/subscription","commits_url":"https://api.github.com/repos/auth0/wp-auth0/commits{/sha}","git_commits_url":"https://api.github.com/repos/auth0/wp-auth0/git/commits{/sha}","comments_url":"https://api.github.com/repos/auth0/wp-auth0/comments{/number}","issue_comment_url":"https://api.github.com/repos/auth0/wp-auth0/issues/comments{/number}","contents_url":"https://api.github.com/repos/auth0/wp-auth0/contents/{+path}","compare_url":"https://api.github.com/repos/auth0/wp-auth0/compare/{base}...{head}","merges_url":"https://api.github.com/repos/auth0/wp-auth0/merges","archive_url":"https://api.github.com/repos/auth0/wp-auth0/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/auth0/wp-auth0/downloads","issues_url":"https://api.github.com/repos/auth0/wp-auth0/issues{/number}","pulls_url":"https://api.github.com/repos/auth0/wp-auth0/pulls{/number}","milestones_url":"https://api.github.com/repos/auth0/wp-auth0/milestones{/number}","notifications_url":"https://api.github.com/repos/auth0/wp-auth0/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/auth0/wp-auth0/labels{/name}","releases_url":"https://api.github.com/repos/auth0/wp-auth0/releases{/id}","deployments_url":"https://api.github.com/repos/auth0/wp-auth0/deployments","created_at":"2014-02-16T20:20:08Z","updated_at":"2018-06-07T17:16:57Z","pushed_at":"2018-06-26T00:41:26Z","git_url":"git://github.com/auth0/wp-auth0.git","ssh_url":"git@github.com:auth0/wp-auth0.git","clone_url":"https://github.com/auth0/wp-auth0.git","svn_url":"https://github.com/auth0/wp-auth0","homepage":"https://auth0.com/wordpress","size":8185,"stargazers_count":67,"watchers_count":67,"language":"PHP","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":53,"mirror_url":null,"archived":false,"open_issues_count":21,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":53,"open_issues":21,"watchers":67,"default_branch":"master"}},"base":{"label":"auth0:dev","ref":"dev","sha":"4d8c4c551495d00afa3bce120eca677b1b8f1e5b","user":{"login":"auth0","id":2824157,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4MjQxNTc=","avatar_url":"https://avatars1.githubusercontent.com/u/2824157?v=4","gravatar_id":"","url":"https://api.github.com/users/auth0","html_url":"https://github.com/auth0","followers_url":"https://api.github.com/users/auth0/followers","following_url":"https://api.github.com/users/auth0/following{/other_user}","gists_url":"https://api.github.com/users/auth0/gists{/gist_id}","starred_url":"https://api.github.com/users/auth0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/auth0/subscriptions","organizations_url":"https://api.github.com/users/auth0/orgs","repos_url":"https://api.github.com/users/auth0/repos","events_url":"https://api.github.com/users/auth0/events{/privacy}","received_events_url":"https://api.github.com/users/auth0/received_events","type":"Organization","site_admin":false},"repo":{"id":16893279,"node_id":"MDEwOlJlcG9zaXRvcnkxNjg5MzI3OQ==","name":"wp-auth0","full_name":"auth0/wp-auth0","owner":{"login":"auth0","id":2824157,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI4MjQxNTc=","avatar_url":"https://avatars1.githubusercontent.com/u/2824157?v=4","gravatar_id":"","url":"https://api.github.com/users/auth0","html_url":"https://github.com/auth0","followers_url":"https://api.github.com/users/auth0/followers","following_url":"https://api.github.com/users/auth0/following{/other_user}","gists_url":"https://api.github.com/users/auth0/gists{/gist_id}","starred_url":"https://api.github.com/users/auth0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/auth0/subscriptions","organizations_url":"https://api.github.com/users/auth0/orgs","repos_url":"https://api.github.com/users/auth0/repos","events_url":"https://api.github.com/users/auth0/events{/privacy}","received_events_url":"https://api.github.com/users/auth0/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/auth0/wp-auth0","description":"Wordpress Plugin for Auth0","fork":false,"url":"https://api.github.com/repos/auth0/wp-auth0","forks_url":"https://api.github.com/repos/auth0/wp-auth0/forks","keys_url":"https://api.github.com/repos/auth0/wp-auth0/keys{/key_id}","collaborators_url":"https://api.github.com/repos/auth0/wp-auth0/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/auth0/wp-auth0/teams","hooks_url":"https://api.github.com/repos/auth0/wp-auth0/hooks","issue_events_url":"https://api.github.com/repos/auth0/wp-auth0/issues/events{/number}","events_url":"https://api.github.com/repos/auth0/wp-auth0/events","assignees_url":"https://api.github.com/repos/auth0/wp-auth0/assignees{/user}","branches_url":"https://api.github.com/repos/auth0/wp-auth0/branches{/branch}","tags_url":"https://api.github.com/repos/auth0/wp-auth0/tags","blobs_url":"https://api.github.com/repos/auth0/wp-auth0/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/auth0/wp-auth0/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/auth0/wp-auth0/git/refs{/sha}","trees_url":"https://api.github.com/repos/auth0/wp-auth0/git/trees{/sha}","statuses_url":"https://api.github.com/repos/auth0/wp-auth0/statuses/{sha}","languages_url":"https://api.github.com/repos/auth0/wp-auth0/languages","stargazers_url":"https://api.github.com/repos/auth0/wp-auth0/stargazers","contributors_url":"https://api.github.com/repos/auth0/wp-auth0/contributors","subscribers_url":"https://api.github.com/repos/auth0/wp-auth0/subscribers","subscription_url":"https://api.github.com/repos/auth0/wp-auth0/subscription","commits_url":"https://api.github.com/repos/auth0/wp-auth0/commits{/sha}","git_commits_url":"https://api.github.com/repos/auth0/wp-auth0/git/commits{/sha}","comments_url":"https://api.github.com/repos/auth0/wp-auth0/comments{/number}","issue_comment_url":"https://api.github.com/repos/auth0/wp-auth0/issues/comments{/number}","contents_url":"https://api.github.com/repos/auth0/wp-auth0/contents/{+path}","compare_url":"https://api.github.com/repos/auth0/wp-auth0/compare/{base}...{head}","merges_url":"https://api.github.com/repos/auth0/wp-auth0/merges","archive_url":"https://api.github.com/repos/auth0/wp-auth0/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/auth0/wp-auth0/downloads","issues_url":"https://api.github.com/repos/auth0/wp-auth0/issues{/number}","pulls_url":"https://api.github.com/repos/auth0/wp-auth0/pulls{/number}","milestones_url":"https://api.github.com/repos/auth0/wp-auth0/milestones{/number}","notifications_url":"https://api.github.com/repos/auth0/wp-auth0/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/auth0/wp-auth0/labels{/name}","releases_url":"https://api.github.com/repos/auth0/wp-auth0/releases{/id}","deployments_url":"https://api.github.com/repos/auth0/wp-auth0/deployments","created_at":"2014-02-16T20:20:08Z","updated_at":"2018-06-07T17:16:57Z","pushed_at":"2018-06-26T00:41:26Z","git_url":"git://github.com/auth0/wp-auth0.git","ssh_url":"git@github.com:auth0/wp-auth0.git","clone_url":"https://github.com/auth0/wp-auth0.git","svn_url":"https://github.com/auth0/wp-auth0","homepage":"https://auth0.com/wordpress","size":8185,"stargazers_count":67,"watchers_count":67,"language":"PHP","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":53,"mirror_url":null,"archived":false,"open_issues_count":21,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":53,"open_issues":21,"watchers":67,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/auth0/wp-auth0/pulls/488"},"html":{"href":"https://github.com/auth0/wp-auth0/pull/488"},"issue":{"href":"https://api.github.com/repos/auth0/wp-auth0/issues/488"},"comments":{"href":"https://api.github.com/repos/auth0/wp-auth0/issues/488/comments"},"review_comments":{"href":"https://api.github.com/repos/auth0/wp-auth0/pulls/488/comments"},"review_comment":{"href":"https://api.github.com/repos/auth0/wp-auth0/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/auth0/wp-auth0/pulls/488/commits"},"statuses":{"href":"https://api.github.com/repos/auth0/wp-auth0/statuses/57a9c1f4290bcc29298bc1a0292a39085d543403"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"lbalmaceda"}}