E-mediumRusthacktoberfesthelp wanted
Description
Description:
Cripta is a service which creates keys and maintains it (includes key rotation etc.) individually for different Merchants and Users.
The idea here is to segregate key data for each tenants logically by creating different schemas for different tenants. So in the service we need to maintain the connection between multiple schemas.
[!NOTE] We will get the tenant for which the current request should be run in
X-tenantheader.
Getting started:
Go through the README for guidelines on the structure and functionality.
Possible implementation:
- Add a config entry for multi-tenancy in this structure
[mult_tenancy]
tenant_name = { schema = "tenant_schema" }
- Add connections for different schemas for different tenants
struct AppState {
// This will maintain connection pool for different schemas for tenants
connections: HashMap<String, DieselConnectionPool>
}
- Add
SessionStatewhich will have the connections for the particular tenant
struct SessionState {
pool: DieselConnectionPool
}
impl AppState {
fn get_session_state(&self,tenant: &str) -> SessionState {
return self.pool.get(tenant)
}
}
Reference:
-
Language: Rust
-
Difficulty: Medium
Submission Process:
- Ask the maintainers for assignment of the issue, you can request for assignment by commenting on the issue itself.
- Once assigned, submit a pull request (PR).
- Maintainers will review and provide feedback, if any.
- Maintainers can unassign issues due to inactivity, read more here.
- For this issue, please raise a PR on the https://github.com/juspay/hyperswitch-encryption-service repo, and link the issue.
Refer here for Terms and conditions for the contest.