Skip to content

SshServerNotify

[Source]

Server-side consumer interface. The session owns the SSH protocol: it sends every protocol reply via its own accept_/reject_ and auth_* behaviors. A consumer signals a decision by calling one of those behaviors back on the session; it never frames protocol messages itself.

Authentication and authorization DENY by default. The auth callback's default rejects unless validate_password/validate_publickey accept, and every channel authorization callback rejects unless overridden — there is no permissive default to forget. validate_password and validate_publickey have no default at all, so the compiler requires every server to state its auth policy.

The SshListener that starts sessions reports its bind outcome here too: ssh_listener_started once it is bound and accepting, ssh_listener_failed if the bind failed. Start clients only after ssh_listener_started; a connect issued before it can be refused.

interface ref SshServerNotify

Public Behaviours

ssh_listener_started

[Source]

be ssh_listener_started(
  listener: DisposableActor tag)

Parameters


ssh_listener_failed

[Source]

be ssh_listener_failed(
  listener: DisposableActor tag)

Parameters


ssh_session_started

[Source]

be ssh_session_started(
  session: SshSession tag)

Parameters


ssh_session_ready

[Source]

be ssh_session_ready(
  session: SshSession tag)

Parameters


ssh_channel_open_request

[Source]

be ssh_channel_open_request(
  session: SshSession tag,
  channel_id: U32 val,
  channel_type: String val)

Parameters


ssh_pty_request

[Source]

be ssh_pty_request(
  session: SshSession tag,
  channel_id: U32 val,
  pty: SshPtyState val,
  want_reply: Bool val)

Parameters


ssh_shell_request

[Source]

be ssh_shell_request(
  session: SshSession tag,
  channel_id: U32 val,
  want_reply: Bool val)

Parameters


ssh_channel_request

[Source]

be ssh_channel_request(
  session: SshSession tag,
  channel_id: U32 val,
  request_type: String val,
  want_reply: Bool val)

Parameters


ssh_window_change

[Source]

be ssh_window_change(
  session: SshSession tag,
  channel_id: U32 val,
  width_chars: U32 val,
  height_rows: U32 val,
  width_pixels: U32 val,
  height_pixels: U32 val)

Parameters

  • session: SshSession tag
  • channel_id: U32 val
  • width_chars: U32 val
  • height_rows: U32 val
  • width_pixels: U32 val
  • height_pixels: U32 val

ssh_channel_data

[Source]

be ssh_channel_data(
  session: SshSession tag,
  channel_id: U32 val,
  data: Array[U8 val] val)

Parameters


ssh_channel_error

[Source]

be ssh_channel_error(
  session: SshSession tag,
  channel_id: U32 val,
  err: SshChannelError val)

Parameters


ssh_channel_send_result

[Source]

Reports one result for each channel_send call. accepted counts the prefix admitted locally. data is the original submitted array. A blocked suffix remains the caller's responsibility.

be ssh_channel_send_result(
  session: SshSession tag,
  channel_id: U32 val,
  data: Array[U8 val] val,
  accepted: USize val,
  outcome: SshSendOutcome)

Parameters


ssh_channel_window_available

[Source]

The peer granted credit after a blocked send. The hint is sent once until another send blocks; it does not reserve credit for a retry.

be ssh_channel_window_available(
  session: SshSession tag,
  channel_id: U32 val)

Parameters


ssh_channel_closed

[Source]

be ssh_channel_closed(
  session: SshSession tag,
  channel_id: U32 val)

Parameters


ssh_error

[Source]

be ssh_error(
  session: SshSession tag,
  err: SshTransportError val)

Parameters


ssh_disconnected

[Source]

be ssh_disconnected(
  session: SshSession tag)

Parameters


ssh_auth_request

[Source]

be ssh_auth_request(
  session: SshSession tag,
  request: SshAuthRequest val)

Parameters


Public Functions

validate_password

[Source]

Return true to accept this password. No default: state your policy.

fun box validate_password(
  username: String val,
  password: String val)
: Bool val

Parameters

Returns


validate_publickey

[Source]

Return true to accept this public key. By the time a signed request reaches here the session has already cryptographically verified possession of the private key, so this only decides authorization. Use pk.matches(...) to compare against an authorized key. No default: state your policy.

fun box validate_publickey(
  username: String val,
  pk: SshAuthPublicKeyData val)
: Bool val

Parameters

Returns