feat(multitenancy): add support for multitenancy and handle the same in router, producer, consumer, drainer and analytics (#4630)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
Co-authored-by: Arun Raj M <jarnura47@gmail.com>
This commit is contained in:
Jagan
2024-06-03 17:57:30 +05:30
committed by GitHub
parent a1788b8da9
commit 15d6c3e846
188 changed files with 2260 additions and 1414 deletions

View File

@ -9,7 +9,7 @@ use crate::{
configs::settings,
consts,
core::errors::{self, RouterResponse, StorageErrorExt},
routes::{metrics, AppState},
routes::{metrics, SessionState},
services::ApplicationResponse,
types::{api, storage, transformers::ForeignInto},
utils,
@ -110,7 +110,7 @@ impl PlaintextApiKey {
#[instrument(skip_all)]
pub async fn create_api_key(
state: AppState,
state: SessionState,
api_key: api::CreateApiKeyRequest,
merchant_id: String,
) -> RouterResponse<api::CreateApiKeyResponse> {
@ -244,7 +244,7 @@ pub async fn add_api_key_expiry_task(
#[instrument(skip_all)]
pub async fn retrieve_api_key(
state: AppState,
state: SessionState,
merchant_id: &str,
key_id: &str,
) -> RouterResponse<api::RetrieveApiKeyResponse> {
@ -261,7 +261,7 @@ pub async fn retrieve_api_key(
#[instrument(skip_all)]
pub async fn update_api_key(
state: AppState,
state: SessionState,
api_key: api::UpdateApiKeyRequest,
) -> RouterResponse<api::RetrieveApiKeyResponse> {
let merchant_id = api_key.merchant_id.clone();
@ -395,7 +395,7 @@ pub async fn update_api_key_expiry_task(
#[instrument(skip_all)]
pub async fn revoke_api_key(
state: AppState,
state: SessionState,
merchant_id: &str,
key_id: &str,
) -> RouterResponse<api::RevokeApiKeyResponse> {
@ -463,7 +463,7 @@ pub async fn revoke_api_key_expiry_task(
#[instrument(skip_all)]
pub async fn list_api_keys(
state: AppState,
state: SessionState,
merchant_id: String,
limit: Option<i64>,
offset: Option<i64>,