mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-10-31 18:17:13 +08:00 
			
		
		
		
	feat: encrypt PII fields before saving it in the database (#1043)
Co-authored-by: Nishant Joshi <nishant.joshi@juspay.in>
This commit is contained in:
		| @ -1,4 +1,4 @@ | ||||
| use common_utils::{consts, custom_serde, pii}; | ||||
| use common_utils::{consts, crypto, custom_serde, pii}; | ||||
| use masking::Secret; | ||||
| use serde::{Deserialize, Serialize}; | ||||
| use utoipa::ToSchema; | ||||
| @ -16,7 +16,7 @@ pub struct CustomerRequest { | ||||
|     pub merchant_id: String, | ||||
|     /// The customer's name | ||||
|     #[schema(max_length = 255, example = "Jon Test")] | ||||
|     pub name: Option<String>, | ||||
|     pub name: Option<Secret<String>>, | ||||
|     /// The customer's email address | ||||
|     #[schema(value_type = Option<String>,max_length = 255, example = "JonTest@test.com")] | ||||
|     pub email: Option<pii::Email>, | ||||
| @ -56,13 +56,13 @@ pub struct CustomerResponse { | ||||
|     pub customer_id: String, | ||||
|     /// The customer's name | ||||
|     #[schema(max_length = 255, example = "Jon Test")] | ||||
|     pub name: Option<String>, | ||||
|     pub name: crypto::OptionalEncryptableName, | ||||
|     /// The customer's email address | ||||
|     #[schema(value_type = Option<String>,max_length = 255, example = "JonTest@test.com")] | ||||
|     pub email: Option<pii::Email>, | ||||
|     pub email: crypto::OptionalEncryptableEmail, | ||||
|     /// The customer's phone number | ||||
|     #[schema(value_type = Option<String>,max_length = 255, example = "9999999999")] | ||||
|     pub phone: Option<Secret<String>>, | ||||
|     pub phone: crypto::OptionalEncryptablePhone, | ||||
|     /// The country code for the customer phone number | ||||
|     #[schema(max_length = 255, example = "+65")] | ||||
|     pub phone_country_code: Option<String>, | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Kartikeya Hegde
					Kartikeya Hegde