跳转到内容

ak.schema.media_ice_configuration_response_body.v1

← Schema 目录

Arkret Media ICE Configuration Response Body
ak.schema.media_ice_configuration_response_body.v1 · schemas/media-ice-configuration-response-body.schema.json

Result shape for the WebRTC media service ICE config endpoint. Used by ak.profile.webrtc_media.v1; see crypto-media/webrtc-signaling.md §4.

必填标记属于当前 Schema 对象或分支。oneOf、anyOf、if / then / else 中的 required 不表示所有实例均必填。树状视图有递归深度限制;完整约束以 canonical 原件为准。

必填 $ · object

Result shape for the WebRTC media service ICE config endpoint. Used by ak.profile.webrtc_media.v1; see crypto-media/webrtc-signaling.md §4.

此对象的 required:realm_id, call_id, actor_id, device_id, ice_servers, ttl_seconds, refresh_lead_seconds, issued_at, signature

必填 realm_id · string · $ref ./common-ids.schema.json#/$defs/realm_id

Retyped ak.realm.create Event token. It therefore carries the same fixed current-v1 0x01/SHA-256 content-address identity and is not selected by Realm state.

pattern: ^ak:realm:[A-Za-z0-9_-]{44}$
必填 call_id · string

Echo of the request call id. Bound into the signature to prevent cross-call replay.

pattern: ^ak:call:[A-Za-z0-9_-]{44}$
必填 actor_id · oneOf[3] · $ref ./common-ids.schema.json#/$defs/actor_id

Closed complete actor identity: account binds a principal permanently to one Station; service acts as itself; realm binds an Applet Bot/Ghost permanently to one owning Realm. Full tagged-object equality is required. No authority is inferred from a discriminator, shared principal, key, route or DID controller.

oneOf · oneOf[0] · object

此分支的 required:kind, account_id

分支必填 kind · const "account"
enum: "account"
分支必填 account_id · $ref #/$defs/account_id · $ref #/$defs/account_id
oneOf · oneOf[1] · object

此分支的 required:kind, service_id

分支必填 kind · const "service"
enum: "service"
分支必填 service_id · $ref #/$defs/did_core_id · $ref #/$defs/did_core_id
oneOf · oneOf[2] · object

此分支的 required:kind, realm_actor_id

分支必填 kind · const "realm"
enum: "realm"
分支必填 realm_actor_id · object · $ref ./common-ids.schema.json#/$defs/realm_actor_id

Stable Realm-owned Bot/Ghost identity. Both components are required for equality; governance handoff does not change either. No Station binding or AccountId is implied.

此分支的 required:realm_id, principal_id

分支必填 realm_id · string · $ref ./common-ids.schema.json#/$defs/realm_id

Retyped ak.realm.create Event token. It therefore carries the same fixed current-v1 0x01/SHA-256 content-address identity and is not selected by Realm state.

pattern: ^ak:realm:[A-Za-z0-9_-]{44}$
分支必填 principal_id · allOf[2]
allOf · allOf[0] · string · $ref ./common-ids.schema.json#/$defs/did_core_id

Canonical stable DID-derived identity core. The lowercase DID method name follows ak:did_core:, and the remaining method-adapter-defined core is opaque to generic consumers. The did:web v1 adapter uses the complete canonical method-specific-id, never a digest or truncated host. Principal-core and service-core equality is byte-for-byte equality of the complete did_core_id. Event actor and Realm membership equality instead use the complete closed ActorId, and account-scoped equality uses the complete AccountId; neither may be reduced to a principal core. A did_core_id is not a DID and cannot be resolved without a did or AuthenticatedServiceResolution.

