RecvInterface

class jetstream.recvinterface.RecvInterface(api_interface, sync_interface, _logging_interface)

RecvInterface provides methods for controlling aspects of Jetstream related to receiving files. RecvInterface is accessed from the APIInterface.

Method Summary

addAuthorizedClientAsync Adds a public key to the list of authorized clients.
allowOnlyAuthorizedClientsAsync Submits a request to enable or disable the restriction to allow only authorized clients to connect to this server.
getSourcesAsync Submits a request to retrieve the sources that have established a connection with this Receiver.
getTransfersAsync Submits a request to retrieve the transfers from a receive server.
removeAuthorizedClientAsync Removes a public key from the list of authorized clients.

Method Documentation

RecvInterface.addAuthorizedClientAsync(clientPublicKey)

Adds a public key to the list of authorized clients.

If allowOnlyAuthorizedClientsAsync() is used to restrict incoming connections, a Receiver server will allow incoming connections only from trusted clients. Adding a client’s public key will permit it to connect.

If a Jetstream server was launched with the --persistent-state-dir flag, its list of authorized clients will be saved, and restored if the server is restarted. If a Jetstream server is launched without this flag, its list of authorized clients must be configured again.

Parameters:clientPublicKey (str) – The public key of an trusted client that is authorized to connect to a Receiver server. Here, “client” refers to a Jetstream Sender server. Also allowed is a dict with a string value extracted from the clientPublicKey key.
Returns:Returns a Request Structure containing a requestId for this request. Use getRequestStatus() or getRequestResult() to monitor the status of the request.
Return type:dict

Changed in version 1.3.0: Restricted to superusers only.

RecvInterface.allowOnlyAuthorizedClientsAsync(onlyAuthorizedClientsAllowed)

Submits a request to enable or disable the restriction to allow only authorized clients to connect to this server.

When enabled, only incoming connections from trusted clients will be accepted. Trusted clients can be added using addAuthorizedClientAsync() and removed using removeAuthorizedClientAsync().

Parameters:onlyAuthorizedClientsAllowed (bool) – True restricts connections to allow only clients authorized with addAuthorizedClientAsync(). False allows connections from any client. Also allowed is a dict with a bool value extracted from the onlyAuthorizedClientsAllowed key.
Returns:Returns a Request Structure containing a requestId for this request. Use getRequestStatus() or getRequestResult() to monitor the status of the request.
Return type:dict

Changed in version 1.3.0: Restricted to superusers only.

RecvInterface.getSourcesAsync()

Submits a request to retrieve the sources that have established a connection with this Receiver.

A “source” is a sending Jetstream, from the viewpoint of the receiver.

Returns:Returns a Request Structure containing a requestId for this request. Use getRequestStatus() or getRequestResult() to monitor the status of the request.

getRequestResult() will return dictionary Source Structure.

Return type:dict
RecvInterface.getTransfersAsync()

Submits a request to retrieve the transfers from a receive server.

This command differs from getTransfers() in that this result describes the transfers being received on a server. The SendInterface method describes transfers being sent from a server.

Returns:Returns a Request Structure containing a requestId for this request. Use getRequestStatus() or getRequestResult() to monitor the status of the request.

getRequestResult() will return dictionary Receive Transfer Structure.

Return type:dict
RecvInterface.removeAuthorizedClientAsync(clientPublicKey)

Removes a public key from the list of authorized clients.

If allowOnlyAuthorizedClientsAsync() is used to restrict incoming connections, a Receiver server will allow incoming connections only from trusted clients. Removing a client’s public key will result in its connections being refused.

If a Jetstream server was launched with the --persistent-state-dir flag, its list of authorized clients will be saved, and restored if the server is restarted. If a Jetstream server is launched without this flag, its list of authorized clients must be configured again.

Parameters:clientPublicKey (str) – The public key of an untrusted client that is not authorized to connect to a Receiver server. Here, “client” refers to a Jetstream Sender server. Also allowed is a dict with a string value extracted from the clientPublicKey key.
Returns:Returns a Request Structure containing a requestId for this request. Use getRequestStatus() or getRequestResult() to monitor the status of the request.
Return type:dict

Changed in version 1.3.0: Restricted to superusers only.