Show Passwords in diagnostics

Hi HA community.
I somehow forgot my password of my local router (Fritzbox) and I want to avoid factory reset it to keep my current configuration.
Since I have the “AVM Tools” integration configured in Home assistant I was wondering if there is a way to get the password from HA.
When I hit the “download diagnostics” button of the integration I can see that a JSON file is created which contains:

      "data": {
        "host": "my-fritzbox-ip",
        "password": "**REDACTED**",
        "port": 49000,
        "username": "**REDACTED**",
        "ssl": false

Now I wonder: is there a way to get the REDACTED values?
Maybe by setting a debug flag or something like that?
Or is there a way to look up the credentials in a HA specific database?
Or by accessing the keyring from the terminal addon?

Thanks for helping,
Flo

Hopefully not, that would mean that someone with access to your HA could look up all the passwords for all your integrations in plain text. Assuming it’s not defined in a secret.yaml file.

The password is asked in the configuration wizzard of the AVM Tools integration, I don´t know how it’s stored.
If this is the source code that is responsible for creating the diagnostics, than maybe it could be done by just commenting out that line:

but I’m not sure if this is the right code location or if it would be enough to edit the file “on the fly” in a running installation.

To answer my own question here, in case someone else wants to deal with the same issue.
Modifying the python code works. However, it is not the main diagnostics.py that I linked above, but the special diagnostics.py for the component. Since I was looking for the AVM Integration the component is just called “fritz”. The file is this one:

Note that the file is located in the homeassistant docker container. So you need to exec into the running container by using docker exec CONTAINER_ID bash.

Inside the container, our file is located at /usr/src/homeassistant/homeassistant/components/fritz/diagnostics.py. Fields that should be redacted are stored in the TO_REDACT dict. I just cleared it by setting it to TO_REDACT = {}.
After changing the file, a HA restart was necessary to apply the changes. Then I could just download the diagnostics file with the clear text password (as expected).

@fleskefjes so yes. If someone has access to your HA instance and the skills to do the steps mentioned above they are able to look up all the integration credentials in plain text.