Skip to content

youtube-cwc/code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

2 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ“Œ PII Data Masking in Spring Boot

Welcome ๐Ÿ‘‹! This project is part of my YouTube tutorial where I show how to mask sensitive customer data (PII) like phone numbers and club card numbers in a Spring Boot application.

๐Ÿง What is PII Masking?

PII stands for Personally Identifiable Information โ€“ things like phone numbers, card numbers, email addresses, etc.

โžก๏ธ If we expose them directly from our API, itโ€™s a security risk. โžก๏ธ Masking means we hide part of the value before sending it back to the client.

Example:

Phone number 9876543210 โ†’ xxxxxx3210

Club card 1234-5678-9012-3456 โ†’ XXXX-XXXX-XXXX-3456

๐Ÿš€ Features of this Project

โœ… Spring Boot REST API

โœ… JPA + H2 (in-memory DB)

โœ… Custom annotation @MaskData

โœ… Jackson Serializer PIIHide for masking

โœ… Demo API tested with Postman

๐Ÿ› ๏ธ Tech Stack

Java 17+ Spring Boot 3+ Maven Lombok Jackson

โ–ถ๏ธ How to Run the Project

Clone this repo

git clone https://github.com/youtube-cwc/code.git cd code

Build and run with Maven

./mvnw spring-boot:run

API Endpoint

GET http://localhost:8080/customer/1

๐Ÿ“ธ Demo ๐Ÿ”ด Before Masking (unsafe response) { "id": 1, "name": "John Doe", "phoneNumber": "9876543210", "clubCardNumber": "1234-5678-9012-3456" }

๐ŸŸข After Masking (safe response) { "id": 1, "name": "John Doe", "phoneNumber": "xxxxxx3210", "clubCardNumber": "XXXX-XXXX-XXXX-3456" }

๐Ÿ‘‰ (Insert Postman screenshots here for better engagement)

๐ŸŽฅ YouTube Tutorial

๐Ÿ“บ Watch the full tutorial here ๐Ÿ‘‰ [Your YouTube Link]

๐Ÿค Contributing

Found a bug? Open an issue.

Have a suggestion? Create a pull request.

๐Ÿ“œ License

Licensed under MIT License โ€“ free to use & modify.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages