diff --git a/.gitignore b/.gitignore index 319a141d9..951cda252 100644 --- a/.gitignore +++ b/.gitignore @@ -19,5 +19,4 @@ target/ # Gradle .gradle/ -/build/ -/*/build/ +build/ diff --git a/build.gradle b/build.gradle index 2573a3733..cb4da9ebc 100644 --- a/build.gradle +++ b/build.gradle @@ -63,7 +63,9 @@ subprojects { } } -evaluationDependsOnChildren() +allprojects { + evaluationDependsOnChildren() +} task assembleJavadoc(type: Sync) { from("docs/index.html") { diff --git a/settings.gradle b/settings.gradle index 64788676b..14392fbb1 100644 --- a/settings.gradle +++ b/settings.gradle @@ -4,3 +4,7 @@ include ':webauthn-server-core' include ':webauthn-server-demo' include ':yubico-util' include ':yubico-util-scala' + +include ':test-dependent-projects:java-dep-webauthn-server-attestation' +include ':test-dependent-projects:java-dep-webauthn-server-core' +include ':test-dependent-projects:java-dep-yubico-util' diff --git a/test-dependent-projects/build.gradle.kts b/test-dependent-projects/build.gradle.kts new file mode 100644 index 000000000..2221c1110 --- /dev/null +++ b/test-dependent-projects/build.gradle.kts @@ -0,0 +1,4 @@ +plugins { + // This is needed because the root project needs the sourceCompatibility property to exist. + `java-library` +} diff --git a/test-dependent-projects/java-dep-webauthn-server-attestation/build.gradle.kts b/test-dependent-projects/java-dep-webauthn-server-attestation/build.gradle.kts new file mode 100644 index 000000000..3545fd00b --- /dev/null +++ b/test-dependent-projects/java-dep-webauthn-server-attestation/build.gradle.kts @@ -0,0 +1,8 @@ +plugins { + `java-library` +} + +dependencies { + implementation(project(":webauthn-server-attestation")) +} + diff --git a/test-dependent-projects/java-dep-webauthn-server-attestation/src/main/java/com/yubico/test/compilability/ThisShouldCompile.java b/test-dependent-projects/java-dep-webauthn-server-attestation/src/main/java/com/yubico/test/compilability/ThisShouldCompile.java new file mode 100644 index 000000000..4320448a1 --- /dev/null +++ b/test-dependent-projects/java-dep-webauthn-server-attestation/src/main/java/com/yubico/test/compilability/ThisShouldCompile.java @@ -0,0 +1,24 @@ +package com.yubico.test.compilability; + +import com.yubico.webauthn.attestation.AttestationResolver; +import java.security.cert.X509Certificate; +import java.util.List; +import java.util.Optional; + +public class ThisShouldCompile { + + public AttestationResolver getResolver() { + return new AttestationResolver() { + @Override + public Optional resolve(X509Certificate attestationCertificate, List certificateChain) { + return Optional.empty(); + } + + @Override + public com.yubico.webauthn.attestation.Attestation untrustedFromCertificate(X509Certificate attestationCertificate) { + return null; + } + }; + } + +} diff --git a/test-dependent-projects/java-dep-webauthn-server-core/build.gradle.kts b/test-dependent-projects/java-dep-webauthn-server-core/build.gradle.kts new file mode 100644 index 000000000..d4936dc4a --- /dev/null +++ b/test-dependent-projects/java-dep-webauthn-server-core/build.gradle.kts @@ -0,0 +1,8 @@ +plugins { + `java-library` +} + +dependencies { + implementation(project(":webauthn-server-core")) +} + diff --git a/test-dependent-projects/java-dep-webauthn-server-core/src/main/java/com/yubico/test/compilability/ThisShouldCompile.java b/test-dependent-projects/java-dep-webauthn-server-core/src/main/java/com/yubico/test/compilability/ThisShouldCompile.java new file mode 100644 index 000000000..4c1a8b761 --- /dev/null +++ b/test-dependent-projects/java-dep-webauthn-server-core/src/main/java/com/yubico/test/compilability/ThisShouldCompile.java @@ -0,0 +1,44 @@ +package com.yubico.test.compilability; + +import com.yubico.webauthn.CredentialRepository; +import com.yubico.webauthn.RegisteredCredential; +import com.yubico.webauthn.RelyingParty; +import com.yubico.webauthn.data.ByteArray; +import com.yubico.webauthn.data.PublicKeyCredentialDescriptor; +import com.yubico.webauthn.data.PublicKeyCredentialType; +import com.yubico.webauthn.data.RelyingPartyIdentity; +import java.util.Optional; +import java.util.Set; + +public class ThisShouldCompile { + + public RelyingParty getRp() { + return RelyingParty.builder() + .identity(RelyingPartyIdentity.builder() + .id("localhost") + .name("Example RP") + .build()) + .credentialRepository(new CredentialRepository() { + @Override public Set getCredentialIdsForUsername(String username) { return null; } + @Override public Optional getUserHandleForUsername(String username) { return Optional.empty(); } + @Override public Optional getUsernameForUserHandle(ByteArray userHandle) { return Optional.empty(); } + @Override public Optional lookup(ByteArray credentialId, ByteArray userHandle) { return Optional.empty(); } + @Override public Set lookupAll(ByteArray credentialId) { return null; } + }) + .build(); + } + + public ByteArray getByteArray() { + ByteArray a = new ByteArray(new byte[] {1, 2, 3, 4}); + byte[] b = a.getBytes(); + return a; + } + + public PublicKeyCredentialType getPublicKeyCredentialType() { + PublicKeyCredentialType a = PublicKeyCredentialType.PUBLIC_KEY; + String b = a.toJsonString(); + return a; + } + + +} diff --git a/test-dependent-projects/java-dep-yubico-util/build.gradle.kts b/test-dependent-projects/java-dep-yubico-util/build.gradle.kts new file mode 100644 index 000000000..822271db6 --- /dev/null +++ b/test-dependent-projects/java-dep-yubico-util/build.gradle.kts @@ -0,0 +1,8 @@ +plugins { + `java-library` +} + +dependencies { + implementation(project(":yubico-util")) +} + diff --git a/test-dependent-projects/java-dep-yubico-util/src/main/java/com/yubico/test/compilability/ThisShouldCompile.java b/test-dependent-projects/java-dep-yubico-util/src/main/java/com/yubico/test/compilability/ThisShouldCompile.java new file mode 100644 index 000000000..71f885e21 --- /dev/null +++ b/test-dependent-projects/java-dep-yubico-util/src/main/java/com/yubico/test/compilability/ThisShouldCompile.java @@ -0,0 +1,12 @@ +package com.yubico.test.compilability; + +import com.fasterxml.jackson.core.JsonProcessingException; +import com.yubico.internal.util.JacksonCodecs; + +public class ThisShouldCompile { + + public String getEncodedValue() throws JsonProcessingException { + return JacksonCodecs.json().writeValueAsString("hej"); + } + +} diff --git a/webauthn-server-attestation/build.gradle b/webauthn-server-attestation/build.gradle index fb74b0159..4c44b1e94 100644 --- a/webauthn-server-attestation/build.gradle +++ b/webauthn-server-attestation/build.gradle @@ -11,8 +11,11 @@ evaluationDependsOn(':webauthn-server-core') dependencies { - implementation( + api( project(':webauthn-server-core'), + ) + + implementation( project(':yubico-util'), 'com.fasterxml.jackson.core:jackson-databind:2.9.9.3', 'com.google.guava:guava:19.0', diff --git a/webauthn-server-core/build.gradle b/webauthn-server-core/build.gradle index f2e0f3247..74bc14d05 100644 --- a/webauthn-server-core/build.gradle +++ b/webauthn-server-core/build.gradle @@ -10,8 +10,11 @@ project.ext.publishMe = true dependencies { - implementation( + api( project(':yubico-util'), + ) + + implementation( 'com.augustcellars.cose:cose-java:0.9.10', 'com.fasterxml.jackson.core:jackson-databind:2.9.9.3', 'com.google.guava:guava:19.0', diff --git a/webauthn-server-demo/build.gradle b/webauthn-server-demo/build.gradle index bec70b913..7c922e895 100644 --- a/webauthn-server-demo/build.gradle +++ b/webauthn-server-demo/build.gradle @@ -26,7 +26,7 @@ dependencies { 'com.fasterxml.jackson.core:jackson-databind:2.9.9.3', 'com.google.guava:guava:19.0', - 'com.upokecenter:cbor:2.4.1', + 'com.upokecenter:cbor:3.6.0', 'javax.ws.rs:javax.ws.rs-api:2.1', 'org.eclipse.jetty:jetty-server:9.4.9.v20180320', 'org.eclipse.jetty:jetty-servlet:9.4.9.v20180320', diff --git a/yubico-util/build.gradle b/yubico-util/build.gradle index 575de6830..edc118834 100644 --- a/yubico-util/build.gradle +++ b/yubico-util/build.gradle @@ -9,10 +9,14 @@ project.ext.publishMe = true dependencies { + api( + 'com.fasterxml.jackson.core:jackson-databind:2.9.9.3', + ) + implementation( 'com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.9.9', 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.9', - 'com.upokecenter:cbor:2.4.1', + 'com.upokecenter:cbor:3.6.0', 'org.bouncycastle:bcprov-jdk15on:1.62', 'org.slf4j:slf4j-api:1.7.25', )