validate-sops


Namevalidate-sops JSON
Version 0.1.1 PyPI version JSON
download
home_pagehttps://github.com/voldy/validate-sops
SummaryA Python utility to ensure your files are securely encrypted with SOPS. Integrates seamlessly into your pre-commit workflow, providing automated validation for SOPS-encrypted files, enhancing security and compliance in your development process.
upload_time2024-02-20 16:36:19
maintainer
docs_urlNone
authorVladimir Zhukov
requires_python>=3.11,<4.0
licenseMIT
keywords sops pre-commit hook
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Validate-SOPS

## Overview

`validate-sops` is a Python utility designed to validate that specified files are encrypted using [Mozilla SOPS (Secrets OPerationS)](https://github.com/mozilla/sops). It ensures that sensitive files committed to your repository are securely encrypted, preventing accidental exposure of secrets.

## Supported Formats

The utility supports validation for files in the following formats:

- JSON (.json)
- YAML (.yaml and .yml)
- Environment files (.env)

## Features

- Validates multiple files for SOPS encryption.
- Easily integrated into pre-commit hooks for automated validation.
- Provides clear error messages for non-compliant files.

## Usage

To use `validate-sops` as a [pre-commit](https://pre-commit.com/) hook in your projects, add the following configuration to your `.pre-commit-config.yaml` file:

```yaml
repos:
-  repo: https://github.com/voldy/validate-sops
    rev: 'v0.1.1'  # Use the latest commit SHA or tag
    hooks:
    -   id: validate-sops
        # Adjust based on your file(s) location and type(s)
        files: '.*\/secrets\/encrypted\.(yaml|yml|json|env)$'
```

Ensure that the file paths and types specified in the files regex pattern match the location and formats of the files you intend to validate in your project.

## Local Development Setup

The following instructions are intended for contributors and developers working on the `validate-sops` utility itself.

### Installation

This project uses [Poetry](https://python-poetry.org/) for dependency management and package handling. Ensure you have Poetry installed on your system.

To set up `validate-sops` for local development, follow these steps:

1. Clone the repository:

```bash
git clone https://github.com/voldy/validate-sops.git
cd validate-sops
```

2. Install dependencies using Poetry:

```bash
poetry install
```

3. Set up the pre-commit hooks:
After configuring `.pre-commit-config.yaml` in your project, run the following command to set up the git hook scripts:

```bash
pre-commit install
```

4. To manually execute all configured pre-commit hooks on all files, run:

```bash
poetry run pre-commit run --all-files
```

This step is useful for testing the hooks before committing.

### Running Tests

To run the unit tests for `validate-sops`, use the following command:

```bash
poetry run pytest
```

### Testing Changes Locally in Another Project
If you're making changes to `validate-sops` and want to test these changes within the context of another project that uses `validate-sops` as a pre-commit hook, you can leverage the `pre-commit try-repo` command. This allows you to run your locally modified version of `validate-sops` directly in the consuming project without needing to commit or push your changes.

Here's how you can test your local changes to `validate-sops` in another project:

1. Navigate to the root directory of the project where `validate-sops` is integrated as a pre-commit hook.
2. Run the following command:

```bash
pre-commit try-repo /local/path/to/validate-sops validate-sops --verbose --all-files
```

Replace `/local/path/to/validate-sops` with the actual path to your local clone of the validate-sops repository.

**Note**: The `try-repo` command allows you to temporarily include your local version of `validate-sops` in the pre-commit configuration of the consuming project. This enables you to test uncommitted changes in `validate-sops` directly, making it easier to iterate on your development before finalizing your changes.

## Contributing

Contributions to `validate-sops` are welcome! Please feel free to submit pull requests or open issues to suggest improvements or report bugs.

## Author

Vladimir Zhukov

## License

`validate-sops` is licensed under the MIT License. See the `LICENSE` file in the project root for the full license text.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/voldy/validate-sops",
    "name": "validate-sops",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.11,<4.0",
    "maintainer_email": "",
    "keywords": "sops,pre-commit,hook",
    "author": "Vladimir Zhukov",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/62/6f/7c03edfd30776d71aeacce66ed71dbaf9422369947efc7f401d1b244c2d1/validate_sops-0.1.1.tar.gz",
    "platform": null,
    "description": "# Validate-SOPS\n\n## Overview\n\n`validate-sops` is a Python utility designed to validate that specified files are encrypted using [Mozilla SOPS (Secrets OPerationS)](https://github.com/mozilla/sops). It ensures that sensitive files committed to your repository are securely encrypted, preventing accidental exposure of secrets.\n\n## Supported Formats\n\nThe utility supports validation for files in the following formats:\n\n- JSON (.json)\n- YAML (.yaml and .yml)\n- Environment files (.env)\n\n## Features\n\n- Validates multiple files for SOPS encryption.\n- Easily integrated into pre-commit hooks for automated validation.\n- Provides clear error messages for non-compliant files.\n\n## Usage\n\nTo use `validate-sops` as a [pre-commit](https://pre-commit.com/) hook in your projects, add the following configuration to your `.pre-commit-config.yaml` file:\n\n```yaml\nrepos:\n-  repo: https://github.com/voldy/validate-sops\n    rev: 'v0.1.1'  # Use the latest commit SHA or tag\n    hooks:\n    -   id: validate-sops\n        # Adjust based on your file(s) location and type(s)\n        files: '.*\\/secrets\\/encrypted\\.(yaml|yml|json|env)$'\n```\n\nEnsure that the file paths and types specified in the files regex pattern match the location and formats of the files you intend to validate in your project.\n\n## Local Development Setup\n\nThe following instructions are intended for contributors and developers working on the `validate-sops` utility itself.\n\n### Installation\n\nThis project uses [Poetry](https://python-poetry.org/) for dependency management and package handling. Ensure you have Poetry installed on your system.\n\nTo set up `validate-sops` for local development, follow these steps:\n\n1. Clone the repository:\n\n```bash\ngit clone https://github.com/voldy/validate-sops.git\ncd validate-sops\n```\n\n2. Install dependencies using Poetry:\n\n```bash\npoetry install\n```\n\n3. Set up the pre-commit hooks:\nAfter configuring `.pre-commit-config.yaml` in your project, run the following command to set up the git hook scripts:\n\n```bash\npre-commit install\n```\n\n4. To manually execute all configured pre-commit hooks on all files, run:\n\n```bash\npoetry run pre-commit run --all-files\n```\n\nThis step is useful for testing the hooks before committing.\n\n### Running Tests\n\nTo run the unit tests for `validate-sops`, use the following command:\n\n```bash\npoetry run pytest\n```\n\n### Testing Changes Locally in Another Project\nIf you're making changes to `validate-sops` and want to test these changes within the context of another project that uses `validate-sops` as a pre-commit hook, you can leverage the `pre-commit try-repo` command. This allows you to run your locally modified version of `validate-sops` directly in the consuming project without needing to commit or push your changes.\n\nHere's how you can test your local changes to `validate-sops` in another project:\n\n1. Navigate to the root directory of the project where `validate-sops` is integrated as a pre-commit hook.\n2. Run the following command:\n\n```bash\npre-commit try-repo /local/path/to/validate-sops validate-sops --verbose --all-files\n```\n\nReplace `/local/path/to/validate-sops` with the actual path to your local clone of the validate-sops repository.\n\n**Note**: The `try-repo` command allows you to temporarily include your local version of `validate-sops` in the pre-commit configuration of the consuming project. This enables you to test uncommitted changes in `validate-sops` directly, making it easier to iterate on your development before finalizing your changes.\n\n## Contributing\n\nContributions to `validate-sops` are welcome! Please feel free to submit pull requests or open issues to suggest improvements or report bugs.\n\n## Author\n\nVladimir Zhukov\n\n## License\n\n`validate-sops` is licensed under the MIT License. See the `LICENSE` file in the project root for the full license text.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A Python utility to ensure your files are securely encrypted with SOPS. Integrates seamlessly into your pre-commit workflow, providing automated validation for SOPS-encrypted files, enhancing security and compliance in your development process.",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://github.com/voldy/validate-sops",
        "Repository": "https://github.com/voldy/validate-sops"
    },
    "split_keywords": [
        "sops",
        "pre-commit",
        "hook"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2704e6e17072632d3a9eeea96fc602dee7dd6e730cfdd8bac8edf01f1622ab48",
                "md5": "80c96301754a54cdf90f07c88b498961",
                "sha256": "91f537b29403ded87eb5b682692335d71f3f218fd5109294536427858a8d5c88"
            },
            "downloads": -1,
            "filename": "validate_sops-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "80c96301754a54cdf90f07c88b498961",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.11,<4.0",
            "size": 6304,
            "upload_time": "2024-02-20T16:36:18",
            "upload_time_iso_8601": "2024-02-20T16:36:18.075540Z",
            "url": "https://files.pythonhosted.org/packages/27/04/e6e17072632d3a9eeea96fc602dee7dd6e730cfdd8bac8edf01f1622ab48/validate_sops-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "626f7c03edfd30776d71aeacce66ed71dbaf9422369947efc7f401d1b244c2d1",
                "md5": "471a3fa8ef142e7be8bef0a61f7bc7fd",
                "sha256": "81446b8c4158cc5c1be72b67633173416e9020d8fa9db0b95a14e722c415c469"
            },
            "downloads": -1,
            "filename": "validate_sops-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "471a3fa8ef142e7be8bef0a61f7bc7fd",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.11,<4.0",
            "size": 4619,
            "upload_time": "2024-02-20T16:36:19",
            "upload_time_iso_8601": "2024-02-20T16:36:19.446325Z",
            "url": "https://files.pythonhosted.org/packages/62/6f/7c03edfd30776d71aeacce66ed71dbaf9422369947efc7f401d1b244c2d1/validate_sops-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-02-20 16:36:19",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "voldy",
    "github_project": "validate-sops",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "validate-sops"
}
        
Elapsed time: 0.18565s