ALPHA

Work in progress. Breaking changes may happen without notice.

Rust Server

Run the server and understand the API endpoints.

The Rust server exposes a small HTTP API for collecting server-side fingerprints.

Endpoints

  • GET /health returns 204 No Content.
  • GET /fingerprint returns the server fingerprint only.
  • POST /fingerprint returns the server fingerprint and a combined composite.

Example request

curl -X POST https://localhost:8443/fingerprint \
	-H "content-type: application/json" \
	-d '{"client_composite":"client-composite-string","delimiter":"-","metadata":{"userId":"user_123"}}'

Client integration

The client library can call this endpoint directly:

import { OpenClientIdClient } from "openclientid";

const client = new OpenClientIdClient({
	endpoint: "https://localhost:8443/fingerprint",
});

const combined = await client.getFingerprintWithServer({
	hashComposite: true,
	metadata: {
		userId: "user_123",
		source: "checkout",
	},
});

console.log(combined.server.server.hash);