CourseModel Context Protocol: The Complete Course · Module 7: Authorization · part 52 of 77
Part 52 · Module 7: Authorization

Lab: Lock the HTTP notes server with tokens

81 min read·13 Oct 2026
Module 7 · Lab · About 75 minutes · Needs: lessons 1 to 3 of this module and the Module 5 lab; Module 6 helps; no model key is used

What you are building

NOTES_ASSISTANT/ auth.py verify, scopes, challenge server.py token_verifier= auth=, check() m07_idp.py stand-in on 9000 notebooks, tests m07_lab.py started as deployed, port 8075 test_auth.py 11 tests, no port read: Nare, Priya, Tomas | write: Nare | stranger: nothing
The lab adds auth.py and upgrades server.py (blue), keeps one stand-in provider for notebooks and tests (grey), and pins the rules with eleven keyless tests (green).

Monday 28 September 2026, week 4. The lessons built authorization in scratch folders. This lab puts one version of each piece into your notes-assistant repository: notes_assistant/auth.py, one stand-in identity provider, an upgrade to notes_assistant/server.py that keeps every earlier test passing, a script that starts the server as a deployment would and signs in as Nare and Priya, and keyless tests.

The running example is course-guide/03's rule, end to end: Priya and Tomas may read (notes:read), only Nare may also write (notes:write), and a stranger gets nothing.

The rest of this course is yours to keep

This course is bought on its own, once, and stays readable afterwards, including the parts added to it later.