Skip to content

Add authorize function support #98

Description

@seratch

The authorize function that is available in Bolt JS is not yet supported in Bolt for Python.

# these arguments should be injected in correspondence with their names
# also, the Bolt framework provides `args` as a single value as with middleware/listeners
def authorize(enterprise_id, team_id, user_id):
    return {
        "bot_id": "B111",
        "bot_user_id": "W111",
        "bot_token": "xoxb-"
    }

app = App(
    signing_secret: os.environ["SLACK_SIGNING_SECRET"],
    authorize: authorize
)

For most use cases, probably, developers prefer using installation_store. That being said if a developer would like to implement a simple but more flexible way to fetch installation data, going with the authorize function can be a handy way.

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

  • slack_bolt.App and/or its core components
  • slack_bolt.async_app.AsyncApp and/or its core components
  • Adapters in slack_bolt.adapter
  • Others

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions