Skip to content

Commit 5bb3a25

Browse files
committed
Release 0.2.0
- Source code translated from Scala to Java
2 parents 2f22baa + d2ffe9a commit 5bb3a25

File tree

160 files changed

+6077
-3665
lines changed

Some content is hidden

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

160 files changed

+6077
-3665
lines changed

NEWS

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1+
== Version 0.2.0 ==
2+
3+
* Core library now recognises username as an internally relevant concept
4+
* Source code translated from Scala to Java
5+
* Too many other changes to count
6+
7+
18
== Version 0.1.0 ==
29

310
* First release of https://www.w3.org/TR/webauthn/[Web Authentication] support
411
* Merged U2F subprojects into webauthn-server-core and deleted lots of unused code
512

613

7-
= java-u2flib-server version history =
14+
== java-u2flib-server version history ==
815

916
This project was forked from https://developers.yubico.com/java-u2flib-server/[java-u2flib-server]. Below is the version history from before the fork.
1017

README

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ https://www.w3.org/TR/webauthn/#rp-operations[Relying Party operations] required
1313
for a server to support Web Authentication. This includes registering
1414
authenticators and authenticating registered authenticators.
1515

16-
The project is currently implemented mostly in Scala; this is intended to be
17-
translated to Java when the specification and these APIs seem stable enough.
18-
1916

2017
=== Example Usage
2118

