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

Working on behalf of users in workspace apps #608

Closed
aoberoi opened this issue Aug 9, 2018 · 5 comments
Closed

Working on behalf of users in workspace apps #608

aoberoi opened this issue Aug 9, 2018 · 5 comments

Comments

@aoberoi
Copy link
Member

@aoberoi aoberoi commented Aug 9, 2018

Description

Slack's workspace apps now support invoking methods on behalf of a specified user.

The WebClient class needs to implement support for this new style of calling methods. The following is a proposal for changes to the API for that purpose.

  1. Define a new ActorEnabled interface which defines an optional property actor?: string.
  2. Intersect all method argument types for methods that support this feature with ActorEnabled.
  3. In the implementation of WebClient#apiCall(), detect the presence of an options.actor property, and when present use the value in request header X-Slack-User.

Open questions:

  • Can we think of a better name than actor? One constraint is that we don't want to use a name that might otherwise be used, or used in the future, as a method argument name. It also should communicate that the app is acting on behalf of this user. actor is mostly okay, but it isn't perfect because truly the app is the actor, and its acting as the user. So perhaps actingAs?

Requirements (place an x in each of the [ ])

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.
@aoberoi aoberoi added the enhancement label Aug 9, 2018
@aoberoi aoberoi changed the title Working on behalf of user in workspace apps Working on behalf of users in workspace apps Aug 9, 2018
@moffatethan
Copy link
Contributor

@moffatethan moffatethan commented Aug 9, 2018

actingAs seems good. I can't think of any other name to use 👍

aoberoi added a commit to aoberoi/node-slack-sdk that referenced this issue Aug 9, 2018
@aoberoi aoberoi mentioned this issue Aug 9, 2018
2 of 2 tasks complete
@aoberoi
Copy link
Member Author

@aoberoi aoberoi commented Aug 9, 2018

thanks for the feedback @jd0920

I've got an implementation in #609 that uses actor. I'll hold out on merging to leave time for additional feedback regarding the name.

@shaydewael
Copy link
Contributor

@shaydewael shaydewael commented Aug 9, 2018

Though it's a little bit of a longer name, maybe impersonate could be an alternative? I think it more clearly connotes what is taking place inside of the app.

@Roach
Copy link
Member

@Roach Roach commented Aug 9, 2018

I vote for on_behalf_of 😎

@aoberoi
Copy link
Member Author

@aoberoi aoberoi commented Aug 9, 2018

I think impersonate isn't going to work for us. It has a potentially negative connotation, and its often in reference to how apps can masquerade as a user when calling chat.postMessage. notably, chat.postMessage is not one of the methods that supports this feature. I don't think @shanedewael is as strongly in favor of this choice anymore either.

at this point, i'm also leaning towards on_behalf_of because it would be most closely aligned to the terminology in the api.slack.com documentation.

i know this is a short timeline, but i'd like to get this feature (and many more sitting on master) released today. so i'll wait a few more hours before moving forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.