Files
nextcloud-mcp-server/third_party/astroglobe/appinfo/routes.php
T
Chris Coutinho 0f7e87a91c feat(astrolabe): add OAuth token refresh and webhook presets
Implement automatic token refresh and pre-configured webhook bundles
to simplify vector sync configuration.

Changes:
- Add IdpTokenRefresher service for automatic OAuth token renewal
  - Works with both Nextcloud OIDC and external IdPs (Keycloak)
  - Uses OIDC discovery for automatic endpoint detection
  - Supports confidential clients with client_secret
- Add WebhookPresets service with pre-configured bundles:
  - Notes sync (file created/written/deleted in Notes folder)
  - Calendar sync (calendar object created/updated/deleted)
  - Tables sync (row added/updated/deleted, Nextcloud 30+)
  - Forms sync (form submitted, Nextcloud 30+)
- Update ApiController to use automatic token refresh
  - Pass refresh callback to McpTokenStorage
  - Add getWebhookPresets endpoint (admin-only)
  - Add configureWebhooks endpoint for bulk setup
- Update OAuthController for webhook management
- Add new API routes for webhook configuration

Benefits:
- Eliminates manual token refresh
- Simplifies webhook setup with one-click presets
- Provides app-aware filtering (only shows presets for installed apps)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-18 00:01:35 +01:00

79 lines
1.4 KiB
PHP

<?php
declare(strict_types=1);
/**
* Routes configuration for MCP Server UI app.
*
* Defines URL routes for OAuth flow and form handlers.
*/
return [
'routes' => [
// OAuth routes
[
'name' => 'oauth#initiateOAuth',
'url' => '/oauth/authorize',
'verb' => 'GET',
],
[
'name' => 'oauth#oauthCallback',
'url' => '/oauth/callback',
'verb' => 'GET',
],
[
'name' => 'oauth#disconnect',
'url' => '/oauth/disconnect',
'verb' => 'POST',
],
// API routes (form handlers)
[
'name' => 'api#revokeAccess',
'url' => '/api/revoke',
'verb' => 'POST',
],
// Vector search API routes
[
'name' => 'api#search',
'url' => '/api/search',
'verb' => 'GET',
],
[
'name' => 'api#vectorStatus',
'url' => '/api/vector-status',
'verb' => 'GET',
],
[
'name' => 'api#chunkContext',
'url' => '/api/chunk-context',
'verb' => 'GET',
],
// Admin settings routes
[
'name' => 'api#saveSearchSettings',
'url' => '/api/admin/search-settings',
'verb' => 'POST',
],
// Webhook management routes (admin only)
[
'name' => 'api#getWebhookPresets',
'url' => '/api/admin/webhooks/presets',
'verb' => 'GET',
],
[
'name' => 'api#enableWebhookPreset',
'url' => '/api/admin/webhooks/presets/{presetId}/enable',
'verb' => 'POST',
],
[
'name' => 'api#disableWebhookPreset',
'url' => '/api/admin/webhooks/presets/{presetId}/disable',
'verb' => 'POST',
],
],
];