Sign inSign up

opencue/rest-gateway

By opencue

•Updated 9 days ago

A rest API gateway for OpenCue

Image
0

46

opencue/rest-gateway repository overview

⁠OpenCue REST Gateway

OpenCue⁠ is an open source render management system for visual effects and animation production, hosted by the Academy Software Foundation⁠.

The REST Gateway puts an HTTP/JSON API in front of Cuebot's gRPC interface. Every Cuebot RPC becomes a POST /<service>/<Method> endpoint, authenticated with a JWT. OpenCueWeb uses it, and so can any script, pipeline tool, or web client that can't speak gRPC.

⁠Tags

TagDescription
latestMost recent OpenCue release
<version> (for example 1.37.0)A specific release. Pin this in production and match your Cuebot version

Release notes: https://github.com/AcademySoftwareFoundation/OpenCue/releases⁠

⁠Quick start

You need a running Cuebot (see opencue/cuebot⁠).

docker run -d --name opencue-rest-gateway \
  -p 8448:8448 \
  -e CUEBOT_ENDPOINT=<cuebot-host>:8443 \
  -e JWT_SECRET=<a-long-random-secret> \
  opencue/rest-gateway

Make a token signed with the same secret (HS256, with an exp claim) and call an endpoint:

JWT_TOKEN=$(python3 -c "
import base64, hmac, hashlib, json, time
b64 = lambda b: base64.urlsafe_b64encode(b).decode().rstrip('=')
h = b64(json.dumps({'alg': 'HS256', 'typ': 'JWT'}).encode())
p = b64(json.dumps({'sub': 'me', 'exp': int(time.time()) + 3600}).encode())
s = b64(hmac.new(b'<a-long-random-secret>', f'{h}.{p}'.encode(), hashlib.sha256).digest())
print(f'{h}.{p}.{s}')
")

curl -X POST http://localhost:8448/show.ShowInterface/GetShows \
  -H "Authorization: Bearer $JWT_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

You can browse the full API in the Swagger UI at http://localhost:8448/swagger/.

For a complete local farm (database, Cuebot, RQD, OpenCueWeb, REST Gateway, and optional monitoring), use the docker-compose.yml sandbox in the repository.

⁠Configuration

Environment variableDefaultPurpose
CUEBOT_ENDPOINTlocalhost:8443Cuebot gRPC address
JWT_SECRETdefault-secret-keyHMAC secret used to validate tokens. Always override
REST_PORT8448HTTP port the gateway listens on
SWAGGER_ENABLEDtrueServe the Swagger UI on /swagger/
GRPC_MAX_RECV_MSG_MB256Largest Cuebot response accepted, in MB (raise it for very large GetJobs results)

⁠Security

  • Set your own JWT_SECRET. The default value is public. OpenCueWeb must be configured with the same secret.
  • The Swagger UI is not authenticated. Set SWAGGER_ENABLED=false wherever the gateway is reachable beyond a trusted network. Every other route requires a valid token.
  • The connection to Cuebot is plaintext gRPC. Run the gateway on the same trusted network as Cuebot. Terminate TLS for HTTP clients at a reverse proxy or load balancer in front of the gateway.

⁠Ports

8448/tcpHTTP/JSON API and Swagger UI

⁠License

Apache License 2.0. See LICENSE⁠.

Tag summary

Content type

Image

Digest

sha256:dece29a27…

Size

46.4 MB

Last updated

9 days ago

docker pull opencue/rest-gateway