-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #209 from smallrye/add-vertx-web-and-friends
- Loading branch information
Showing
15 changed files
with
899 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
121 changes: 121 additions & 0 deletions
121
vertx-mutiny-clients/vertx-mutiny-auth-htdigest/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>io.smallrye.reactive</groupId> | ||
<artifactId>vertx-mutiny-clients</artifactId> | ||
<version>1.3.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>smallrye-mutiny-vertx-auth-htdigest</artifactId> | ||
<name>SmallRye Mutiny - Vert.x Auth - htdigest</name> | ||
|
||
<properties> | ||
<gen-source-groupId>io.vertx</gen-source-groupId> | ||
<gen-source-artifactId>vertx-auth-htdigest</gen-source-artifactId> | ||
<gen.output>${project.build.directory}/sources/java</gen.output> | ||
</properties> | ||
|
||
<dependencies> | ||
<!-- Generation source --> | ||
<dependency> | ||
<groupId>${gen-source-groupId}</groupId> | ||
<artifactId>${gen-source-artifactId}</artifactId> | ||
<version>${vertx.version}</version> | ||
</dependency> | ||
|
||
<!-- Vert.x Mutiny Core --> | ||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>smallrye-mutiny-vertx-core</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>smallrye-mutiny-vertx-auth-common</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<configuration> | ||
<includeGroupIds>${gen-source-groupId}</includeGroupIds> | ||
<includeArtifactIds>${gen-source-artifactId}</includeArtifactIds> | ||
<classifier>sources</classifier> | ||
<includeTypes>jar</includeTypes> | ||
</configuration> | ||
<executions> | ||
<!-- Unpack java sources to target/java-sources --> | ||
<execution> | ||
<id>unpack-java</id> | ||
<phase>generate-sources</phase> | ||
<goals> | ||
<goal>unpack-dependencies</goal> | ||
</goals> | ||
<configuration> | ||
<includes>io/vertx/**/*.java</includes> | ||
<excludes>**/impl/**/*.java</excludes> | ||
<outputDirectory>${gen.output}</outputDirectory> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.bsc.maven</groupId> | ||
<artifactId>maven-processor-plugin</artifactId> | ||
<version>4.2-jdk8</version> | ||
<configuration> | ||
<systemProperties> | ||
<java.util.logging.SimpleFormatter.format>%4$s: %3$s - %5$s %6$s%n | ||
</java.util.logging.SimpleFormatter.format> | ||
<mvel2.disable.jit>true</mvel2.disable.jit> | ||
</systemProperties> | ||
</configuration> | ||
<executions> | ||
<!-- Run the annotation processor on java sources and generate the API --> | ||
<execution> | ||
<id>generate-api</id> | ||
<goals> | ||
<goal>process</goal> | ||
</goals> | ||
<phase>generate-sources</phase> | ||
<configuration> | ||
<sourceDirectory>${project.build.directory}/sources/java</sourceDirectory> | ||
<processors> | ||
<processor>io.vertx.codegen.CodeGenProcessor</processor> | ||
</processors> | ||
<optionMap> | ||
<codegen.generators>mutiny</codegen.generators> | ||
</optionMap> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<profiles> | ||
<profile> | ||
<id>windows</id> | ||
<activation> | ||
<os> | ||
<family>Windows</family> | ||
</os> | ||
</activation> | ||
<properties> | ||
<maven.test.skip>true</maven.test.skip> | ||
</properties> | ||
</profile> | ||
</profiles> | ||
|
||
</project> |
71 changes: 71 additions & 0 deletions
71
...ients/vertx-mutiny-auth-htdigest/src/test/java/io/vertx/mutiny/auth/HtDigestAuthTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package io.vertx.mutiny.auth; | ||
|
||
import static org.junit.Assert.assertEquals; | ||
import static org.junit.Assert.assertNotNull; | ||
|
||
import org.junit.After; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
import io.vertx.core.json.JsonObject; | ||
import io.vertx.mutiny.core.Vertx; | ||
import io.vertx.mutiny.ext.auth.User; | ||
import io.vertx.mutiny.ext.auth.htdigest.HtdigestAuth; | ||
|
||
public class HtDigestAuthTest { | ||
|
||
private Vertx vertx; | ||
private HtdigestAuth authProvider; | ||
|
||
@Before | ||
public void setup() { | ||
vertx = Vertx.vertx(); | ||
authProvider = HtdigestAuth.create(vertx); | ||
} | ||
|
||
@After | ||
public void tearDown() { | ||
vertx.closeAndAwait(); | ||
} | ||
|
||
@Test | ||
public void testValidDigestWithQOP() { | ||
JsonObject authInfo = new JsonObject() | ||
.put("method", "GET") | ||
|
||
.put("username", "Mufasa") | ||
.put("realm", "[email protected]") | ||
.put("nonce", "dcd98b7102dd2f0e8b11d0f600bfb0c093") | ||
.put("uri", "/dir/index.html") | ||
.put("qop", "auth") | ||
.put("nc", "00000001") | ||
.put("cnonce", "0a4f113b") | ||
.put("response", "6629fae49393a05397450978507c4ef1") | ||
.put("opaque", "5ccc069c403ebaf9f0171e9517f40e41"); | ||
|
||
User user = authProvider.authenticate(authInfo).await().indefinitely(); | ||
assertNotNull(user); | ||
assertEquals("Mufasa", user.principal().getString("username")); | ||
} | ||
|
||
@Test | ||
public void testValidDigestWithoutQOP() { | ||
JsonObject authInfo = new JsonObject() | ||
.put("method", "GET") | ||
|
||
.put("username", "Mufasa") | ||
.put("realm", "[email protected]") | ||
.put("nonce", "dcd98b7102dd2f0e8b11d0f600bfb0c093") | ||
.put("uri", "/dir/index.html") | ||
.put("nc", "00000001") | ||
.put("cnonce", "0a4f113b") | ||
.put("response", "670fd8c2df070c60b045671b8b24ff02") | ||
.put("opaque", "5ccc069c403ebaf9f0171e9517f40e41"); | ||
|
||
User user = authProvider.authenticate(authInfo).await().indefinitely(); | ||
assertNotNull(user); | ||
assertNotNull(user); | ||
assertEquals("Mufasa", user.principal().getString("username")); | ||
} | ||
|
||
} |
1 change: 1 addition & 0 deletions
1
vertx-mutiny-clients/vertx-mutiny-auth-htdigest/src/test/resources/.htdigest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Mufasa:[email protected]:939e7578ed9e3c518a452acee763bce9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
116 changes: 116 additions & 0 deletions
116
vertx-mutiny-clients/vertx-mutiny-bridge-common/pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>io.smallrye.reactive</groupId> | ||
<artifactId>vertx-mutiny-clients</artifactId> | ||
<version>1.3.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>smallrye-mutiny-vertx-bridge-common</artifactId> | ||
<name>SmallRye Mutiny - Vert.x Bridge Common</name> | ||
|
||
<properties> | ||
<gen-source-groupId>io.vertx</gen-source-groupId> | ||
<gen-source-artifactId>vertx-bridge-common</gen-source-artifactId> | ||
<gen.output>${project.build.directory}/sources/java</gen.output> | ||
</properties> | ||
|
||
<dependencies> | ||
<!-- Generation source --> | ||
<dependency> | ||
<groupId>${gen-source-groupId}</groupId> | ||
<artifactId>${gen-source-artifactId}</artifactId> | ||
<version>${vertx.version}</version> | ||
</dependency> | ||
|
||
<!-- Vert.x Mutiny Core --> | ||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>smallrye-mutiny-vertx-core</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<configuration> | ||
<includeGroupIds>${gen-source-groupId}</includeGroupIds> | ||
<includeArtifactIds>${gen-source-artifactId}</includeArtifactIds> | ||
<classifier>sources</classifier> | ||
<includeTypes>jar</includeTypes> | ||
</configuration> | ||
<executions> | ||
<!-- Unpack java sources to target/java-sources --> | ||
<execution> | ||
<id>unpack-java</id> | ||
<phase>generate-sources</phase> | ||
<goals> | ||
<goal>unpack-dependencies</goal> | ||
</goals> | ||
<configuration> | ||
<includes>io/vertx/**/*.java</includes> | ||
<excludes>**/impl/**/*.java</excludes> | ||
<outputDirectory>${gen.output}</outputDirectory> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.bsc.maven</groupId> | ||
<artifactId>maven-processor-plugin</artifactId> | ||
<version>4.2-jdk8</version> | ||
<configuration> | ||
<systemProperties> | ||
<java.util.logging.SimpleFormatter.format>%4$s: %3$s - %5$s %6$s%n | ||
</java.util.logging.SimpleFormatter.format> | ||
<mvel2.disable.jit>true</mvel2.disable.jit> | ||
</systemProperties> | ||
</configuration> | ||
<executions> | ||
<!-- Run the annotation processor on java sources and generate the API --> | ||
<execution> | ||
<id>generate-api</id> | ||
<goals> | ||
<goal>process</goal> | ||
</goals> | ||
<phase>generate-sources</phase> | ||
<configuration> | ||
<sourceDirectory>${project.build.directory}/sources/java</sourceDirectory> | ||
<processors> | ||
<processor>io.vertx.codegen.CodeGenProcessor</processor> | ||
</processors> | ||
<optionMap> | ||
<codegen.generators>mutiny</codegen.generators> | ||
</optionMap> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<profiles> | ||
<profile> | ||
<id>windows</id> | ||
<activation> | ||
<os> | ||
<family>Windows</family> | ||
</os> | ||
</activation> | ||
<properties> | ||
<maven.test.skip>true</maven.test.skip> | ||
</properties> | ||
</profile> | ||
</profiles> | ||
|
||
</project> |
Oops, something went wrong.