backend.globaleaks.handlers.rtip

Module Contents

Classes

RTipInstance This interface exposes the Receiver’s Tip
RTipCommentCollection Interface use to write rtip comments
ReceiverMsgCollection Interface use to write rtip messages
WhistleblowerFileHandler Receiver interface to upload a file intended for the whistleblower
WBFileHandler This class is used in both RTip and WBTip to define a base for respective handlers
RTipWBFileHandler This handler lets the recipient download and delete wbfiles, which are files
ReceiverFileDownload This handler exposes rfiles for download.
IdentityAccessRequestsCollection Handler responsible of the creation of identity access requests

Functions

db_update_submission_status(session, user_id, itip, status_id, substatus_id) Transaction for registering a change of status of a submission
update_tip_submission_status(session, tid, user_id, rtip_id, status_id, substatus_id) Transaction for registering a change of status of a submission
receiver_serialize_rfile(session, rfile) Transaction returning a serialized descriptor of an rfile
receiver_serialize_wbfile(session, wbfile) Transaction returning a serialized descriptor of an wbfile
serialize_comment(session, comment) Transaction returning a serialized descriptor of a comment
serialize_message(session, message) Transaction returning a serialized descriptor of a message
serialize_rtip(session, rtip, itip, language) Transaction returning a serialized descriptor of a tip
db_access_rtip(session, tid, user_id, rtip_id) Transaction retrieving an rtip and performing basic access checks
db_access_wbfile(session, tid, user_id, wbfile_id) Transaction retrieving an wbfile and performing basic access checks
db_receiver_get_rfile_list(session, rtip_id) Transaction retrieving the list of rfiles attached to an rtip
receiver_get_rfile_list(session, rtip_id) Transaction retrieving the list of rfiles attached to an rtip
db_receiver_get_wbfile_list(session, itip_id) Transaction retrieving the list of rfiles attached to an itip
register_wbfile_on_db(session, tid, rtip_id, uploaded_file) Register a file on the database
db_set_itip_open_if_new(session, tid, user_id, itip) Transaction setting a submission status to open if the current status is new
db_get_rtip(session, tid, user_id, rtip_id, language) Transaction retrieving an rtip
get_rtip(session, tid, user_id, rtip_id, language) Transaction retrieving an rtip
db_delete_itips(session, itips_ids) Transaction for deleting a list of submissions
db_delete_itip(session, itip_id) Transaction for deleting a submission
db_postpone_expiration(session, itip) Transaction for postponing the expiration of a submission
delete_rtip(session, tid, user_id, rtip_id) Transaction for deleting a submission
postpone_expiration(session, tid, user_id, rtip_id) Transaction for postponing the expiration of a submission
set_internaltip_variable(session, tid, user_id, rtip_id, key, value) Transaction for setting properties of a submission
set_receivertip_variable(session, tid, user_id, rtip_id, key, value) Transaction for setting properties of a submission
update_label(session, tid, user_id, rtip_id, value) Transaction for setting the label of a submission
update_important(session, tid, user_id, rtip_id, value) Transaction for setting the important flag of a submission
db_get_itip_comment_list(session, itip_id) Transaction for retrieving the list of comments associated to a submission
db_create_identityaccessrequest_notifications(session, itip, rtip, iar) Transaction for the creation of notifications related to identity access requests
create_identityaccessrequest(session, tid, user_id, rtip_id, request) Transaction for the creation of notifications related to identity access requests
db_get_rtip_identityaccessrequest_list(session, rtip_id) Transaction for retrieving identity associated to an rtip
create_comment(session, tid, user_id, rtip_id, content) Transaction for registering a new comment
create_message(session, tid, user_id, rtip_id, content) Transaction for registering a new message
db_get_itip_message_list(session, rtip_id) Transact for retrieving the list of comments associated to a tip
delete_wbfile(session, tid, user_id, file_id) Transation for deleting a wbfile
backend.globaleaks.handlers.rtip.db_update_submission_status(session, user_id, itip, status_id, substatus_id)[source]

Transaction for registering a change of status of a submission

Parameters:
  • session – An ORM session
  • user_id – A user ID of the user changing the state
  • itip – The ID of the submission
  • status_id – The new status ID
  • substatus_id – A new substatus ID
backend.globaleaks.handlers.rtip.update_tip_submission_status(session, tid, user_id, rtip_id, status_id, substatus_id)[source]

