Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/public-verification-method-init.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@germ-network/atprototypes": patch
---

`Atproto.DIDDocument.VerificationMethod`'s memberwise initializer is now public, matching its `Service` sibling. Only code inside this package could construct one, so a resolver adapter in another package that is handed a signing key directly rather than a DID document — Slingshot's `resolveMiniDoc`, which returns `signing_key` on the wire — had no way to publish it and shipped `verificationMethod: []`. `AtprotoTypesVerify`'s `RepoSigningKey` then refuses every document that resolver produces, and since `optimizedResolve` races it against plc.directory, whether a repo proof verifies depends on which resolver wins.
8 changes: 7 additions & 1 deletion Sources/AtprotoTypes/Atproto/DIDDocument.swift
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,13 @@ extension Atproto.DIDDocument {
/// though this type does not model that field, since nothing here reads it.
public let publicKeyMultibase: String?

package init(
/// Public, matching ``Service``'s initializer, because a resolver
/// adapter in another package may be handed the signing key directly
/// rather than a full DID document — Slingshot's `resolveMiniDoc`
/// returns it on the wire. While this was package-scoped, such an
/// adapter could only publish an empty `verificationMethod`, and any
/// repo proof checked against its documents failed for want of a key.
public init(
id: String,
type: String,
controller: String,
Expand Down
7 changes: 4 additions & 3 deletions Tests/AtprotoTypesVerifyTests/RepoProofVerifierTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,10 @@ struct RepoProofVerifierTests {
}
}

///The gap this closes on the shipped fetch path: today's `resolveMiniDoc`
///adapter builds a document with `verificationMethod: []`, so every proof
///would stop here until that key is carried through.
///The gap this closes on the shipped fetch path: Slingshot's
///`resolveMiniDoc` adapter used to build a document with
///`verificationMethod: []`, so every proof stopped here until that key
///was carried through.
@Test("a document with only a non-atproto method is refused")
func refusesWrongFragment() throws {
let scenario = Scenario()
Expand Down
Loading