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>