build.gradle

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@ buildscript {
33
mavenCentral()
44
}
55
dependencies {
6-
classpath 'info.solidsoft.gradle.pitest:gradle-pitest-plugin:1.1.11'
6+
configurations.maybeCreate('pitest')
7+
classpath 'com.cinnober.gradle:semver-git:2.3.1'
8+
classpath 'info.solidsoft.gradle.pitest:gradle-pitest-plugin:1.3.0'
9+
pitest 'org.pitest:pitest-command-line:1.4.2' // Transitive dependency from pitest plugin
710
}
811
}
912
plugins {
@@ -24,10 +27,13 @@ if (publishEnabled) {
2427
}
2528

2629
task wrapper(type: Wrapper) {
27-
gradleVersion = '4.5.1'
30+
gradleVersion = '4.8'
2831
}
2932

3033
allprojects {
34+
ext.snapshotSuffix = "<count>.g<sha>-SNAPSHOT"
35+
36+
apply plugin: 'com.cinnober.gradle.semver-git'
3137
apply plugin: 'java'
3238
apply plugin: 'maven'
3339
apply plugin: 'signing'
@@ -42,10 +48,9 @@ allprojects {
4248
}
4349

4450
group = 'com.yubico'
45-
version = '0.1.0'
4651

47-
sourceCompatibility = 1.6
48-
targetCompatibility = 1.6
52+
sourceCompatibility = 1.8
53+
targetCompatibility = 1.8
4954

5055
tasks.withType(JavaCompile) {
5156
options.encoding = 'UTF-8'
@@ -59,11 +64,17 @@ allprojects {
5964

6065

6166
idea.module { downloadJavadoc = true }
67+
68+
test {
69+
failFast = true
70+
}
6271
}
6372

6473
evaluationDependsOnChildren()
6574

6675
subprojects {
76+
apply plugin: 'info.solidsoft.pitest'
77+
6778
task packageSources(type: Jar) {
6879
classifier = 'sources'
6980
from sourceSets.main.allSource
@@ -79,7 +90,7 @@ subprojects {
7990

8091
dependencies {
8192

82-
compileOnly 'org.projectlombok:lombok:1.16.18'
93+
compileOnly 'org.projectlombok:lombok:1.18.2'
8394

8495
compile(
8596
'org.slf4j:slf4j-api:1.7.25',
@@ -90,10 +101,6 @@ subprojects {
90101
[group: 'org.mockito', name: 'mockito-core', version:'2.8.47'],
91102
)
92103

93-
testRuntime(
94-
'org.slf4j:slf4j-simple:1.7.25',
95-
)
96-
97104
}
98105

99106
if (publishEnabled) {
@@ -142,13 +149,9 @@ subprojects {
142149
}
143150
}
144151

145-
}
146-
147-
subprojects {
148-
apply plugin: 'info.solidsoft.pitest'
149-
150152
pitest {
151-
pitestVersion = '1.2.2'
153+
pitestVersion = '1.4.2'
154+
152155
timestampedReports = false
153156
outputFormats = ['XML', 'HTML']
154157

gradle/wrapper/gradle-wrapper.jar

80 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.8-bin.zip
34
zipStoreBase=GRADLE_USER_HOME
45
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.5.1-bin.zip

webauthn-server-core/build.gradle

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,44 @@ dependencies {
1414
[group: 'org.bouncycastle', name: 'bcpkix-jdk15on', version:'1.54'],
1515
'com.augustcellars.cose:cose-java:0.9.4',
1616
[group: 'com.google.guava', name: 'guava', version:'19.0'],
17-
[group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version:'2.6.5'],
18-
[group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-cbor', version:'2.6.5'],
19-
'org.scala-lang:scala-library:2.11.3'
17+
[group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version:'2.9.6'],
18+
[group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-cbor', version:'2.9.6'],
2019
)
2120

2221
testCompile(
2322
'commons-io:commons-io:2.5',
2423
'org.mockito:mockito-core:2.10.0',
24+
'org.scala-lang:scala-library:2.11.3',
2525
'org.scalatest:scalatest_2.11:3.0.4',
2626
'org.scalacheck:scalacheck_2.11:1.13.5',
2727
)
2828

29+
testRuntime(
30+
'org.slf4j:slf4j-simple:1.7.25',
31+
)
32+
2933
scalaRepl(
3034
'org.scala-lang:scala-compiler:2.11.3',
3135
jar.outputs.files,
3236
)
3337

3438
}
3539

40+
41+
jar {
42+
manifest {
43+
attributes([
44+
'Specification-Title': 'Web Authentication: An API for accessing Public Key Credentials',
45+
'Specification-Version': 'Level 1 Candidate Recommendation 2018-03-20',
46+
'Specification-Vendor': 'World Wide Web Consortium',
47+
'Implementation-Id': 'java-webauthn-server',
48+
'Implementation-Title': 'Yubico Web Authentication server library',
49+
'Implementation-Version': project.version,
50+
'Implementation-Vendor': 'Yubico',
51+
])
52+
}
53+
}
54+
3655
def scalaReplDistDir = file(Paths.get(project.distsDir.path, 'scala-repl'))
3756
task scalaReplClasspath(type: Sync) {
3857
from configurations.scalaRepl

webauthn-server-core/src/main/scala/com/yubico/u2f/attestation/MetadataObject.java renamed to webauthn-server-core/src/main/java/com/yubico/u2f/attestation/MetadataObject.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,21 @@
88
import com.fasterxml.jackson.core.type.TypeReference;
99
import com.fasterxml.jackson.databind.JsonMappingException;
1010
import com.fasterxml.jackson.databind.JsonNode;
11+
import com.fasterxml.jackson.databind.ObjectMapper;
1112
import com.google.common.base.MoreObjects;
1213
import com.google.common.collect.ImmutableList;
13-
import com.yubico.u2f.data.messages.json.JsonSerializable;
1414
import com.yubico.u2f.exceptions.U2fBadConfigurationException;
15-
import com.yubico.u2f.exceptions.U2fBadInputException;
15+
import com.yubico.webauthn.util.WebAuthnCodecs;
1616
import java.io.IOException;
1717
import java.util.List;
1818
import java.util.Map;
1919
import lombok.EqualsAndHashCode;
2020

2121
@JsonIgnoreProperties(ignoreUnknown = true)
2222
@EqualsAndHashCode(of = { "data" }, callSuper = false)
23-
public class MetadataObject extends JsonSerializable {
23+
public class MetadataObject {
24+
private static final ObjectMapper OBJECT_MAPPER = WebAuthnCodecs.json();
25+
2426
private static final TypeReference<Map<String, String>> MAP_STRING_STRING_TYPE = new TypeReference<Map<String, String>>() {
2527
};
2628
private static final TypeReference LIST_STRING_TYPE = new TypeReference<List<String>>() {
@@ -55,7 +57,6 @@ public MetadataObject(JsonNode data) throws U2fBadConfigurationException {
5557
version = data.get("version").asLong();
5658
}
5759

58-
@Override
5960
public String toJson() {
6061
return data.toString();
6162
}
@@ -100,8 +101,8 @@ public static List<MetadataObject> parseFromJson(String jsonData) throws U2fBadC
100101

101102
public static MetadataObject fromJson(String json) throws U2fBadConfigurationException {
102103
try {
103-
return fromJson(json, MetadataObject.class);
104-
} catch (U2fBadInputException e) {
104+
return OBJECT_MAPPER.readValue(json, MetadataObject.class);
105+
} catch (IOException e) {
105106
throw new U2fBadConfigurationException("Malformed data", e);
106107
}
107108
}

0 commit comments

Comments
 (0)