Sign in

Apply core and periphery

The core and periphery pattern keeps the smallest amount of logic in the position of highest trust. A minimal core holds the valuable state and enforces the rules that guard it. Everything convenient lives in a replaceable periphery that reaches the core only through a narrow interface, with no special powers of its own.

This task gives you a user store that mixes the two: it holds password hashes and also offers convenience features built on the same records, and one of them lets a hash escape. Apply the pattern so the leak cannot happen by construction, splitting the store so the core holds the hashes behind a narrow interface and nothing outside it can reach one.

Clone the template repository and open the 03-core-periphery folder. Complete the task in one language only, editing that language's store file. The other files, including store-data, are given. At the top of SOLUTION.md, declare the language you used, keeping a single value such as language: "python", since your work is graded against that file. Then explain what belonged in the core, what belonged in the periphery, and why your split makes it impossible, rather than merely difficult, to reach a hash from outside the core. Push your work to your own fork and submit the repository URL.