Transaction for registering a change of status of a submission

Parameters:
  • session – An ORM session
  • tid – The tenant ID
  • user_id – A user ID of the user changing the state
  • rtip_id – The ID of the rtip accessed by the user
  • status_id – The new status ID
  • substatus_id – A new substatus ID
backend.globaleaks.handlers.rtip.receiver_serialize_rfile(session, rfile)[source]

Transaction returning a serialized descriptor of an rfile

Parameters:
  • session – An ORM session
  • rfile – A model to be serialized
Returns:

A serialized description of the model specified

backend.globaleaks.handlers.rtip.receiver_serialize_wbfile(session, wbfile)[source]

Transaction returning a serialized descriptor of an wbfile

Parameters:
  • session – An ORM session
  • wbfile – A model to be serialized
Returns:

A serialized description of the model specified

backend.globaleaks.handlers.rtip.serialize_comment(session, comment)[source]

Transaction returning a serialized descriptor of a comment

Parameters:
  • session – An ORM session
  • comment – A model to be serialized
Returns:

A serialized description of the model specified

backend.globaleaks.handlers.rtip.serialize_message(session, message)[source]

Transaction returning a serialized descriptor of a message

Parameters:
  • session – An ORM session
  • message – A model to be serialized
Returns:

A serialized description of the model specified

backend.globaleaks.handlers.rtip.serialize_rtip(session, rtip, itip, language)[source]

Transaction returning a serialized descriptor of a tip

Parameters:
  • session – An ORM session
  • rtip – A model to be serialized
  • itip – A itip object referenced by the model to be serialized
  • language – A language of the serialization
Returns:

A serialized description of the model specified

backend.globaleaks.handlers.rtip.db_access_rtip(session, tid, user_id, rtip_id)[source]

Transaction retrieving an rtip and performing basic access checks

Parameters:
  • session – An ORM session
  • tid – A tenant ID of the user
  • user_id – A user ID
  • rtip_id – the requested rtip ID
Returns:

A model requested

backend.globaleaks.handlers.rtip.db_access_wbfile(session, tid, user_id, wbfile_id)[source]

Transaction retrieving an wbfile and performing basic access checks

Parameters:
  • session – An ORM session
  • tid – A tenant ID of the user
  • user_id – A user ID
  • wbfile_id – the requested wbfile ID
Returns:

A model requested

backend.globaleaks.handlers.rtip.db_receiver_get_rfile_list(session, rtip_id)[source]

Transaction retrieving the list of rfiles attached to an rtip

Parameters:
  • session – An ORM session
  • rtip_id – A rtip ID
Returns:

A list of serializations of the retrieved models

backend.globaleaks.handlers.rtip.receiver_get_rfile_list(session, rtip_id)[source]

Transaction retrieving the list of rfiles attached to an rtip

Parameters:
  • session – An ORM session
  • rtip_id – A rtip ID
Returns:

A list of serializations of the retrieved models

backend.globaleaks.handlers.rtip.db_receiver_get_wbfile_list(session, itip_id)[source]

Transaction retrieving the list of rfiles attached to an itip

Parameters:
  • session – An ORM session
  • itip_id – A itip ID
Returns:

A list of serializations of the retrieved models

backend.globaleaks.handlers.rtip.register_wbfile_on_db(session, tid, rtip_id, uploaded_file)[source]

Register a file on the database

Parameters:
  • session – An ORM session
  • tid – A tenant id
  • rtip_id – A id of the rtip on which attaching the file
  • uploaded_file – A file to be attached
Returns:

A descriptor of the file

backend.globaleaks.handlers.rtip.db_set_itip_open_if_new(session, tid, user_id, itip)[source]

Transaction setting a submission status to open if the current status is new

Parameters:
  • session – An ORM session
  • tid – A tenant ID
  • user_id – A user ID of the user opening the submission
  • itip – A submission
backend.globaleaks.handlers.rtip.db_get_rtip(session, tid, user_id, rtip_id, language)[source]

Transaction retrieving an rtip

Parameters:
  • session – An ORM session
  • tid – A tenant ID
  • user_id – A user ID of the user opening the submission
  • rtip_id – A rtip ID to accessed
  • language – A language to be used for the serialization
Returns:

The serialized descriptor of the rtip

backend.globaleaks.handlers.rtip.get_rtip(session, tid, user_id, rtip_id, language)[source]

