From c437f5b1e507be792f16b17edd3107392950da80 Mon Sep 17 00:00:00 2001 From: "github-classroom[bot]" <66690702+github-classroom[bot]@users.noreply.github.com> Date: Tue, 23 Sep 2025 22:36:28 +0000 Subject: [PATCH 1/3] GitHub Classroom Feedback --- .github/.keep | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 .github/.keep diff --git a/.github/.keep b/.github/.keep new file mode 100644 index 0000000..e69de29 From 57f6e2e57b3d743b35a2e8805b0dd0136a61337a Mon Sep 17 00:00:00 2001 From: "github-classroom[bot]" <66690702+github-classroom[bot]@users.noreply.github.com> Date: Tue, 23 Sep 2025 22:36:28 +0000 Subject: [PATCH 2/3] Setting up GitHub Classroom Feedback From 57cdc5c0d26b6374046946e4c0f3d2a02b127a34 Mon Sep 17 00:00:00 2001 From: LuisV Date: Sun, 28 Sep 2025 18:37:10 -0700 Subject: [PATCH 3/3] newbranch --- .DS_Store | Bin 0 -> 6148 bytes breakout-exercises/code_review_exercise.md | 6 +++++- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..48d1361511b996bbc83aa06de265b3589019b70c GIT binary patch literal 6148 zcmeHK%}N6?5dKmZEPAl$#e>McK*fR&u&wJ|D0tRwOIvK&(jV}+44W(*t#i4*8j} zH4C%6IAv(5xG;CTzqs5>#;#WMv)HiCYpL{zmCRY?lvZl1v$`Bzw(Il^F~$TV^ukIH zp36suwHC`aP;%WZ@2_NZSg-w^NzE#o4DiersqQ;es|+Xu%D^WBvOmOB!Ng zkL_@n#GzVcKp6-b*l~|FIsdP=-~YoPeNqOLfq%t-iPCo3VoCmN-6&4Z+L(Gv6_Ig; lLmNWlk7L`AqxhI=g}zuC#KdFakUbRrBVcJzqYV5i10VARq*4F? literal 0 HcmV?d00001 diff --git a/breakout-exercises/code_review_exercise.md b/breakout-exercises/code_review_exercise.md index bc31b44..3daa931 100644 --- a/breakout-exercises/code_review_exercise.md +++ b/breakout-exercises/code_review_exercise.md @@ -16,18 +16,21 @@ import requests import sqlite3 import hashlib +# API Key, Database_URL, and Debug_mode should all be in a .env file API_KEY = "sk-live-1234567890abcdef" DATABASE_URL = "postgresql://admin:password123@localhost/prod" DEBUG_MODE = True def authenticate_user(username, password): conn = sqlite3.connect("users.db") + #No f string on sqlite query for security reasons query = f"SELECT * FROM users WHERE username='{username}' AND password='{password}'" result = conn.execute(query).fetchone() + #Password should be hashtag print(f"Login attempt: {username}:{password}") - + #This API call should be in a try and except block response = requests.post("https://api.auth.com/verify", data={"user": username, "key": API_KEY}) @@ -35,6 +38,7 @@ def authenticate_user(username, password): def reset_password(user_id, new_password): conn = sqlite3.connect("users.db") + #No f string on sqlite query for security reasons query = f"UPDATE users SET password='{new_password}' WHERE id={user_id}" conn.execute(query) conn.commit()