Skip to content

Fix #158 by adding token_verification_enabled option to App - #180

Merged
seratch merged 1 commit into
slackapi:mainfrom
seratch:issue-158-token_verification_enabled
Dec 18, 2020
Merged

seratch merged 1 commit into
slackapi:mainfrom
seratch:issue-158-token_verification_enabled

Conversation

@seratch

@seratch seratch commented Dec 18, 2020 •

Copy link
Copy Markdown
Contributor

This pull request adds a new option token_verification_enabled: bool to App constructor arguments. The default value of this option is True. If it's True, Bolt performs auth.test API call when instantiating an App instance. If False, the initial call will be postponed until the first execution of the single team authorization middleware. Regardless of the timing of the initial call, the API response is cached as before.

Due to the compatibility with async/await nature in Python, AsyncApp does not verify a given token when creating a new AsyncApp instance. Thus, this pull request does not apply any changes to AsyncApp.

Fixes #158

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
  • Document pages under /docs
  • Others

Requirements (place an x in each [ ])

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

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've run ./scripts/install_all_and_run_tests.sh after making the changes.

@seratch seratch added this to the 1.1.4 milestone Dec 18, 2020
@seratch seratch self-assigned this Dec 18, 2020
@codecov

codecov Bot commented Dec 18, 2020

Copy link
Copy Markdown

Codecov Report

Merging #180 (1d99150) into main (8efa2ba) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #180   +/-   ##
=======================================
  Coverage   91.76%   91.77%           
=======================================
  Files         149      149           
  Lines        4446     4448    +2     
=======================================
+ Hits         4080     4082    +2     
  Misses        366      366           
Impacted Files Coverage Δ
slack_bolt/app/app.py 86.96% <100.00%> (+0.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8efa2ba...1d99150. Read the comment docs.

@mwbrooks mwbrooks left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Looks good to me.

Should we also add this to Bolt for JavaScript and Java to keep feature parity?

@seratch

seratch commented Dec 18, 2020

Copy link
Copy Markdown
Contributor Author

Should we also add this to Bolt for JavaScript and Java to keep feature parity?

@mwbrooks yes, let's do this 👍

@seratch
seratch merged commit edd9279 into slackapi:main Dec 18, 2020
@seratch
seratch deleted the issue-158-token_verification_enabled branch December 18, 2020 23:49
@mwbrooks

Copy link
Copy Markdown
Member

@seratch created an issue to track the work for Bolt JS - slackapi/bolt-js#718

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow disabling of token auth test

2 participants