IceIce
Home
  • Getting Started

    • Quick Start
    • Core Concepts
    • Architecture
  • SDK Guide

    • Java SDK
    • Go SDK
    • Python SDK
  • Reference

    • Node Types
    • Roam API
    • Mock
    • Server Config
    • Client Config
Playground
FAQ
  • Changelog
  • Upgrade Guide
Sponsor
Community
GitHub
  • English
  • 简体中文
Home
  • Getting Started

    • Quick Start
    • Core Concepts
    • Architecture
  • SDK Guide

    • Java SDK
    • Go SDK
    • Python SDK
  • Reference

    • Node Types
    • Roam API
    • Mock
    • Server Config
    • Client Config
Playground
FAQ
  • Changelog
  • Upgrade Guide
Sponsor
Community
GitHub
  • English
  • 简体中文
  • Reference

    • Node Types
    • Roam API
    • Server Config
    • Client Config
    • Mock Execution

Mock Execution

Mock execution allows remote rule debugging from the Web UI to Client SDKs, with Server acting as a proxy using file-based RPC.

Architecture

Web UI ──POST──▶ Server ──write request──▶ mock/{app}/{address}/{mockId}.json
                                           │
                 Client SDK polls ◀────────┘
                                           │
Web UI ◀─────── Server ◀──read response── mock/{app}/{address}/{mockId}_result.json
  1. Web UI sends POST /ice-server/mock/execute
  2. Server writes the request to mock/{app}/{address}/{mockId}.json
  3. Client SDK polls the mock directory, picks up the request, executes the rule locally, and writes the result to {mockId}_result.json
  4. Server polls for the response file (60s timeout, 1s interval) and returns the result to the Web UI

Server API

POST /ice-server/mock/execute

Execute a mock request.

Request body:

{
  "app": 1,
  "iceId": 100,
  "confId": null,
  "ts": 1710000000000,
  "roam": { "uid": 12345, "score": 85.0 },
  "target": "all"
}
FieldTypeRequiredDescription
appintYesApplication ID
iceIdintNoRule ID (one of iceId or confId is required)
confIdintNoConfiguration ID (one of iceId or confId is required)
tsint64NoTimestamp
roamobjectNoInput data
targetstringNoExecution target; defaults to "all" (any available client) when empty or omitted

target values:

ValueDescription
allAny available client
lane:xxxClient in a specific lane
address:xxxClient at a specific address

Response body:

{
  "mockId": "abc123",
  "success": true,
  "roam": { "uid": 12345, "score": 85.0, "result": "pass" },
  "process": "...",
  "error": null,
  "executeAt": 1710000001000
}

GET /ice-server/mock/schema

Get the form schema for mock input. Used by the Web UI to auto-generate form fields.

Query parameters:

ParameterTypeRequiredDescription
appintYesApplication ID
iceIdintNoRule ID (at least one of iceId or confId is required)
confIdintNoConfiguration ID (at least one of iceId or confId is required)
lanestringNoLane
addressstringNoClient address

Response body:

{
  "fields": [
    {
      "key": "uid",
      "valueType": "Long",
      "nodeId": 42,
      "nodeName": "checkUser"
    }
  ],
  "fallback": false
}

fallback: true means the target client was offline and the schema was obtained from a fallback client.

Client SDK

All three SDKs (Java / Go / Python) have built-in mock polling in their FileClient. No extra configuration needed -- when the mock directory exists, the client automatically processes mock requests.

Roam Key Scanning

Each SDK includes a static code analyzer that scans leaf node methods (doFlow / doResult / doNone) to extract roam key access metadata. This metadata powers the schema endpoint's automatic form field generation.

Edit this page on GitHub
Last Updated: 3/21/26, 11:30 PM
Contributors: waitmoon
Prev
Client Config