Skip to content

Commit 923eeca

Browse files
authored
Merge branch 'master' into tpm-attestation-ecc-fix
2 parents 6c884b3 + b47438c commit 923eeca

File tree

94 files changed

+7097
-326
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+7097
-326
lines changed

.github/workflows/ci-5.x.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- os: ubuntu-latest
1717
jdk: 11
1818
- os: ubuntu-latest
19-
jdk: 17
19+
jdk: 21
2020
uses: ./.github/workflows/ci.yml
2121
with:
2222
branch: ${{ github.event.pull_request.head.sha || github.ref_name }}

pom.xml

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
~ http://www.opensource.org/licenses/apache2.0.php
1414
~
1515
~ You may elect to redistribute this code under either of these licenses.
16-
-->
17-
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18-
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
16+
--><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">
1917

2018
<modelVersion>4.0.0</modelVersion>
2119

@@ -36,6 +34,7 @@
3634
<module>vertx-auth-htdigest</module>
3735
<module>vertx-auth-htpasswd</module>
3836
<module>vertx-auth-webauthn</module>
37+
<module>vertx-auth-webauthn4j</module>
3938
<module>vertx-auth-properties</module>
4039
<module>vertx-auth-sql-client</module>
4140
<module>vertx-auth-otp</module>
@@ -44,19 +43,14 @@
4443
<parent>
4544
<groupId>io.vertx</groupId>
4645
<artifactId>vertx5-parent</artifactId>
47-
<version>3</version>
46+
<version>9</version>
4847
</parent>
4948

5049
<artifactId>vertx-auth-parent</artifactId>
5150
<version>5.0.0-SNAPSHOT</version>
5251

5352
<name>Vert.x Auth</name>
5453

55-
<properties>
56-
<jar.manifest>${project.basedir}/src/main/resources/META-INF/MANIFEST.MF</jar.manifest>
57-
<test.useModulePath>true</test.useModulePath>
58-
</properties>
59-
6054
<dependencyManagement>
6155
<dependencies>
6256
<dependency>
@@ -72,18 +66,22 @@
7266
<dependencies>
7367
<dependency>
7468
<groupId>io.vertx</groupId>
75-
<artifactId>vertx-core</artifactId>
69+
<artifactId>vertx-codegen-api</artifactId>
70+
<optional>true</optional>
71+
</dependency>
72+
<dependency>
73+
<groupId>io.vertx</groupId>
74+
<artifactId>vertx-codegen-json</artifactId>
75+
<optional>true</optional>
7676
</dependency>
7777
<dependency>
7878
<groupId>io.vertx</groupId>
79-
<artifactId>vertx-codegen</artifactId>
80-
<scope>provided</scope>
79+
<artifactId>vertx-docgen-api</artifactId>
8180
<optional>true</optional>
8281
</dependency>
8382
<dependency>
8483
<groupId>io.vertx</groupId>
85-
<artifactId>vertx-docgen</artifactId>
86-
<scope>provided</scope>
84+
<artifactId>vertx-core</artifactId>
8785
</dependency>
8886

8987
<dependency>
@@ -104,30 +102,22 @@
104102
<id>default-compile</id>
105103
<phase>compile</phase>
106104
<configuration>
107-
<annotationProcessors>
108-
<annotationProcessor>io.vertx.codegen.CodeGenProcessor</annotationProcessor>
109-
<annotationProcessor>io.vertx.docgen.JavaDocGenProcessor</annotationProcessor>
110-
</annotationProcessors>
111105
<annotationProcessorPaths>
112106
<annotationProcessorPath>
113107
<groupId>io.vertx</groupId>
114108
<artifactId>vertx-codegen</artifactId>
109+
<classifier>processor</classifier>
115110
</annotationProcessorPath>
116111
<annotationProcessorPath>
117112
<groupId>io.vertx</groupId>
118-
<artifactId>vertx-docgen</artifactId>
113+
<artifactId>vertx-docgen-processor</artifactId>
114+
<classifier>processor</classifier>
119115
</annotationProcessorPath>
120116
</annotationProcessorPaths>
121117
</configuration>
122118
</execution>
123119
</executions>
124120
</plugin>
125-
<plugin>
126-
<artifactId>maven-surefire-plugin</artifactId>
127-
<configuration>
128-
<useModulePath>${test.useModulePath}</useModulePath>
129-
</configuration>
130-
</plugin>
131121
</plugins>
132122
</pluginManagement>
133123
<plugins>
@@ -145,4 +135,4 @@
145135
</plugins>
146136
</build>
147137

148-
</project>
138+
</project>

