Skip to content

fix(ssh): run SSHConnectionParams auth validator on pydantic >=2.12#1346

Open
jayantkamble10000 wants to merge 1 commit into
coinbase:mainfrom
jayantkamble10000:fix/ssh-pydantic-validator
Open

fix(ssh): run SSHConnectionParams auth validator on pydantic >=2.12#1346
jayantkamble10000 wants to merge 1 commit into
coinbase:mainfrom
jayantkamble10000:fix/ssh-pydantic-validator

Conversation

@jayantkamble10000

@jayantkamble10000 jayantkamble10000 commented Jun 27, 2026

Copy link
Copy Markdown

What

SSHConnectionParams.check_auth_method_provided is decorated with both @classmethod and @model_validator(mode="after"). On pydantic >= 2.12 that combination is deprecated and the validator is silently skipped (pydantic emits PydanticDeprecatedSince212 and does not run it), so SSHConnectionParams can be constructed with no authentication method, empty host, or empty username.

Why

The committed uv.lock pins pydantic 2.10.4 (where it still runs), but pyproject.toml allows pydantic~=2.0 (i.e. >= 2.12), and pydantic 3.0 removes the pattern entirely — so on those installs the intended validation is lost.

Change

python/coinbase-agentkit/coinbase_agentkit/action_providers/ssh/connection.py — make check_auth_method_provided an instance-method mode="after" validator (drop @classmethod, use self, return self), the supported pattern across pydantic 2.x and 3.0.

@cb-heimdall

cb-heimdall commented Jun 27, 2026

Copy link
Copy Markdown

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@github-actions github-actions Bot added action provider New action provider python labels Jun 27, 2026
check_auth_method_provided used @classmethod together with @model_validator(mode=after). That combination is deprecated and silently skipped on pydantic >= 2.12, so the auth-method/host/username checks never ran. Make it an instance-method mode=after validator, supported across pydantic 2.x and 3.0.
@jayantkamble10000 jayantkamble10000 force-pushed the fix/ssh-pydantic-validator branch from 8cb0cf1 to 67d06dd Compare June 27, 2026 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action provider New action provider python

Development

Successfully merging this pull request may close these issues.

2 participants