Joaci Morais 1724dfc7b5 Improve exception handling
Improving the error handling during the requires requests
on to authentication procedure, was found due procedural
issues on oidc configuration unhandled exceptions on the
oidc-auth scripts.

Test Plan:
PASS: Deploy a system from master ISO.
PASS: Apply & Test procedure:
  - Apply oidc-auth-apps acording 'Set up OIDC Auth Applications'
  guide. The oidc-auth-apps should be applied successfully.
  - Once oidc-auth-apps in applied status, perform oidc-auth-apps
  test by creating a user, apply rolebiding and authenticate it
  using oidc-auth command, check if the new user can send k8s
  commands based on its roles.

PASS: Local Test (oidc-auth)
  - Once oidc-auth-apps applied and a LDAP user created, authenticate
  through oidc-auth script. Should Work
  - Reconfigure oidc-auth-apps for Windows Active Directory using
  multiples backends, try to authenticate using oidc-auth script.
  Should work.

PASS: Remote CLI
  - Configure the Remote CLI according the official guide
  'Configure Container-backed Remote CLIs and Clients'.
  - Authenticate through oidc-auth command from the remote
  workstation. Should work.

PASS: Check HTTP Errors & Generic Exceptions
  - Give a wrong IP address (-c) to force an exception, the
  oidc-auth script should show to the user that an error occurs.

PASS: Mocking Errors & Exceptions
  - Mock the methods that performs network socket communications
  to simulate the handled and unexpected exceptions
  (Generic Exceptions).
  - raise handled urllib.error.URLError() exceptions, All exceptions
  should be detected.
  - raise unhandled urllib.error.URLError() exceptions, All
  exceptions should be detected.
  - urllib.error.URLError exceptions withour an error code, now
  should be detected as well.
  - raise generic exceptions (Exception). All
  exceptions should be detected.

PASS: Check dex misconfiguration
  - Force a misconfiguration on the value:
  config.staticClients[0].redirectURIs[0]: https://bad.value:30555/
  callback. The exception should be now handled fixing the NoneType
  on erro code.

Closes-Bug: 2103616

Change-Id: Ic4cad52514b1d4c73a0f9f41ac361d2208b4be25
Signed-off-by: Joaci Morais <joaci.demorais@windriver.com>
2025-03-20 14:39:54 -03:00
2025-02-18 10:03:15 -03:00
2025-02-18 10:03:15 -03:00
2023-12-18 09:08:54 -07:00
2019-12-06 17:46:31 +00:00
2021-09-09 10:48:57 -04:00
2024-03-05 13:45:03 -07:00
2023-12-18 09:08:54 -07:00
Description
StarlingX OIDC Authentication App
1.7 MiB
Languages
Python 51.2%
Go 28.1%
Makefile 17.2%
Smarty 2.2%
Dockerfile 0.7%
Other 0.6%