pattern: ^ak:did_core:[a-z0-9]+:[^\s/?#]+$
allOf · allOf[1] · ?
pattern: ^ak:did_core:webvh:[^\s/?#]+$
必填 device_id · string

Device that may use this ICE configuration. Bound into the signature.

pattern: ^ak:device:[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
必填 ice_servers · array<$ref #/$defs/ice_server>

STUN / TURN server entries the client may use during this call.

items · object · $ref #/$defs/ice_server

此对象的 required:urls

必填 urls · oneOf[2]

STUN/TURN server URL(s). Schemes: stun:, stuns:, turn:, turns:.

oneOf · oneOf[0] · string
oneOf · oneOf[1] · array<string>
items · string
username · string

TURN ephemeral credential username. v1: <expiry-unix>:<per-call-pseudonym>. MUST NOT contain principal DID, handle, email, or any cross-call stable identifier.

credential · string

TURN ephemeral credential password (HMAC-SHA256 of username with per-tenant turn shared secret in REST-style).

credential_type · string (enum)
enum: "password" "oauth"
example: "password"
(^x_[a-z][a-z0-9_]{0,63}$) · any
必填 ttl_seconds · integer

Validity window for the issued credentials in seconds. Clients MUST refresh before this expires; servers SHOULD pick a value <= 1 hour for normal calls.

必填 refresh_lead_seconds · integer

Minimum lead time before ttl expiry at which the client SHOULD initiate refresh. refresh_lead_seconds MUST be strictly less than ttl_seconds (servers MUST NOT issue refresh_lead_seconds >= ttl_seconds, otherwise the client would judge the credential stale at issuance and storm refresh). Defaults SHOULD be ttl_seconds / 4. The recommended floor (60s) applies only when ttl_seconds is large enough that floor < ttl_seconds still holds; for small ttl (e.g. the 60s minimum) the server MUST shrink refresh_lead_seconds below ttl_seconds (see webrtc-signaling.md §4.2). Required so all clients refresh at consistent cadence and servers can plan secret rotation grace windows.

必填 issued_at · string (date-time) · format=date-time · $ref ./time.schema.json#/$defs/timestamp

Canonical Arkret-owned absolute instant. UTC Z form with exactly three millisecond digits. Whole seconds MUST use .000Z; offsets, missing/finer fractions, lowercase separators, leap seconds, and invalid Gregorian calendar dates are forbidden. Shape validation by this pattern is supplemented by semantic date validation.

pattern: ^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]\.[0-9]{3}Z$
turn_required · boolean

When true, clients MUST disable host/srflx ICE candidates and only relay through TURN. Used by high-privacy Realms to prevent IP leakage.

example: false
constraints · object

Optional server-suggested ICE policy.

udp_allowed · boolean
example: true
tcp_allowed · boolean
example: true
ipv6_allowed · boolean
example: true
next_retry_at · string (date-time) · format=date-time · $ref ./time.schema.json#/$defs/timestamp

Canonical Arkret-owned absolute instant. UTC Z form with exactly three millisecond digits. Whole seconds MUST use .000Z; offsets, missing/finer fractions, lowercase separators, leap seconds, and invalid Gregorian calendar dates are forbidden. Shape validation by this pattern is supplemented by semantic date validation.

pattern: ^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):[0-5][0-9]:[0-5][0-9]\.[0-9]{3}Z$
必填 signature · object · $ref #/$defs/signature

Detached signature by the media service DID over the canonical bytes of this response (excluding `signature`).

此对象的 required:kid, signature_algorithm, signature

必填 kid · string

DID URL of the concrete media-service verification method. Bare DID is not accepted because the response must pin one already accepted service key binding.

pattern: ^did:[a-z0-9]+:[^\s#?]+#[A-Za-z0-9._:-]+$
必填 signature_algorithm · string (enum)

Current-v1 signature algorithm. Reserved algorithms, including ML-DSA-65, are rejected as unsupported until a new negotiated schema/profile activates them while preserving the exact signing input defined in webrtc-signaling.md §4.1.

enum: "Ed25519"
必填 signature · string

base64url-encoded detached signature over canonical response bytes.

pattern: ^[A-Za-z0-9_-]+={0,2}$
(^x_[a-z][a-z0-9_]{0,63}$) · any
完整 JSON(格式化展示)
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://arkret.org/v1/schemas/media-ice-configuration-response-body.schema.json",
  "title": "Arkret Media ICE Configuration Response Body",
  "description": "Result shape for the WebRTC media service ICE config endpoint. Used by ak.profile.webrtc_media.v1; see crypto-media/webrtc-signaling.md §4.",
  "type": "object",
  "required": [
    "realm_id",
    "call_id",
    "actor_id",
    "device_id",
    "ice_servers",
    "ttl_seconds",
    "refresh_lead_seconds",
    "issued_at",
    "signature"
  ],
  "properties": {
    "realm_id": {
      "$ref": "./common-ids.schema.json#/$defs/realm_id",
      "description": "Echo of the request Realm id. Bound into the signature to prevent cross-Realm replay."
    },
    "call_id": {
      "type": "string",
      "pattern": "^ak:call:[A-Za-z0-9_-]{44}$",
      "description": "Echo of the request call id. Bound into the signature to prevent cross-call replay."
    },
    "actor_id": {
      "$ref": "./common-ids.schema.json#/$defs/actor_id",
      "description": "Stable actor did_core_id that may use this ICE configuration. Bound into the signature."
    },
    "device_id": {
      "type": "string",
      "pattern": "^ak:device:[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
      "description": "Device that may use this ICE configuration. Bound into the signature."
    },
    "ice_servers": {
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "#/$defs/ice_server"
      },
      "description": "STUN / TURN server entries the client may use during this call."
    },
    "ttl_seconds": {
      "type": "integer",
      "minimum": 60,
      "maximum": 86400,
      "description": "Validity window for the issued credentials in seconds. Clients MUST refresh before this expires; servers SHOULD pick a value <= 1 hour for normal calls."
    },
    "refresh_lead_seconds": {
      "type": "integer",
      "minimum": 10,
      "maximum": 1800,
      "description": "Minimum lead time before ttl expiry at which the client SHOULD initiate refresh. refresh_lead_seconds MUST be strictly less than ttl_seconds (servers MUST NOT issue refresh_lead_seconds >= ttl_seconds, otherwise the client would judge the credential stale at issuance and storm refresh). Defaults SHOULD be ttl_seconds / 4. The recommended floor (60s) applies only when ttl_seconds is large enough that floor < ttl_seconds still holds; for small ttl (e.g. the 60s minimum) the server MUST shrink refresh_lead_seconds below ttl_seconds (see webrtc-signaling.md §4.2). Required so all clients refresh at consistent cadence and servers can plan secret rotation grace windows."
    },
    "issued_at": {
      "$ref": "./time.schema.json#/$defs/timestamp",
      "description": "Server-issued timestamp (RFC 3339 UTC). Bound into the ICE config signature."
    },
    "turn_required": {
      "type": "boolean",
      "default": false,
      "description": "When true, clients MUST disable host/srflx ICE candidates and only relay through TURN. Used by high-privacy Realms to prevent IP leakage.",
      "x-arkret-member-role": "obligation"
    },
    "constraints": {
      "type": "object",
      "description": "Optional server-suggested ICE policy.",
      "properties": {
        "udp_allowed": {
          "type": "boolean",
          "default": true,
          "x-arkret-member-role": "permission"
        },
        "tcp_allowed": {
          "type": "boolean",
          "default": true,
          "x-arkret-member-role": "permission"
        },
        "ipv6_allowed": {
          "type": "boolean",
          "default": true,
          "x-arkret-member-role": "permission"
        }
      },
      "additionalProperties": false
    },
    "next_retry_at": {
      "$ref": "./time.schema.json#/$defs/timestamp",
      "description": "Set when the response reports a temporary service failure (e.g. turn_credential_expired). Clients MUST NOT retry before this time."
    },
    "signature": {
      "$ref": "#/$defs/signature",
      "description": "Detached signature by the media service DID over the canonical bytes of this response (excluding `signature`)."
    }
  },
  "patternProperties": {
    "^x_[a-z][a-z0-9_]{0,63}$": true
  },
  "additionalProperties": false,
  "$defs": {
    "ice_server": {
      "type": "object",
      "required": [
        "urls"
      ],
      "properties": {
        "urls": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "type": "string"
              },
              "minItems": 1
            }
          ],
          "description": "STUN/TURN server URL(s). Schemes: stun:, stuns:, turn:, turns:."
        },
        "username": {
          "type": "string",
          "description": "TURN ephemeral credential username. v1: <expiry-unix>:<per-call-pseudonym>. MUST NOT contain principal DID, handle, email, or any cross-call stable identifier."
        },
        "credential": {
          "type": "string",
          "description": "TURN ephemeral credential password (HMAC-SHA256 of username with per-tenant turn shared secret in REST-style)."
        },
        "credential_type": {
          "type": "string",
          "enum": [
            "password",
            "oauth"
          ],
          "default": "password",
          "x-arkret-value-ownership": {
            "class": "owned_symbol",
            "authority": "media-ice-configuration-response-body.schema.json#/$defs/ice_server/properties/credential_type",
            "owner": "media-ice-configuration-response-body.schema.json#/$defs/ice_server/properties/credential_type",
            "values": [
              "password",
              "oauth"
            ]
          }
        }
      },
      "patternProperties": {
        "^x_[a-z][a-z0-9_]{0,63}$": true
      },
      "additionalProperties": false
    },
    "signature": {
      "type": "object",
      "required": [
        "kid",
        "signature_algorithm",
        "signature"
      ],
      "properties": {
        "kid": {
          "type": "string",
          "pattern": "^did:[a-z0-9]+:[^\\s#?]+#[A-Za-z0-9._:-]+$",
          "description": "DID URL of the concrete media-service verification method. Bare DID is not accepted because the response must pin one already accepted service key binding."
        },
        "signature_algorithm": {
          "type": "string",
          "enum": [
            "Ed25519"
          ],
          "description": "Current-v1 signature algorithm. Reserved algorithms, including ML-DSA-65, are rejected as unsupported until a new negotiated schema/profile activates them while preserving the exact signing input defined in webrtc-signaling.md §4.1.",
          "x-arkret-value-ownership": {
            "class": "external_literal",
            "authority": "https://www.rfc-editor.org/rfc/rfc8032.html#section-5.1",
            "owner": "media-ice-configuration-response-body.schema.json#/$defs/signature/properties/signature_algorithm",
            "values": [
              "Ed25519"
            ]
          }
        },
        "signature": {
          "type": "string",
          "pattern": "^[A-Za-z0-9_-]+={0,2}$",
          "description": "base64url-encoded detached signature over canonical response bytes."
        }
      },
      "additionalProperties": false
    }
  }
}

查看 canonical 原件:spec/v1/artifacts/schemas/media-ice-configuration-response-body.schema.json

Source