feat(router): implement API endpoints for managing API keys (#511)

This commit is contained in:
Sanchith Hegde
2023-02-10 14:20:57 +05:30
committed by GitHub
parent 903b452146
commit 1bdc8955c2
35 changed files with 1759 additions and 99 deletions

View File

@ -37,6 +37,16 @@ pub fn which() -> Env {
std::env::var(RUN_ENV).map_or_else(|_| default_env, |v| v.parse().unwrap_or(default_env))
}
/// Three letter (lowercase) prefix corresponding to the current environment.
/// Either `dev`, `snd` or `prd`.
pub fn prefix_for_env() -> &'static str {
match which() {
Env::Development => "dev",
Env::Sandbox => "snd",
Env::Production => "prd",
}
}
///
/// Base path to look for config and logs directories.
/// Application expects to find `./config/` and `./logs/` relative this directories.

View File

@ -150,6 +150,16 @@ pub enum Flow {
IncomingWebhookReceive,
/// Validate payment method flow
ValidatePaymentMethod,
/// API Key create flow
ApiKeyCreate,
/// API Key retrieve flow
ApiKeyRetrieve,
/// API Key update flow
ApiKeyUpdate,
/// API Key revoke flow
ApiKeyRevoke,
/// API Key list flow
ApiKeyList,
}
/// Category of log event.