Node-slack-sdk: Working on behalf of users in workspace apps

Created on 9 Aug 2018  路  5Comments  路  Source: slackapi/node-slack-sdk

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 [ ])

  • [x] I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • [x] I've read and agree to the Code of Conduct.
  • [x] I've searched for any related issues and avoided creating a duplicate issue.
enhancement

Most helpful comment

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.

All 5 comments

actingAs seems good. I can't think of any other name to use :+1:

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.

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.

I vote for on_behalf_of 馃槑

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

freder picture freder  路  12Comments

bobrik picture bobrik  路  25Comments

kurisubrooks picture kurisubrooks  路  36Comments

hckhanh picture hckhanh  路  21Comments

mmmulani picture mmmulani  路  10Comments