Skip to content

Stale external ID mapping#805

Draft
cursor[bot] wants to merge 4 commits intomainfrom
LINTEST-425
Draft

Stale external ID mapping#805
cursor[bot] wants to merge 4 commits intomainfrom
LINTEST-425

Conversation

@cursor
Copy link

@cursor cursor bot commented Feb 11, 2026

✨ Description

This PR resolves LINTEST-425 by addressing the issue of Okta Push Groups failing due to stale externalId references and orphaned SSO group mappings.

It introduces a diagnostic and cleanup utility to identify and remove these orphaned mappings, enhances the SSO client with improved validation and logging, and provides comprehensive documentation for users and support teams.

Jira link: LINTEST-425


🧩 Type of change

Select all that apply:

  • 🚀 New feature (non-breaking change that adds functionality)
  • 🐛 Bug fix (non-breaking change that fixes an issue) — please include tests! Refer testing-toolkit 🧪
  • 🔄 Refactor (code change that neither fixes a bug nor adds a feature)
  • 🧹 Maintenance (chores, cleanup, minor improvements)
  • 💥 Breaking change (fix or feature that may break existing functionality)
  • 📦 Dependency upgrade/downgrade
  • 📚 Documentation updates

✅ How has this been tested? (e.g. screenshots, logs, workflow links)

The changes have been tested with comprehensive unit tests (tests/unit/test_sso_diagnostic.py) covering:

  • Orphaned mapping detection: Verified the diagnostic script correctly identifies mappings where the referenced Atlan group ID does not exist, the group name does not match, or there is a group ID mismatch.
  • Cleanup operations: Tested both interactive and non-interactive modes for deleting orphaned mappings, including scenarios with no orphaned mappings found.
  • Edge cases: Ensured handling of incomplete SSO mapping data.
  • SSO Client enhancements: Verified new validation logic and improved logging for create and delete operations.

📋 Checklist

  • My code follows the project’s style guidelines
  • I’ve performed a self-review of my code
  • I’ve added comments in tricky or complex areas
  • I’ve updated the documentation as needed
  • There are no new warnings from my changes
  • I’ve added tests to cover my changes
  • All new and existing tests pass locally

Open in Cursor Open in Web

…s (LINTEST-425)

This commit resolves the issue where Okta Push Groups fails with stale
externalId errors due to orphaned SSO group mappings in Keycloak.

Changes:
- Add diagnostic script to identify orphaned SSO group mappings
- Add cleanup functionality to remove orphaned mappings
- Enhance SSO client with better validation and logging
- Add new error codes for SSO mapping issues
- Create comprehensive documentation for troubleshooting
- Add support guide for resolving orphaned mapping issues
- Add unit tests for diagnostic utility

The diagnostic script can:
1. Identify orphaned mappings (where group ID no longer exists)
2. Clean up orphaned mappings (interactive or automated)
3. List all SSO group mappings for a provider
4. Filter diagnostics by specific group name

Usage:
  python -m pyatlan.samples.sso.diagnose_orphaned_group_mappings \
    --mode diagnose --sso-alias okta

Fixes: LINTEST-425
@cursor
Copy link
Author

cursor bot commented Feb 11, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

- Remove unused Set import from diagnose_orphaned_group_mappings.py
- Fix trailing whitespace in all modified files
- Add None check for mapping.id before deletion to satisfy mypy
- Format code to pass ruff format and ruff check
- Break long lines in docstrings and help text
- Split long conditional statements across multiple lines
- Format function signatures to be within line length limits
Remove trailing whitespace from empty lines in diagnostic script docstring
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.

1 participant

Comments