Pushing changes for Atlan backend - #58
Conversation
There was a problem hiding this comment.
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 |
| internalName := strings.ToLower(strings.ReplaceAll(team.Name, " ", "_")) | ||
| internalName = strings.ReplaceAll(internalName, "-", "_") |
There was a problem hiding this comment.
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.
| 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), "_") |
Accepting Copilot's suggestion on adding group name to the error Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
closing in favour of #162 |
Key changes -