mirror of
https://gitlab.com/veilid/veilid.git
synced 2025-07-25 16:05:23 -04:00
Gate insecure capabilities behind footgun feature
This commit is contained in:
parent
29eeebd9c1
commit
7a2a8ae4cb
15 changed files with 143 additions and 77 deletions
|
@ -448,11 +448,11 @@ async def test_watch_many_dht_values():
|
|||
|
||||
# make routing contexts
|
||||
# unsafe version for debugging
|
||||
rc0 = await (await api0.new_routing_context()).with_safety(SafetySelection.unsafe())
|
||||
rc1 = await (await api1.new_routing_context()).with_safety(SafetySelection.unsafe())
|
||||
# rc0 = await (await api0.new_routing_context()).with_safety(SafetySelection.unsafe())
|
||||
# rc1 = await (await api1.new_routing_context()).with_safety(SafetySelection.unsafe())
|
||||
# safe default version
|
||||
# rc0 = await api0.new_routing_context()
|
||||
# rc1 = await api1.new_routing_context()
|
||||
rc0 = await api0.new_routing_context()
|
||||
rc1 = await api1.new_routing_context()
|
||||
|
||||
async with rc0, rc1:
|
||||
|
||||
|
|
|
@ -34,9 +34,15 @@ async def test_routing_contexts(api_connection: veilid.VeilidAPI):
|
|||
)
|
||||
await rc.release()
|
||||
|
||||
rc = await (await api_connection.new_routing_context()).with_safety(
|
||||
veilid.SafetySelection.unsafe(veilid.Sequencing.PREFER_ORDERED)
|
||||
)
|
||||
|
||||
# Test that creating an Unsafe routing context throws an error
|
||||
# as mentioned in the CHANGELOG (footgun feature disabled by default)
|
||||
rc = await api_connection.new_routing_context()
|
||||
with pytest.raises(Exception):
|
||||
rc = await rc.with_safety(
|
||||
veilid.SafetySelection.unsafe(veilid.Sequencing.PREFER_ORDERED)
|
||||
)
|
||||
|
||||
await rc.release()
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue