{"openapi":"3.1.0","jsonSchemaDialect":"https://json-schema.org/draft/2020-12/schema","info":{"title":"Media backend grant API","version":"0.1.0-alpha.29","description":"Request a short-lived, origin-bound Plugin Grant. The reviewed deployment endpoint is returned only after Registry validation.","license":{"name":"MIT"}},"servers":[{"url":"https://registry.al-amr.com","description":"Al-Amr Registry Runtime API"}],"paths":{"/v1/runtime/grants":{"post":{"operationId":"requestPluginGrant","summary":"Request access to Media backend component","description":"Environment and actor identity are derived from the Runtime bearer token and cannot be supplied in the request body.","security":[{"runtimeBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"oneOf":[{"type":"object","additionalProperties":false,"required":["pluginId","releaseVersion","backendComponentId","scopes","context"],"properties":{"pluginId":{"type":"string","const":"plg_media"},"releaseVersion":{"type":"string","const":"0.1.0-alpha.29"},"backendComponentId":{"type":"string","const":"control"},"scopes":{"type":"array","minItems":1,"uniqueItems":true,"items":{"type":"string","enum":["media:connect","media:direct-call","media:join-space","media:request-speak","media:publish"]}},"context":{"type":"object","properties":{"scope":{"type":"string","minLength":1,"maxLength":96,"pattern":"^[A-Za-z0-9][A-Za-z0-9:_-]{0,95}$"}},"required":["scope"],"additionalProperties":false}}}]}}}},"responses":{"200":{"description":"A short-lived grant plus the currently reviewed backend deployment endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PluginGrantResponse"}}}},"401":{"description":"Runtime authorization is missing or expired."},"403":{"description":"Plugin installation, scope, origin, or context is not authorized."}}}}},"components":{"securitySchemes":{"runtimeBearer":{"type":"http","scheme":"bearer","bearerFormat":"short-lived Runtime access token"}},"schemas":{"PluginGrantResponse":{"type":"object","additionalProperties":false,"required":["token","tokenType","pluginId","releaseId","backendComponentId","scopes","runtimeLease","endpoint","conditions","expiresAt"],"properties":{"token":{"type":"string","description":"Short-lived signed Plugin Grant; never persist it."},"tokenType":{"type":"string","const":"PluginGrant"},"pluginId":{"type":"string","const":"plg_media"},"releaseId":{"type":"string","pattern":"^rel_"},"backendComponentId":{"type":"string","enum":["control"]},"scopes":{"type":"array","items":{"type":"string","enum":["media:connect","media:direct-call","media:join-space","media:publish","media:request-speak"]}},"runtimeLease":{"type":"object","additionalProperties":false,"required":["leaseId","leaseVersion","expiresAt"],"properties":{"leaseId":{"type":"string","pattern":"^rle_"},"leaseVersion":{"type":"integer","minimum":1},"expiresAt":{"type":"string","format":"date-time"}}},"endpoint":{"type":"object","additionalProperties":false,"required":["deploymentId","protocol","url"],"properties":{"deploymentId":{"type":"string","pattern":"^dep_"},"protocol":{"type":"string","enum":["https","websocket","webrtc-signaling"]},"url":{"type":"string","format":"uri"}}},"conditions":{"type":"array","minItems":1,"maxItems":16,"items":{"type":"object","additionalProperties":false,"required":["type","status","reason","message","retryable"],"properties":{"type":{"type":"string"},"status":{"type":"string","enum":["True","False","Unknown"]},"reason":{"type":"string"},"message":{"type":"string"},"observedGeneration":{"type":"string"},"observedDigest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"lastProbeAt":{"type":"string","format":"date-time"},"lastTransitionAt":{"type":"string","format":"date-time"},"retryable":{"type":"boolean"},"retryAfterSeconds":{"type":"integer","minimum":1,"maximum":86400},"nextAction":{"type":"string"}}}},"expiresAt":{"type":"string","format":"date-time"}}}}},"x-al-amr-plugin":{"pluginId":"plg_media","releaseVersion":"0.1.0-alpha.29","runtimeClass":"trusted_library","backendComponents":[{"id":"control","name":"Media control plane","protocol":"websocket","protocolArtifactId":"media-v2-data-plane","hostCallbacks":[{"id":"publisher-authority","description":"Asks the owning Environment backend whether the scope-bound actor may publish in a configured Media space.","target":"environment_backend","endpointConfigPointer":"/spaces/*/policy/roleAuthorityUrl","protocolArtifactId":"publisher-authority-api","operationId":"authorizePublisher","authorization":{"kind":"forwarded_plugin_grant","requiredScopes":["media:publish"],"location":"json_body","field":"grant"},"timeoutMs":2000,"maxResponseBytes":4096,"redirectPolicy":"error","failureMode":"deny"}],"capabilities":["call:signaling","space:membership","media:authorization","moderation"],"grantScopes":["media:connect","media:direct-call","media:join-space","media:request-speak","media:publish"],"contextSchema":{"type":"object","properties":{"scope":{"type":"string","minLength":1,"maxLength":96,"pattern":"^[A-Za-z0-9][A-Za-z0-9:_-]{0,95}$"}},"required":["scope"],"additionalProperties":false},"limits":{"maxConcurrentSessions":1,"maxParticipantsPerContext":150,"maxMessageBytes":16384,"requestsPerMinute":600}}],"note":"Live deployment URLs are Registry state and are deliberately absent from the immutable Plugin manifest and release document."}}