Skip to content

Conversation

@aldbr
Copy link
Contributor

@aldbr aldbr commented Dec 3, 2025

Vladimir and I sometimes play with the Computing Elements and need to get tokens from the TokenManager. It was working until that commit: bedcfb0

Now we get the following error:

>           pDict["client_id"] = pDict[f"{client_name_prefix}client_id"]
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E           KeyError: 'client_id'

Why? Because the TokenManagerClient is obviously not expected to store the client_id and client_secret but might need all the public info to cache the tokens (name, scope, issuer, ...). Therefore, it's calling IdProviderFactory.getIdProvider(), which know try to extract the secret fields.

Here I added a simple unit test to avoid regression and make these client_id and client_secret optional.

BEGINRELEASENOTES
*Resources
FIX: make client_id and secret optional to avoid KeyError exceptions.
ENDRELEASENOTES

@aldbr aldbr requested review from atsareg and fstagni as code owners December 3, 2025 13:08
@aldbr aldbr force-pushed the v9_fix_idProviderFactory branch from 54489fb to 748fd3b Compare December 3, 2025 15:01
@chaen chaen merged commit 57d6234 into DIRACGrid:integration Dec 3, 2025
21 checks passed
@DIRACGridBot DIRACGridBot added the sweep:ignore Prevent sweeping from being ran for this PR label Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

sweep:ignore Prevent sweeping from being ran for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants