Route the human-session tests through the real code path
This commit is contained in:
parent
69669f12ec
commit
43c55682c7
@ -82,23 +82,19 @@ class TestHumanSessions(Base):
|
||||
|
||||
def test_view_session_cannot_be_minted_with_write_scope(self):
|
||||
with self.assertRaises(errors.ScopeDenied):
|
||||
sessions.issue_view_session(
|
||||
self.store, "bigpickle", scopes=["view:read", "view:write"]
|
||||
)
|
||||
self.issue("bigpickle", scopes=["view:read", "view:write"])
|
||||
|
||||
def test_view_session_cannot_be_minted_with_agent_act_scope(self):
|
||||
with self.assertRaises(errors.ScopeDenied):
|
||||
sessions.issue_view_session(
|
||||
self.store, "bigpickle", scopes=["agent:act"]
|
||||
)
|
||||
self.issue("bigpickle", scopes=["agent:act"])
|
||||
|
||||
def test_long_session_grants_no_extra_capability(self):
|
||||
"""Expiry and authority are separate axes."""
|
||||
short = self.issue("bigpickle")
|
||||
short_session = viewcodes.redeem_code(self.store, short["code"])
|
||||
long_session = sessions.issue_view_session(
|
||||
self.store, "bigpickle", ttl=86400
|
||||
)
|
||||
# 24 hours of access, redeemed the same way a 5-minute code would be.
|
||||
long_issued = self.issue("bigpickle", code_ttl=300, view_ttl=86400)
|
||||
long_session = viewcodes.redeem_code(self.store, long_issued["code"])
|
||||
self.assertEqual(
|
||||
sorted(sessions.resolve(self.store, short_session["token"])["scopes"]),
|
||||
sorted(sessions.resolve(self.store, long_session["token"])["scopes"]),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user