hubot-archive / hubot-auth

Assign roles to users and restrict command access in other scripts
149 stars 54 forks source link

hubot auth no longer works after upgrading "hubot-slack": "^4.0.0", #42

Closed nsturnitin closed 7 years ago

nsturnitin commented 7 years ago

Something changed and our hubot-auth logic no longer works.

eve deploy b78e275f9821a58e6249757faf3019f9274362c4 to production

Sorry, (user1) hasn't been added to the 'prod_deploy' role An administrator has to approve you for this role using: eve user1 has prod_deploy role

eve who has prod_deploy role

@user1 The following people have the 'prod_deploy' role: user1, user2, user3

Here is the code I'm using in my script to evaluate if the user has a specific role:

if !robot.auth.hasRole(res.envelope.user, 'prod_deploy')
        res.send "Sorry, (#{res.message.user.name}) hasn't been added to the 'prod_deploy' role"
        res.send "An administrator has to approve you for this role using: eve #{res.message.user.name} has prod_deploy role"
        return

What am I doing wrong? Can someone please help, this is awfully frustrating to experience during a release.

nsturnitin commented 7 years ago

@ceci-woodward can you please take a look at this? It's a production script and I really need to get it working asap. I can share my entire script if that may help, or maybe my hubot package.json has outdated. This happened after we updated slack-hubot.

nsturnitin commented 7 years ago

{ "name": "eve", "version": "0.0.1", "private": true, "author": "nskitch@turnitin.com", "description": "ev teams hubot", "dependencies": { "bart": "0.0.3", "chrono-node": "^1.2.1", "forever": "^0.15.2", "hubot": "^2.19.0", "hubot-auth": "^1.3.0", "hubot-bart": "^1.0.6", "hubot-cron": "^0.2.9", "hubot-diagnostics": "0.0.1", "hubot-help": "^0.2.0", "hubot-jenkins": "^1.0.2", "hubot-redis-brain": "0.0.3", "hubot-rules": "^0.1.1", "hubot-slack": "^4.0.0", "lodash": "^4.6.1", "sha1-regex": "^1.0.0" }, "engines": { "node": "0.10.x" }

cecilia-sanare commented 7 years ago

I'm guessing this is partially related to #37 and #36.

My suggestion would be to revert hubot-auth to version v1.2.0 and slack to v3.4.2 until #37, #36, and slackhq/hubot-slack#326 are resolved

As a side note, I don't have write-access to this repository. So realistically all I can do is submit PRs like everyone else.

Soulfire86 commented 7 years ago

+1

cecilia-sanare commented 7 years ago

I'll try to look into this sometime this week, although I don't really know what can be accomplished since it seems that slack heavily modified their hubot-slack api regarding users.

nsturnitin commented 7 years ago

thanks Cecilia, could you let them know what you find? I eventually had to downgrade my slackapi version and everything was back to normal. However, I needed the new slackapi to overcome frequent disconnects.

On Thu, Aug 18, 2016 at 7:17 AM, Cecilia Woodward notifications@github.com wrote:

I'll try to look into this sometime this week, although I don't really know what can be accomplished since it seems that slack heavily modified their hubot-slack api regarding users.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/hubot-scripts/hubot-auth/issues/42#issuecomment-240736766, or mute the thread https://github.com/notifications/unsubscribe-auth/AMgIe6WYIqSHVaMMehVrL2KAo25L2KQqks5qhGmNgaJpZM4Ja22I .

comnam90 commented 7 years ago

https://github.com/slackapi/hubot-slack/commit/1585a319d6eaccc173d173fa9240f272b2364c0d

sebastiandero commented 7 years ago

@comnam90 https://github.com/slackapi/hubot-slack/pull/381 Fixed all the issues, is merged in 4.2.1

cecilia-sanare commented 7 years ago

Verified that this has been resolved.

Closing.