CI rehearsal only (do not merge) - #17
michael-moffett wants to merge 20 commits into
Conversation
…matrix A Gradle stdin/stdout runner over the Kotlin SDK's protocol functions, plus `harness/protocol-runners/kotlin.json`, so the spawned-runner block drives Kotlin. No protocol-layer vector reaches Kotlin today. Milestone 1 of our harness proposal puts Kotlin in the divergence matrix.
…-run steps in the kotlin harness job, and asserted Kotlin divergences in the spawned-runner matrix
…cratch (--rerun-tasks); 5/5 MainTest cases pass, the vitest suite is still unrun
…l as a must-pass case (TS reference re-parses Kotlin's header) and lists receipt.format as a known unsupported divergence
…lDist test) and Main.kt gains its 3-line header comment
…ned-runner block, with Kotlin's SDK gaps asserted by exact response
…elds after whole-object serialization (Go omitempty), with its unit test asserting the omission
…d digest; an empty request now returns parse_error, with a MainTest case for it
|
| val fields = Json.encodeToJsonElement(PaymentChallenge.serializer(), challenge).jsonObject | ||
| return JsonObject( | ||
| fields.filter { (name, value) -> name !in setOf("expires", "digest") || value != JsonPrimitive("") }.mapValues { (name, value) -> | ||
| if (name == "request" || name == "opaque") decodeJson(value.jsonPrimitive.content) else value |
There was a problem hiding this comment.
Valid opaque values rejected A challenge can contain a plain-text
opaque value. The SDK parses it as a string, but this runner tries to base64url-decode and JSON-parse it, returning parse_error for a valid challenge. Only request should be decoded this way.
| if (name == "request" || name == "opaque") decodeJson(value.jsonPrimitive.content) else value | |
| if (name == "request") decodeJson(value.jsonPrimitive.content) else value |
| } | ||
|
|
||
| private fun parseChallenge(input: JsonElement): JsonObject { | ||
| val challenge = MppHeaders.parseWWWAuthenticate(input.jsonObject.getValue("header").jsonPrimitive.content) |
There was a problem hiding this comment.
Empty challenge IDs accepted When a challenge has
id="", the SDK parser checks that the field exists but does not reject its empty value. This runner returns a successful parse, although the canonical vector requires parse_error, so it reports an invalid challenge as valid.
| val challenge = MppHeaders.parseWWWAuthenticate(input.jsonObject.getValue("header").jsonPrimitive.content) | |
| val challenge = MppHeaders.parseWWWAuthenticate(input.jsonObject.getValue("header").jsonPrimitive.content) | |
| require(challenge.id.isNotEmpty()) { "challenge id must not be empty" } |
…ed as a known divergence with its exact response; the opaque and vector-coverage findings are answered with the earlier rulings
…d credential.format case through the runner; the other seven SDKs keep their smoke cases
Fork CI only. Do not merge.