Skip to content

Commit 457c280

Browse files
committed
docs: publish comprehensive documentation for CI browsing feature and add l10n support
- Add complete technical documentation covering architecture, API, security, testing, and UX - Include German translation support (informal/formal variants) - Prepare Phase 2-8 implementation roadmap
1 parent 0dd71bd commit 457c280

19 files changed

+10893
-0
lines changed

docs/PLAN_CI_BROWSING.md

Lines changed: 255 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,255 @@
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.

docs/README.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Integration iTop - Documentation
2+
3+
This directory contains comprehensive documentation for the iTop Integration app for Nextcloud, with a focus on the Configuration Item (CI) browsing and management feature.
4+
5+
## Documentation Structure
6+
7+
### 📋 Planning & Architecture
8+
- **[PLAN_CI_BROWSING.md](PLAN_CI_BROWSING.md)** - Master implementation plan and project roadmap
9+
- **[architecture.md](architecture.md)** - High-level app architecture and data flow diagrams
10+
- **[security-auth.md](security-auth.md)** - Dual-token flow, storage, permissions model, profile checks
11+
12+
### 🔌 API & Data Integration
13+
- **[itop-api.md](itop-api.md)** - REST endpoints, OQL queries, pagination/limits, error semantics
14+
- **[class-mapping.md](class-mapping.md)** - CI classes, fields, preview mapping, icons, search weights
15+
16+
### 🔍 Feature Specifications
17+
- **[unified-search.md](unified-search.md)** - Search provider spec, response format, result limits, i18n
18+
- **[smart-picker.md](smart-picker.md)** - Suggestion provider spec, UX, throttling, access rules
19+
- **[rich-preview.md](rich-preview.md)** - Reference provider spec, preview templates, assets, fallbacks
20+
21+
### ⚙️ Configuration & Setup
22+
- **[configuration.md](configuration.md)** - Admin and personal settings, validation, feature flags
23+
- **[testing.md](testing.md)** - OrbStack dev environment, manual and automated test scripts, QA matrix
24+
25+
### 🎨 User Experience
26+
- **[UX-widgets.md](UX-widgets.md)** - Widget wireframes, states, and responsive design guidelines
27+
28+
### 🚀 Performance & Operations
29+
- **[caching-performance.md](caching-performance.md)** - Client-side and server-side caching, ETags, TTLs
30+
- **[observability.md](observability.md)** - Logging, metrics, debug switches
31+
32+
### 🌍 Localization
33+
- **[l10n.md](l10n.md)** - Translation guide, German informal/formal variants, community contributions
34+
35+
### 📝 Release Management
36+
- **[changelog-notes.md](changelog-notes.md)** - Placeholders for CHANGELOG.md entries and info.xml notes
37+
- **[edge-cases.md](edge-cases.md)** - Timeouts, partial data, missing rights, mixed locales, error handling
38+
39+
## Current Status
40+
41+
**Phase 1**: Foundation & Documentation ✅ **COMPLETE**
42+
- [x] Comprehensive planning and scope definition
43+
- [x] Technical specifications and contracts
44+
- [x] Security and permissions model design
45+
- [x] UI/UX wireframes and component specifications
46+
47+
**Next Phase**: Core Infrastructure Development
48+
- [ ] ItopClient service with dual-token authentication
49+
- [ ] ProfileService for user profile detection
50+
- [ ] PreviewMapper for CI data transformation
51+
- [ ] Caching and rate limiting infrastructure
52+
53+
## Key Features Overview
54+
55+
### 🔍 Unified Search Integration
56+
Search across Configuration Items directly from Nextcloud's global search bar. Results include CI name, organization, status, and direct links to iTop.
57+
58+
### 🎯 Smart Picker Suggestions
59+
When composing text in Talk, Text app, or comments, get intelligent CI suggestions that insert as clickable links with rich previews.
60+
61+
### 🖼️ Rich Link Previews
62+
Paste iTop CI URLs anywhere in Nextcloud to get rich previews showing key information like hardware specs, software versions, or contact details.
63+
64+
### 🔐 Profile-Aware Permissions
65+
Portal users see only CIs they're related to, while power users get full CMDB access within their iTop permissions - all secured via dual-token architecture.
66+
67+
## Target Classes
68+
69+
**End User Devices**: PC, Phone, IPPhone, MobilePhone, Tablet, Printer, Peripheral
70+
**Software & Applications**: PCSoftware, OtherSoftware, WebApplication
71+
72+
## For Developers
73+
74+
### Getting Started
75+
1. Review the [master implementation plan](PLAN_CI_BROWSING.md)
76+
2. Use the existing [OrbStack test environment](testing.md)
77+
3. Understand the [security model](security-auth.md) and dual-token approach
78+
4. Study the [API integration patterns](itop-api.md) and [class mappings](class-mapping.md)
79+
80+
### Contributing
81+
- All changes must pass integration tests on the OrbStack dev environment
82+
- Follow the dual-token security patterns established in the codebase
83+
- Update relevant documentation when adding features or changing APIs
84+
- Manual version bumps only - no automatic releases
85+
86+
### Architecture Philosophy
87+
- **Security-first**: User data isolation, encrypted token storage, no write operations
88+
- **Performance-aware**: Aggressive caching, rate limiting, minimal API calls
89+
- **User-centric**: Portal user compatibility, intuitive UX, consistent with Nextcloud patterns
90+
- **Maintainable**: Clean abstractions, comprehensive testing, clear documentation
91+
92+
---
93+
94+
For questions or clarifications, please refer to the specific documentation files or consult the project maintainer.

0 commit comments

Comments
 (0)