Installation and Bot reject ISO 8601 timestamps with a negative UTC offset or a Z suffix
I maintainer di solito rispondono entro 1 giorno
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 4k
- Fork
- 874
- Merge medio
- 13h 22m
- PR unite (30g)
- 64
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di slackapi/python-slack-sdk
-
`WebClient` raises `JSONDecodeError` instead of `SlackApiError` on a malformed JSON body when retry handlers are setForse già presa @agustin18 l’ha presa 13 giorni fa. Apertabug semver:major web-client
Difficoltà 2/5 1-3 ore Idoneità per principianti 30/100
slackapi/python-slack-sdk#2070 ·
I maintainer di solito rispondono entro 1 giorno
-
SignatureVerifier.is_valid raises instead of returning False for a malformed timestamp, signature or bodyForse già presa @AmyScript l’ha presa 12 giorni fa. Apertabug security semver:patch
Difficoltà 2/5 1-3 ore Idoneità per principianti 57/100
slackapi/python-slack-sdk#2067 · 2 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 Mezza giornata Idoneità per principianti 42/100
slackapi/python-slack-sdk#2066 ·
I maintainer di solito rispondono entro 1 giorno
-
Add missing Web API methods that are documented on docs.slack.dev to WebClientForse già presa @zimeg l’ha presa 19 giorni fa. Apertaenhancement web-client
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
slackapi/python-slack-sdk#2014 · 2 commenti · 2 reazioni · 2 assegnatari ·
I maintainer di solito rispondono entro 1 giorno
-
chat_postMessage silently forwards thread_id to the API, so a threaded reply posts to the channelForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Apertaauto-triage-skip enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
slackapi/python-slack-sdk#1923 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di slackapi/python-slack-sdk
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
bad-antics/lateralus-lang#1623 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
fossguild/thelifesnake#82 ·
I maintainer di solito rispondono entro 1 giorno
-
Unfitted DialectClassifier crashes with a confusing ValueError: raise a clear "not fitted" errorApertagood first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
omarelshamy25x/shamy-arabic-nlp#111 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
pietbarber/Manage2Soar#1189 ·
I maintainer di solito rispondono entro 1 giorno
-
BUG: write_netcdf fails on Tutorial 3 BEM output with pandas CategoricalDtype DOF coordinatesForse già presa @dtgaebe l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
sandialabs/WecOptTool#467 ·