{"action":"opened","issue":{"url":"https://api.github.com/repos/mongodb-js/kerberos/issues/91","repository_url":"https://api.github.com/repos/mongodb-js/kerberos","labels_url":"https://api.github.com/repos/mongodb-js/kerberos/issues/91/labels{/name}","comments_url":"https://api.github.com/repos/mongodb-js/kerberos/issues/91/comments","events_url":"https://api.github.com/repos/mongodb-js/kerberos/issues/91/events","html_url":"https://github.com/mongodb-js/kerberos/issues/91","id":379067100,"node_id":"MDU6SXNzdWUzNzkwNjcxMDA=","number":91,"title":"defaultRealm in checkPassword function is not optional","user":{"login":"velezsarain","id":10710628,"node_id":"MDQ6VXNlcjEwNzEwNjI4","avatar_url":"https://avatars1.githubusercontent.com/u/10710628?v=4","gravatar_id":"","url":"https://api.github.com/users/velezsarain","html_url":"https://github.com/velezsarain","followers_url":"https://api.github.com/users/velezsarain/followers","following_url":"https://api.github.com/users/velezsarain/following{/other_user}","gists_url":"https://api.github.com/users/velezsarain/gists{/gist_id}","starred_url":"https://api.github.com/users/velezsarain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/velezsarain/subscriptions","organizations_url":"https://api.github.com/users/velezsarain/orgs","repos_url":"https://api.github.com/users/velezsarain/repos","events_url":"https://api.github.com/users/velezsarain/events{/privacy}","received_events_url":"https://api.github.com/users/velezsarain/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-09T08:30:41Z","updated_at":"2018-11-09T08:30:41Z","closed_at":null,"author_association":"NONE","body":"The documentation for checkPassword implies that the argument defaultRealm is optional (argument is inside brackets)\r\n```\r\n * @kind function\r\n * @param {string} username The Kerberos user name. If no realm is supplied, then the `defaultRealm` will be used.\r\n * @param {string} password The password for the user.\r\n * @param {string} service The Kerberos service to check access for.\r\n * @param {string} [defaultRealm] The default realm to use if one is not supplied in the user argument.\r\n * @param {function} [callback]\r\n * @return {Promise} returns Promise if no callback passed\r\n```\r\nYet the implementation says otherwise, as defaultRealm is not assigned a default value and the validateParameter function will fail as the defineOperation monkey patcher does not have a special case for the defaultRealm argument (similar to the \"options\" special case)\r\n```\r\nconst checkPassword = defineOperation(kerberos.checkPassword, [\r\n  { name: 'username', type: 'string' },\r\n  { name: 'password', type: 'string' },\r\n  { name: 'service', type: 'string' },\r\n  { name: 'defaultRealm', type: 'string' }\r\n]);\r\n```\r\nEither the documentation is wrong, and defaultRealm should me marked as a required argument, or the implementation is wrong, and defaultRealm should be assigned a default value or have a special case in the defineOperation function."}}
{"actor":{"display_login":"velezsarain"}}