Open lwhitworth opened 8 years ago
Sorry @lwhitworth, I'm not currently using this, so am not the best person to respond.
Might be worth poking around the issue queue or the git-blame logs and see who's actively using this, and perhaps @-mention them in this issue.
Also, I've been told hubot middleware might be the future of auth scripts, so might be worth investigating this: https://github.com/therealklanni/hubot-auth-middleware
I can reproduce the error, but not the scenario.
@lwhitworth you're using the campfire adapter, correct?
Nope I'm using the rocket chat adapter
On 13 Jul 2016, at 18:06, Ceci Woodward notifications@github.com wrote:
I can reproduce the error, but not the scenario.
@lwhitworth you're using the campfire adapter, correct?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
@patcon what do you mean by it being the future of auth-scripts? The project you linked hasn't been updated in 2 yrs! https://github.com/therealklanni/hubot-auth-middleware
It seems I got very similar issue. My intention is to use Hubot as AWS controller. Locally on my PC it works (hubot ec2 ls gave me correct answer), I think it's because I got my env variables set manually (export HUBOT_AWS_ACCESS_KEY_ID and others). When I try to call the very same command via Slack (Hubot being hosted on Heroku), I receive error "DescribeInstancesError: ConfigError: Missing region in config". I googled, that "hubot auth" might be the culprit, as AWS-SDK was unable to retreive env vars (but I'm only guessing).
hubot what roles does Shell have
ERROR TypeError: Cannot read property 'length' of undefined
at TextListener.callback (/home/nexus/IdeaProjects/autobot/node_modules/hubot-auth/src/auth.coffee:136:17, <js>:177:20)
at executeListener (/home/nexus/IdeaProjects/autobot/node_modules/hubot/src/listener.coffee:65:11, <js>:53:19)
at allDone (/home/nexus/IdeaProjects/autobot/node_modules/hubot/src/middleware.coffee:44:37, <js>:34:16)
at /home/nexus/IdeaProjects/autobot/node_modules/async/lib/async.js:274:13
at Object.async.eachSeries (/home/nexus/IdeaProjects/autobot/node_modules/async/lib/async.js:142:20)
at Object.async.reduce (/home/nexus/IdeaProjects/autobot/node_modules/async/lib/async.js:268:15)
at /home/nexus/IdeaProjects/autobot/node_modules/hubot/src/middleware.coffee:49:7, <js>:37:22
at nextTickCallbackWith0Args (node.js:420:9)
at process._tickCallback (node.js:349:13)
Frankly speaking, I guess I got incorrectly set HUBOT_AUTH_ROLES - I'm actually not sure, what exactly should I type in. Anyway, it seems to be not related to error message above, or is it?
Any help appreciated!
@lwhitworth Can you verify if this is still an issue with the latest version of hubot-auth
?
Frankly speaking, I have solved my issue (it was not your auth module after all) elsewhere - now it seems to work :).
If I need to open a new Issue, I can, but I am now having issues with auth working as far as matching. This only just started after upgrading to the latest version. The commands work fine. I can check who has roles, I can add/remove roles as an admin.
But in my scripts the check for the user's role is not working:
if robot.auth.hasRole(msg.envelope.user, 'dev')
I'm using the Slack adapter, and I'm out of ideas other than just rolling back to previous versions again.
@Soulfire86 try retrieving the user by Id from brain, I don't think the envelope user has any roles. So get the userById using the I'd of the envelope user
@sebastiandero Yep! Actually just figured that out a few minutes ago. The userRoles(user) function used to handle this itself, but I see now it's since been changed. Know if there's a reason why it shouldn't just handle this for us?
Because if we're needing to retrieve the user from the brain now, the documentation is incorrect. The notes say to pass in the envelope user.
@Soulfire86 That would be a great (re)addition for sure! I do not know the reason and cant come up with one tbh.. Glad everything works now
Having a few issues (aplogies if I'm just being stupid):
When I run "what roles do I have" hubot returns nothing, debug looks like:
Additionally despite having set the env variable:
Running "list assigned roles" returns:
@bob Sorry, only admins can list assigned roles.
Any tips on what might be occuring?