Skip to content

Commit 47d0c4a

Browse files
authored
Merge pull request #38 from Yubico/api-deps
Fix API dependency declarations
2 parents ef760b8 + 18bbb2f commit 47d0c4a

File tree

14 files changed

+130
-7
lines changed

14 files changed

+130
-7
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,4 @@ target/
1919

2020
# Gradle
2121
.gradle/
22-
/build/
23-
/*/build/
22+
build/

build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ subprojects {
6363
}
6464
}
6565

66-
evaluationDependsOnChildren()
66+
allprojects {
67+
evaluationDependsOnChildren()
68+
}
6769

6870
task assembleJavadoc(type: Sync) {
6971
from("docs/index.html") {

settings.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,7 @@ include ':webauthn-server-core'
44
include ':webauthn-server-demo'
55
include ':yubico-util'
66
include ':yubico-util-scala'
7+
8+
include ':test-dependent-projects:java-dep-webauthn-server-attestation'
9+
include ':test-dependent-projects:java-dep-webauthn-server-core'
10+
include ':test-dependent-projects:java-dep-yubico-util'
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
plugins {
2+
// This is needed because the root project needs the sourceCompatibility property to exist.
3+
`java-library`
4+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
plugins {
2+
`java-library`
3+
}
4+
5+
dependencies {
6+
implementation(project(":webauthn-server-attestation"))
7+
}
8+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.yubico.test.compilability;
2+
3+
import com.yubico.webauthn.attestation.AttestationResolver;
4+
import java.security.cert.X509Certificate;
5+
import java.util.List;
6+
import java.util.Optional;
7+
8+
public class ThisShouldCompile {
9+
10+
public AttestationResolver getResolver() {
11+
return new AttestationResolver() {
12+
@Override
13+
public Optional<com.yubico.webauthn.attestation.Attestation> resolve(X509Certificate attestationCertificate, List<X509Certificate> certificateChain) {
14+
return Optional.empty();
15+
}
16+
17+
@Override
18+
public com.yubico.webauthn.attestation.Attestation untrustedFromCertificate(X509Certificate attestationCertificate) {
19+
return null;
20+
}
21+
};
22+
}
23+
24+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
plugins {
2+
`java-library`
3+
}
4+
5+
dependencies {
6+
implementation(project(":webauthn-server-core"))
7+
}
8+
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package com.yubico.test.compilability;
2+
3+
import com.yubico.webauthn.CredentialRepository;
4+
import com.yubico.webauthn.RegisteredCredential;
5+
import com.yubico.webauthn.RelyingParty;
6+
import com.yubico.webauthn.data.ByteArray;
7+
import com.yubico.webauthn.data.PublicKeyCredentialDescriptor;
8+
import com.yubico.webauthn.data.PublicKeyCredentialType;
9+
import com.yubico.webauthn.data.RelyingPartyIdentity;
10+
import java.util.Optional;
11+
import java.util.Set;
12+
13+
public class ThisShouldCompile {
14+
15+
public RelyingParty getRp() {
16+
return RelyingParty.builder()
17+
.identity(RelyingPartyIdentity.builder()
18+
.id("localhost")
19+
.name("Example RP")
20+
.build())
21+
.credentialRepository(new CredentialRepository() {
22+
@Override public Set<PublicKeyCredentialDescriptor> getCredentialIdsForUsername(String username) { return null; }
23+
@Override public Optional<ByteArray> getUserHandleForUsername(String username) { return Optional.empty(); }
24+
@Override public Optional<String> getUsernameForUserHandle(ByteArray userHandle) { return Optional.empty(); }
25+
@Override public Optional<RegisteredCredential> lookup(ByteArray credentialId, ByteArray userHandle) { return Optional.empty(); }
26+
@Override public Set<RegisteredCredential> lookupAll(ByteArray credentialId) { return null; }
27+
})
28+
.build();
29+
}
30+
31+
public ByteArray getByteArray() {
32+
ByteArray a = new ByteArray(new byte[] {1, 2, 3, 4});
33+
byte[] b = a.getBytes();
34+
return a;
35+
}
36+
37+
public PublicKeyCredentialType getPublicKeyCredentialType() {
38+
PublicKeyCredentialType a = PublicKeyCredentialType.PUBLIC_KEY;
39+
String b = a.toJsonString();
40+
return a;
41+
}
42+
43+
44+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
plugins {
2+
`java-library`
3+
}
4+
5+
dependencies {
6+
implementation(project(":yubico-util"))
7+
}
8+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package com.yubico.test.compilability;
2+
3+
import com.fasterxml.jackson.core.JsonProcessingException;
4+
import com.yubico.internal.util.JacksonCodecs;
5+
6+
public class ThisShouldCompile {
7+
8+
public String getEncodedValue() throws JsonProcessingException {
9+
return JacksonCodecs.json().writeValueAsString("hej");
10+
}
11+
12+
}

0 commit comments

Comments
 (0)