Transaction retrieving an rtip

Parameters:
  • session – An ORM session
  • tid – A tenant ID
  • user_id – A user ID of the user opening the submission
  • rtip_id – A rtip ID to accessed
  • language – A language to be used for the serialization
Returns:

The serialized descriptor of the rtip

backend.globaleaks.handlers.rtip.db_delete_itips(session, itips_ids)[source]

Transaction for deleting a list of submissions

Parameters:
  • session – An ORM session
  • itips_ids – A list of submissions ID
backend.globaleaks.handlers.rtip.db_delete_itip(session, itip_id)[source]

Transaction for deleting a submission

Parameters:
  • session – An ORM session
  • itip_id – A submission ID
backend.globaleaks.handlers.rtip.db_postpone_expiration(session, itip)[source]

Transaction for postponing the expiration of a submission

Parameters:
  • session – An ORM session
  • itip – A submission model to be postponed
backend.globaleaks.handlers.rtip.delete_rtip(session, tid, user_id, rtip_id)[source]

Transaction for deleting a submission

Parameters:
  • session – An ORM session
  • tid – A tenant ID of the user performing the operation
  • user_id – A user ID of the user performing the operation
  • rtip_id – A rtip ID of the submission object of the operation
backend.globaleaks.handlers.rtip.postpone_expiration(session, tid, user_id, rtip_id)[source]

Transaction for postponing the expiration of a submission

Parameters:
  • session – An ORM session
  • tid – A tenant ID of the user performing the operation
  • user_id – A user ID of the user performing the operation
  • rtip_id – A rtip ID of the submission object of the operation
backend.globaleaks.handlers.rtip.set_internaltip_variable(session, tid, user_id, rtip_id, key, value)[source]

Transaction for setting properties of a submission

Parameters:
  • session – An ORM session
  • tid – A tenant ID of the user performing the operation
  • user_id – A user ID of the user performing the operation
  • rtip_id – A rtip ID of the submission object of the operation
  • key – A key of the property to be set
  • value – A value to be assigned to the property
backend.globaleaks.handlers.rtip.set_receivertip_variable(session, tid, user_id, rtip_id, key, value)[source]

Transaction for setting properties of a submission

Parameters:
  • session – An ORM session
  • tid – A tenant ID of the user performing the operation
  • user_id – A user ID of the user performing the operation
  • rtip_id – A rtip ID of the submission object of the operation
  • key – A key of the property to be set
  • value – A value to be assigned to the property
backend.globaleaks.handlers.rtip.update_label(session, tid, user_id, rtip_id, value)[source]

Transaction for setting the label of a submission

Parameters:
  • session – An ORM session
  • tid – A tenant ID of the user performing the operation
  • user_id – A user ID of the user performing the operation
  • rtip_id – A rtip ID of the submission object of the operation
  • value – A value to be assigned to the label property
backend.globaleaks.handlers.rtip.update_important(session, tid, user_id, rtip_id, value)[source]

Transaction for setting the important flag of a submission

Parameters:
  • session – An ORM session
  • tid – A tenant ID of the user performing the operation
  • user_id – A user ID of the user performing the operation
  • rtip_id – A rtip ID of the submission object of the operation
  • value – A value to be assigned to important flag
backend.globaleaks.handlers.rtip.db_get_itip_comment_list(session, itip_id)[source]

Transaction for retrieving the list of comments associated to a submission :param session: An ORM session :param itip_id: A submission object of the request :return: A serialized descriptor of the comments

backend.globaleaks.handlers.rtip.db_create_identityaccessrequest_notifications(session, itip, rtip, iar)[source]

Transaction for the creation of notifications related to identity access requests :param session: An ORM session :param tid: A tenant ID on which the request is issued :param itip: A itip ID of the tip involved in the request :param rtip: A rtip ID of the rtip involved in the request :param iar: A identity access request model

backend.globaleaks.handlers.rtip.create_identityaccessrequest(session, tid, user_id, rtip_id, request)[source]

Transaction for the creation of notifications related to identity access requests :param session: An ORM session :param tid: A tenant ID of the user issuing the request :param user_id: A user ID of the user issuing the request :param rtip_id: A rtip_id ID of the rtip involved in the request :param request: The request data

backend.globaleaks.handlers.rtip.db_get_rtip_identityaccessrequest_list(session, rtip_id)[source]

