ThaliaBridge — Connecteurs externes
Le module ThaliaBridge connecte l'intranet aux outils externes (BookStack, GitLab, Nextcloud, Passbolt).
Capacités par outil
| Outil | Lecture | Écriture | Authentification |
|---|---|---|---|
| BookStack | Pages, livres, recherche plein texte | Créer/modifier pages | API Token ID/Secret |
| GitLab | Issues, MRs, wiki, commits, fichiers | Créer issues, commentaires | Personal access token |
| Nextcloud | Fichiers, dossiers, partages | Upload, créer dossiers | App password WebDAV + OCS API |
| Passbolt | Noms de coffres uniquement | Jamais | Lecture seule — jamais exposer les mots de passe |
:::danger Règle absolue Passbolt Ne jamais exposer les mots de passe Passbolt, même en lecture, même avec scope admin. :::
Pattern service (identique à ProxmoxApiService)
final class BookStackService
{
private readonly string $baseUrl;
private readonly string $tokenId;
private readonly string $tokenSecret;
public function __construct()
{
try {
$this->tokenId = config('thaliabridge.bookstack.token_id');
$this->tokenSecret = config('thaliabridge.bookstack.token_secret');
$this->baseUrl = config('thaliabridge.bookstack.url');
} catch (DecryptException $e) {
throw new BridgeConnectionException('BookStack: token invalide', previous: $e);
}
}
public function searchPages(string $query, int $limit = 10): array
{
return $this->get('/api/search', ['query' => $query, 'count' => $limit]);
}
}
Endpoints API v2
GET /api/v2/bridge/bookstack/search?q=xxx
GET /api/v2/bridge/bookstack/pages/{id}
GET /api/v2/bridge/gitlab/issues?project=xxx&state=opened
GET /api/v2/bridge/gitlab/search?q=xxx
GET /api/v2/bridge/nextcloud/files?path=/Documents
GET /api/v2/bridge/passbolt/vaults # noms uniquement
Structure du module
Modules/ThaliaBridge/
├── app/
│ ├── Services/
│ │ ├── BookStackService.php
│ │ ├── GitLabService.php
│ │ ├── NextcloudService.php
│ │ └── PassboltService.php
│ ├── DTO/
│ │ ├── BookStackPageDTO.php
│ │ ├── GitLabIssueDTO.php
│ │ └── NextcloudFileDTO.php
│ └── Exceptions/
│ └── BridgeConnectionException.php
└── config/
└── thaliabridge.php