Skip to content
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

Draft
wants to merge 367 commits into
base: dev
Choose a base branch
from
Draft

Bookworm + Portal rework #1657

wants to merge 367 commits into from

Conversation

alexAubin
Copy link
Member

@alexAubin alexAubin force-pushed the bookworm branch 2 times, most recently from cd1bb22 to bed9ecc Compare May 15, 2023 20:13
debian/changelog Outdated Show resolved Hide resolved
src/user.py Fixed Show fixed Hide fixed
@alexAubin alexAubin force-pushed the bookworm branch 4 times, most recently from 945ecdb to 8ac48ee Compare June 14, 2023 06:07
@alexAubin alexAubin added the 🏗️ Major project Big decision label Jul 10, 2023
src/dyndns.py Fixed Show fixed Hide fixed
src/dyndns.py Fixed Show fixed Hide fixed
src/utils/form.py Fixed Show fixed Hide fixed
src/utils/form.py Fixed Show fixed Hide fixed
src/utils/form.py Fixed Show fixed Hide fixed
src/utils/form.py Fixed Show fixed Hide fixed
src/utils/form.py Fixed Show fixed Hide fixed
@alexAubin alexAubin changed the title Bookworm Bookworm + Portal rework Sep 27, 2023
src/authenticators/ldap_ynhuser.py Fixed Show fixed Hide fixed
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

File is opened but is not closed.
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

File is opened but is not closed.
@alexAubin alexAubin marked this pull request as draft September 27, 2023 18:12
Comment on lines +92 to +98
r = session.get(
logout_endpoint,
headers={
"X-Requested-With": "",
},
verify=False,
)

Check failure

Code scanning / CodeQL

Request without certificate validation High

This request may run without certificate validation because
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

This request may run without certificate validation because
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

This request may run without certificate validation because
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

This request may run without certificate validation because
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

'except' clause does nothing but pass and there is no explanatory comment.
# 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

This assignment to 'r' is unnecessary as it is
redefined
before this value is used.

assert number_of_active_session_for_user("alice") == 1

r = logout(session)

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable r is not used.
# 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

Variable r is not used.


# Get main domain
maindomain = open("/etc/yunohost/current_host").read().strip()

Check warning

Code scanning / CodeQL

File is not always closed Warning

File is opened but is not closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
7 participants