Aller au contenu principal

ThaliaBridge — Connecteurs externes

Le module ThaliaBridge connecte l'intranet aux outils externes (BookStack, GitLab, Nextcloud, Passbolt).


Capacités par outil

OutilLectureÉcritureAuthentification
BookStackPages, livres, recherche plein texteCréer/modifier pagesAPI Token ID/Secret
GitLabIssues, MRs, wiki, commits, fichiersCréer issues, commentairesPersonal access token
NextcloudFichiers, dossiers, partagesUpload, créer dossiersApp password WebDAV + OCS API
PassboltNoms de coffres uniquementJamaisLecture 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