-
Notifications
You must be signed in to change notification settings - Fork 21
RUN-3734: Retrieve git password from key storage #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ltamaster
wants to merge
9
commits into
master
Choose a base branch
from
nodes-with-key-storage
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
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
03ce7bc to
c0cf954
Compare
- Fix UI labels to distinguish plain text vs Key Storage password fields - Reverse precedence: Key Storage password now takes precedence over plain text - Add null safety check before setting password from Key Storage - Fix NullPointerException by reusing storageTree variable - Add error handling with try-catch and logging for Key Storage access - Add JavaDoc documentation to getFromKeyStorage method - Use explicit UTF-8 encoding for password strings - Update README with Key Storage authentication documentation - Clean up test file whitespace All changes maintain backwards compatibility - no breaking changes to property names.
- Refactor GitPluginUtil: Extract duplicate code into readResourceMetaAsString() helper method - Add SSH Key Storage support for Resource Model (feature parity with Workflow Steps) - Add GIT_KEY_STORAGE_PATH property for SSH keys from Rundeck Key Storage - Update GitResourceModel to retrieve SSH keys from Key Storage with precedence over filesystem - Add UI field label clarification (Filesystem vs Storage Path) - Add comprehensive test for SSH Key Storage authentication - Update README with SSH Key Storage documentation Maintains backwards compatibility - filesystem SSH key paths still work.
…orage - Added detailed step-by-step setup instructions for Key Storage - Added example Key Storage paths for different scenarios - Created authentication examples table by Git URL type - Added comprehensive troubleshooting section for common issues - Added security best practices section - Added Quick Reference section with: - Key Storage setup instructions - Common configuration scenarios (GitHub, GitLab, HTTPS, SSH) - Property reference table - Version requirements - Improved workflow steps authentication documentation - Organized content with clear sections and examples README expanded from 175 to 344 lines with actionable guidance.
…compatibility - Updated jgitSsh from 5.13.3 to 6.6.1 to match core jgit version - Fixed package imports in PluginSshSessionFactory for JGit 6.x - JschConfigSessionFactory moved to org.eclipse.jgit.transport.ssh.jsch - OpenSshConfig moved to org.eclipse.jgit.transport.ssh.jsch - Resolves version mismatch that could cause SSH authentication issues
- Renamed misleading constant names for clarity (no breaking changes to property values) - GIT_KEY_STORAGE -> GIT_KEY_PATH (filesystem paths) - GIT_PASSWORD_STORAGE -> GIT_PASSWORD_PATH (plain text passwords) - Fixed potential NullPointerException in GitPluginUtil - Added null checks before calling logger.log() - Fixed misleading error messages to use 'credential' instead of 'password' - Messages now accurate for both passwords and SSH keys - Added comprehensive documentation to getFromKeyStorage methods - Documented parameters, return values, and exception behavior - Fixed spelling errors in README: 'commiting' -> 'committing' - All tests passing
- Refactored ExecutionContext creation to avoid duplication - Create context once and reuse for both password and SSH key retrieval - Changed method parameter from ExecutionContextImpl to ExecutionContext interface - Improves flexibility and follows dependency inversion principle - Removed unnecessary semicolon from import statement - Fixed inconsistent spacing in test mock interactions (1* -> 1 *) - Fixed @OverRide annotation formatting for consistency - All tests passing
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
This PR adds support for retrieving Git passwords and SSH keys from Rundeck's Key Storage system, providing a secure alternative to storing credentials in plain text or filesystem paths. This work is based on PR #29 and has been enhanced with comprehensive improvements.
Key Features
🔐 Key Storage Support for Passwords
gitPasswordPathStorageproperty for Key Storage pathsgitPasswordPathfor plain text🔑 Key Storage Support for SSH Keys
gitKeyPathStorageproperty for SSH Key Storage pathsgitKeyPathfor filesystem paths📚 Comprehensive Documentation
Changes Made
Code Quality Improvements
GitPluginUtilinto sharedreadResourceMetaAsString()helper methodNew Tests
Technical Details
Files Modified
GitResourceModel.groovy- Added Key Storage support for passwords and SSH keysGitResourceModelFactory.groovy- Added new properties and UI configurationGitPluginUtil.groovy- Refactored code, improved error handlingGitResourceModelSpec.groovy- Added comprehensive test coverageREADME.md- Extensive documentation improvementsgradle/libs.versions.toml- Updated JGit SSH module version to match core versionPluginSshSessionFactory.groovy- Fixed package imports for JGit 6.x compatibilityJGit Dependency Updates
jgitSshfrom 5.13.3 to 6.6.1 to match corejgitversionJschConfigSessionFactoryandOpenSshConfigmoved toorg.eclipse.jgit.transport.ssh.jschpackageBackwards Compatibility
✅ No breaking changes - all existing property names maintained:
gitPasswordPath- Still works for plain text passwordsgitKeyPath- Still works for filesystem SSH key pathsgitPasswordPathStorage- New property for Key Storage passwordsgitKeyPathStorage- New property for Key Storage SSH keysRequirements
Testing
Related
Based on PR #29. Thank you @blink38
Security
Improvements
Best Practices
Users are encouraged to:
Migration Guide
No migration required! Existing configurations will continue to work without any changes.
To adopt Key Storage (recommended):
gitPasswordPathStorageorgitKeyPathStoragepropertiesScreenshots
Resource Model Configuration
The plugin now offers clear options for authentication:
Checklist