feat: FT204 datetime — ISO 8601 パース・タイムゾーン変換・日時演算 (v1.8.81)#569
Merged
Conversation
- 実装: parse_datetime / convert_timezone / diff_datetimes / get_now / add_duration - ZoneInfo によるタイムゾーン変換(pytz 不要) - _TIMEZONE_PATTERN による入力バリデーション(パストラバーサル防御) - _ISO8601_PATTERN による入力バリデーション(SQLi/ReDoS 防御) - naive/aware 混在検出(TypeError を API 境界で 422 に変換) - セキュリティ診断: 合格(全12カテゴリ) - クラッカーペンテスト: 堅牢(15攻撃すべて耐えた) - ruff DTZ ルール(flake8-datetimez)を pyproject.toml に追加 - バージョン v1.8.81 Closes #568 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
datetime+zoneinfoモジュールの FT204 実装(セキュリティ診断・クラッカーペンテスト両方実施)ruff DTZルール(flake8-datetimez)をpyproject.tomlに追加 —datetime.now()naive 呼び出しを検出実装内容
parse_datetime(text)convert_timezone(iso8601, tz_name)ZoneInfo)diff_datetimes(start, end)get_now(tz_name)add_duration(iso8601, days, hours, minutes)セキュリティ診断結果(FT204: 204 % 3 = 0)
総合評価: 合格
_TIMEZONE_PATTERNで../../etc/passwd等を遮断_ISO8601_PATTERNでアポストロフィ等を遮断クラッカーペンテスト結果(FT204: 204 % 4 = 0)
攻撃耐性評価: 堅牢(15攻撃すべて耐えた)
Test plan
uv run pytest)Closes #568
🤖 Generated with Claude Code