Skip to content

Commit 82d10c2

Browse files
committed
style: delete white spaces when using json encoder class in controllers
1 parent 6bc7d03 commit 82d10c2

File tree

4 files changed

+25
-25
lines changed

4 files changed

+25
-25
lines changed

app/controllers/auth_controller.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ async def signup(
4242
if existing_user:
4343
return JSONResponse(
4444
status_code=status.HTTP_409_CONFLICT,
45-
content= json_encoder.encode(
45+
content=json_encoder.encode(
4646
{
4747
"detail": "user_already_exists",
4848
}
@@ -54,7 +54,7 @@ async def signup(
5454
})
5555
return JSONResponse(
5656
status_code=status.HTTP_200_OK,
57-
content= json_encoder.encode(
57+
content=json_encoder.encode(
5858
{
5959
"detail": "signup_success",
6060
}
@@ -78,7 +78,7 @@ async def login(
7878
if user is None:
7979
return JSONResponse(
8080
status_code=status.HTTP_400_BAD_REQUEST,
81-
content= json_encoder.encode(
81+
content=json_encoder.encode(
8282
{
8383
"detail": "user_no_exist",
8484
}
@@ -88,7 +88,7 @@ async def login(
8888
if not await password_encoder.verify(login_request.password, hashed_pass):
8989
return JSONResponse(
9090
status_code=status.HTTP_400_BAD_REQUEST,
91-
content= json_encoder.encode(
91+
content=json_encoder.encode(
9292
{
9393
"detail": "user_incorrect_password",
9494
}
@@ -99,7 +99,7 @@ async def login(
9999
refresh_token = await jwt_bearer.create_refresh_token(user_id)
100100
response = JSONResponse(
101101
status_code=status.HTTP_200_OK,
102-
content= json_encoder.encode({
102+
content=json_encoder.encode({
103103
"user_id": user_id,
104104
"detail": "login_success",
105105
}),
@@ -124,14 +124,14 @@ async def logout(
124124
if not refresh_token:
125125
return JSONResponse(
126126
status_code=status.HTTP_400_BAD_REQUEST,
127-
content= json_encoder.encode({
127+
content=json_encoder.encode({
128128
"detail": "missing_refresh_token",
129129
}),
130130
)
131131
await auth_service.create_revoked_token(refresh_token, await jwt_bearer.read_expiration_date(refresh_token))
132132
response = JSONResponse(
133133
status_code=status.HTTP_200_OK,
134-
content= json_encoder.encode({
134+
content=json_encoder.encode({
135135
"detail": "logout_success",
136136
}),
137137
)
@@ -155,7 +155,7 @@ async def account_exists(
155155
user = await auth_service.read_user_by_email(account_exists_request.email)
156156
return JSONResponse(
157157
status_code=status.HTTP_200_OK,
158-
content= json_encoder.encode(
158+
content=json_encoder.encode(
159159
{
160160
"user_exists": True if user else False,
161161
"detail": "account_exists_success",
@@ -181,7 +181,7 @@ async def change_password(
181181
if user is None:
182182
return JSONResponse(
183183
status_code=status.HTTP_400_BAD_REQUEST,
184-
content= json_encoder.encode(
184+
content=json_encoder.encode(
185185
{
186186
"detail": "user_no_exist",
187187
}
@@ -190,7 +190,7 @@ async def change_password(
190190
if not await password_encoder.verify(change_password_request.old_password, user.password):
191191
return JSONResponse(
192192
status_code=status.HTTP_400_BAD_REQUEST,
193-
content= json_encoder.encode(
193+
content=json_encoder.encode(
194194
{
195195
"detail": "user_invalid_old_password",
196196
}
@@ -201,7 +201,7 @@ async def change_password(
201201
await auth_service.update_user_password(user)
202202
return JSONResponse(
203203
status_code=status.HTTP_200_OK,
204-
content= json_encoder.encode(
204+
content=json_encoder.encode(
205205
{
206206
"detail": "change_password_success",
207207
}
@@ -222,7 +222,7 @@ async def check_token(request: Request, verify_token_request: VerifyTokenRequest
222222
if not token:
223223
return JSONResponse(
224224
status_code=status.HTTP_400_BAD_REQUEST,
225-
content= json_encoder.encode({
225+
content=json_encoder.encode({
226226
"valid": False,
227227
"detail": "token_missing",
228228
}),
@@ -231,7 +231,7 @@ async def check_token(request: Request, verify_token_request: VerifyTokenRequest
231231
payload = await jwt_bearer.verify_access_token(token)
232232
return JSONResponse(
233233
status_code=status.HTTP_200_OK,
234-
content= json_encoder.encode({
234+
content=json_encoder.encode({
235235
"valid": True,
236236
"user_id": payload.get("user_id"),
237237
"detail": "token_verification_success",
@@ -240,23 +240,23 @@ async def check_token(request: Request, verify_token_request: VerifyTokenRequest
240240
except ExpiredSignatureError:
241241
return JSONResponse(
242242
status_code=status.HTTP_401_UNAUTHORIZED,
243-
content= json_encoder.encode({
243+
content=json_encoder.encode({
244244
"valid": False,
245245
"detail": "token_expired",
246246
}),
247247
)
248248
except InvalidTokenError:
249249
return JSONResponse(
250250
status_code=status.HTTP_401_UNAUTHORIZED,
251-
content= json_encoder.encode({
251+
content=json_encoder.encode({
252252
"valid": False,
253253
"detail": "token_invalid",
254254
}),
255255
)
256256
except Exception:
257257
return JSONResponse(
258258
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
259-
content= json_encoder.encode({
259+
content=json_encoder.encode({
260260
"valid": False,
261261
"detail": "token_error",
262262
}),
@@ -278,14 +278,14 @@ async def refresh_token_endpoint(
278278
if not refresh_token:
279279
return JSONResponse(
280280
status_code=status.HTTP_400_BAD_REQUEST,
281-
content= json_encoder.encode({
281+
content=json_encoder.encode({
282282
"detail": "missing_refresh_token",
283283
}),
284284
)
285285
if await auth_service.is_token_revoked(refresh_token):
286286
return JSONResponse(
287287
status_code=status.HTTP_401_UNAUTHORIZED,
288-
content= json_encoder.encode({
288+
content=json_encoder.encode({
289289
"detail": "token_revoked",
290290
}),
291291
)
@@ -294,7 +294,7 @@ async def refresh_token_endpoint(
294294
new_access_token = await jwt_bearer.create_access_token(payload["user_id"])
295295
response = JSONResponse(
296296
status_code=status.HTTP_200_OK,
297-
content= json_encoder.encode({
297+
content=json_encoder.encode({
298298
"detail": "refresh_token_success",
299299
}),
300300
)
@@ -310,21 +310,21 @@ async def refresh_token_endpoint(
310310
except ExpiredSignatureError:
311311
return JSONResponse(
312312
status_code=status.HTTP_401_UNAUTHORIZED,
313-
content= json_encoder.encode({
313+
content=json_encoder.encode({
314314
"detail": "token_expired",
315315
}),
316316
)
317317
except InvalidTokenError:
318318
return JSONResponse(
319319
status_code=status.HTTP_401_UNAUTHORIZED,
320-
content= json_encoder.encode({
320+
content=json_encoder.encode({
321321
"detail": "token_invalid",
322322
}),
323323
)
324324
except Exception:
325325
return JSONResponse(
326326
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,
327-
content= json_encoder.encode({
327+
content=json_encoder.encode({
328328
"detail": "token_error",
329329
}),
330330
)

app/controllers/health_controller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
@limiter.limit("25/minute")
1818
async def health_check(request: Request) -> JSONResponse:
1919
return JSONResponse(
20-
status_code=status.HTTP_200_OK, content= json_encoder.encode(
20+
status_code=status.HTTP_200_OK, content=json_encoder.encode(
2121
{
2222
"detail": "healthy",
2323
}

app/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
app = FastAPI(
1919
title="Secure Chain User Backend",
2020
docs_url=settings.DOCS_URL,
21-
version="1.0.19",
21+
version="1.1.1",
2222
description=DESCRIPTION,
2323
contact={
2424
"name": "Secure Chain Team",

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "securechain-auth"
3-
version = "1.0.19"
3+
version = "1.1.1"
44
description = "A simple user registry backend for Secure Chain tools"
55
readme = "README.md"
66
requires-python = ">=3.13"

0 commit comments

Comments
 (0)