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:
@@ -3,6 +3,7 @@
|
||||
import asyncio
|
||||
import base64
|
||||
import json
|
||||
import uuid
|
||||
import zlib
|
||||
from types import SimpleNamespace
|
||||
|
||||
@@ -121,8 +122,8 @@ def test_a_known_device_passes_validation(server, monkeypatch):
|
||||
[
|
||||
(True, {}, True, {"tokens", "keys/planted"}),
|
||||
(False, {}, True, {"tokens", "keys/planted"}),
|
||||
(False, {"cdm_type": "playready", "cdm_relay": True}, True, {"tokens", "keys/planted"}),
|
||||
(False, {"cdm_type": "playready", "cdm_relay": True}, False, {"tokens", "keys/device1", "keys/planted"}),
|
||||
(False, {"cdm_type": "playready"}, True, {"tokens", "keys/planted"}),
|
||||
(False, {"cdm_type": "playready"}, False, {"tokens", "keys/device1", "keys/planted"}),
|
||||
],
|
||||
)
|
||||
def test_a_session_keeps_identity_keys_from_the_client_unless_the_identity_is_the_clients(
|
||||
@@ -147,7 +148,14 @@ def test_a_session_keeps_identity_keys_from_the_client_unless_the_identity_is_th
|
||||
monkeypatch.setattr(handlers, "load_client_cookies", lambda text: text)
|
||||
|
||||
async def run():
|
||||
data = {"service": "EXAMPLE", "title_id": "t", "cookies": "x", "cache": {"keys/planted": text}, **sent}
|
||||
data = {
|
||||
"service": "EXAMPLE",
|
||||
"title_id": "t",
|
||||
"session_id": str(uuid.uuid4()),
|
||||
"cookies": "x",
|
||||
"cache": {"keys/planted": text},
|
||||
**sent,
|
||||
}
|
||||
response = await handlers.session_create_handler(data)
|
||||
session = get_session_store().peek(json.loads(response.body)["session_id"])
|
||||
try:
|
||||
@@ -183,7 +191,13 @@ def test_a_service_on_the_lent_device_makes_a_lent_device_session(server, monkey
|
||||
monkeypatch.setattr(handlers, "load_client_cookies", lambda text: text)
|
||||
|
||||
async def run():
|
||||
data = {"service": "EXAMPLE", "title_id": "t", "cookies": "x", "cdm_type": "widevine", "cdm_relay": True}
|
||||
data = {
|
||||
"service": "EXAMPLE",
|
||||
"title_id": "t",
|
||||
"session_id": str(uuid.uuid4()),
|
||||
"cookies": "x",
|
||||
"cdm_type": "widevine",
|
||||
}
|
||||
reply = json.loads((await handlers.session_create_handler(data)).body)
|
||||
session = get_session_store().peek(reply["session_id"])
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user