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

Integration of OIDC authentication #620

Closed
wants to merge 8 commits into from

Conversation

spointu
Copy link
Contributor

@spointu spointu commented Jul 2, 2024

No description provided.

xdri3n and others added 8 commits May 14, 2024 11:31
- Enables creation and management of virtual machines orchestrated through Jenkins
- Provides remote access to these machines via Guacamole
- configuration file - authproviders.ini
- list in the provider index provided in the configuration file
- if connection from a basic rights provider
This commit fixes the style issues introduced in 08c0c67 according to the output
from Black and PHP CS Fixer.

Details: #619
- configuration file - authproviders.ini
- list in the provider index provided in the configuration file
- if connection from a basic rights provider

(cherry picked from commit 5ce1bd6)
Copy link

sourcery-ai bot commented Jul 2, 2024

🧙 Sourcery has finished reviewing your pull request!


Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • Continue your discussion with Sourcery by replying directly to review comments.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

@spointu spointu closed this Jul 2, 2024
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've reviewed this pull request using the Sourcery rules engine. If you would also like our AI-powered code review then let us know.

Comment on lines +105 to +106
headers = {"Content-Type": "application/x-www-form-urlencoded"}
headers.update(crumb)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (code-quality): Merge dictionary updates via the union operator [×2] (dict-assign-update-to-union)

Suggested change
headers = {"Content-Type": "application/x-www-form-urlencoded"}
headers.update(crumb)
headers = {"Content-Type": "application/x-www-form-urlencoded"} | crumb

info = domain.info()

root = ET.fromstring(xml)
domain_info = {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (code-quality): Inline variable that is immediately returned (inline-immediately-returned-variable)

source = disk.find("source")
if source is not None:
old_path = source.get("file")
if old_path.startswith(
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (code-quality): Replace call to format with f-string [×5] (use-fstring-for-formatting)

"The virtual machine '%s' was successfully created !", name
)

dict = getVMInfo(name)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (code-quality): Don't assign to builtin variable dict (avoid-builtin-shadow)


ExplanationPython has a number of builtin variables: functions and constants that
form a part of the language, such as list, getattr, and type
(See https://docs.python.org/3/library/functions.html).
It is valid, in the language, to re-bind such variables:

list = [1, 2, 3]

However, this is considered poor practice.

  • It will confuse other developers.
  • It will confuse syntax highlighters and linters.
  • It means you can no longer use that builtin for its original purpose.

How can you solve this?

Rename the variable something more specific, such as integers.
In a pinch, my_list and similar names are colloquially-recognized
placeholders.

"/guacamole/",
)
try:
identifier = guacapi.get_connection_by_name(name)["identifier"]
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (code-quality): We've found these issues:

Comment on lines +92 to +96
lines = []
for row in ret:
lines.append(row.toDict())

return lines
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (code-quality): We've found these issues:

Suggested change
lines = []
for row in ret:
lines.append(row.toDict())
return lines
return [row.toDict() for row in ret]

@DatabaseHelper._sessionm
def getVMs(self, session):
try:
results = session.query(Machines).all()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (code-quality): We've found these issues:

@DatabaseHelper._sessionm
def getVMByName(self, session, name):
try:
result = session.query(Machines).filter(Machines.nom == name).first()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (code-quality): We've found these issues:

Comment on lines +174 to +175
machine = session.query(Machines).filter(Machines.nom == name).first()
if machine:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (code-quality): Use named expression to simplify assignment and conditional (use-named-expression)

Suggested change
machine = session.query(Machines).filter(Machines.nom == name).first()
if machine:
if (
machine := session.query(Machines)
.filter(Machines.nom == name)
.first()
):

Comment on lines +231 to +236
result = session.query(Machines).filter(Machines.nom == name).first()
if result:
return True
else:
return False

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (code-quality): We've found these issues:

Suggested change
result = session.query(Machines).filter(Machines.nom == name).first()
if result:
return True
else:
return False
return bool(
result := session.query(Machines)
.filter(Machines.nom == name)
.first()
)

deepsource-autofix bot added a commit that referenced this pull request Jul 2, 2024
This commit fixes the style issues introduced in caa5547 according to the output
from Black and PHP CS Fixer.

Details: #620
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants