Migrate craft CLI to cleo 2 (last pip-audit finding)#25
Merged
Conversation
cleo 0.8.1 (2020) is vulnerable to CVE-2022-42966 (ReDoS) — the fix lives in cleo 2 — and was the last remaining pip-audit finding. Commands keep declaring their signature in the docstring block format: the base masonite.commands.Command now parses it into a cleo 2 definition, so none of the 40+ command classes changed. - cleo 0.8 semantics preserved for bare optional-value options (craft preset --list stays truthy) - CommandCapsule uses command.name and cleo 2's Application.add; swap() updates the internal registry consistently - TestCommand accumulates fetch_output()/fetch_error() since cleo 2 drains the buffer on fetch (multiple assertOutputContains calls) - Kernel/Entry/test fixtures updated to cleo 2 import paths - requires masonite-framework-orm>=3.1 (its CLI migrated in masonitedev/orm#1) and drops the cleo 0.8 DeprecationWarning filter Fixes #9
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.
Migrates the
craftCLI from cleo 0.8.1 to cleo 2.1 — the finalpip-auditfinding (cleo ≤ 0.8 is vulnerable to CVE-2022-42966, ReDoS, fixed in 2.0).Closes #9
Approach
Commands keep declaring their signature in the historical docstring block format. The base
masonite.commands.Commandnow parses that format into a cleo 2 definition (cleo.helpers.argument/option), so none of the 40+ command classes changed — and package authors' existing commands (and themake:commandstub) stay valid.craft preset --liststays truthy)CommandCapsuleusescommand.nameand cleo 2'sApplication.add;swap()keeps the internal registry consistentTestCommandaccumulatesfetch_output()/fetch_error()(cleo 2 drains the buffer on fetch, breaking consecutiveassertOutputContains)DeprecationWarningfilter (craft output is warning-free natively now)timezonevalidation rule moved from undeclaredpytz(which arrived transitively via vonage 3) to stdlibzoneinfoValidation
-m "not integrations") under cleo 2.1 + masonite-framework-orm 3.1.0craft list(all framework + ORM commands registered), per-command--help(names/shortcuts/defaults correct),craft preset --list,craft serve(HTTP 200, styled output intact)pip-auditafter this PR: zero findings