diff --git a/LICENSE b/LICENSE index e40f17b8d..d74618a4e 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 - 2025 ANSYS, Inc. and/or its affiliates. +Copyright (c) 2022 - 2026 ANSYS, Inc. and/or its affiliates. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in diff --git a/examples/cfx_static_mixer/exec_cfx.py b/examples/cfx_static_mixer/exec_cfx.py index 330646fd2..72bfa7d6e 100644 --- a/examples/cfx_static_mixer/exec_cfx.py +++ b/examples/cfx_static_mixer/exec_cfx.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/examples/cfx_static_mixer/project_setup.py b/examples/cfx_static_mixer/project_setup.py index 7d2b76dd9..f8b95d657 100644 --- a/examples/cfx_static_mixer/project_setup.py +++ b/examples/cfx_static_mixer/project_setup.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/examples/fluent_2d_heat_exchanger/project_setup.py b/examples/fluent_2d_heat_exchanger/project_setup.py index 94a81a1b4..5aa51507c 100644 --- a/examples/fluent_2d_heat_exchanger/project_setup.py +++ b/examples/fluent_2d_heat_exchanger/project_setup.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/examples/fluent_nozzle/project_setup.py b/examples/fluent_nozzle/project_setup.py index 944d6dbb9..da663120d 100644 --- a/examples/fluent_nozzle/project_setup.py +++ b/examples/fluent_nozzle/project_setup.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/examples/generic_api/project_setup.py b/examples/generic_api/project_setup.py index a1cc22387..c8415fe3d 100644 --- a/examples/generic_api/project_setup.py +++ b/examples/generic_api/project_setup.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/examples/lsdyna_cylinder_plate/lsdyna_job.py b/examples/lsdyna_cylinder_plate/lsdyna_job.py index dad2e0bc3..8c42da85f 100644 --- a/examples/lsdyna_cylinder_plate/lsdyna_job.py +++ b/examples/lsdyna_cylinder_plate/lsdyna_job.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/examples/mapdl_linked_analyses/project_setup.py b/examples/mapdl_linked_analyses/project_setup.py index bc24cd481..ca2f0b79c 100644 --- a/examples/mapdl_linked_analyses/project_setup.py +++ b/examples/mapdl_linked_analyses/project_setup.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/examples/mapdl_motorbike_frame/exec_mapdl.py b/examples/mapdl_motorbike_frame/exec_mapdl.py index d177c32ab..a51b07d62 100644 --- a/examples/mapdl_motorbike_frame/exec_mapdl.py +++ b/examples/mapdl_motorbike_frame/exec_mapdl.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/examples/mapdl_motorbike_frame/project_query.py b/examples/mapdl_motorbike_frame/project_query.py index 242bea64a..9721cf2a9 100644 --- a/examples/mapdl_motorbike_frame/project_query.py +++ b/examples/mapdl_motorbike_frame/project_query.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/examples/mapdl_motorbike_frame/project_setup.py b/examples/mapdl_motorbike_frame/project_setup.py index 1b03d68bb..d036ae7e5 100644 --- a/examples/mapdl_motorbike_frame/project_setup.py +++ b/examples/mapdl_motorbike_frame/project_setup.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/examples/mapdl_motorbike_frame/task_files.py b/examples/mapdl_motorbike_frame/task_files.py index 8c820eae6..5f518f0f9 100644 --- a/examples/mapdl_motorbike_frame/task_files.py +++ b/examples/mapdl_motorbike_frame/task_files.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/examples/mapdl_tyre_performance/project_setup.py b/examples/mapdl_tyre_performance/project_setup.py index d8b9bcbd2..c79d1702e 100644 --- a/examples/mapdl_tyre_performance/project_setup.py +++ b/examples/mapdl_tyre_performance/project_setup.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/examples/python_large_output/evaluate.py b/examples/python_large_output/evaluate.py index a6dbdf227..72bd8812c 100644 --- a/examples/python_large_output/evaluate.py +++ b/examples/python_large_output/evaluate.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/examples/python_large_output/exec_python.py b/examples/python_large_output/exec_python.py index ca24ae468..fdebb9977 100644 --- a/examples/python_large_output/exec_python.py +++ b/examples/python_large_output/exec_python.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/examples/python_large_output/project_setup.py b/examples/python_large_output/project_setup.py index 07a0a5314..865ae59c1 100644 --- a/examples/python_large_output/project_setup.py +++ b/examples/python_large_output/project_setup.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/examples/python_linked_multi_process_step/eval.py b/examples/python_linked_multi_process_step/eval.py index 9ab0c0b49..feafee118 100644 --- a/examples/python_linked_multi_process_step/eval.py +++ b/examples/python_linked_multi_process_step/eval.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/examples/python_linked_multi_process_step/project_setup.py b/examples/python_linked_multi_process_step/project_setup.py index c5a52daf1..e41f174e7 100644 --- a/examples/python_linked_multi_process_step/project_setup.py +++ b/examples/python_linked_multi_process_step/project_setup.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/examples/python_multi_process_step/eval.py b/examples/python_multi_process_step/eval.py index beab09a95..7c09d6f07 100644 --- a/examples/python_multi_process_step/eval.py +++ b/examples/python_multi_process_step/eval.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/examples/python_multi_process_step/project_setup.py b/examples/python_multi_process_step/project_setup.py index 8d7374524..e33df8d2e 100644 --- a/examples/python_multi_process_step/project_setup.py +++ b/examples/python_multi_process_step/project_setup.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/examples/python_multi_process_step/task_files.py b/examples/python_multi_process_step/task_files.py index 18aa13883..8e7390292 100644 --- a/examples/python_multi_process_step/task_files.py +++ b/examples/python_multi_process_step/task_files.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/examples/python_two_bar_truss_problem/evaluate.py b/examples/python_two_bar_truss_problem/evaluate.py index b02929e4e..6b38d3841 100644 --- a/examples/python_two_bar_truss_problem/evaluate.py +++ b/examples/python_two_bar_truss_problem/evaluate.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/examples/python_two_bar_truss_problem/exec_python.py b/examples/python_two_bar_truss_problem/exec_python.py index ca24ae468..fdebb9977 100644 --- a/examples/python_two_bar_truss_problem/exec_python.py +++ b/examples/python_two_bar_truss_problem/exec_python.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/examples/python_two_bar_truss_problem/project_setup.py b/examples/python_two_bar_truss_problem/project_setup.py index 0b85eacb3..9c2fd7157 100644 --- a/examples/python_two_bar_truss_problem/project_setup.py +++ b/examples/python_two_bar_truss_problem/project_setup.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/generate_resources.py b/generate_resources.py index da8eb167d..7b1ea44ef 100644 --- a/generate_resources.py +++ b/generate_resources.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022 - 2025 ANSYS, Inc. and/or its affiliates. +# Copyright (C) 2022 - 2026 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # diff --git a/oidc_pkce.py b/oidc_pkce.py index 69fb4b9b2..6635e557c 100644 --- a/oidc_pkce.py +++ b/oidc_pkce.py @@ -1,6 +1,4 @@ -""" -Script to demonstrate how to authenticate with an OIDC provider -using the Authorization Code Flow with PKCE. +"""Script to demonstrate OIDC authentication with Authorization Code Flow using PKCE. Mostly inspired by: - https://www.camiloterevinto.com/post/oauth-pkce-flow-from-python-desktop @@ -10,27 +8,38 @@ import argparse import base64 import hashlib -from http.server import BaseHTTPRequestHandler, HTTPServer import os import re import socket +import webbrowser +from http.server import BaseHTTPRequestHandler, HTTPServer from typing import Any from urllib import parse -import webbrowser import requests from requests import Request class OAuthHttpServer(HTTPServer): + """HTTP server for OAuth authentication with authorization code storage.""" + def __init__(self, *args, **kwargs): + """Initialize the OAuth HTTP server. + + Args: + *args: Variable length argument list passed to HTTPServer. + **kwargs: Arbitrary keyword arguments passed to HTTPServer. + + """ HTTPServer.__init__(self, *args, **kwargs) self.authorization_code = "" class OAuthHttpHandler(BaseHTTPRequestHandler): - def do_GET(self): + """HTTP request handler for OAuth authentication callbacks.""" + def do_GET(self): + """Handle GET requests to capture OAuth authorization code.""" parsed = parse.urlparse(self.path) qs = parse.parse_qs(parsed.query) self.server.authorization_code = qs["code"][0] @@ -38,7 +47,7 @@ def do_GET(self): self.send_response(200) self.send_header("Content-Type", "text/html") self.end_headers() - html_body = """ + html_body = b"""