UniversalResolverProtocolAdapter

Protocol adapter for Universal Resolver implementations.

Different Universal Resolver providers may use different:

  • Endpoint paths (e.g., /1.0/identifiers vs /1.0.0/universal-resolver/identifiers)

  • Authentication mechanisms

  • Response formats

  • Error handling

This adapter abstracts these differences, allowing DefaultUniversalResolver to work with any Universal Resolver-compatible service.

Example Usage:

// Standard adapter for dev.uniresolver.io
val adapter = StandardUniversalResolverAdapter()
val resolver = DefaultUniversalResolver("https://dev.uniresolver.io", protocolAdapter = adapter)

// Custom adapter for specific provider
val customAdapter = object : UniversalResolverProtocolAdapter {
override fun buildResolveUrl(baseUrl: String, did: String) = "$baseUrl/custom/path/$did"
// ... implement other methods
}

Inheritors

Properties

Link copied to clipboard
abstract val providerName: String

Gets the provider name for metadata. This is used in resolution metadata to identify which provider was used.

Functions

Link copied to clipboard
abstract fun buildMethodsUrl(baseUrl: String): String?

Builds the URL for querying supported methods.

Link copied to clipboard
abstract fun buildResolveUrl(baseUrl: String, did: String): String

Builds the URL for resolving a DID.

Link copied to clipboard
abstract fun configureAuth(requestBuilder: HttpRequest.Builder, apiKey: String?)

Configures HTTP request headers for authentication.

Link copied to clipboard
abstract fun extractDidDocument(jsonResponse: JsonObject): JsonObject?

Extracts the DID document from the response.

Link copied to clipboard
abstract fun extractDocumentMetadata(jsonResponse: JsonObject): JsonObject?

Extracts document metadata from the response.

Link copied to clipboard
abstract fun extractResolutionMetadata(jsonResponse: JsonObject): JsonObject

Extracts resolution metadata from the response.