NAME

Langertha::Raider::Hall::PermissionChannel - Internal per-run Unix socket on which a hall raider asks the ACP client for permission

VERSION

version 0.504

SYNOPSIS

# Internal to Langertha-Raider -- no API promise.
my $channel = Langertha::Raider::Hall::PermissionChannel->new(
  loop    => $loop,
  timeout => 120,
  handler => sub { my ($request) = @_; return $future_of_answer },
);
my $path = $channel->start;     # for --permission-channel
...
$channel->close;

DESCRIPTION

Internal module. Its interface may change without notice.

The hall's end of the channel of one run (ADR 0021, Nachtrag P2): the hall creates it for a run bound to an ACP session, passes the socket path to the raider as --permission-channel PATH, and closes it when the run ends. The socket lives in a directory of its own (mode 0700) under the temporary directory, so only the hall's user can connect.

Each line the raider writes is a question { id, tool, source, arguments, reason, rule }; "handler" returns a Future of { answer => 'once' | 'session' | 'no', reason }, which is written back as { id, answer, reason }. Deny by default: a handler that dies, fails, answers anything else, or does not answer within "timeout" seconds gives no. The raider is never killed for waiting.

loop

The IO::Async::Loop. Required.

handler

Called with the question (a hash); returns a Future of the answer. Required.

timeout

Seconds the handler gets before the answer is no (default 120).

path

The socket path, after "start".

start

my $path = $channel->start;

Creates the socket and starts listening. Returns the path.

close

Ends the channel: open questions are dropped (the raider is gone or going), the socket and its directory are removed. Safe to call twice.

SEE ALSO

SUPPORT

Issues

Please report bugs and feature requests at https://github.com/Getty/langertha-raider/issues.

IRC

Join #langertha on irc.perl.org or message Getty directly.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

https://raudssus.de/