Comprehensive connector enhancement with new features, bug fixes, architecture refactoring and automated test coverage#18
Open
wadahiro wants to merge 7 commits into
Open
Conversation
- Add createMemberById() to correctly handle member additions using member IDs - Rename createMember() to createMemberByEmail() for clarity - Fix bug where member IDs were incorrectly passed as emails when adding users to groups
- Use group IDs instead of emails for safer, immutable references - Fix null handling bug that prevented "Remove all membership" from working
- Enable users to be assigned to groups during creation, not just updates
- Add support for Name-based query in addition to UID-based query - Fix incorrect logger message in executeAccountReadQuery (was "Groups#Get") - Add proper Name attribute definition with case-insensitive subtype for Group and User - Add ENABLE operational attribute support for user activation/deactivation
…omprehensive testing Major Features and Enhancements: - Implement PoolableConnector for connection pool management and improved performance - Migrate from UpdateOp to UpdateDeltaOp for more granular attribute updates - Add support for ALLOW_PARTIAL_ATTRIBUTE_VALUES operation option for incomplete attributes - Add support for RETURN_DEFAULT_ATTRIBUTES operation option for optimized data retrieval - Implement activation support with __ENABLE__ attribute for user account suspended state - Implement OP_PAGED_RESULTS_OFFSET support Architecture Improvements: - Split monolithic GoogleAppsConnector into specialized handlers - Add GoogleApiExecutor for centralized API execution with retry logic - Implement GoogleFilter and GoogleFilterTranslator for enhanced filtering capabilities - Extract UserConverter, GroupConverter and SchemaDefinition classes for better separation of concerns - Introduce specialized handlers: UserHandler, GroupHandler, MemberHandler, OrgunitsHandler, LicenseAssignmentsHandler Configuration Enhancements: - Add timeout configurations - Add proxy configuration - Add custom API base URL configuration for private/testing endpoints - Add service account scopes configuration for fine-grained permissions control Dependency Updates: - Update Google APIs dependencies to latest versions - Add google-http-client-apache-v2 for Apache HttpClient Bug Fixes and Improvements: - Fix attribute clearing using Data.NULL_STRING for proper null handling - Fix group membership operations to use immutable IDs instead of emails - Add Name-based lookups for users and groups via GoogleFilter Testing Infrastructure: - Add comprehensive test suite using WireMock - Implement GoogleApiMockServer for HTTP-level API testing - Add specialized test coverage for all operation types (Create, Update, Delete, Search) - Include edge case testing for partial attributes, pagination, filtering, and ordering
- Replace key-value separator from '=' to ':' for proper JSON format - Sort keys alphabetically using TreeMap to ensure consistent output - Add comprehensive test coverage for structured attributes JSON output This fixes issues where midPoint's string comparison would fail due to inconsistent key ordering in JSON strings returned for structured attributes (emails, phones, externalIds, organizations, etc).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR delivers comprehensive enhancements to the Google Apps connector including new features (UpdateDelta operations, enhanced search capabilities, group membership management), architectural improvements through handler separation and API executor introduction, bug fixes for attribute handling, and robust test coverage with automated tests.
New Feature
1. UpdateDelta Operation Implementation
2. Enhanced Search Capabilities
3. Group Membership Operations
Configuration Enhancements
Service Account Configuration
Proxy Configuration
HTTP Timeout Configuration
Pagination Configuration
Advanced API Configuration
Bug Fixes & Improvements
Architecture Refactoring
Test Infrastructure
Testing
mvn testmidPoint Configuration Example
Group Membership Mapping Example
With the group membership management in midPoint can be configured more efficiently using associations. Here's a recommended configuration:
This configuration enables:
The UpdateDelta implementation ensures that only changed memberships are processed, improving performance for users with many group memberships.
Structured Attributes Mapping Example
The connector now provides consistent JSON formatting for structured attributes like
externalIds,emails,phones, andorganizations. This ensures reliable midPoint integration and prevents unnecessary update operations due to format inconsistencies.Important Note: When constructing JSON strings in midPoint expressions, ensure that keys are specified in alphabetical order to match the connector's consistent output format. In the following example,
"type"comes before"value"alphabetically, which matches the connector's sorted JSON output.