Commit Graph

18 Commits

Author SHA1 Message Date
fang
c33ddfa101
Merge branch 'next/kelvin/412' into m/eyre-mirage 2023-06-26 13:47:39 +02:00
fang
41048b21e2
tests: update for new eauth architecture
Tag names have been changed, communication direction is now
client->host, and other changes which heavily affect the tests.
2023-06-16 21:20:20 +02:00
Tinnus Napbus
7c3a1c4d7c Merge branch 'next/kelvin/412' into tinnus/local-provenance 2023-06-07 20:38:05 +12:00
Tinnus Napbus
df53148183 tests: change sock to sack 2023-05-30 23:38:26 +12:00
fang
bf64e94ca3
tests: expand eyre eauth tests
For the server case, we add tests for http-first finalization, incorrect
eauth tokens, attempt expiration, client abort signalling, and client
deletion requests.

For the client case, we add a test for approving eauth attempts without
being locally authenticated.

To this end, we refactor the layout of the eauth tests. The +eauth core
now contains the tasks/gifts to be handled by the client/server, but no
longer does move checking. This happens within the test arms only. This
way, we may trivially re-run parts of the eauth flow under different
conditions.
2023-05-23 20:32:24 +02:00
Tinnus Napbus
2ba8e45fd2 tests: fix tests for provenance 2023-05-23 01:55:55 +12:00
fang
a6acfe3c93
tests: add based happy-path eauth tests 2023-05-19 19:25:04 +02:00
fang
3347e84811
eyre: rename authentication-state to auth
Only in the $server-state type, the lull typename remains unchanged (for
now). "authentication-state" is just such a mouthful!
2023-05-19 11:32:07 +02:00
fang
dd41df7d7c
tests: make eyre tests build & succeed again 2023-05-19 11:09:11 +02:00
fang
b8ff52d79a
tests: remove trailing whitespace in eyre tests 2023-05-16 21:47:23 +02:00
fang
637992475b
eyre: refactor guest name generation
Concatenating before we truncate, instead of truncating the entropy by
itself, is slightly simpler.

Because this slightly changes the naming algorithm, we must update the
eyre tests to match.
2023-05-16 21:46:48 +02:00
Philip Monk
c3dc248b30 Merge remote-tracking branch 'origin/m/the-open-eyre' into philip/mare 2023-05-11 11:19:25 -07:00
fang
466fc0b63b
eyre: pass session-id+identity into auth handling
This lets it also clean up guest sessions created just for the login
request, and lets us display the current guest identity on the login
page.
2023-05-09 15:10:14 +02:00
Philip Monk
8910e12f67 eyre: refactor tests
This shaves off 1000 lines of testing code while maintaining the same
tests.  It reduces boilerplate by introducing "mare", a monad for
testing Eyre.  It's very simple (just maintains the current state of
Eyre and the current time), but it's easier to build helper functions in
this form, and that reduces the immense quantities of copy-and-paste
that were in the old tests.  What's there now could surely be improved
further, but I think this is a good start.

The underlying mare machinery is not really specific to Eyre, so it
would be straightforward to apply this strategy to other vanes.  The
work is in creating appropriate helper functions for each vane.  Eyre is
undergoing work, so that's the only one I've changed here.  Further,
it's not clear that this is the ultimate solution to unit testing vanes.
The resulting code is IMO clearer than before, but I wouldn't say it's
*clear*.
2023-05-08 20:40:28 -07:00
fang
67799c77e0
tests: update eyre tests for guest sessions
Unauthenticated requests now also create sessions. This affects most
HTTP request handling tests.

The situation here is not ideal, and worsening over time. Worth spending
some time to think about how to best refactor the Eyre tests to make
them more manageable and easier to maintain.
2023-05-08 19:10:00 +02:00
fang
4bc88f2825
tests: patch eyre tests for channel modes
Since the tests call arms from eyre directly, these had to be updated
alongside it, to now specify the channel mode in light of which the
request should be parsed.

Includes smoke tests for jam-mode channels.
2023-04-12 19:33:05 +02:00
fang
92066f3a33
Merge branch 'develop' into m/http-auth-tokens 2023-02-06 19:44:01 +01:00
fang
e888960370
tests: move to root, out of pkg/arvo
Including these in pkg/arvo has caused many minor problems over the
years. We don't want to include them in releases, but this often meant
excluding them manually, which was error-prone.

Here, we move them out of /pkg/arvo/tests and into /tests. CI will have
to be updated to match, since we'll still want to include tests there.
2023-01-18 16:50:42 +01:00