mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2026-12-05 23:45:07 +00:00
feat(remote)!: make remote serve WebSocket-only and refuse older clients with CLIENT_OUTDATED
This commit is contained in:
@@ -18,8 +18,8 @@ from unshackle.core.remote_service import RemoteClient
|
||||
|
||||
|
||||
def session_entry(**fields: Any) -> SessionEntry:
|
||||
"""A remote session that the server CDM licenses, unless *fields* set another :class:`SessionEntry` value."""
|
||||
return SessionEntry(
|
||||
"""A remote session that the server CDM licenses and whose client attached its channel, unless *fields* say other."""
|
||||
entry = SessionEntry(
|
||||
**{
|
||||
"session_id": "sess",
|
||||
"service_tag": "EXAMPLE",
|
||||
@@ -28,6 +28,8 @@ def session_entry(**fields: Any) -> SessionEntry:
|
||||
**fields,
|
||||
}
|
||||
)
|
||||
entry.presence.attached()
|
||||
return entry
|
||||
|
||||
|
||||
def session_launch(licensor: Licensor = Licensor.NO_DEVICE, **fields: Any) -> SessionLaunch:
|
||||
@@ -75,4 +77,5 @@ def hold_session(service: Any, session_id: str | None = "sess") -> None:
|
||||
client = SimpleNamespace(send=unreachable, timeout=1, tunnel=None)
|
||||
service.lifetime = RemoteSessionLifetime(client, lambda cache: None) # type: ignore[arg-type]
|
||||
if session_id:
|
||||
service.lifetime.adopt(service.lifetime.name(), session_id)
|
||||
service.lifetime._held.add(session_id)
|
||||
service.lifetime.adopt(session_id)
|
||||
|
||||
Reference in New Issue
Block a user