node-tasks-app icon indicating copy to clipboard operation
node-tasks-app copied to clipboard

[FEATURE] Org-aware app

Open colmdoyle opened this issue 4 years ago • 4 comments

Description

As a Developer

I want to Make my app aware of Slack Enterprise Grid

So that I can Deploy it across my whole organisation

Languages

This feature is now implemented in:

  • [x] #44
  • [ ] #45
  • [x] #46

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.

colmdoyle avatar Jun 09 '21 11:06 colmdoyle

I'm thinking about skipping regular OAuth and going direct to an Organisation wide install, since I believe the code would be able to support both a Grid install and a single workspace install on a single code path.

We've probably got two options in terms of table structure. A pair of tables - installations and tokens with a relationship, or just a single table that keeps it all to a single row, keyed off enterprise_id.

Any suggestions on the better approach @seratch @stevengill ?

colmdoyle avatar Jul 06 '21 10:07 colmdoyle

My comments in the past may be helpful for thinking about the database table design.

  • https://github.com/slackapi/node-slack-sdk/pull/1272#issuecomment-864303143
  • https://github.com/slackapi/node-slack-sdk/pull/1279#discussion_r662712482
  • https://github.com/slackapi/node-slack-sdk/issues/1122

In a nutshell,

  • If we operate the app in production, all the installation history should be kept
    • For easier troubleshooting and system operations
    • For storing all the incoming webhook URLs (and other properties)
  • Even after revoking all the user installations, bot token must still exist
    • This is one of the major improvements in GBP
    • Python / Java SDK have bots table for this purpose

It's fine to have a bit different table design in this app but the above points should be taken in consideration.

seratch avatar Jul 06 '21 12:07 seratch

Those are great thanks.

I think we should develop this app with the assumption it would be deployed to production, so I'll go with your suggestions.

colmdoyle avatar Jul 06 '21 12:07 colmdoyle

Of course, if we considered this as an app to be deployed only on a single grid / workspace, then we could upgrade all the various call sites to pass team_id, store the org level token as a environment variable, then forgo any extra tables at all right?

colmdoyle avatar Jul 06 '21 14:07 colmdoyle