Skip to content

KC-1453: Fix Gateway Name not displayed in pam rotation info output - #2365

Merged
sshrushanth-ks merged 4 commits into
KC-1453from
KC-1453-int
Sep 18, 2026
Merged

sshrushanth-ks merged 4 commits into
KC-1453from
KC-1453-int

Conversation

@sshrushanth-ks

Copy link
Copy Markdown
Contributor

Summary

The pam rotation info command was showing a dash (-) for Gateway Name even when a valid gateway was associated with the PAM rotation configuration. The API response from pam/get_rotation_info returns a populated controllerUid but an empty controllerName. We now resolve the gateway name by looking it up in the gateway list using the controllerUid when controllerName is empty.

Changes

  • discoveryrotation.py:
    • In PAMRouterGetRotationInfo.execute(), add fallback logic to resolve gateway name from the gateway list when controllerName is empty but controllerUid exists; query gateway_helper.get_all_gateways() and match by controllerUid to retrieve the controllerName
  • unit-tests/pam/test_pam_rotation.py:
    • Add test_gateway_name_resolved_from_uid_when_empty() to verify that when controllerName is empty, it's correctly resolved from the gateway list and displayed in JSON output

@sshrushanth-ks
sshrushanth-ks changed the base branch from master to release September 11, 2026 05:53
@sshrushanth-ks
sshrushanth-ks changed the base branch from release to KC-1453 September 11, 2026 05:53
@sshrushanth-ks sshrushanth-ks self-assigned this Sep 11, 2026
@sshrushanth-ks
sshrushanth-ks marked this pull request as ready for review September 11, 2026 11:37
except Exception:
all_gateways = []

matched = next((g for g in all_gateways

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible that none and none would equate here and give false positive

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, added a check to prevent the false positive

Comment thread keepercommander/commands/discoveryrotation.py
Comment thread keepercommander/commands/discoveryrotation.py Outdated
@sshrushanth-ks
sshrushanth-ks merged commit a776d7f into KC-1453 Sep 18, 2026
4 checks passed
sshrushanth-ks added a commit that referenced this pull request Sep 18, 2026
…2365)

* Fix Gateway Name not displayed in pam rotation info output

* Add UID type normalization and graceful error handling to gateway name resolution

* Improve gateway name resolution: add UID validation and specific exception logging

* Prevent None == None false positive by explicitly checking target_uid before gateway lookup
craiglurey pushed a commit that referenced this pull request Sep 18, 2026
…2365) (#2379)

* Fix Gateway Name not displayed in pam rotation info output

* Add UID type normalization and graceful error handling to gateway name resolution

* Improve gateway name resolution: add UID validation and specific exception logging

* Prevent None == None false positive by explicitly checking target_uid before gateway lookup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants