feat: implement example rpc method with timeout
Description
Partial implementation of [PerunRpcAdapter](https://gitlab.ics.muni.cz/perun/perun-proxyidp/perun-connector/-/blob/main/perun/connector/adapters/PerunRpcAdapter.py?ref_type=heads)
functionality in Java. Handles configuration of the adapter, saving/loading of cookies, and demonstrates how to integrate openapi method calls on the getPerunUser
method. Other methods can be implemented based on this example.
How to test
Get configuration for RPC connection for example from perun microservices on id-test VM. Replace the example in RPC adapters in adapters-manager-test.yml
with a properly configured RPC adapter. Add a new test file with @Autowired AdaptersManager
or expand AdaptersManagerTest with a new test (in that case, be mindful of mocks and their overridden properties). Call the getPerunUser
method on AdaptersManager
(in the test, it should be autoconfigured based on your test configuration from adapters-manager-test.yml
). Observe whether it results in the correct result. You may add:
try {
TimeUnit.SECONDS.sleep(10);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
to getPerunUser
in PerunRpcAdapter
to test the timeout.
Author's checklist
-
I have followed the contribution guidelines -
This MR has been tested or does not change functionality -
I have added relevant merge request dependencies (if this MR has any) -
I have added the correct labels -
I have assigned reviewers (if any are relevant) -
I have edited the documentation (if the changes require it) or I have noted the need for the change if I do not have access to the documentation -
I have marked all introduced BREAKING CHANGES or necessary DEPLOYMENT NOTES in the commit message(s)
Reviewer's checklist
-
This MR has been tested or does not change functionality -
This MR has correct commit message format
Other information
This implementation also introduces the timeout to AdaptersManager
it automatically cancels method execution regardless of the adapter after a timeout set on per-adapter basis in the config.
Related issues
Re STR-1396