com.gruelbox:dropwizard-https-redirect

A small dropwizard bundle which will redirect any income HTTP requests to the equivalent HTTPS URL.

Лицензия

Лицензия

Категории

Категории

DropWizard Контейнер Микросервисы
Группа

Группа

com.gruelbox
Идентификатор

Идентификатор

dropwizard-https-redirect
Последняя версия

Последняя версия

0.0.6
Дата

Дата

Тип

Тип

jar
Описание

Описание

com.gruelbox:dropwizard-https-redirect
A small dropwizard bundle which will redirect any income HTTP requests to the equivalent HTTPS URL.
Ссылка на сайт

Ссылка на сайт

https://github.com/gruelbox/dropwizard-https-redirect
Организация-разработчик

Организация-разработчик

Graham Crockford
Система контроля версий

Система контроля версий

https://github.com/gruelbox/dropwizard-https-redirect

Скачать dropwizard-https-redirect

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.gruelbox/dropwizard-https-redirect/ -->
<dependency>
    <groupId>com.gruelbox</groupId>
    <artifactId>dropwizard-https-redirect</artifactId>
    <version>0.0.6</version>
</dependency>
// https://jarcasting.com/artifacts/com.gruelbox/dropwizard-https-redirect/
implementation 'com.gruelbox:dropwizard-https-redirect:0.0.6'
// https://jarcasting.com/artifacts/com.gruelbox/dropwizard-https-redirect/
implementation ("com.gruelbox:dropwizard-https-redirect:0.0.6")
'com.gruelbox:dropwizard-https-redirect:jar:0.0.6'
<dependency org="com.gruelbox" name="dropwizard-https-redirect" rev="0.0.6">
  <artifact name="dropwizard-https-redirect" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.gruelbox', module='dropwizard-https-redirect', version='0.0.6')
)
libraryDependencies += "com.gruelbox" % "dropwizard-https-redirect" % "0.0.6"
[com.gruelbox/dropwizard-https-redirect "0.0.6"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
io.dropwizard : dropwizard-core jar 1.3.15
org.apache.commons : commons-collections4 jar 4.4

test (3)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12
org.mockito : mockito-all jar 1.10.19
org.hamcrest : hamcrest-core jar 2.2

Модули Проекта

Данный проект не имеет модулей.

Dropwizard HTTPS redirection bundle

Build Status Sonarcloud Security Rating Sonarcloud Vulnerabilities Sonarcloud Coverage CodeFactor

Maven Central Javadocs

A small DropWizard bundle which will redirect any incoming HTTP requests to the equivalent HTTPS URL. Handles both the cases where the application is hosting both HTTP and HTTPS directly or where it is sitting behind an SSL proxy and receiving all traffic as HTTP.

Also protects against HTTP Response Splitting attacks.

Usage

Add to your pom.xml

<dependency>
  <groupId>com.gruelbox</groupId>
  <artifactId>dropwizard-https-redirect</artifactId>
  <version>0.0.4</version>
</dependency>

Set up configuration

Modify your application configuration class so that it implements HttpEnforcementConfiguration.

The isHttpsOnly() property enables or disables the redirection. It usually makes sense to disable it in configuration when testing locally.

The getHttpResponsibility() property is extremely important:

  • If your application is exposed directly to the internet without any sort of proxy (so your application manages its own SSL certificates) set this to HTTPS_DIRECT. The bundle will check the servlet request directly to ensure that it is secure.
  • If your application is hosted behind a proxy, and the proxy is managing the SSL side of things and forwarding both HTTP and HTTPS to your application as plain old HTTP (common with platforms such as Heroku), we have to rely on the proxy to tell us what the original protocol was using the X-Forwarded-Proto header. Most proxies do this, but do check yours. To enabled this, use HTTPS_AT_PROXY.

Install the bundle

In your Application, modify initialise():

  @Override
  public void initialize(final Bootstrap<MyConfiguration> bootstrap) {
    bootstrap.addBundle(new HttpsEnforcementBundle());
  }

That's it!

Credit

The POM and Travis build borrow heavily from other projects. See oss-archetype for credits.

com.gruelbox

The Gruelbox

Simple, nutritious open source tools.

Версии библиотеки

Версия
0.0.6
0.0.5
0.0.4
0.0.3