Skip to content

Commit a4f4b32

Browse files
committed
add TEMP logging for base user creation, login 2.61
1 parent 5ee9321 commit a4f4b32

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/helm-chart/values.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ server:
99
repository: ghcr.io/codeforphilly/paws-data-pipeline/server
1010
pullPolicy: Always
1111
# Overrides the image tag whose default is the chart appVersion.
12-
tag: "2.60"
12+
tag: "2.61"
1313

1414
client:
1515
image:
1616
repository: ghcr.io/codeforphilly/paws-data-pipeline/client
1717
pullPolicy: Always
1818
# Overrides the image tag whose default is the chart appVersion.
19-
tag: "2.60"
19+
tag: "2.61"
2020

2121
db:
2222
image:

src/server/api/user_api.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,18 @@ def dummy_check():
135135
check_password('password', pw_bytes)
136136

137137
try:
138+
logger.debug(request.data) #TODO: Remove
138139
post_dict = json.loads(request.data)
139140
username = post_dict["username"]
140141
presentedpw = post_dict["password"]
141-
except:
142+
except Exception as err:
142143
dummy_check() # Take the same time as with well-formed requests
144+
logger.info("Exception parsing or getting username/pw : %s", str(err))
143145
return jsonify("Bad credentials"), 401
144146

145147
if not (isinstance(username, str) and isinstance(presentedpw, str) ):
146148
dummy_check() # Take the same time as with well-formed requests
149+
logger.info("Not string")
147150
return jsonify("Bad credentials"), 401 # Don't give us ints, arrays, etc.
148151

149152

@@ -163,6 +166,7 @@ def dummy_check():
163166
pwhash, role, is_active = result.fetchone()
164167
else:
165168
log_user_action(username, "Failure", "Invalid username")
169+
logger.info("Unknown username")
166170
dummy_check()
167171
return jsonify("Bad credentials"), 401
168172

@@ -175,6 +179,7 @@ def dummy_check():
175179
else:
176180
log_user_action(username, "Failure", "Bad password or inactive")
177181
# No dummy_check needed as we ran a real one to get here
182+
logger.info("Bad password or inactive user")
178183
return jsonify("Bad credentials"), 401
179184

180185

src/server/db_setup/base_users.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def create_base_users(): # TODO: Just call create_user for each
7676
ins_stmt = pu.insert().values(
7777
username="base_admin", full_name="Base Admin", password=pw_hash, active="Y", role=9,
7878
)
79+
logger.info("base_admin password: %s", BASEADMIN_PW) #TODO: Remove this
7980
connection.execute(ins_stmt)
8081

8182
else:

0 commit comments

Comments
 (0)