instance.sh: the staff's log may hold acts that name nobody

Since R6 an act on one of the acting login's own personas is logged without its name, and every persona of the pasture
is the root's, so the scenario's log check takes an entry with no name too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WpVCoDeM1qUTRp4fXQdfof
This commit is contained in:
thepraandClaude Opus 5.5 committed 2026-10-18 10:30:28 +02:00
1 parent 048eb15bb7
commit 5020c031a3
1 file changed
+3 -2
+3 -2
View File
@@ -207,9 +207,10 @@ missing=$(echo "$log" | j "
seen={i['action'] for i in d['items']} seen={i['action'] for i in d['items']}
print(' '.join(sorted({'root.promote','settings.update','rule.insert','rule.update','rule.delete','domain_block.insert','domain_block.delete','report.resolve','announcement.insert','announcement.update','announcement.delete','settings.thumbnail','relay.insert','relay.delete'} - seen)))") print(' '.join(sorted({'root.promote','settings.update','rule.insert','rule.update','rule.delete','domain_block.insert','domain_block.delete','report.resolve','announcement.insert','announcement.update','announcement.delete','settings.thumbnail','relay.insert','relay.delete'} - seen)))")
[ -z "$missing" ] && [ -n "$log" ] && ok "it lists every act of the scenario" || ko "the log misses: $missing" [ -z "$missing" ] && [ -n "$log" ] && ok "it lists every act of the scenario" || ko "the log misses: $missing"
[ "$(echo "$log" | j "print(all(i.get('by') in ('$ROOT_USER', 'cli') for i in d['items']))")" = True ] \ # an act on one of the acting login's own personas names nobody (R6), and the pasture's personas are all the root's
[ "$(echo "$log" | j "print(all(i.get('by') in ('$ROOT_USER', 'cli', None) for i in d['items']))")" = True ] \
&& [ "$(echo "$log" | j "print(any(i['action'] == 'root.promote' and i.get('by') == 'cli' for i in d['items']))")" = True ] \ && [ "$(echo "$log" | j "print(any(i['action'] == 'root.promote' and i.get('by') == 'cli' for i in d['items']))")" = True ] \
&& ok "each by the administrator's login, or the command line's" || ko "the log names someone else" && ok "each by the administrator's login, the command line's, or nobody's" || ko "the log names someone else: $(echo "$log" | j "print(sorted({str(i.get('by')) for i in d['items']}))")"
echo "$log" | grep -qE '127\.0\.0\.1|11\.42\.|::1' && ko "the log holds an address" || ok "and holds no address" echo "$log" | grep -qE '127\.0\.0\.1|11\.42\.|::1' && ko "the log holds an address" || ok "and holds no address"
page=$(api "$ADMIN" GET "/clientapi/moderator/log?limit=2") page=$(api "$ADMIN" GET "/clientapi/moderator/log?limit=2")
next=$(echo "$page" | j "print(d['next'])") next=$(echo "$page" | j "print(d['next'])")