Differences

This shows you the differences between two versions of the page.

Link to this comparison view

ii:labs:s2:03:tasks:02 [2024/04/01 21:38]
florin.stancu removed
ii:labs:s2:03:tasks:02 [2024/04/01 21:39] (current)
florin.stancu created
Line 1: Line 1:
-==== 02. [10pRunning containers ​====+==== 02. [30pMock Authentication ​====
  
-== Subtasks ==+Now, it's the time to add authentication to our website. 
 + 
 +  * Use a server-side ''​session''​ to store the user's state (e.g., an ''​authenticated''​ bool + ''​username''​ string keys). 
 +    * Don't forget to set a ''​secret_key''​ for the session, otherwise it won't work! 
 +  * Write the Flask functions for ''/​login''​ and ''/​logout''​ with the appropriate checks / actions. 
 +  * You can either use the included ''​login.html''​ template page, or roll out your own! 
 +    * Check out the input names inside the ''<​form>''​! 
 +  * Hint: you can also set the ''​authenticated''​ variable inside the Jinja template to conditionally display the user's status. 
 +    * You can use a Flask [[https://​flask.palletsprojects.com/​en/​3.0.x/​templating/#​context-processors|context processor]] to avoid needless code duplication;​ 
 +    * //​Alternative//:​ the ''​session''​ is readily available inside Jinja2 templates!
  
-  - pull the **//​busybox//​** image from the official Docker registry to the local cache 
-  - run a **//​busybox//​** container that executes the **//​uptime//​** command 
-  - run an interactive **//​busybox//​** container; once you enter it, run the command **//wget google.com//​**,​ then exit 
-  - run a **//​busybox//​** detached interactive container (daemon); once you have started it, attach to it and run the **//id//** command, then exit 
-  - delete all containers and images created at the previous points 
  
ii/labs/s2/03/tasks/02.1711996716.txt.gz · Last modified: 2024/04/01 21:38 by florin.stancu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0