Skip to content

Release staging : FTP connection via SSH key#970

Merged
heloise-gllm merged 11 commits intostagingfrom
develop
Feb 23, 2026
Merged

Release staging : FTP connection via SSH key#970
heloise-gllm merged 11 commits intostagingfrom
develop

Conversation

@heloise-gllm
Copy link
Collaborator

No description provided.

Jonathan Loriaux and others added 11 commits February 20, 2026 15:09
Add support for SSH key authentication in addition to password
authentication for SFTP image hosting.

## Changes

### Dependencies
- Upgrade ssh2-sftp-client from 5.1.2 to 7.2.3 (fixed version)
- Required for rsa-sha2-256/512 support (OpenSSH 8.8+)

### Backend
- group.schema.js: Add ftpAuthType (password/ssh_key) and ftpSshKey fields
- ftp-client.service.js: Support privateKey in connection settings
- mailing.service.js: Pass auth type and SSH key to FTP client
- group.controller.js:
  - Validate SSH key format (PEM/OpenSSH)
  - Mask ftpPassword and ftpSshKey in API responses
  - Handle credential updates (preserve masked, delete with __DELETE__)
  - Add testFtpConnection endpoint
- group.routes.js: Add POST /:groupId/test-ftp-connection route

### Frontend
- form.vue: Auth method selector, SSH key textarea, test connection button
- api-routes.js: Add groupTestFtpConnection route
- Translations FR/EN for new fields

## Supported key types (Node 14)
- RSA 2048+ ✓
- ECDSA ✓
- Ed25519 ✗ (requires Node 16+)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Fix undefined groupId error for admin users without a group
- Fix maskFtpCredentials using toJSON() to include Mongoose virtuals (id)
- Pass ftpAuthType and ftpSshKey through ftpServerParams to FTP client

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
- Add 4 clear sections: General Info, Image Hosting, Authentication, Permissions
- Group FTP fields logically: connection, authentication, paths, display
- Add visual encapsulation for FTP and CDN subsections
- Move permissions checkbox to its own section (was buried in SAML)
- Add section titles with FR/EN translations
- Fix typo: "Compagny" → "Company" in English locale

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
## Code Quality Improvements
- Extract FTP logic from group.controller.js to group-ftp.service.js
- Extract FTP form fields from form.vue to ftp-settings.vue component
- Add ERROR_CODES for FTP/SSH errors (standardized error handling)
- Fix console.error to use development-only logging in user.js store

## Tests
- Add 29 unit tests for group-ftp.service.js (100% coverage)
- Tests cover: validateSshKeyFormat, maskFtpCredentials,
  processCredentialsForUpdate, mapFtpError

## File Size Reduction
- group.controller.js: 587 → 463 lines (-124)
- form.vue: 695 → 477 lines (-218)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
feat(ftp): add SSH key authentication for SFTP
…-toggle

feat: add adress lookup failed error message and activate ftp toggle …
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
7.1% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@heloise-gllm heloise-gllm merged commit 44d7c6e into staging Feb 23, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant