-
Notifications
You must be signed in to change notification settings - Fork 28
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
[HERMES-5354] Add userScopes
to ISlackManifestShared
#189
base: main
Are you sure you want to change the base?
Conversation
@@ -60,26 +60,26 @@ export interface ISlackManifestRemote extends ISlackManifestShared { | |||
socketModeEnabled?: boolean; | |||
tokenRotationEnabled?: boolean; | |||
appDirectory?: ManifestAppDirectorySchema; | |||
userScopes?: Array<string>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer needed here since we're moving it up to the shared interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a couple of questions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good changes 💯 just had one query
true, | ||
); | ||
}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this file defines botScopes: []
in many tests 🤔
Should we also define userScopes:[]
in those tests as well @filmaj ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like for the tests to use definition
variables that reflect how end-users would craft their own manifest definitions. In my own experience creating manifest definitions, I would omit the property altogether if I'm not using it. However, devs do the darndest things! I think we should guard against common JS-y/TS-y pitfalls such as what counts as truthy vs. falsy, like empty arrays and empty strings. Therefore, I would recommend the Manifest()
constructor clean user-provided definitions up into a state that the Slack manifest APIs expect as a baseline.
Codecov Report
@@ Coverage Diff @@
## main #189 +/- ##
=======================================
Coverage 99.23% 99.23%
=======================================
Files 55 55
Lines 2084 2084
Branches 115 115
=======================================
Hits 2068 2068
Misses 15 15
Partials 1 1
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
src/manifest/mod.ts
Outdated
manifest.oauth_config.token_management_enabled = false; | ||
// Oauth Config | ||
// Run On Slack manage their own tokens | ||
// if and only if at least one user scope is included in the manifest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand this-- Adding scopes in the manifest should not require apps to use token management, right? In general I don't think any ROSI apps needs token management, right? Having token management enabled would mean the app needs to provide an oauth token server, which ROSI apps cannot do. Is there an issue we're trying to solve with this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jpbrabec - This was also something I'm also unsure about, so thanks for weighing in.
Adding scopes in the manifest should not require apps to use token management.
I get this error when adding user scopes to the manifest and leaving token_management_enabled: false:
Is this error expected?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that's for user scopes specifically (not bot scopes). Hermes apps do not support user scopes at all right now, so this error is basically here to say "You can't be a hermes ROSI app and use user scopes at the same time". We can chat in slack about future plans for this area.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jpbrabec are you open to me changing the error to be able to bypass it if Hermes User Delegated Auth Houston FF is in place
Summary
Adds the
userScopes
property to the ISlackManifestShared interface.Ask from BE folks to enable authoring app manifest that use built-ins with user-delegated auth.
Context thread
Changes:
userScopes
property to theISlackManifestShared
interface and sets the value on Manifest if not emptytoken_management_enabled
defaulted to false on behalf of the developer. But in the case where user scopes are requested, the backend requirestoken_management_enabled
to be set totrue
. So I have modified the SDK behavior to default to setting the value to true only when there's at least one user scope defined.Requirements (place an
x
in each[ ]
)