Installation and Bot reject ISO 8601 timestamps with a negative UTC offset or a Z suffix
Maintainer antworten meist innerhalb von 1 Tag
Bewertung
Dieses Issue wurde noch nicht bewertet.
Beschreibung
What happens
Installation, Bot and the token rotation code accept installed_at (and *_token_expires_at) as an ISO 8601 string. Strings with a positive offset parse correctly, but a negative offset or a Z suffix raises ValueError:
from slack_sdk.oauth.installation_store import Installation
Installation(
user_id="U111",
installed_at="2021-07-14T03:00:17-05:00",
)
# ValueError: Invalid isoformat string: '2021-07-14T03:00:17-05:00+00:00'
Installation(
user_id="U111",
installed_at="2021-07-14T08:00:17Z",
)
# ValueError: Invalid isoformat string: '2021-07-14T08:00:17Z+00:00' (Python 3.11+)
"2021-07-14T17:00:17+09:00" works, so the result depends on the sign of the offset.
What should happen
Any string datetime.fromisoformat can parse should be accepted. Strings without an offset should keep being treated as UTC.
Root cause
_from_iso_format_to_datetime in slack_sdk/oauth/installation_store/internals.py decides whether a string already has an offset by checking for a + character:
if "+" not in iso_datetime_str:
iso_datetime_str += "+00:00"
return datetime.fromisoformat(iso_datetime_str)
For -05:00 or Z there is no +, so a second offset is appended and parsing fails. Parsing first and setting UTC only when tzinfo is None fixes it, which matches how naive datetime values are already handled in _timestamp_to_type since #1970.
- Vorherrschende Sprache
- Python
- Sterne
- 4k
- Forks
- 874
- Ø Merge
- 13 Std. 22 Min.
- Gemergte PRs (30 T.)
- 64
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus slackapi/python-slack-sdk
-
`WebClient` raises `JSONDecodeError` instead of `SlackApiError` on a malformed JSON body when retry handlers are setEvtl. vergeben @agustin18 hat das vor 13 Tagen übernommen. Offenbug semver:major web-client
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 30/100
slackapi/python-slack-sdk#2070 ·
Maintainer antworten meist innerhalb von 1 Tag
-
SignatureVerifier.is_valid raises instead of returning False for a malformed timestamp, signature or bodyEvtl. vergeben @AmyScript hat das vor 12 Tagen übernommen. Offenbug security semver:patch
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 57/100
slackapi/python-slack-sdk#2067 · 2 Kommentare · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 3/5 Ein halber Tag Anfängerfreundlichkeit 42/100
slackapi/python-slack-sdk#2066 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Add missing Web API methods that are documented on docs.slack.dev to WebClientEvtl. vergeben @zimeg hat das vor 19 Tagen übernommen. Offenenhancement web-client
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
slackapi/python-slack-sdk#2014 · 2 Kommentare · 2 Reaktionen · 2 zugewiesene Personen ·
Maintainer antworten meist innerhalb von 1 Tag
-
chat_postMessage silently forwards thread_id to the API, so a threaded reply posts to the channelEvtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. Offenauto-triage-skip enhancement
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
slackapi/python-slack-sdk#1923 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in slackapi/python-slack-sdk
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
plone/plone.observability#114 ·
Maintainer antworten meist innerhalb von 1 Tag
-
area:docs type:docs
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
jejjohnson/gauss_flows#246 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
openvax/varcode#824 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Add SAS as a cable typeOffennetbox status: needs triage type: feature
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
netbox-community/netbox#23868 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
emeryberger/CSrankings#15757 ·
Maintainer antworten meist innerhalb von 9 Tagen