Skip to content

Pushing changes for Atlan backend - #58

Closed
Pujathacker2210 wants to merge 6 commits into
redhat-data-and-ai:mainfrom
Pujathacker2210:pthacker_atlan_client
Closed

Pushing changes for Atlan backend#58
Pujathacker2210 wants to merge 6 commits into
redhat-data-and-ai:mainfrom
Pujathacker2210:pthacker_atlan_client

Conversation

@Pujathacker2210

Copy link
Copy Markdown
Collaborator

Key changes -

  • Added Atlan as a backend for Usernaut
  • Implemented FetchGroups, CreateGroup and DeleteGroup functions
  • Added a check in controller to create Atlan group only if rover backend is mentioned for the same group in the CR
  • Group Sync and user sync is handled automatically via ldap/rover

@vinamra28
vinamra28 requested a review from Copilot July 29, 2025 06:01

This comment was marked as outdated.

Comment thread pkg/clients/client.go Outdated
Comment thread pkg/clients/atlan/teams.go
@vinamra28
vinamra28 requested a review from Copilot July 29, 2025 07:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds Atlan as a new backend for the Usernaut system, enabling group management operations while leveraging LDAP/Rover for user synchronization. The implementation includes API client setup, group operations (fetch, create, delete), and validation logic to ensure Rover groups exist before creating corresponding Atlan groups.

Key changes:

  • Integration of Atlan backend with group management capabilities
  • Implementation of stub user operations that delegate to LDAP/Rover
  • Addition of validation logic requiring Rover backend existence for Atlan group creation

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pkg/clients/client.go Adds Atlan case to backend factory and moves config initialization for reuse
pkg/clients/atlan/client.go Core Atlan client implementation with HTTP client setup and authentication
pkg/clients/atlan/teams.go Group/team operations including fetch, create, and delete functionality
pkg/clients/atlan/users.go Stub user operations that return empty data (handled by LDAP)
pkg/clients/atlan/team_membership.go Stub team membership operations (handled by LDAP)
internal/controller/group_controller.go Validation logic to ensure Rover group exists before Atlan group creation
appconfig/default.yaml Configuration template for Atlan backend connection

Comment thread pkg/clients/atlan/client.go Outdated
Comment on lines +68 to +69
internalName := strings.ToLower(strings.ReplaceAll(team.Name, " ", "_"))
internalName = strings.ReplaceAll(internalName, "-", "_")

Copilot AI Jul 29, 2025

Copy link

Choose a reason for hiding this comment

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

The team name sanitization logic only handles spaces and hyphens but may not cover all invalid characters for Atlan group names. Consider using a more comprehensive sanitization approach or regex to ensure all invalid characters are properly handled.

Suggested change
internalName := strings.ToLower(strings.ReplaceAll(team.Name, " ", "_"))
internalName = strings.ReplaceAll(internalName, "-", "_")
// Use regex to sanitize the team name: lowercase, alphanumeric + underscore only
regex := regexp.MustCompile(`[^a-z0-9_]`)
internalName := regex.ReplaceAllString(strings.ToLower(team.Name), "_")

Copilot uses AI. Check for mistakes.
Comment thread internal/controller/group_controller.go Outdated
Pujathacker2210 and others added 3 commits July 29, 2025 15:35
Accepting Copilot's suggestion on adding group name to the error

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@vinamra28

Copy link
Copy Markdown
Member

closing in favour of #162

@vinamra28 vinamra28 closed this Jan 8, 2026
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