mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 04:04:55 +08:00
refactor(router): Introduce ApiKeyId id type (#6324)
This commit is contained in:
@ -29,8 +29,8 @@ pub struct CreateApiKeyRequest {
|
||||
#[derive(Debug, Serialize, ToSchema)]
|
||||
pub struct CreateApiKeyResponse {
|
||||
/// The identifier for the API Key.
|
||||
#[schema(max_length = 64, example = "5hEEqkgJUyuxgSKGArHA4mWSnX")]
|
||||
pub key_id: String,
|
||||
#[schema(max_length = 64, example = "5hEEqkgJUyuxgSKGArHA4mWSnX", value_type = String)]
|
||||
pub key_id: common_utils::id_type::ApiKeyId,
|
||||
|
||||
/// The identifier for the Merchant Account.
|
||||
#[schema(max_length = 64, example = "y3oqhf46pyzuxjbcn2giaqnb44", value_type = String)]
|
||||
@ -72,8 +72,8 @@ pub struct CreateApiKeyResponse {
|
||||
#[derive(Debug, Serialize, ToSchema)]
|
||||
pub struct RetrieveApiKeyResponse {
|
||||
/// The identifier for the API Key.
|
||||
#[schema(max_length = 64, example = "5hEEqkgJUyuxgSKGArHA4mWSnX")]
|
||||
pub key_id: String,
|
||||
#[schema(max_length = 64, example = "5hEEqkgJUyuxgSKGArHA4mWSnX", value_type = String)]
|
||||
pub key_id: common_utils::id_type::ApiKeyId,
|
||||
|
||||
/// The identifier for the Merchant Account.
|
||||
#[schema(max_length = 64, example = "y3oqhf46pyzuxjbcn2giaqnb44", value_type = String)]
|
||||
@ -131,7 +131,8 @@ pub struct UpdateApiKeyRequest {
|
||||
pub expiration: Option<ApiKeyExpiration>,
|
||||
|
||||
#[serde(skip_deserializing)]
|
||||
pub key_id: String,
|
||||
#[schema(value_type = String)]
|
||||
pub key_id: common_utils::id_type::ApiKeyId,
|
||||
|
||||
#[serde(skip_deserializing)]
|
||||
#[schema(value_type = String)]
|
||||
@ -146,8 +147,8 @@ pub struct RevokeApiKeyResponse {
|
||||
pub merchant_id: common_utils::id_type::MerchantId,
|
||||
|
||||
/// The identifier for the API Key.
|
||||
#[schema(max_length = 64, example = "5hEEqkgJUyuxgSKGArHA4mWSnX")]
|
||||
pub key_id: String,
|
||||
#[schema(max_length = 64, example = "5hEEqkgJUyuxgSKGArHA4mWSnX", value_type = String)]
|
||||
pub key_id: common_utils::id_type::ApiKeyId,
|
||||
/// Indicates whether the API key was revoked or not.
|
||||
#[schema(example = "true")]
|
||||
pub revoked: bool,
|
||||
|
||||
Reference in New Issue
Block a user