Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
# ✅ Combined Flask + Gradio App with Google OAuth for CyberSentinel
|
| 2 |
|
| 3 |
import os
|
| 4 |
import re
|
|
@@ -30,10 +30,7 @@ google = oauth.register(
|
|
| 30 |
name='google',
|
| 31 |
client_id=CLIENT_ID,
|
| 32 |
client_secret=CLIENT_SECRET,
|
| 33 |
-
|
| 34 |
-
authorize_url='https://accounts.google.com/o/oauth2/auth',
|
| 35 |
-
api_base_url='https://www.googleapis.com/oauth2/v1/',
|
| 36 |
-
userinfo_endpoint='https://openidconnect.googleapis.com/v1/userinfo',
|
| 37 |
client_kwargs={'scope': 'openid email profile'},
|
| 38 |
)
|
| 39 |
|
|
@@ -65,7 +62,6 @@ Your job is to:
|
|
| 65 |
user_prompt = f"""
|
| 66 |
Analyze:
|
| 67 |
{user_input}
|
| 68 |
-
|
| 69 |
Format:
|
| 70 |
1. Tone:
|
| 71 |
2. Threat Type:
|
|
@@ -125,14 +121,10 @@ def report_to_it(language, selected_email, analysis_result):
|
|
| 125 |
global session_email
|
| 126 |
subject = "🚨 Suspicious Activity Reported via CyberSentinel"
|
| 127 |
body = f"""Dear IT,
|
| 128 |
-
|
| 129 |
Reported by user: {session_email}
|
| 130 |
-
|
| 131 |
Result:
|
| 132 |
{analysis_result}
|
| 133 |
-
|
| 134 |
Please investigate.
|
| 135 |
-
|
| 136 |
— CyberSentinel"""
|
| 137 |
try:
|
| 138 |
save_report(session_email, analysis_result)
|
|
|
|
| 1 |
+
# ✅ Combined Flask + Gradio App with Google OAuth for CyberSentinel (Updated with server_metadata_url)
|
| 2 |
|
| 3 |
import os
|
| 4 |
import re
|
|
|
|
| 30 |
name='google',
|
| 31 |
client_id=CLIENT_ID,
|
| 32 |
client_secret=CLIENT_SECRET,
|
| 33 |
+
server_metadata_url='https://accounts.google.com/.well-known/openid-configuration',
|
|
|
|
|
|
|
|
|
|
| 34 |
client_kwargs={'scope': 'openid email profile'},
|
| 35 |
)
|
| 36 |
|
|
|
|
| 62 |
user_prompt = f"""
|
| 63 |
Analyze:
|
| 64 |
{user_input}
|
|
|
|
| 65 |
Format:
|
| 66 |
1. Tone:
|
| 67 |
2. Threat Type:
|
|
|
|
| 121 |
global session_email
|
| 122 |
subject = "🚨 Suspicious Activity Reported via CyberSentinel"
|
| 123 |
body = f"""Dear IT,
|
|
|
|
| 124 |
Reported by user: {session_email}
|
|
|
|
| 125 |
Result:
|
| 126 |
{analysis_result}
|
|
|
|
| 127 |
Please investigate.
|
|
|
|
| 128 |
— CyberSentinel"""
|
| 129 |
try:
|
| 130 |
save_report(session_email, analysis_result)
|