RunJobStreamTicketResult run.job-stream-ticket-result@1
Generated at from
openvibe-contracts v0.97.0 and
openvibe-sdk v0.26.0.
- Version
- 1.0.0
- Owner
- run
- Visibility
- public
- Status
- planned
- Compatibility
- backward
- Decision
- ADR-034
- Schema
https://openvibe.network/contracts/run/job-stream-ticket-result.v1.json
run.job-stream-ticket-result@1 (PLANNED; plan T14 R1): the answer of POST /api/v1/jobs/{id}/stream/ticket on OpenVibe.Run (capability run.job.stream), modelled on Events' realtime ticket (network.realtime-ticket-result@1). A browser cannot put a header on an EventSource, so it opens `${stream_url}?ticket=${ticket}` (plus Last-Event-ID when it resumes) at once. The ticket is a two-minute RS256 JWT that Run signs: audience openvibe.run, typ run-stream (so it is never a session token), it names this one job, and Run refuses a jti it has already seen while the ticket is valid, so a ticket opens one stream; ask for a fresh one for every reconnect. Never logged, never stored. A server caller may instead send its Bearer token to GET /api/v1/jobs/{id}/stream. The stream is text/event-stream of run.job-stream-event@1.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
ticket | string | yes | The signed ticket (a compact JWS). |
|
expires_at | string | yes |
| |
expires_in | integer | yes | Seconds until the ticket expires (120). |
|
stream_url | string | yes |
| |
job_id | string | yes |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: ticket
{
"ticket": "sample-ticket.not-a-jwt.placeholder",
"expires_at": "2026-10-04T10:02:00.000Z",
"expires_in": 120,
"stream_url": "https://openvibe.run/api/v1/jobs/job_01JAB2C3D4E5F6G7H8J9K0MNPQ/stream",
"job_id": "job_01JAB2C3D4E5F6G7H8J9K0MNPQ"
}Rejected: long-lived
{
"ticket": "sample-ticket.not-a-jwt.placeholder",
"expires_at": "2026-10-04T10:02:00.000Z",
"expires_in": 3600,
"stream_url": "https://openvibe.run/api/v1/jobs/job_01JAB2C3D4E5F6G7H8J9K0MNPQ/stream",
"job_id": "job_01JAB2C3D4E5F6G7H8J9K0MNPQ"
}Rejected: other-stream-url
{
"ticket": "sample-ticket.not-a-jwt.placeholder",
"expires_at": "2026-10-04T10:02:00.000Z",
"expires_in": 120,
"stream_url": "https://openvibe.run/api/v1/jobs",
"job_id": "job_01JAB2C3D4E5F6G7H8J9K0MNPQ"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('run.job-stream-ticket-result@1', value); // { valid, errors: [{ path, message }] }