-
-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bookworm + Portal rework #1657
base: dev
Are you sure you want to change the base?
Bookworm + Portal rework #1657
Conversation
cd1bb22
to
bed9ecc
Compare
945ecdb
to
8ac48ee
Compare
allowed_cors_origins_file = "/etc/yunohost/.admin-api-allowed-cors-origins" | ||
|
||
if os.path.exists(allowed_cors_origins_file): | ||
allowed_cors_origins = open(allowed_cors_origins_file).read().strip().split(",") |
Check warning
Code scanning / CodeQL
File is not always closed Warning
allowed_cors_origins_file = "/etc/yunohost/.portal-api-allowed-cors-origins" | ||
|
||
if os.path.exists(allowed_cors_origins_file): | ||
allowed_cors_origins = open(allowed_cors_origins_file).read().strip().split(",") |
Check warning
Code scanning / CodeQL
File is not always closed Warning
…e label+show_tile info in ssowat conf anymore
…g domain info in ldap
… may be included by nginx app confs ~_~
…lly cache static assets with etags etc ?
… only store the file id which the front should then query as a regular asset
…the portal API route
…t_for_app_script already handles everything..
r = session.get( | ||
logout_endpoint, | ||
headers={ | ||
"X-Requested-With": "", | ||
}, | ||
verify=False, | ||
) |
Check failure
Code scanning / CodeQL
Request without certificate validation High
it is disabled
|
||
# Anonymous access | ||
if session: | ||
r = session.get(webpath, verify=False, allow_redirects=False, headers=headers) |
Check failure
Code scanning / CodeQL
Request without certificate validation High
it is disabled
if session: | ||
r = session.get(webpath, verify=False, allow_redirects=False, headers=headers) | ||
elif not logged_as: | ||
r = requests.get(webpath, verify=False, allow_redirects=False, headers=headers) |
Check failure
Code scanning / CodeQL
Request without certificate validation High
it is disabled
r = login(session, logged_as, logged_on) | ||
# We should have some cookies related to authentication now | ||
assert session.cookies | ||
r = session.get(webpath, verify=False, allow_redirects=False, headers=headers) |
Check failure
Code scanning / CodeQL
Request without certificate validation High
it is disabled
if list_ == DEFAULT_APPS_CATALOG_LIST: | ||
try: | ||
os.remove(APPS_CATALOG_CONF) | ||
except Exception: |
Check notice
Code scanning / CodeQL
Empty except Note
# Login as a user using dummy password | ||
else: | ||
with requests.Session() as session: | ||
r = login(session, logged_as, logged_on) |
Check warning
Code scanning / CodeQL
Variable defined multiple times Warning
redefined
|
||
assert number_of_active_session_for_user("alice") == 1 | ||
|
||
r = logout(session) |
Check notice
Code scanning / CodeQL
Unused local variable Note
# Bob can't even login because doesnt has access to any app on the domain | ||
# (that's debattable tho) | ||
with requests.Session() as session: | ||
r = login(session, "bob") |
Check notice
Code scanning / CodeQL
Unused local variable Note
|
||
|
||
# Get main domain | ||
maindomain = open("/etc/yunohost/current_host").read().strip() |
Check warning
Code scanning / CodeQL
File is not always closed Warning
…and $final_path always exist
…rsion_id, system_arch, system_virt
Allow users to access their own domain portal without app permission
[bookworm] Return auth cookie valid for whole main domain.
cf YunoHost/issues#2050