cesar
pushed to proto/independent-signatory at cesar/cdk
18f7297d1b Add more commands
3db93e501c Remove the shared Mint instance between tests
Since the SignatoryManager spawns a worker (with `tokio::spawn`) to execute the
Signatory (which implements the `Signatory` trait), a mpsc channel is used to
exchange messages.
In side Tokio tests, each test has its own Tokio runtime. When the first test
is done, since `instantiate` shares all the Mint instances, their Tokio runtime
is dropped, and the tokio::spawn's task gets killed, breaking the channel.
Since the SignatoryManager has no way to respawn, understandably so, since the
task runs in an infinite loop, receiving messages and spawning new tasks to
non-blocking. There are two choices: either create one Mint per test (which is
what this PR does) or compile a modified version of the SignatoryManager for
tests, which performs the calls to the Signatory trait in place instead of
converting it to a message and passing to the signatory Tokio task.
The first option is more straightforward and fixes other instances of the code
where `tokio::spawn` is used, such as subscriptions.
A third option could be explored, which would imply spawning a Tokio runtime in
another OS-level thread, creating the Mint in that context, and sharing it with
everything else; perhaps this should explored further if the idea is to test
Mint this way.
792b7a3180 Introduce a SignatoryManager service.
The SignatoryManager manager provides an API to interact with keysets, private
keys, and all key-related operations, offering segregation between the mint and
the most sensible part of the mind: the private keys.
Although the default signatory runs in memory, it is completely isolated from
the rest of the system and can only be communicated through the interface
offered by the signatory manager. Only messages can be sent from the mintd to
the Signatory trait through the Signatory Manager.
This pull request sets the foundation for eventually being able to run the
Signatory and all the key-related operations in a separate service, possibly in
a foreign service, to offload risks, as described in #476.
The Signatory manager is concurrent and deferred any mechanism needed to handle
concurrency to the Signatory trait.
6e86235970 Merge pull request #610 from BitcreditProtocol/peanut/swagger_type
fix openApi attributes to keyset id to present it as a string
606385f44a fix openApi attributes to keyset id to present it as a string
The attribute `schema(as = String)` does not result in the expected
behaviour.
It does not convert Id to being represented as a simple string, but
rather simply rename the type `Id` to `String`.
This commit removes the attribute that implements utoipa::ToSchema trait
for type `Id` and adds attribute to all the types that have a keyset id
as inner type to represent it as string.
3 weeks ago