Skip to content

Commit 3fa8083

Browse files
committed
merge conflicts
2 parents 1cf9d7e + fa37311 commit 3fa8083

113 files changed

Lines changed: 10456 additions & 1533 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ __pycache__/
1212
*~
1313

1414
# virtualenv
15-
env/
15+
env*/
1616
venv/
1717

1818
# codecov / coverage
19-
.coverage
19+
.coverage*
2020
cov_*
2121
coverage.xml
2222

@@ -33,3 +33,4 @@ pip
3333

3434
tmp.txt
3535
.DS_Store
36+
logs/

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
sudo: false
21
dist: xenial
32
language: python
43
python:
54
- "3.6"
65
- "3.7"
6+
- "3.8"
77
install:
88
- python setup.py install
99
script:

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ We've created this [tutorial](/tutorial) to build a basic Slack app in less than
7474

7575
---
7676

77-
Slack provide a Web API that gives you the ability to build applications that interact with Slack in a variety of ways. This Development Kit is a module based wrapper that makes interaction with that API easier. We have a basic example here with some of the more common uses but a full list of the available methods are available [here][api-methods]. More detailed examples can be found in our [Basic Usage](https://slack.dev/python-slackclient/basic_usage.html) guide
77+
Slack provide a Web API that gives you the ability to build applications that interact with Slack in a variety of ways. This Development Kit is a module based wrapper that makes interaction with that API easier. We have a basic example here with some of the more common uses but a full list of the available methods are available [here][api-methods]. More detailed examples can be found in our [Basic Usage](https://slack.dev/python-slackclient/basic_usage.html) guide.
7878

7979
#### Sending a message to Slack
8080

81-
One of the most common use-cases is sending a message to Slack. If you want to send a message as your app, or as a user, this method can do both. In our examples, we specify the channel name, however it is recommended to use the `channel_id` where possible.
81+
One of the most common use-cases is sending a message to Slack. If you want to send a message as your app, or as a user, this method can do both. In our examples, we specify the channel name, however it is recommended to use the `channel_id` where possible. Also, if your app's bot user is not in a channel yet, invite the bot user before running the code snippet (or add `chat:write.public` to Bot Token Scopes for posting in any public channels).
8282

8383
```python
8484
import os

codecov.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
coverage:
2+
status:
3+
project:
4+
default:
5+
threshold: 0.3%
6+
patch:
7+
default:
8+
target: 50%

docs-src/basic_usage.rst

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -178,19 +178,16 @@ Modals use the same blocks that compose messages with the addition of an `input`
178178

179179
.. code-block:: python
180180
181+
# This module is available since v2.6.0rc1
182+
from slack.signature import SignatureVerifier
183+
signature_verifier = SignatureVerifier(os.environ["SLACK_SIGNING_SECRET"])
184+
181185
from flask import Flask, request, make_response
182186
app = Flask(__name__)
183-
signing_secret = os.environ["SLACK_SIGNING_SECRET"]
184187
185188
@app.route("/slack/events", methods=["POST"])
186189
def slack_app():
187-
# Refer to https://github.com/slackapi/python-slack-events-api
188-
# (The Slack Team is going to provide a new package soon)
189-
if not verify_request(
190-
signing_secret=signing_secret,
191-
request_body=request.get_data(),
192-
timestamp=request.headers.get("X-Slack-Request-Timestamp"),
193-
signature=request.headers.get("X-Slack-Signature")):
190+
if not signature_verifier.is_valid_request(request.get_data(), request.headers):
194191
return make_response("invalid request", 403)
195192
196193
if "command" in request.form \

docs-src/changelog.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,29 @@
22
Changelog
33
==============================================
44

5+
v2.6.0rc1 (2020-05-14)
6+
-------------------
7+
8+
Refer to `v2.6.0 milestone <https://github.com/slackapi/python-slackclient/milestone/5>`_ to know the complete list of the issues resolved by this release.
9+
10+
**New Features**
11+
12+
1. [Block Kit] #659 Add complete supports for Block Kit components and fixed a few existing bugs as well (#500 #519 #623 #632 #635 #639 #676) - Thanks @seratch @diurnalist @ruberVulpes @jeremyschulman @e271828- @RodneyU215
13+
2. [Signature] #686 Add slack.signature.SignatureVerifier for request verification - Thanks @seratch
14+
3. [WebClient] #682 Add missing Grid admin APIs (`admin.usergroups.*`, `admin.users.*`, `admin.apps.*`) - Thanks @stevengill @seratch
15+
16+
**Updates**
17+
18+
1. [WebClient][RTMClient] Fixed a bunch of the currency issues this SDK had (#429 #463 #492 #497 #530 #558 #569 #605 #613 #619 #626 #630 #631 #633 #669) - Thanks @seratch @aaguilartablada @aoberoi @stevengill
19+
2. [WebClient] #681 #560 Enable using bool values for request parameters - Thanks @roman-kachanovsky @seratch
20+
3. [WebClient] #661 #678 Improve handling of required "ids" parameters (e.g., channel_ids, users) - Thanks @seratch
21+
4. [WebClient] #680 Add non-conversation API deprecation warnings - Thanks @seratch
22+
5. [WebClient] #671 #670 Enable passing None values for request parameters (they used to result in errors) - Thanks @seratch
23+
6. [WebClient] #673 Fix #672 files.upload fails with a filepath containing multi byte chars - Thanks @yuji38kwmt @seratch
24+
7. [WebClient] #656 Fix #594 preview_image for files.remote.add API method is not properly supported - Thanks @seratch
25+
8. [Maintenance] #618 Add py.typed file to package distribution - Thanks @JKillian
26+
9. [WebClient] #599 Strip token string parameters of whitespace - Thanks @TheFrozenFire
27+
528
v2.5.0 (2019-12-09)
629
-------------------
730
**New Features**

docs/basic_usage.html

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@
162162
</ul>
163163
</li>
164164
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a><ul>
165+
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v2-6-0rc1-2020-05-14">v2.6.0rc1 (2020-05-14)</a></li>
165166
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v2-5-0-2019-12-09">v2.5.0 (2019-12-09)</a></li>
166167
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v2-4-0-2019-11-27">v2.4.0 (2019-11-27)</a></li>
167168
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v2-3-1-2019-10-29">v2.3.1 (2019-10-29)</a></li>
@@ -354,19 +355,16 @@ <h2>Deleting a message<a class="headerlink" href="#deleting-a-message" title="Pe
354355
<h2>Opening a modal<a class="headerlink" href="#opening-a-modal" title="Permalink to this headline"></a></h2>
355356
<p>Modals allow you to collect data from users and display dynamic information in a focused surface.</p>
356357
<p>Modals use the same blocks that compose messages with the addition of an <cite>input</cite> block.</p>
357-
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">flask</span> <span class="kn">import</span> <span class="n">Flask</span><span class="p">,</span> <span class="n">request</span><span class="p">,</span> <span class="n">make_response</span>
358+
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="c1"># This module is available since v2.6.0rc1</span>
359+
<span class="kn">from</span> <span class="nn">slack.signature</span> <span class="kn">import</span> <span class="n">SignatureVerifier</span>
360+
<span class="n">signature_verifier</span> <span class="o">=</span> <span class="n">SignatureVerifier</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s2">&quot;SLACK_SIGNING_SECRET&quot;</span><span class="p">])</span>
361+
362+
<span class="kn">from</span> <span class="nn">flask</span> <span class="kn">import</span> <span class="n">Flask</span><span class="p">,</span> <span class="n">request</span><span class="p">,</span> <span class="n">make_response</span>
358363
<span class="n">app</span> <span class="o">=</span> <span class="n">Flask</span><span class="p">(</span><span class="vm">__name__</span><span class="p">)</span>
359-
<span class="n">signing_secret</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s2">&quot;SLACK_SIGNING_SECRET&quot;</span><span class="p">]</span>
360364

361365
<span class="nd">@app</span><span class="o">.</span><span class="n">route</span><span class="p">(</span><span class="s2">&quot;/slack/events&quot;</span><span class="p">,</span> <span class="n">methods</span><span class="o">=</span><span class="p">[</span><span class="s2">&quot;POST&quot;</span><span class="p">])</span>
362366
<span class="k">def</span> <span class="nf">slack_app</span><span class="p">():</span>
363-
<span class="c1"># Refer to https://github.com/slackapi/python-slack-events-api</span>
364-
<span class="c1"># (The Slack Team is going to provide a new package soon)</span>
365-
<span class="k">if</span> <span class="ow">not</span> <span class="n">verify_request</span><span class="p">(</span>
366-
<span class="n">signing_secret</span><span class="o">=</span><span class="n">signing_secret</span><span class="p">,</span>
367-
<span class="n">request_body</span><span class="o">=</span><span class="n">request</span><span class="o">.</span><span class="n">get_data</span><span class="p">(),</span>
368-
<span class="n">timestamp</span><span class="o">=</span><span class="n">request</span><span class="o">.</span><span class="n">headers</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;X-Slack-Request-Timestamp&quot;</span><span class="p">),</span>
369-
<span class="n">signature</span><span class="o">=</span><span class="n">request</span><span class="o">.</span><span class="n">headers</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s2">&quot;X-Slack-Signature&quot;</span><span class="p">)):</span>
367+
<span class="k">if</span> <span class="ow">not</span> <span class="n">signature_verifier</span><span class="o">.</span><span class="n">is_valid_request</span><span class="p">(</span><span class="n">request</span><span class="o">.</span><span class="n">get_data</span><span class="p">(),</span> <span class="n">request</span><span class="o">.</span><span class="n">headers</span><span class="p">):</span>
370368
<span class="k">return</span> <span class="n">make_response</span><span class="p">(</span><span class="s2">&quot;invalid request&quot;</span><span class="p">,</span> <span class="mi">403</span><span class="p">)</span>
371369

372370
<span class="k">if</span> <span class="s2">&quot;command&quot;</span> <span class="ow">in</span> <span class="n">request</span><span class="o">.</span><span class="n">form</span> \

docs/changelog.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@
162162
</ul>
163163
</li>
164164
<li class="toctree-l1 current"><a class="current reference internal" href="#">Changelog</a><ul>
165+
<li class="toctree-l2"><a class="reference internal" href="#v2-6-0rc1-2020-05-14">v2.6.0rc1 (2020-05-14)</a></li>
165166
<li class="toctree-l2"><a class="reference internal" href="#v2-5-0-2019-12-09">v2.5.0 (2019-12-09)</a></li>
166167
<li class="toctree-l2"><a class="reference internal" href="#v2-4-0-2019-11-27">v2.4.0 (2019-11-27)</a></li>
167168
<li class="toctree-l2"><a class="reference internal" href="#v2-3-1-2019-10-29">v2.3.1 (2019-10-29)</a></li>
@@ -222,6 +223,28 @@
222223
<div class="card">
223224
<div class="section" id="changelog">
224225
<h1>Changelog<a class="headerlink" href="#changelog" title="Permalink to this headline"></a></h1>
226+
<div class="section" id="v2-6-0rc1-2020-05-14">
227+
<h2>v2.6.0rc1 (2020-05-14)<a class="headerlink" href="#v2-6-0rc1-2020-05-14" title="Permalink to this headline"></a></h2>
228+
<p>Refer to <a class="reference external" href="https://github.com/slackapi/python-slackclient/milestone/5">v2.6.0 milestone</a> to know the complete list of the issues resolved by this release.</p>
229+
<p><strong>New Features</strong></p>
230+
<ol class="arabic simple">
231+
<li><p>[Block Kit] #659 Add complete supports for Block Kit components and fixed a few existing bugs as well (#500 #519 #623 #632 #635 #639 #676) - Thanks &#64;seratch &#64;diurnalist &#64;ruberVulpes &#64;jeremyschulman &#64;e271828- &#64;RodneyU215</p></li>
232+
<li><p>[Signature] #686 Add slack.signature.SignatureVerifier for request verification - Thanks &#64;seratch</p></li>
233+
<li><p>[WebClient] #682 Add missing Grid admin APIs (<cite>admin.usergroups.*</cite>, <cite>admin.users.*</cite>, <cite>admin.apps.*</cite>) - Thanks &#64;stevengill &#64;seratch</p></li>
234+
</ol>
235+
<p><strong>Updates</strong></p>
236+
<ol class="arabic simple">
237+
<li><p>[WebClient][RTMClient] Fixed a bunch of the currency issues this SDK had (#429 #463 #492 #497 #530 #558 #569 #605 #613 #619 #626 #630 #631 #633 #669) - Thanks &#64;seratch &#64;aaguilartablada &#64;aoberoi &#64;stevengill</p></li>
238+
<li><p>[WebClient] #681 #560 Enable using bool values for request parameters - Thanks &#64;roman-kachanovsky &#64;seratch</p></li>
239+
<li><p>[WebClient] #661 #678 Improve handling of required “ids” parameters (e.g., channel_ids, users) - Thanks &#64;seratch</p></li>
240+
<li><p>[WebClient] #680 Add non-conversation API deprecation warnings - Thanks &#64;seratch</p></li>
241+
<li><p>[WebClient] #671 #670 Enable passing None values for request parameters (they used to result in errors) - Thanks &#64;seratch</p></li>
242+
<li><p>[WebClient] #673 Fix #672 files.upload fails with a filepath containing multi byte chars - Thanks &#64;yuji38kwmt &#64;seratch</p></li>
243+
<li><p>[WebClient] #656 Fix #594 preview_image for files.remote.add API method is not properly supported - Thanks &#64;seratch</p></li>
244+
<li><p>[Maintenance] #618 Add py.typed file to package distribution - Thanks &#64;JKillian</p></li>
245+
<li><p>[WebClient] #599 Strip token string parameters of whitespace - Thanks &#64;TheFrozenFire</p></li>
246+
</ol>
247+
</div>
225248
<div class="section" id="v2-5-0-2019-12-09">
226249
<h2>v2.5.0 (2019-12-09)<a class="headerlink" href="#v2-5-0-2019-12-09" title="Permalink to this headline"></a></h2>
227250
<p><strong>New Features</strong></p>

docs/genindex.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@
163163
</ul>
164164
</li>
165165
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a><ul>
166+
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v2-6-0rc1-2020-05-14">v2.6.0rc1 (2020-05-14)</a></li>
166167
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v2-5-0-2019-12-09">v2.5.0 (2019-12-09)</a></li>
167168
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v2-4-0-2019-11-27">v2.4.0 (2019-11-27)</a></li>
168169
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v2-3-1-2019-10-29">v2.3.1 (2019-10-29)</a></li>

docs/index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@
162162
</ul>
163163
</li>
164164
<li class="toctree-l1"><a class="reference internal" href="changelog.html">Changelog</a><ul>
165+
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v2-6-0rc1-2020-05-14">v2.6.0rc1 (2020-05-14)</a></li>
165166
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v2-5-0-2019-12-09">v2.5.0 (2019-12-09)</a></li>
166167
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v2-4-0-2019-11-27">v2.4.0 (2019-11-27)</a></li>
167168
<li class="toctree-l2"><a class="reference internal" href="changelog.html#v2-3-1-2019-10-29">v2.3.1 (2019-10-29)</a></li>

0 commit comments

Comments
 (0)