Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is no way to pre-load user/role list other than admin #56

Open
benzvan opened this issue Oct 12, 2017 · 7 comments
Open

There is no way to pre-load user/role list other than admin #56

benzvan opened this issue Oct 12, 2017 · 7 comments

Comments

@benzvan
Copy link

benzvan commented Oct 12, 2017

I would like a way to pre-load/bulk-load user roles at build/deploy time via an environment variable.

Example

HUBOT_AUTH_ROLES="role1:user1,user2,user3;role2:user1,user2,user3"

This could be handled similarly to the HUBOT_ADMIN_USERS environment variable.

Happy to do a PR for this. Happy to take input on variable format and separators.

@chaselee
Copy link

chaselee commented Oct 12, 2017

This was actually added in #32. BUT from what I can tell it's not working. You look on master now and this code is gone. You look in the latest release tag, and it's not there either. If we can get this situation sorted out, this issue will be resolved.

@benzvan
Copy link
Author

benzvan commented Oct 12, 2017

I could re-create #32 and resubmit it...

@chaselee
Copy link

Might want to ping one of the maintainers first, but it couldn't hurt.

@ShipraShalini
Copy link

Has this been implemented? I am looking for something like this for my project.

@benzvan
Copy link
Author

benzvan commented Oct 14, 2019

I don't think so. I ran into technical problems re-creating #32.

I ended up writing my own local auth plugin that reads a json file to populate its own user list. I used robot.brain.userForId(slack_id) to create a reference to the slack user ID. I'm only using the hubot-auth plugin for the admin user.

@jtomaszon
Copy link

@benzvan could you please share that code? I’m looking for some auth plugin working with Slack too!
Thank you!

@benzvan
Copy link
Author

benzvan commented Jun 22, 2020

Honestly, I would do it differently if I was starting now. I would use an oauth integration to require users to log into SSO and store their remote information in the on-board user object. That way you know you're using the correct mapping. Ideally there would be some shared information about that user, like email address, that hubot would use to verify the oauth response matches the user.

Here's a rough idea of how I implemented an internal data map between one external system's IDs and slack's IDs. https://gist.github.com/benzvan/580fffd7aea7963e99e5da3f925fd952

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants