{"action":"created","issue":{"url":"https://api.github.com/repos/hapijs/basic/issues/15","repository_url":"https://api.github.com/repos/hapijs/basic","labels_url":"https://api.github.com/repos/hapijs/basic/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/hapijs/basic/issues/15/comments","events_url":"https://api.github.com/repos/hapijs/basic/issues/15/events","html_url":"https://github.com/hapijs/basic/issues/15","id":42066562,"node_id":"MDU6SXNzdWU0MjA2NjU2Mg==","number":15,"title":"Testing basic auth's validate function with lab","user":{"login":"kontza","id":2431112,"node_id":"MDQ6VXNlcjI0MzExMTI=","avatar_url":"https://avatars2.githubusercontent.com/u/2431112?v=4","gravatar_id":"","url":"https://api.github.com/users/kontza","html_url":"https://github.com/kontza","followers_url":"https://api.github.com/users/kontza/followers","following_url":"https://api.github.com/users/kontza/following{/other_user}","gists_url":"https://api.github.com/users/kontza/gists{/gist_id}","starred_url":"https://api.github.com/users/kontza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kontza/subscriptions","organizations_url":"https://api.github.com/users/kontza/orgs","repos_url":"https://api.github.com/users/kontza/repos","events_url":"https://api.github.com/users/kontza/events{/privacy}","received_events_url":"https://api.github.com/users/kontza/received_events","type":"User","site_admin":false},"labels":[{"id":87540908,"node_id":"MDU6TGFiZWw4NzU0MDkwOA==","url":"https://api.github.com/repos/hapijs/basic/labels/non%20issue","name":"non issue","color":"c7def8","default":false,"description":"Issue is not a problem or requires changes"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2014-09-05T16:49:47Z","updated_at":"2020-01-09T02:08:42Z","closed_at":"2014-09-06T07:16:37Z","author_association":"NONE","body":"Hi,\n\nI'm trying to run tests on my basic auth validate-function. How can I perform that? My setup is as follows: the validator-function is defined as a plugin and it does the following to register things:\n\n``` javascript\n        server.pack.register(require('hapi-auth-basic'), function (err) {\n            if (err) {\n                throw \"Basic-auth registration failed: \" + JSON.stringify(err);\n            } else {\n                server.auth.strategy('gatekeeper', 'basic', {\n                    validateFunc: validate\n                });\n                server.auth[\"default\"]('gatekeeper');\n            }\n        });\n```\n\nThe problem currently is such that when I setup a server in my test module, and load the gatekeeper-plugin there, it seems as if it is not called. Here's the calling part:\n\n``` javascript\n    lab.test(\"login with real credentials, no AD\", function (done) {\n        server.inject({\n            url: url.format(urlObj),\n            credentials: {\n                password: 'XXX',\n                username: 'YYY'\n            }\n        }, function (res) {\n            console.error(\"RES: %j\", res);\n            Lab.expect(res.statusCode).to.equal(200);\n            done();\n        });\n    });\n```\n\nRES-printout's last property is `strategy: \"bypass\"`. Where does that come from? How can I force my gatekeeper-strategy to be used?\n"},"comment":{"url":"https://api.github.com/repos/hapijs/basic/issues/comments/572347831","html_url":"https://github.com/hapijs/basic/issues/15#issuecomment-572347831","issue_url":"https://api.github.com/repos/hapijs/basic/issues/15","id":572347831,"node_id":"MDEyOklzc3VlQ29tbWVudDU3MjM0NzgzMQ==","user":{"login":"lock[bot]","id":33595554,"node_id":"MDM6Qm90MzM1OTU1NTQ=","avatar_url":"https://avatars1.githubusercontent.com/in/6672?v=4","gravatar_id":"","url":"https://api.github.com/users/lock%5Bbot%5D","html_url":"https://github.com/apps/lock","followers_url":"https://api.github.com/users/lock%5Bbot%5D/followers","following_url":"https://api.github.com/users/lock%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/lock%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/lock%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lock%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/lock%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/lock%5Bbot%5D/repos","events_url":"https://api.github.com/users/lock%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/lock%5Bbot%5D/received_events","type":"Bot","site_admin":false},"created_at":"2020-01-09T02:08:42Z","updated_at":"2020-01-09T02:08:42Z","author_association":"NONE","body":"This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions."}}
{"actor":{"display_login":"lock"}}