Commit Graph

4 Commits

Author SHA1 Message Date
Marco Trevisan (Treviño) ac879208ea module-transaction: Add support for binary conversations
A module can now initiate a binary conversation decoding the native
pointer value as it wants.

Added tests to verify the main cases
2023-12-14 22:07:50 +01:00
Marco Trevisan (Treviño) 883dc86533 module-transaction: Add support for initiating PAM Conversations
Modules have the ability to start PAM conversations, so while the
transaction code can handle them we did not have a way to init them.
Yet.

So add some APIs allowing this, making it easier from the go side to
handle the conversations.

In this commit we only support text-based conversations, but code is
designed with the idea of supporting binary cases too.

Added the integration tests using the module that is now able to both
start conversation and handle them using Go only.
2023-12-14 22:07:50 +01:00
Marco Trevisan (Treviño) 7a073f5ba0 module-transaction: Add support for setting/getting module data
Module data is data associated with a module handle that is available
for the whole module loading time so it can be used also during
different operations.

We use cgo handles to preserve the life of the go objects so any value
can be associated with a pam transaction.
2023-12-14 22:07:50 +01:00
Marco Trevisan (Treviño) 449b2672b9 module-transaction: Add GetUser() method that prompts an user if non-set
We can now finally test this properly both using a mock and through the
interactive module that will do the request for us in various conditions.
2023-12-14 22:07:50 +01:00