|
| 1 | +# Configuration Item Browsing and Management Feature - Implementation Plan |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +This document outlines the comprehensive implementation plan for adding Configuration Item (CI) browsing and management capabilities to the iTop Integration app for Nextcloud. The feature enables users to search, browse, and create rich previews of Configuration Items (CIs) from their iTop CMDB directly within Nextcloud. |
| 6 | + |
| 7 | +## Project Scope |
| 8 | + |
| 9 | +### ✅ In Scope |
| 10 | +- **Read-only CI browsing** across selected CMDB classes |
| 11 | +- **Unified Search integration** - CIs appear in Nextcloud's global search |
| 12 | +- **Smart Picker suggestions** - CI links insertable in Text, Talk, etc. |
| 13 | +- **Rich preview widgets** - Paste iTop CI links for rich previews |
| 14 | +- **Profile-aware permissions** - Portal users see only related assets |
| 15 | +- **Dual-token security architecture** - App token + personal token model |
| 16 | + |
| 17 | +### ❌ Out of Scope (v1.0) |
| 18 | +- Write operations (create/update CIs, manage relationships) |
| 19 | +- Bulk operations, workflows, or approval processes |
| 20 | +- Advanced reporting or analytics |
| 21 | +- Custom field extensions |
| 22 | + |
| 23 | +## Target Classes |
| 24 | + |
| 25 | +### End User Devices |
| 26 | +- **PC** - Desktops and laptops with hardware specs |
| 27 | +- **Phone, IPPhone, MobilePhone** - Telephony devices |
| 28 | +- **Tablet** - Mobile tablet devices |
| 29 | +- **Printer** - Network and local printers |
| 30 | +- **Peripheral** - Other hardware peripherals |
| 31 | + |
| 32 | +### Software and Applications |
| 33 | +- **PCSoftware** - Desktop/server software instances |
| 34 | +- **OtherSoftware** - Miscellaneous software |
| 35 | +- **WebApplication** - Web-based applications with URLs |
| 36 | + |
| 37 | +### Explicitly Excluded (Future Versions) |
| 38 | +- Middleware, MiddlewareInstance, DatabaseSchema |
| 39 | + |
| 40 | +## Technical Architecture |
| 41 | + |
| 42 | +### Core Services (PHP) |
| 43 | +``` |
| 44 | +lib/Service/ |
| 45 | +├── ItopClient.php # REST API client with dual-token support |
| 46 | +├── ProfileService.php # User profile detection and permissions |
| 47 | +├── PreviewMapper.php # Map iTop objects → preview DTOs |
| 48 | +└── CacheService.php # Caching layer for performance |
| 49 | +
|
| 50 | +lib/Search/ |
| 51 | +└── ItopUnifiedSearchProvider.php # Nextcloud Unified Search |
| 52 | +
|
| 53 | +lib/Reference/ |
| 54 | +└── ItopReferenceProvider.php # Rich preview provider |
| 55 | +
|
| 56 | +lib/Picker/ |
| 57 | +└── ItopSmartPickerProvider.php # Smart Picker suggestions |
| 58 | +``` |
| 59 | + |
| 60 | +### Frontend Components |
| 61 | +``` |
| 62 | +src/components/ |
| 63 | +├── CIPreviewWidget.vue # Common CI preview widget |
| 64 | +└── CISearchResult.vue # Search result item |
| 65 | +
|
| 66 | +img/ |
| 67 | +├── PC.svg, Phone.svg, Tablet.svg, Printer.svg |
| 68 | +├── PCSoftware.svg, WebApplication.svg |
| 69 | +└── FunctionalCI.svg # Fallback icon |
| 70 | +``` |
| 71 | + |
| 72 | +## Implementation Phases |
| 73 | + |
| 74 | +### Phase 1: Foundation & Documentation ✅ |
| 75 | +- [x] Create comprehensive documentation structure |
| 76 | +- [x] Define technical specifications and contracts |
| 77 | +- [x] Security and permissions model design |
| 78 | +- [x] UI/UX wireframes and component specifications |
| 79 | + |
| 80 | +### Phase 2: Core Infrastructure |
| 81 | +- [ ] ItopClient service with dual-token authentication |
| 82 | +- [ ] ProfileService for user profile detection |
| 83 | +- [ ] PreviewMapper for CI data transformation |
| 84 | +- [ ] Caching and rate limiting infrastructure |
| 85 | + |
| 86 | +### Phase 3: Search Integration |
| 87 | +- [ ] Unified Search provider implementation |
| 88 | +- [ ] Smart Picker provider |
| 89 | +- [ ] Search result ranking and filtering |
| 90 | +- [ ] Per-class search query optimization |
| 91 | + |
| 92 | +### Phase 4: Rich Previews |
| 93 | +- [ ] Reference provider for link detection |
| 94 | +- [ ] Common CI preview widget component |
| 95 | +- [ ] Icon assets and theming support |
| 96 | +- [ ] Responsive design for all Nextcloud contexts |
| 97 | + |
| 98 | +### Phase 5: Configuration & Settings |
| 99 | +- [ ] Admin settings panel with connectivity testing |
| 100 | +- [ ] Personal settings with token validation |
| 101 | +- [ ] Per-class enable/disable toggles |
| 102 | +- [ ] Portal profile detection configuration |
| 103 | + |
| 104 | +### Phase 6: Localization (l10n) |
| 105 | +- [ ] Extract all translatable strings to l10n/en.json |
| 106 | +- [ ] Create l10n/de.json (German informal - Du) |
| 107 | +- [ ] Create l10n/de_DE.json (German formal - Sie) |
| 108 | +- [ ] Ensure all user-facing strings use $this->l10n->t() |
| 109 | +- [ ] Test with both German variants |
| 110 | +- [ ] Document translation contribution process |
| 111 | + |
| 112 | +### Phase 7: Testing & QA |
| 113 | +- [ ] Unit tests for all services |
| 114 | +- [ ] Integration tests with OrbStack environment |
| 115 | +- [ ] Manual testing across all features |
| 116 | +- [ ] Performance benchmarking |
| 117 | +- [ ] Translation completeness verification |
| 118 | + |
| 119 | +### Phase 8: Documentation & Release |
| 120 | +- [ ] User documentation updates |
| 121 | +- [ ] CHANGELOG.md entries |
| 122 | +- [ ] Version bump in info.xml |
| 123 | +- [ ] Release preparation (manual approval required) |
| 124 | + |
| 125 | +## Key Features |
| 126 | + |
| 127 | +### 1. Unified Search Integration |
| 128 | +**Location**: Nextcloud's global search bar |
| 129 | +**Functionality**: |
| 130 | +- Search across all enabled CI classes simultaneously |
| 131 | +- Results show: `[Class] • [Organization] • [Status]` |
| 132 | +- Direct links to iTop CI details pages |
| 133 | +- Respects user permissions and profile restrictions |
| 134 | + |
| 135 | +### 2. Smart Picker Suggestions |
| 136 | +**Location**: Text editor, Talk chat, file comments |
| 137 | +**Functionality**: |
| 138 | +- Suggest CIs as user types |
| 139 | +- Insert clickable links that auto-preview |
| 140 | +- Debounced queries for performance |
| 141 | +- Same permission model as search |
| 142 | + |
| 143 | +### 3. Rich Link Previews |
| 144 | +**Trigger**: Pasting iTop CI URLs |
| 145 | +**Pattern**: `http://itop-dev.orb.local/pages/UI.php?operation=details&class=<Class>&id=<ID>` |
| 146 | +**Preview Shows**: |
| 147 | +- CI icon, name, and status badge |
| 148 | +- Organization, location, asset numbers |
| 149 | +- Hardware specs (CPU, RAM) or software details (version, URL) |
| 150 | +- Actions: Copy link, Open in iTop |
| 151 | + |
| 152 | +### 4. Profile-Based Permissions |
| 153 | +**Portal Users**: See only CIs they are related to via the Contact→CI relationship (contacts_list). No organization-based fallback is applied. iTop's built‑in ACL still applies. |
| 154 | + |
| 155 | +**Power Users**: If the user has any additional profile beyond "Portal user" (e.g. Service Desk Agent, Service Manager…), allow full CMDB search within iTop ACL. |
| 156 | + |
| 157 | +## Security Model |
| 158 | + |
| 159 | +### Dual-Token Architecture |
| 160 | +- **Application Token**: Used for all iTop API access by the app. Requests are scoped using the authenticated user's identity (person_id) to preserve isolation. |
| 161 | +- **Personal Token (one-time)**: Provided by the user once to verify identity; we resolve and store the user's `person_id` in app config and then discard the token. |
| 162 | +- **Token Storage**: Only the application token is stored (encrypted). Personal tokens are never persisted. |
| 163 | +- **Scope Isolation**: All queries are performed with the application token but filtered by the stored `person_id` (and profiles) to enforce per-user visibility. |
| 164 | + |
| 165 | +### Privacy Guarantees |
| 166 | +- No cross-user data leakage |
| 167 | +- No tokens logged in plain text |
| 168 | +- No write operations without explicit consent |
| 169 | +- Rate limiting per user per endpoint |
| 170 | + |
| 171 | +## Configuration |
| 172 | + |
| 173 | +### Admin Settings |
| 174 | +- iTop base URL and display name |
| 175 | +- Application token management |
| 176 | +- Global result limits and class toggles |
| 177 | +- Portal profile identification rules |
| 178 | +- Connectivity testing and validation |
| 179 | + |
| 180 | +### Personal Settings |
| 181 | +- One-time personal API token verification (token is NOT stored); on success we store only the `person_id` in user config |
| 182 | +- Profile preview and permission summary |
| 183 | +- Per-feature enable/disable options |
| 184 | + |
| 185 | +## Quality Assurance |
| 186 | + |
| 187 | +### Acceptance Criteria |
| 188 | +- ✅ All target classes searchable and previewable |
| 189 | +- ✅ Portal users restricted to relevant assets only |
| 190 | +- ✅ Multi-profile users access full CMDB (within ACL) |
| 191 | +- ✅ Rich previews render <300ms after cache warm |
| 192 | +- ✅ Zero write operations sent to iTop |
| 193 | +- ✅ Tokens never exposed in logs or client-side |
| 194 | +- ✅ Icons and actions work in all Nextcloud contexts |
| 195 | + |
| 196 | +### Test Matrix |
| 197 | +| Feature | Portal User | Power User | Edge Cases | |
| 198 | +|---------|-------------|------------|------------| |
| 199 | +| Unified Search | ✅ Limited scope | ✅ Full scope | ❌ Invalid tokens | |
| 200 | +| Smart Picker | ✅ Limited scope | ✅ Full scope | ⚠️ Network timeouts | |
| 201 | +| Rich Previews | ✅ Own CIs only | ✅ All accessible | 🔒 No permissions | |
| 202 | +| Configuration | ❌ Read-only | ✅ Full access | 🔧 Invalid URLs | |
| 203 | + |
| 204 | +## Performance Targets |
| 205 | + |
| 206 | +- **Search Response**: <500ms for cached results |
| 207 | +- **Preview Rendering**: <300ms after data fetch |
| 208 | +- **Cache TTL**: 60s for previews, 300s for profiles |
| 209 | +- **Rate Limiting**: 5 req/sec/user for interactive features |
| 210 | +- **Memory Usage**: <10MB additional per active user |
| 211 | + |
| 212 | +## Environment Requirements |
| 213 | + |
| 214 | +### Development Environment |
| 215 | +- **iTop Instance**: http://itop-dev.orb.local/ |
| 216 | +- **Infrastructure**: OrbStack with Europe/Vienna timezone |
| 217 | +- **Authentication**: allow_rest_services_via_tokens enabled |
| 218 | +- **Test Data**: Sample CIs across all target classes |
| 219 | +- **Browser Testing**: Context7 + browseMCP for UI validation |
| 220 | + |
| 221 | +### Dependencies |
| 222 | +- Nextcloud 30.0+ |
| 223 | +- PHP 8.1+ |
| 224 | +- iTop 3.1+ with REST API enabled |
| 225 | +- Personal API tokens for test users |
| 226 | + |
| 227 | +## Risks and Mitigations |
| 228 | + |
| 229 | +| Risk | Impact | Mitigation | |
| 230 | +|------|---------|------------| |
| 231 | +| iTop API changes | High | Version pinning + compatibility testing | |
| 232 | +| Performance issues | Medium | Aggressive caching + query optimization | |
| 233 | +| Permission model changes | High | Configurable fallback strategies | |
| 234 | +| Token compromise | Critical | Encrypted storage + automatic expiration | |
| 235 | + |
| 236 | +## Decisions Locked In |
| 237 | + |
| 238 | +- Portal profile code: "Portal user" |
| 239 | +- Permission model: For Portal‑only users, filter by Contact→CI relation (contacts_list) only; no organization fallback. Users with additional profiles may search the full CMDB within ACL. |
| 240 | +- Global search limit: 20; results distributed round‑robin per class up to the global limit. |
| 241 | +- Display label: "Open in [DisplayName]" where DisplayName comes from app config. |
| 242 | + |
| 243 | +## Remaining Decision |
| 244 | +- Finalize the exact preview output_fields per class (we will start with the common set and iterate during implementation). |
| 245 | + |
| 246 | +## Success Metrics |
| 247 | + |
| 248 | +- **User Adoption**: >50% of configured users actively search CIs within 30 days |
| 249 | +- **Performance**: 95th percentile response times <1s for all features |
| 250 | +- **Reliability**: <1% error rate across all CI operations |
| 251 | +- **Support Load**: Zero escalations related to data access permissions |
| 252 | + |
| 253 | +--- |
| 254 | + |
| 255 | +**Next Steps**: Please review and confirm the open decisions above, then proceed with Phase 2 implementation. |
0 commit comments