vertx-auth-abac/src/main/java/module-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
module io.vertx.auth.abac {
1212
requires transitive io.vertx.auth.common;
1313
requires static io.vertx.codegen.api;
14-
requires static vertx.docgen;
14+
requires static io.vertx.docgen;
1515
exports io.vertx.ext.auth.abac;
1616
}

vertx-auth-abac/src/main/resources/META-INF/MANIFEST.MF

Whitespace-only changes.

vertx-auth-common/src/main/asciidoc/enums.adoc

Lines changed: 0 additions & 21 deletions
This file was deleted.

vertx-auth-common/src/main/asciidoc/index.adoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,10 @@ To authenticate a user you use {@link io.vertx.ext.auth.authentication.Authentic
6262
The first argument is a Credentials object which contains authentication information.
6363
What this actually contains depends on the specific implementation; for a simple username/password based authentication it might contain something like:
6464

65+
[source,json]
6566
----
6667
{
67-
"username": "tim"
68+
"username": "tim",
6869
"password": "mypassword"
6970
}
7071
----
@@ -219,8 +220,8 @@ PEM files are common and easy to use but are not password protected, so private
219220

220221
JWKs are a standard used by OpenID connect and JWT providers.
221222
They represent a key as a JSON object.
222-
Usually these JSON documents are provided by an identity provider server like Google, Microsoft, etc... but you can also generate your own keys using the online application <a href="https://mkjwk.org/">https://mkjwk.org</a>.
223-
For an offline experience there is also the tool: <a href="https://connect2id.com/products/nimbus-jose-jwt/generator">https://connect2id.com/products/nimbus-jose-jwt/generator</a>.
223+
Usually these JSON documents are provided by an identity provider server like Google, Microsoft, etc... but you can also generate your own keys using the online application https://mkjwk.org.
224+
For an offline experience there is also the tool: https://connect2id.com/products/nimbus-jose-jwt/generator.
224225

225226
== Chaining authentication providers
226227

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
package io.vertx.ext.auth;
2+
3+
import io.vertx.core.json.JsonObject;
4+
import io.vertx.core.json.JsonArray;
5+
import java.time.Instant;
6+
import java.time.format.DateTimeFormatter;
7+
8+
/**
9+
* Converter and mapper for {@link io.vertx.ext.auth.JWTOptions}.
10+
* NOTE: This class has been automatically generated from the {@link io.vertx.ext.auth.JWTOptions} original class using Vert.x codegen.
11+
*/
12+
public class JWTOptionsConverter {
13+
14+
static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, JWTOptions obj) {
15+
for (java.util.Map.Entry<String, Object> member : json) {
16+
switch (member.getKey()) {
17+
case "leeway":
18+
if (member.getValue() instanceof Number) {
19+
obj.setLeeway(((Number)member.getValue()).intValue());
20+
}
21+
break;
22+
case "ignoreExpiration":
23+
if (member.getValue() instanceof Boolean) {
24+
obj.setIgnoreExpiration((Boolean)member.getValue());
25+
}
26+
break;
27+
case "algorithm":
28+
if (member.getValue() instanceof String) {
29+
obj.setAlgorithm((String)member.getValue());
30+
}
31+
break;
32+
case "header":
33+
if (member.getValue() instanceof JsonObject) {
34+
obj.setHeader(((JsonObject)member.getValue()).copy());
35+
}
36+
break;
37+
case "noTimestamp":
38+
if (member.getValue() instanceof Boolean) {
39+
obj.setNoTimestamp((Boolean)member.getValue());
40+
}
41+
break;
42+
case "expiresInSeconds":
43+
if (member.getValue() instanceof Number) {
44+
obj.setExpiresInSeconds(((Number)member.getValue()).intValue());
45+
}
46+
break;
47+
case "expiresInMinutes":
48+
if (member.getValue() instanceof Number) {
49+
obj.setExpiresInMinutes(((Number)member.getValue()).intValue());
50+
}
51+
break;
52+
case "audience":
53+
if (member.getValue() instanceof JsonArray) {
54+
java.util.ArrayList<java.lang.String> list = new java.util.ArrayList<>();
55+
((Iterable<Object>)member.getValue()).forEach( item -> {
56+
if (item instanceof String)
57+
list.add((String)item);
58+
});
59+
obj.setAudience(list);
60+
}
61+
break;
62+
case "audiences":
63+
if (member.getValue() instanceof JsonArray) {
64+
((Iterable<Object>)member.getValue()).forEach( item -> {
65+
if (item instanceof String)
66+
obj.addAudience((String)item);
67+
});
68+
}
69+
break;
70+
case "issuer":
71+
if (member.getValue() instanceof String) {
72+
obj.setIssuer((String)member.getValue());
73+
}
74+
break;
75+
case "subject":
76+
if (member.getValue() instanceof String) {
77+
obj.setSubject((String)member.getValue());
78+
}
79+
break;
80+
case "nonceAlgorithm":
81+
if (member.getValue() instanceof String) {
82+
obj.setNonceAlgorithm((String)member.getValue());
83+
}
84+
break;
85+
}
86+
}
87+
}
88+
89+
static void toJson(JWTOptions obj, JsonObject json) {
90+
toJson(obj, json.getMap());
91+
}
92+
93+
static void toJson(JWTOptions obj, java.util.Map<String, Object> json) {
94+
json.put("leeway", obj.getLeeway());
95+
json.put("ignoreExpiration", obj.isIgnoreExpiration());
96+
if (obj.getAlgorithm() != null) {
97+
json.put("algorithm", obj.getAlgorithm());
98+
}
99+
if (obj.getHeader() != null) {
100+
json.put("header", obj.getHeader());
101+
}
102+
json.put("noTimestamp", obj.isNoTimestamp());
103+
json.put("expiresInSeconds", obj.getExpiresInSeconds());
104+
if (obj.getAudience() != null) {
105+
JsonArray array = new JsonArray();
106+
obj.getAudience().forEach(item -> array.add(item));
107+
json.put("audience", array);
108+
}
109+
if (obj.getIssuer() != null) {
110+
json.put("issuer", obj.getIssuer());
111+
}
112+
if (obj.getSubject() != null) {
113+
json.put("subject", obj.getSubject());
114+
}
115+
if (obj.getNonceAlgorithm() != null) {
116+
json.put("nonceAlgorithm", obj.getNonceAlgorithm());
117+
}
118+
}
119+
}
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
package io.vertx.ext.auth;
2+
3+
import io.vertx.core.json.JsonObject;
4+
import io.vertx.core.json.JsonArray;
5+
import java.time.Instant;
6+
import java.time.format.DateTimeFormatter;
7+
8+
/**
9+
* Converter and mapper for {@link io.vertx.ext.auth.KeyStoreOptions}.
10+
* NOTE: This class has been automatically generated from the {@link io.vertx.ext.auth.KeyStoreOptions} original class using Vert.x codegen.
11+
*/
12+
public class KeyStoreOptionsConverter {
13+
14+
static void fromJson(Iterable<java.util.Map.Entry<String, Object>> json, KeyStoreOptions obj) {
15+
for (java.util.Map.Entry<String, Object> member : json) {
16+
switch (member.getKey()) {
17+
case "type":
18+
if (member.getValue() instanceof String) {
19+
obj.setType((String)member.getValue());
20+
}
21+
break;
22+
case "provider":
23+
if (member.getValue() instanceof String) {
24+
obj.setProvider((String)member.getValue());
25+
}
26+
break;
27+
case "password":
28+
if (member.getValue() instanceof String) {
29+
obj.setPassword((String)member.getValue());
30+
}
31+
break;
32+
case "path":
33+
if (member.getValue() instanceof String) {
34+
obj.setPath((String)member.getValue());
35+
}
36+
break;
37+
case "passwordProtection":
38+
if (member.getValue() instanceof JsonObject) {
39+
java.util.Map<String, java.lang.String> map = new java.util.LinkedHashMap<>();
40+
((Iterable<java.util.Map.Entry<String, Object>>)member.getValue()).forEach(entry -> {
41+
if (entry.getValue() instanceof String)
42+
map.put(entry.getKey(), (String)entry.getValue());
43+
});
44+
obj.setPasswordProtection(map);
45+
}
46+
break;
47+
}
48+
}
49+
}
50+
51+
static void toJson(KeyStoreOptions obj, JsonObject json) {
52+
toJson(obj, json.getMap());
53+
}
54+
55+
static void toJson(KeyStoreOptions obj, java.util.Map<String, Object> json) {
56+
if (obj.getType() != null) {
57+
json.put("type", obj.getType());
58+
}
59+
if (obj.getProvider() != null) {
60+
json.put("provider", obj.getProvider());
61+
}
62+
if (obj.getPassword() != null) {
63+
json.put("password", obj.getPassword());
64+
}
65+
if (obj.getPath() != null) {
66+
json.put("path", obj.getPath());
67+
}
68+
if (obj.getPasswordProtection() != null) {
69+
JsonObject map = new JsonObject();
70+
obj.getPasswordProtection().forEach((key, value) -> map.put(key, value));
71+
json.put("passwordProtection", map);
72+
}
73+
}
74+
}

0 commit comments

Comments
 (0)