Skip to content

feat: add bot_optional and user_optional scopes to app manifest#517

Open
mwbrooks wants to merge 1 commit intomainfrom
mwbrooks-manifest-user-bot-optional-scopes
Open

feat: add bot_optional and user_optional scopes to app manifest#517
mwbrooks wants to merge 1 commit intomainfrom
mwbrooks-manifest-user-bot-optional-scopes

Conversation

@mwbrooks
Copy link
Copy Markdown
Member

@mwbrooks mwbrooks commented Apr 30, 2026

Changelog

Add support for optional OAuth scopes (bot_optional and user_optional) in the app manifest schema.

Summary

This pull request adds two new optional properties to the manifest schema: oauth_config.scopes.bot_optional and oauth_config.scopes.user_optional. These allow apps to declare optional OAuth scopes for both bot and user tokens.

Notes

  • The new fields use omitempty, so they are fully backwards-compatible and only serialized when set.
  • We may need to update the developerInstall endpoint to accept the optional scopes. We can investigate this next.

Testing

# Create a Starter App
$ ./bin/slack create my-app -t https://github.com/slack-samples/bolt-js-starter-template
$ cd my-app/

# Add optional scopes
$ vim manifest.json
# Replace "oauth_config: { .... }" with:
    "oauth_config": {
        "scopes": {
            "user": [
                "search:read.public",
                "search:read.private",
                "search:read.mpim",
                "search:read.im",
                "search:read.files",
                "search:read.users",
                "chat:write",
                "channels:history",
                "groups:history",
                "mpim:history",
                "im:history",
                "canvases:read",
                "canvases:write",
                "users:read",
                "users:read.email",
                "reactions:write"
            ],
            "user_optional": [
                "search:read.private",
                "search:read.mpim",
                "search:read.im",
                "search:read.files",
                "chat:write",
                "groups:history",
                "mpim:history",
                "im:history",
                "canvases:read",
                "canvases:write"
            ],
            "bot": [
                "app_mentions:read",
                "assistant:write",
                "im:history",
                "channels:history",
                "chat:write",
                "commands"
            ],
            "bot_optional": [
                "canvases:read"
            ]
        }
    },
# Confirm production CLI is missing optional scopes
$ lack-prod manifest info --source local
# → Confirm no `user_optional` or `bot_optional` scopes

# Confirm new CLI includes the optional scopes
$ ../bin/slack manifest info --source local

# Confirm new CLI installs the app
$ ../bin/slack run

# Cleanup
$ lack delete -f

Requirements

Support optional OAuth scopes for both bot and user tokens in the
manifest schema via `oauth_config.scopes.bot_optional` and
`oauth_config.scopes.user_optional` properties.
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 30, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.27%. Comparing base (783ac1a) to head (0e5c9b3).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #517      +/-   ##
==========================================
+ Coverage   71.25%   71.27%   +0.02%     
==========================================
  Files         222      222              
  Lines       18682    18682              
==========================================
+ Hits        13311    13316       +5     
+ Misses       4190     4187       -3     
+ Partials     1181     1179       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mwbrooks mwbrooks self-assigned this Apr 30, 2026
@mwbrooks mwbrooks added enhancement M-T: A feature request for new functionality changelog Use on updates to be included in the release notes semver:minor Use on pull requests to describe the release version increment labels Apr 30, 2026
@mwbrooks mwbrooks added this to the Next Release milestone Apr 30, 2026
@mwbrooks mwbrooks marked this pull request as ready for review April 30, 2026 19:27
@mwbrooks mwbrooks requested a review from a team as a code owner April 30, 2026 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog Use on updates to be included in the release notes enhancement M-T: A feature request for new functionality semver:minor Use on pull requests to describe the release version increment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant