my-cloud-devops-consulting 1.1.202507211749__py3-none-any.whl → 1.1.202507211825__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
app.py CHANGED
@@ -278,11 +278,27 @@ oauth.register(
278
278
  ################################################
279
279
 
280
280
  # Configure a login route to direct to Amazon Cognito managed login for authentication with a redirect to an authorize route.
281
+ # @app.route('/login/cognito')
282
+ # def login_cognito():
283
+ # session.pop('user', None)
284
+ # redirect_uri = url_for('authorize', _external=True)
285
+ # print("🧭 Redirect URI being used:", redirect_uri) # <--- add this
286
+ # return oauth.oidc.authorize_redirect(
287
+ # redirect_uri,
288
+ # prompt='login'
289
+ # )
290
+
281
291
  @app.route('/login/cognito')
282
292
  def login_cognito():
283
293
  session.pop('user', None)
284
- redirect_uri = url_for('authorize', _external=True)
285
- print("🧭 Redirect URI being used:", redirect_uri) # <--- add this
294
+
295
+ # Determine redirect URI based on environment
296
+ if '1beto.com' in request.host:
297
+ redirect_uri = 'https://1beto.com/authorize' # force HTTPS for production
298
+ else:
299
+ redirect_uri = url_for('authorize', _external=True) # use localhost in dev
300
+
301
+ print("🧭 Redirect URI being used:", redirect_uri)
286
302
  return oauth.oidc.authorize_redirect(
287
303
  redirect_uri,
288
304
  prompt='login'
@@ -291,7 +307,6 @@ def login_cognito():
291
307
 
292
308
 
293
309
 
294
-
295
310
  # The OAuth module collects the access token and retrieves user data from the Amazon Cognito userInfo endpoint. Configure an authorize route to handle the access token and user data after authentication.
296
311
  @app.route('/authorize')
297
312
  def authorize():
@@ -307,13 +322,33 @@ def authorize():
307
322
  # session.pop('user', None)
308
323
  # return redirect(url_for('home')) # 🔁 Also change to 'home' if 'index' doesn't exist
309
324
 
325
+ # @app.route('/logout/cognito')
326
+ # def logout_cognito():
327
+ # session.pop('user', None)
328
+
329
+ # cognito_domain = 'https://us-east-1tzvykdvvg.auth.us-east-1.amazoncognito.com'
330
+ # client_id = '1lc7qso1g3lr9kqbr0nb0jktbs' # Make sure this matches your App Client ID
331
+ # logout_redirect_uri = url_for('home', _external=True)
332
+
333
+ # return redirect(
334
+ # f"{cognito_domain}/logout?client_id={client_id}&logout_uri={logout_redirect_uri}"
335
+ # )
336
+
337
+
338
+ from flask import request
339
+
310
340
  @app.route('/logout/cognito')
311
341
  def logout_cognito():
312
342
  session.pop('user', None)
313
343
 
314
344
  cognito_domain = 'https://us-east-1tzvykdvvg.auth.us-east-1.amazoncognito.com'
315
- client_id = '1lc7qso1g3lr9kqbr0nb0jktbs' # Make sure this matches your App Client ID
316
- logout_redirect_uri = url_for('home', _external=True)
345
+ client_id = '1lc7qso1g3lr9kqbr0nb0jktbs'
346
+
347
+ # Ensure trailing slash and domain match Cognito settings exactly
348
+ if '1beto.com' in request.host:
349
+ logout_redirect_uri = 'https://1beto.com/' # ✅ Matches Cognito config
350
+ else:
351
+ logout_redirect_uri = 'http://localhost:50/' # ✅ Matches Cognito config for local
317
352
 
318
353
  return redirect(
319
354
  f"{cognito_domain}/logout?client_id={client_id}&logout_uri={logout_redirect_uri}"
@@ -321,8 +356,6 @@ def logout_cognito():
321
356
 
322
357
 
323
358
 
324
-
325
-
326
359
  if __name__ == '__main__':
327
360
  app.run(debug=True, host='0.0.0.0', port=50)
328
361
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: my-cloud-devops-consulting
3
- Version: 1.1.202507211749
3
+ Version: 1.1.202507211825
4
4
  Summary: This is my consulting website for Cloud & DevOps services.
5
5
  Home-page: https://github.com/Betrand1999/project-root
6
6
  Author: Betrand Mutagha
@@ -0,0 +1,5 @@
1
+ app.py,sha256=aXPXa9ph0pzOKJoPAGzRxkrXanC3tQo-zX9_ry6P09E,12468
2
+ my_cloud_devops_consulting-1.1.202507211825.dist-info/METADATA,sha256=NgDR-gSFg_BsK6aMhCvMrf_59qd7SG7QpO8wfIHPCyM,785
3
+ my_cloud_devops_consulting-1.1.202507211825.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
4
+ my_cloud_devops_consulting-1.1.202507211825.dist-info/top_level.txt,sha256=io9g7LCbfmTG1SFKgEOGXmCFB9uMP2H5lerm0HiHWQE,4
5
+ my_cloud_devops_consulting-1.1.202507211825.dist-info/RECORD,,
@@ -1,5 +0,0 @@
1
- app.py,sha256=JhYl1My8hHBBqNLDarRAyNdJ6iHjya0b8grK4pZkU9U,11290
2
- my_cloud_devops_consulting-1.1.202507211749.dist-info/METADATA,sha256=vR3vutNXYmdUiMG7rh0ngIVFcOOWZNwx1qUFCK6hckM,785
3
- my_cloud_devops_consulting-1.1.202507211749.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
4
- my_cloud_devops_consulting-1.1.202507211749.dist-info/top_level.txt,sha256=io9g7LCbfmTG1SFKgEOGXmCFB9uMP2H5lerm0HiHWQE,4
5
- my_cloud_devops_consulting-1.1.202507211749.dist-info/RECORD,,