Skip to content

Commit 01851f9

Browse files
committed
Remove debug output from tests
1 parent f210366 commit 01851f9

File tree

6 files changed

+0
-121
lines changed

6 files changed

+0
-121
lines changed

webauthn-server-core/src/test/scala/com/yubico/webauthn/OriginMatcherSpec.scala

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ class OriginMatcherSpec
101101
it("accepts nothing if no allowed origins are given.") {
102102
forAll(urlOrArbitraryString, arbitrary[Boolean], arbitrary[Boolean]) {
103103
(origin, allowPort, allowSubdomain) =>
104-
println(origin)
105104
OriginMatcher.isAllowed(
106105
origin,
107106
Set.empty[String].asJava,
@@ -114,7 +113,6 @@ class OriginMatcherSpec
114113
it("always accepts string equality even for invalid URLs.") {
115114
forAll(urlOrArbitraryString, arbitrary[Boolean], arbitrary[Boolean]) {
116115
(origin, allowPort, allowSubdomain) =>
117-
println(origin)
118116
OriginMatcher.isAllowed(
119117
origin,
120118
Set(origin).asJava,
@@ -127,7 +125,6 @@ class OriginMatcherSpec
127125
it("does not accept superdomains.") {
128126
forAll(superAndSubdomain) {
129127
case (origin: URL, allowedOrigin: URL) =>
130-
println(allowedOrigin, origin)
131128
OriginMatcher.isAllowed(
132129
origin.toExternalForm,
133130
Set(allowedOrigin.toExternalForm).asJava,
@@ -141,7 +138,6 @@ class OriginMatcherSpec
141138
it("by default.") {
142139
forAll(superAndSubdomain, arbitrary[Boolean]) { (origins, allowPort) =>
143140
val (allowedOrigin: URL, origin: URL) = origins
144-
println(allowedOrigin, origin)
145141

146142
OriginMatcher.isAllowed(
147143
origin.toExternalForm,
@@ -156,8 +152,6 @@ class OriginMatcherSpec
156152
forAll(superAndSubdomain) {
157153
case (allowedOrigin: URL, origin: URL) =>
158154
val invalidAllowedOrigin = invalidize(allowedOrigin)
159-
println(allowedOrigin, origin, invalidAllowedOrigin)
160-
161155
OriginMatcher.isAllowed(
162156
origin.toExternalForm,
163157
Set(invalidAllowedOrigin).asJava,
@@ -171,8 +165,6 @@ class OriginMatcherSpec
171165
forAll(superAndSubdomain) {
172166
case (allowedOrigin: URL, origin: URL) =>
173167
val invalidOrigin = invalidize(origin)
174-
println(allowedOrigin, origin, invalidOrigin)
175-
176168
OriginMatcher.isAllowed(
177169
invalidOrigin,
178170
Set(allowedOrigin.toExternalForm).asJava,
@@ -185,8 +177,6 @@ class OriginMatcherSpec
185177
it("unless configured to.") {
186178
forAll(superAndSubdomain, arbitrary[Boolean]) { (origins, allowPort) =>
187179
val (allowedOrigin: URL, origin: URL) = origins
188-
println(allowedOrigin, origin)
189-
190180
OriginMatcher.isAllowed(
191181
origin.toExternalForm,
192182
Set(allowedOrigin.toExternalForm).asJava,
@@ -203,8 +193,6 @@ class OriginMatcherSpec
203193
(allowedOrigin, port, allowSubdomain) =>
204194
whenever(port > 0) {
205195
val origin = replacePort(allowedOrigin, port)
206-
println(allowedOrigin, origin)
207-
208196
OriginMatcher.isAllowed(
209197
origin.toExternalForm,
210198
Set(allowedOrigin.toExternalForm).asJava,
@@ -218,8 +206,6 @@ class OriginMatcherSpec
218206
it("unless the same port is specified in an allowed origin.") {
219207
forAll(urlWithPort, arbitrary[Boolean]) {
220208
(origin: URL, allowSubdomain: Boolean) =>
221-
println(origin)
222-
223209
OriginMatcher.isAllowed(
224210
origin.toExternalForm,
225211
Set(origin.toExternalForm).asJava,
@@ -242,8 +228,6 @@ class OriginMatcherSpec
242228
port,
243229
allowedOrigin.getFile,
244230
)
245-
println(allowedOrigin, origin)
246-
247231
OriginMatcher.isAllowed(
248232
origin.toExternalForm,
249233
Set(allowedOrigin.toExternalForm).asJava,
@@ -258,8 +242,6 @@ class OriginMatcherSpec
258242
it("accepts subdomains and arbitrary ports when configured to.") {
259243
forAll(superAndSubdomainWithPorts) {
260244
case (allowedOrigin, origin) =>
261-
println(allowedOrigin, origin)
262-
263245
OriginMatcher.isAllowed(
264246
origin.toExternalForm,
265247
Set(allowedOrigin.toExternalForm).asJava,

webauthn-server-core/src/test/scala/com/yubico/webauthn/RelyingPartyAssertionSpec.scala

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,12 +1320,6 @@ class RelyingPartyAssertionSpec
13201320

13211321
forAll(Extensions.unrequestedClientAssertionExtensions) {
13221322
case (extensionInputs, clientExtensionOutputs, _) =>
1323-
println(extensionInputs.getExtensionIds, extensionInputs)
1324-
println(
1325-
clientExtensionOutputs.getExtensionIds,
1326-
clientExtensionOutputs,
1327-
)
1328-
13291323
val steps = finishAssertion(
13301324
requestedExtensions = extensionInputs,
13311325
clientExtensionResults = clientExtensionOutputs,
@@ -1344,12 +1338,6 @@ class RelyingPartyAssertionSpec
13441338
it("Succeeds if clientExtensionResults is not a subset of the extensions requested by the Relying Party, but the Relying Party has enabled allowing unrequested extensions.") {
13451339
forAll(Extensions.unrequestedClientAssertionExtensions) {
13461340
case (extensionInputs, clientExtensionOutputs, _) =>
1347-
println(extensionInputs.getExtensionIds, extensionInputs)
1348-
println(
1349-
clientExtensionOutputs.getExtensionIds,
1350-
clientExtensionOutputs,
1351-
)
1352-
13531341
val steps = finishAssertion(
13541342
allowUnrequestedExtensions = true,
13551343
requestedExtensions = extensionInputs,
@@ -1366,12 +1354,6 @@ class RelyingPartyAssertionSpec
13661354
it("Succeeds if clientExtensionResults is a subset of the extensions requested by the Relying Party.") {
13671355
forAll(Extensions.subsetAssertionExtensions) {
13681356
case (extensionInputs, clientExtensionOutputs, _) =>
1369-
println(extensionInputs.getExtensionIds, extensionInputs)
1370-
println(
1371-
clientExtensionOutputs.getExtensionIds,
1372-
clientExtensionOutputs,
1373-
)
1374-
13751357
val steps = finishAssertion(
13761358
requestedExtensions = extensionInputs,
13771359
clientExtensionResults = clientExtensionOutputs,
@@ -1393,9 +1375,6 @@ class RelyingPartyAssertionSpec
13931375
_,
13941376
authenticatorExtensionOutputs: CBORObject,
13951377
) =>
1396-
println(extensionInputs)
1397-
println(authenticatorExtensionOutputs)
1398-
13991378
val steps = finishAssertion(
14001379
requestedExtensions = extensionInputs,
14011380
authenticatorData = TestAuthenticator.makeAuthDataBytes(

webauthn-server-core/src/test/scala/com/yubico/webauthn/RelyingPartyRegistrationSpec.scala

Lines changed: 0 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ import com.yubico.webauthn.attestation.MetadataService
4040
import com.yubico.webauthn.data.AttestationObject
4141
import com.yubico.webauthn.data.AttestationType
4242
import com.yubico.webauthn.data.AuthenticatorData
43-
import com.yubico.webauthn.data.AuthenticatorRegistrationExtensionOutputs
4443
import com.yubico.webauthn.data.AuthenticatorSelectionCriteria
4544
import com.yubico.webauthn.data.AuthenticatorTransport
4645
import com.yubico.webauthn.data.ByteArray
@@ -947,12 +946,6 @@ class RelyingPartyRegistrationSpec
947946
it("Succeeds if clientExtensionResults is a subset of the extensions requested by the Relying Party.") {
948947
forAll(Extensions.subsetRegistrationExtensions) {
949948
case (extensionInputs, clientExtensionOutputs, _) =>
950-
println(extensionInputs.getExtensionIds, extensionInputs)
951-
println(
952-
clientExtensionOutputs.getExtensionIds,
953-
clientExtensionOutputs,
954-
)
955-
956949
val steps = finishRegistration(
957950
testData =
958951
RegistrationTestData.Packed.BasicAttestation.copy(
@@ -971,12 +964,6 @@ class RelyingPartyRegistrationSpec
971964
it("Succeeds if clientExtensionResults is not a subset of the extensions requested by the Relying Party, but the Relying Party has enabled allowing unrequested extensions.") {
972965
forAll(Extensions.unrequestedClientRegistrationExtensions) {
973966
case (extensionInputs, clientExtensionOutputs, _) =>
974-
println(extensionInputs.getExtensionIds, extensionInputs)
975-
println(
976-
clientExtensionOutputs.getExtensionIds,
977-
clientExtensionOutputs,
978-
)
979-
980967
val steps = finishRegistration(
981968
allowUnrequestedExtensions = true,
982969
testData =
@@ -996,12 +983,6 @@ class RelyingPartyRegistrationSpec
996983
it("Fails if clientExtensionResults is not a subset of the extensions requested by the Relying Party.") {
997984
forAll(Extensions.unrequestedClientRegistrationExtensions) {
998985
case (extensionInputs, clientExtensionOutputs, _) =>
999-
println(extensionInputs.getExtensionIds, extensionInputs)
1000-
println(
1001-
clientExtensionOutputs.getExtensionIds,
1002-
clientExtensionOutputs,
1003-
)
1004-
1005986
val steps = finishRegistration(
1006987
testData =
1007988
RegistrationTestData.Packed.BasicAttestation.copy(
@@ -1038,12 +1019,6 @@ class RelyingPartyRegistrationSpec
10381019
_,
10391020
authenticatorExtensionOutputs: CBORObject,
10401021
) =>
1041-
println(extensionInputs.getExtensionIds, extensionInputs)
1042-
println(
1043-
authenticatorExtensionOutputs.getKeys,
1044-
authenticatorExtensionOutputs,
1045-
)
1046-
10471022
val steps = finishRegistration(
10481023
testData = RegistrationTestData.Packed.BasicAttestation
10491024
.copy(
@@ -1063,13 +1038,6 @@ class RelyingPartyRegistrationSpec
10631038

10641039
step.validations shouldBe a[Success[_]]
10651040
step.tryNext shouldBe a[Success[_]]
1066-
1067-
println(
1068-
AuthenticatorRegistrationExtensionOutputs
1069-
.fromAuthenticatorData(
1070-
step.getAttestation.getAuthenticatorData
1071-
)
1072-
)
10731041
}
10741042
}
10751043

@@ -1082,12 +1050,6 @@ class RelyingPartyRegistrationSpec
10821050
_,
10831051
authenticatorExtensionOutputs: CBORObject,
10841052
) =>
1085-
println(extensionInputs.getExtensionIds, extensionInputs)
1086-
println(
1087-
authenticatorExtensionOutputs.getKeys,
1088-
authenticatorExtensionOutputs,
1089-
)
1090-
10911053
val steps = finishRegistration(
10921054
allowUnrequestedExtensions = true,
10931055
testData = RegistrationTestData.Packed.BasicAttestation
@@ -1108,13 +1070,6 @@ class RelyingPartyRegistrationSpec
11081070

11091071
step.validations shouldBe a[Success[_]]
11101072
step.tryNext shouldBe a[Success[_]]
1111-
1112-
println(
1113-
AuthenticatorRegistrationExtensionOutputs
1114-
.fromAuthenticatorData(
1115-
step.getAttestation.getAuthenticatorData
1116-
)
1117-
)
11181073
}
11191074
}
11201075

@@ -1127,12 +1082,6 @@ class RelyingPartyRegistrationSpec
11271082
_,
11281083
authenticatorExtensionOutputs: CBORObject,
11291084
) =>
1130-
println(extensionInputs.getExtensionIds, extensionInputs)
1131-
println(
1132-
authenticatorExtensionOutputs.getKeys,
1133-
authenticatorExtensionOutputs,
1134-
)
1135-
11361085
val steps = finishRegistration(
11371086
testData = RegistrationTestData.Packed.BasicAttestation
11381087
.copy(
@@ -1155,13 +1104,6 @@ class RelyingPartyRegistrationSpec
11551104
IllegalArgumentException
11561105
]
11571106
step.tryNext shouldBe a[Failure[_]]
1158-
1159-
println(
1160-
AuthenticatorRegistrationExtensionOutputs
1161-
.fromAuthenticatorData(
1162-
step.getAttestation.getAuthenticatorData
1163-
)
1164-
)
11651107
}
11661108
}
11671109

webauthn-server-core/src/test/scala/com/yubico/webauthn/RelyingPartyStartOperationSpec.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,6 @@ class RelyingPartyStartOperationSpec
346346
it("by default sets the credProps extension.") {
347347
forAll(registrationExtensionInputs(credPropsGen = None)) {
348348
extensions: RegistrationExtensionInputs =>
349-
println(extensions.getExtensionIds)
350-
println(extensions)
351-
352349
val rp = relyingParty(userId = userId)
353350
val result = rp.startRegistration(
354351
StartRegistrationOptions

webauthn-server-core/src/test/scala/com/yubico/webauthn/data/ExtensionsSpec.scala

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ class ExtensionsSpec
5050
val json = JacksonCodecs.json()
5151
forAll(Generators.Extensions.registrationExtensionInputsJson()) {
5252
encoded: ObjectNode =>
53-
println(encoded)
5453
val decoded =
5554
json.treeToValue(encoded, classOf[RegistrationExtensionInputs])
5655

@@ -249,9 +248,6 @@ class ExtensionsSpec
249248
val jsonKeyNames = json.fieldNames.asScala.toList
250249
val extensionIds = input.getExtensionIds
251250

252-
println(input)
253-
println(json)
254-
255251
jsonKeyNames.length should equal(extensionIds.size)
256252
jsonKeyNames.toSet should equal(extensionIds.asScala)
257253
}
@@ -267,7 +263,6 @@ class ExtensionsSpec
267263
val encoded = json.valueToTree[ObjectNode](clientExtensionOutputs)
268264
encoded.setAll(unknownOutputs)
269265

270-
println(encoded)
271266
val decoded = json.treeToValue(
272267
encoded,
273268
classOf[ClientRegistrationExtensionOutputs],
@@ -292,7 +287,6 @@ class ExtensionsSpec
292287
)
293288
) { input: ClientRegistrationExtensionOutputs =>
294289
val json = JacksonCodecs.json().valueToTree[ObjectNode](input)
295-
println(json)
296290
json.has(Extensions.AppidExclude.EXTENSION_ID) should be(true)
297291
json.get("appidExclude").booleanValue should equal(
298292
input.getAppidExclude.get

webauthn-server-core/src/test/scala/com/yubico/webauthn/data/JsonIoSpec.scala

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -89,16 +89,9 @@ class JsonIoSpec
8989

9090
it("is identical after multiple serialization round-trips..") {
9191
forAll { value: A =>
92-
println(value)
93-
9492
val encoded: String = json.writeValueAsString(value)
95-
println(encoded)
96-
9793
val decoded: A = json.readValue(encoded, tpe)
98-
println(decoded)
99-
10094
val recoded: String = json.writeValueAsString(decoded)
101-
println(recoded)
10295

10396
decoded should equal(value)
10497
recoded should equal(encoded)
@@ -374,7 +367,6 @@ class JsonIoSpec
374367
describe("The class PublicKeyCredentialCreationOptions") {
375368
it("""has a toCredentialsCreateJson() method which returns a JSON object with the PublicKeyCredentialCreationOptions set as a top-level "publicKey" property.""") {
376369
forAll { pkcco: PublicKeyCredentialCreationOptions =>
377-
println(pkcco)
378370
val jsonValue =
379371
JacksonCodecs.json.readTree(pkcco.toCredentialsCreateJson)
380372
jsonValue.get("publicKey") should not be null
@@ -388,7 +380,6 @@ class JsonIoSpec
388380
describe("has a toJson() method and a fromJson(String) factory method") {
389381
it("which behave like a Jackson ObjectMapper.") {
390382
forAll { req: PublicKeyCredentialCreationOptions =>
391-
println(req)
392383
val json1 = req.toJson
393384
val json2 = JacksonCodecs.json.writeValueAsString(req)
394385
json1 should equal(json2)
@@ -404,7 +395,6 @@ class JsonIoSpec
404395

405396
it("which are stable over multiple serialization round-trips.") {
406397
forAll { req: PublicKeyCredentialCreationOptions =>
407-
println(req)
408398
val encoded = req.toJson
409399
val decoded = PublicKeyCredentialCreationOptions.fromJson(encoded)
410400
val reencoded = decoded.toJson
@@ -421,7 +411,6 @@ class JsonIoSpec
421411
describe("The class PublicKeyCredentialRequestOptions") {
422412
it("""has a toCredentialsGetJson() method which returns a JSON object with the PublicKeyCredentialGetOptions set as a top-level "publicKey" property.""") {
423413
forAll { pkcro: PublicKeyCredentialRequestOptions =>
424-
println(pkcro)
425414
val jsonValue = JacksonCodecs.json.readTree(pkcro.toCredentialsGetJson)
426415
jsonValue.get("publicKey") should not be null
427416
JacksonCodecs.json.treeToValue(
@@ -435,8 +424,6 @@ class JsonIoSpec
435424
describe("The class AssertionRequest") {
436425
it("""has a toCredentialsGetJson() method which returns a JSON object with the PublicKeyCredentialGetOptions set as a top-level "publicKey" property.""") {
437426
forAll { req: AssertionRequest =>
438-
println(req)
439-
440427
val jsonValue = JacksonCodecs.json.readTree(req.toCredentialsGetJson)
441428
jsonValue.get("publicKey") should not be null
442429
JacksonCodecs.json.treeToValue(
@@ -449,7 +436,6 @@ class JsonIoSpec
449436
describe("has a toJson() method and a fromJson(String) factory method") {
450437
it("which behave like a Jackson ObjectMapper.") {
451438
forAll { req: AssertionRequest =>
452-
println(req)
453439
val json1 = req.toJson
454440
val json2 = JacksonCodecs.json.writeValueAsString(req)
455441

@@ -463,7 +449,6 @@ class JsonIoSpec
463449

464450
it("which are stable over multiple serialization round-trips.") {
465451
forAll { req: AssertionRequest =>
466-
println(req)
467452
val encoded = req.toJson
468453
val decoded = AssertionRequest.fromJson(encoded)
469454
val reencoded = decoded.toJson

0 commit comments

Comments
 (0)