Transaction for retrieving identity associated to an rtip :param session: An ORM session :param rtip_id: An rtip ID :return: The list of descriptors of the identity access requests associated to the specified rtip

backend.globaleaks.handlers.rtip.create_comment(session, tid, user_id, rtip_id, content)[source]

Transaction for registering a new comment :param session: An ORM session :param tid: A tenant ID :param user_id: The user id of the user creating the comment :param rtip_id: The rtip associated to the comment to be created :param content: The content of the comment :return: A serialized descriptor of the comment

backend.globaleaks.handlers.rtip.create_message(session, tid, user_id, rtip_id, content)[source]

Transaction for registering a new message :param session: An ORM session :param tid: A tenant ID :param user_id: The user id of the user creating the message :param rtip_id: The rtip associated to the message to be created :param content: The content of the message :return: A serialized descriptor of the message

backend.globaleaks.handlers.rtip.db_get_itip_message_list(session, rtip_id)[source]

Transact for retrieving the list of comments associated to a tip :param session: An ORM session :param rtip_id: An rtip ID :return: A serialized list of descriptors of messages associated to the specified rtip

backend.globaleaks.handlers.rtip.delete_wbfile(session, tid, user_id, file_id)[source]

Transation for deleting a wbfile :param session: An ORM session :param tid: A tenant ID :param user_id: The user ID of the user performing the operation :param file_id: The file ID of the wbfile to be deleted

class backend.globaleaks.handlers.rtip.RTipInstance[source]

Bases: globaleaks.handlers.operation.OperationHandler

This interface exposes the Receiver’s Tip

check_roles = receiver[source]
get(self, tip_id)[source]
operation_descriptors(self)[source]
set_tip_val(self, req_args, tip_id, *args, **kwargs)[source]
postpone_expiration(self, _, tip_id, *args, **kwargs)[source]
update_important(self, req_args, tip_id, *args, **kwargs)[source]
update_label(self, req_args, tip_id, *args, **kwargs)[source]
update_submission_status(self, req_args, tip_id, *args, **kwargs)[source]
delete(self, tip_id)[source]

Remove the Internaltip and all the associated data

class backend.globaleaks.handlers.rtip.RTipCommentCollection[source]

Bases: globaleaks.handlers.base.BaseHandler

Interface use to write rtip comments

check_roles = receiver[source]
post(self, tip_id)[source]
class backend.globaleaks.handlers.rtip.ReceiverMsgCollection[source]

Bases: globaleaks.handlers.base.BaseHandler

Interface use to write rtip messages

check_roles = receiver[source]
post(self, tip_id)[source]
class backend.globaleaks.handlers.rtip.WhistleblowerFileHandler[source]

Bases: globaleaks.handlers.base.BaseHandler

Receiver interface to upload a file intended for the whistleblower

check_roles = receiver[source]
upload_handler = True[source]
can_perform_action(self, session, tid, tip_id, filename)[source]
post(self, tip_id)[source]
class backend.globaleaks.handlers.rtip.WBFileHandler[source]

Bases: globaleaks.handlers.base.BaseHandler

This class is used in both RTip and WBTip to define a base for respective handlers

check_roles = receiver[source]
user_can_access(self, session, tid, wbfile)[source]
access_wbfile(self, session, wbfile)[source]
download_wbfile(self, session, tid, file_id)[source]
get(self, wbfile_id)[source]
class backend.globaleaks.handlers.rtip.RTipWBFileHandler[source]

Bases: backend.globaleaks.handlers.rtip.WBFileHandler

This handler lets the recipient download and delete wbfiles, which are files intended for delivery to the whistleblower.

check_roles = receiver[source]
user_can_access(self, session, tid, wbfile)[source]
delete(self, file_id)[source]

This interface allow the recipient to set the description of a WhistleblowerFile

class backend.globaleaks.handlers.rtip.ReceiverFileDownload[source]

Bases: globaleaks.handlers.base.BaseHandler

This handler exposes rfiles for download.

check_roles = receiver[source]
download_rfile(self, session, tid, user_id, file_id)[source]
get(self, rfile_id)[source]
class backend.globaleaks.handlers.rtip.IdentityAccessRequestsCollection[source]

Bases: globaleaks.handlers.base.BaseHandler

Handler responsible of the creation of identity access requests

check_roles = receiver[source]
post(self, tip_id)[source]