Metadata-Version: 2.4
Name: damv1paramikossh_forscriptspipeline
Version: 0.2.3
Summary: A secure, Cython-compiled Python package for executing SSH commands via Paramiko in CI/CD pipeline scripts.
Author: dhonyabumuhammad (Djogja)
Author-email: baba-rtw24150@tutamail.com
Keywords: paramiko,ssh,rsakey,openssh,djogja,pipeline-scripts,cython,obfuscation
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Cython
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Security
Classifier: License :: OSI Approved :: MIT License
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: paramiko>=3.0.0
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: keywords
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

## damv1paramikossh_forscriptspipeline

A specialized, **Cython-compiled** Python package designed to execute remote SSH commands via Paramiko. Engineered for CI/CD pipeline scripts with enhanced source code protection (obfuscation).

### Overview

This package provides a robust command-line interface to authenticate with remote servers and execute shell commands. It features **automatic credential detection**, seamlessly handling both password-based and private key-based authentication. 

**Security Enhancement (v0.2.0+):** Core logic is compiled into C-extensions (`.so`/`.pyd`), preventing easy reverse-engineering or unauthorized modification of the execution logic.

### Key Features

- **Source Code Obfuscation**: Compiled via Cython for enhanced security in shared or restricted environments.
- **Automatic Credential Detection**: Intelligently distinguishes between OpenSSH private keys and plain-text passwords.
- **Pipeline-Ready Exit Codes**: Propagates the remote command's exit status directly to the shell.
- **Clean Log Output**: Structured output formatting optimized for CI/CD log readability.

### Platform Compatibility Warning

Due to Cython compilation, this package is **architecture and OS-specific**. 
- A wheel built on **macOS ARM64** will ONLY run on macOS ARM64.
- A wheel built on **Linux x86_64** will ONLY run on Linux x86_64.
- *Recommendation:* Build the distribution wheel on the same OS/architecture where it will be deployed, or use a CI/CD matrix build (e.g., `cibuildwheel`).

### Installation

Install the package directly from PyPI using pip:

```bash
pip install damv1paramikossh_forscriptspipeline
```

### CLI Syntax

```bash
damv1paramikossh_forscriptspipeline <SERVER> <SSH_USERNAME> <SSH_PORT> <PASSWORD_OR_KEY> "<COMMAND>"
```

#### Parameters
| Position | Parameter | Description |
|----------|-----------|-------------|
| 1 | `SERVER` | The IP address or hostname of the target server. |
| 2 | `SSH_USERNAME` | The SSH user account on the remote server. |
| 3 | `SSH_PORT` | The SSH port number (typically `22`). |
| 4 | `PASSWORD_OR_KEY` | Plain-text password OR raw string content of an OpenSSH private key. |
| 5 | `COMMAND` | The shell command to execute. **Must be enclosed in quotes.** |

### Usage Examples

#### Example 1: Bitbucket Pipeline (Linux x86_64 Environment)
```yaml
pipelines:
  default:
    - step:
        name: Execute Remote Command via SSH Key
        image: python:3.10-slim
        script:
          - pip install damv1paramikossh_forscriptspipeline
          - damv1paramikossh_forscriptspipeline ${SERVER} ${SSH_USERNAME} ${SSH_PORT} "${SSH_PRIVATE_KEY}" "kubectl rollout restart deployment/inbound-wms -n sit"
```

#### Example 2: Local Testing (Match your local OS/Arch)
```bash
# Ensure single quotes are used to prevent shell expansion of special characters
damv1paramikossh_forscriptspipeline '103.186.30.214' 'ubuntu' '22' 'p4$$W0Rd2025!' 'uname -a'
```

### Maintainer
- **Author**: dhonyabumuhammad (Djogja)
- **Contact**: baba-rtw24150@tutamail.com
- **Version**: 0.2.0 (Cython Secured)
