SigilGuard.Registry (SigilGuard v0.2.0)

View Source

REST client for the SIGIL registry.

Fetches pattern bundles, resolves DIDs, and retrieves policy definitions from a SIGIL registry server. Uses Finch for HTTP with configurable timeouts.

Configuration

Set these in your application config:

config :sigil_guard,
  registry_url: "https://registry.sigil-protocol.org",
  registry_timeout_ms: 5_000,
  registry_enabled: true

Usage

{:ok, bundle} = SigilGuard.Registry.fetch_bundle()
{:ok, patterns} = SigilGuard.Patterns.parse_bundle(bundle)

Summary

Functions

Fetch the pattern bundle from the registry.

Fetch policy definitions from the registry.

Resolve a DID (Decentralized Identifier) via the registry.

Types

fetch_result()

@type fetch_result() :: {:ok, map()} | {:error, term()}

Functions

fetch_bundle(opts \\ [])

@spec fetch_bundle(keyword()) :: fetch_result()

Fetch the pattern bundle from the registry.

Returns the parsed JSON response containing patterns for sensitivity scanning.

Options

  • :url — override registry base URL
  • :timeout — override request timeout in milliseconds

fetch_policies(opts \\ [])

@spec fetch_policies(keyword()) :: fetch_result()

Fetch policy definitions from the registry.

Returns a list of policy rules for action classification and trust requirements.

Options

  • :url — override registry base URL
  • :timeout — override request timeout in milliseconds

resolve_did(did, opts \\ [])

@spec resolve_did(
  String.t(),
  keyword()
) :: fetch_result()

Resolve a DID (Decentralized Identifier) via the registry.

Returns the DID document with public keys and service endpoints.

Options

  • :url — override registry base URL
  • :timeout — override request timeout in milliseconds