Giter Club home page Giter Club logo

jasypt-gradle-plugin's Introduction

Jasypt gradle plugin

Download Travis Twitter Follow Donate

This plugin was inspired by "mowedgrass/jasypt-gradle-boot".

This plugin works with Gradle 4.10+ and does not have a dependency to Spring Boot but can be used with it. It only depends on Jasypt.

I wrote it especially for the usage with "ulisesbocchio/jasypt-spring-boot" as I needed to encrypt my credentials somehow.

Usage

Add a buildscript block to the top of your build.gradle :

buildscript {
	repositories {
		jcenter()
	}
	dependencies {
		classpath "com.byteowls:jasypt-gradle-plugin:1.0.1"
	}
}

Apply the plugin by adding that to your build.gradle

apply plugin: "com.byteowls.jasypt"

Note: This plugin can not be discovered within the plugin block right now but apply plugin: ... and the plugin block can coexist beside each other.

Run `./gradlew tasks´ to ensure that the plugin is loaded.

Tasks

All below tasks need the --password option to work.

Use --strong-encryption option so the StrongTextEncryptor is used internally which runs a high-strength algorithm. (you may need to download and install the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files to use it).

encryptProperties

Search recursively for all .properties files for values wrapped with ENCRYPT() and encrypted the values.

./gradlew encryptProperties --password=encryptor_password

Search recursively for non production property files and encrypt their wrapped values.

./gradlew encryptProperties --file-filter-pattern='application-((?!prod).*)\.properties' --password=encryptor_password

The original files are always backed up unless you add --no-backup.

encryptText

./gradlew encryptText --text=hello --password=encryptor_password

decryptProperties

Search recursively for all .properties files for values wrapped with ENC() and decrypted the values.

./gradlew decryptProperties --password=encryptor_password

Search recursively for non production property files and decrypt their wrapped values.

./gradlew decryptProperties --file-filter-pattern='application-((?!prod).*)\.properties' --password=encryptor_password

The original files are always backed up unless you add --no-backup.

decryptText

./gradlew decryptText --text=UjNjJVq8ly/oU3JGMNiQXw== --password=encryptor_password

Changelog

See CHANGELOG.

License

MIT. Please see LICENSE.

jasypt-gradle-plugin's People

Contributors

wilsimpson avatar cccs-ian avatar

Stargazers

d.sviridov avatar

Forkers

cccs-ian

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.