All Projects → meltmedia → dropwizard-crypto

meltmedia / dropwizard-crypto

Licence: Apache-2.0 license
A Crytpographic Bundle for Dropwizard

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to dropwizard-crypto

keycloak-dropwizard-integration
This project shows how JBoss Keycloak and Dropwizard can be used together.
Stars: ✭ 49 (+250%)
Mutual labels:  dropwizard, dropwizard-bundle
dropwizard-mongo
A Dropwizard bundle for MongoDB
Stars: ✭ 20 (+42.86%)
Mutual labels:  dropwizard, dropwizard-bundle
Dropwizard Jobs
Scheduling / Quartz integration for Dropwizard
Stars: ✭ 132 (+842.86%)
Mutual labels:  dropwizard
thunder
REST API application that manages user databases
Stars: ✭ 22 (+57.14%)
Mutual labels:  dropwizard
dropwizard-swagger
a Dropwizard bundle that serves Swagger UI static content and loads Swagger endpoints.
Stars: ✭ 176 (+1157.14%)
Mutual labels:  dropwizard
Pac4j
Security engine for Java (authentication, authorization, multi frameworks): OAuth, CAS, SAML, OpenID Connect, LDAP, JWT...
Stars: ✭ 2,097 (+14878.57%)
Mutual labels:  dropwizard
sbt-guardrail
Principled code generation from OpenAPI specifications
Stars: ✭ 24 (+71.43%)
Mutual labels:  dropwizard
Rufus
Rufus - fetches the paper for you!
Stars: ✭ 108 (+671.43%)
Mutual labels:  dropwizard
dropwizard-influxdb-reporter
Dropwizard Integrations for InfluxDB.
Stars: ✭ 16 (+14.29%)
Mutual labels:  dropwizard
metrics-agent
JVM agent based metrics with Prometheus and Dropwizard support (Java, Scala, Clojure, Kotlin, etc)
Stars: ✭ 25 (+78.57%)
Mutual labels:  dropwizard
dropwizard-elasticsearch
A set of classes for using Elasticsearch in a Dropwizard service.
Stars: ✭ 61 (+335.71%)
Mutual labels:  dropwizard
Jax Rs Performance Comparison
⚡️ Performance Comparison of Jax-RS implementations and embedded containers
Stars: ✭ 181 (+1192.86%)
Mutual labels:  dropwizard
dropwizard-guicey-ext
Dropwizard-guicey extensions
Stars: ✭ 11 (-21.43%)
Mutual labels:  dropwizard
Hikaku
A library that tests if the implementation of a REST-API meets its specification.
Stars: ✭ 154 (+1000%)
Mutual labels:  dropwizard
dropwizard-raven
Dropwizard integration for error logging to Sentry.
Stars: ✭ 20 (+42.86%)
Mutual labels:  dropwizard
Melon
Melon 🍈 - Dropwizard-like web service framework in Go (golang)
Stars: ✭ 111 (+692.86%)
Mutual labels:  dropwizard
Dropwizard Guicey
Dropwizard guice integration
Stars: ✭ 197 (+1307.14%)
Mutual labels:  dropwizard
metrics-aspectj
AspectJ integration for Dropwizard Metrics
Stars: ✭ 78 (+457.14%)
Mutual labels:  dropwizard
dropwizard-auth-multitenancy-example
Sample code for my blog post
Stars: ✭ 15 (+7.14%)
Mutual labels:  dropwizard
dropwizard-zipkin
Dropwizard Zipkin Bundle
Stars: ✭ 48 (+242.86%)
Mutual labels:  dropwizard

Dropwizard Crypto

A Dropwizard bundle that adds encryption support to an application's ObjectMapper.

Build Status

Usage

Maven

This project releases to Maven Central. To use the bundle, simply include its dependency in your project.

<dependency>
  <groupId>com.meltmedia.dropwizard</groupId>
  <artifactId>dropwizard-crypto</artifactId>
  <version>0.3.1</version>
</dependency>

To use SNAPSHOTs of this project, you will need to include the sonatype repository in your POM.

<repositories>
    <repository>
        <snapshots>
        <enabled>true</enabled>
        </snapshots>
        <id>sonatype-nexus-snapshots</id>
        <name>Sonatype Nexus Snapshots</name>
        <url>https://oss.sonatype.org/content/repositories/snapshots</url>
    </repository>
</repositories>

Java

Include the bundle in the initialize method of your application:

import com.meltmedia.dropwizard.crypto.CryptoBundle;

...

@Override
public void initialize(Bootstrap<MyConfiguration> bootstrap) {
  bootstrap.addBundle(
    CryptoBundle
      .builder().build());
}

And include the @Encrypted annotations on your Configuration object's encrypted properties:

@Encrypted
public String getSecret() {
  return secret;
}

Environment

When running your application, define the passphrase in the environment.

export DROPWIZARD_PASSPHRASE='correct horse battery staple'

Configuration

Create an unencrypted version of your configuration.

secret: secret

Then pass it through the encryption command.

dropwizard-app encrypt -p /secret unencrypted.yml encrypted.yml

This will give you an encrypted version of your config.

---
secret:
  salt: "tKD8wQ=="
  iv: "s9hTJRaZn6fxxpA4nVfDag=="
  value: "UZENJOltf+9EZS03AXbmeg=="
  cipher: "aes-256-cbc"
  keyDerivation: "pbkdf2"
  keyLength: 256
  iterations: 2000
  encrypted: true

Running

Run any of your application's configured commands like you normally would, just pass in a version of the configuration with encrypted values.

dropwizard-app server encrypted.yml

Building

This project builds with Java8 and Maven 3. Simply clone the repo and run

mvn clean install

from the root directory.

Contributing

This project accepts PRs, so feel free to fork the project and send contributions back.

Formatting

This project contains formatters to help keep the code base consistent. The formatter will update Java source files and add headers to other files. When running the formatter, I suggest the following procedure:

  1. Make sure any outstanding stages are staged. This will prevent the formatter from destroying your code.
  2. Run mvn format, this will format the source and add any missing license headers.
  3. If the changes look good and the project still compiles, add the formatting changes to your staged code.

If things go wrong, you can run git checkout -- . to drop the formatting changes.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].