374 Commits
Author SHA1 Message Date
renovate-bot-cbcoutinho[bot]andGitHub a82491de15 chore(deps): update nextcloud-32 docker tag to v32.0.8 2026-04-07 10:19:27 +00:00
Chris CoutinhoandGitHub 204053d262 Merge pull request #679 from cbcoutinho/fix/cloud-client-registration
fix: support cloud OAuth clients and graceful DCR fallback
2026-04-05 19:40:30 +02:00
renovate-bot-cbcoutinho[bot]andGitHub 3038e3b936 chore(deps): update anthropics/claude-code-action action to v1.0.89 2026-04-05 16:13:51 +00:00
Chris CoutinhoandClaude Opus 4.6 7d775d2a52 refactor: remove ALLOWED_MCP_CLOUD_CLIENTS and add keycloak CI profile
Remove the unused ALLOWED_MCP_CLOUD_CLIENTS env var — all clients are
defined via ALLOWED_MCP_CLIENTS or the static well-known defaults.
Add keycloak as an integration test profile in CI now that login-flow
replaces the old bearer token approach for external IdPs.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 15:06:56 +02:00
Chris CoutinhoandGitHub 877535aeb7 Merge pull request #674 from cbcoutinho/refactor/remove-oauth-profile
refactor: remove oauth profile, migrate MCP/OAuth tests to login-flow
2026-04-04 10:31:42 +02:00
renovate-bot-cbcoutinho[bot]andGitHub 1234bfcbaf chore(deps): update anthropics/claude-code-action action to v1.0.85 2026-04-02 04:21:06 +00:00
Chris CoutinhoandClaude Opus 4.6 aeddc28ca6 refactor: remove oauth profile, migrate MCP/OAuth tests to login-flow
Remove the oauth Docker Compose profile (mcp-oauth service, port 8001)
which used OAuth bearer tokens for direct NC API access, requiring
upstream OIDC patches. All NC access should use app passwords via
Login Flow v2 or BasicAuth.

Changes:
- Remove mcp-oauth service from docker-compose.yml
- Remove oauth mode from CI test matrix
- Delete oauth pass-through tests (core, permissions, token exchange)
- Delete oauth-specific tests (elicitation, NC PHP app, astrolabe)
- Migrate MCP/OAuth integration tests to login-flow profile:
  - DCR lifecycle, deletion, token type tests
  - Scope authorization (tool filtering) tests
  - Token introspection tests
- Fix flaky consent screen automation: replace JS btn.click() with
  Playwright native click + retry (handles Vue.js event binding race)
- Add scope-filtered OAuth client fixtures to login-flow conftest
- Keep keycloak profile for external IdP testing

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 16:05:14 +02:00
Chris CoutinhoandClaude Opus 4.6 fe8799a133 fix: resolve OAuth compatibility issues for login-flow deployment
- Drop OIDC fork: comment out third_party/oidc mount, use upstream
  v1.16.3 from app store (fixes consent redirect race, PR #631)
- Support client_secret_basic auth: add _extract_basic_auth() helper
  so TS MCP SDK can authenticate at token endpoint (RFC 6749 §2.3.1)
- Multi-issuer JWT validation: accept tokens with internal Docker
  issuer (http://app:80) or public URL (NEXTCLOUD_PUBLIC_ISSUER_URL)
  since AS proxy obtains tokens server-to-server
- Introspection fallback: try token introspection when JWT verification
  fails, supporting both JWT and opaque token types
- Register all tool scopes in DCR: add semantic:read, collectives:read,
  collectives:write to OIDC client allowed_scopes so tokens include
  them and semantic search tools are visible to authenticated clients
- Auto-create Astrolabe OAuth client: new app-hook creates OIDC client
  and stores credentials in config.php so the "Authorize via OAuth"
  button works without manual setup

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-29 15:05:26 +02:00
renovate-bot-cbcoutinho[bot]andGitHub 4354ee7270 chore(deps): update nextcloud-33 docker tag to v33.0.1 2026-03-28 11:20:49 +00:00
renovate-bot-cbcoutinho[bot]andGitHub 5d380f9819 chore(deps): update nextcloud-31:31.0.14 docker digest to 07ec73c 2026-03-28 10:13:40 +00:00
Chris CoutinhoandGitHub 89791a558b Merge pull request #657 from cbcoutinho/fix/renovate-nextcloud-version-pinning
fix: pin Renovate Nextcloud updates to matching major version
2026-03-28 10:53:11 +01:00
Chris CoutinhoandClaude Opus 4.6 1482d2d43d fix: pin Renovate Nextcloud updates to matching major version
The custom regex manager matched all nextcloud_image entries with the
same depName, causing Renovate to bump all matrix entries (NC 31, 32, 33)
to the latest version instead of only the targeted major.

Fix by capturing nextcloud_version to create version-specific dep names
(nextcloud-31, nextcloud-32, nextcloud-33) with allowedVersions rules
constraining each to its own major. Also pins docker-compose.yml to 32.x
and removes redundant inline # renovate: comments that could cause
duplicate matching.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-28 10:48:55 +01:00
renovate-bot-cbcoutinho[bot]andGitHub 162bb5b7e4 chore(deps): update anthropics/claude-code-action action to v1.0.81 2026-03-27 23:20:33 +00:00
renovate-bot-cbcoutinho[bot]andGitHub 84fafa6a6b chore(deps): update anthropics/claude-code-action action to v1.0.80 2026-03-26 23:19:45 +00:00
renovate-bot-cbcoutinho[bot]andGitHub f14b2ec76e chore(deps): update anthropics/claude-code-action action to v1.0.79 2026-03-26 05:22:41 +00:00
Chris CoutinhoandGitHub b62442b767 Merge pull request #636 from cbcoutinho/renovate/anthropics-claude-code-action-1.x
chore(deps): update anthropics/claude-code-action action to v1.0.76
2026-03-22 13:33:00 +01:00
renovate-bot-cbcoutinho[bot]andGitHub 073bc3e015 chore(deps): update anthropics/claude-code-action action to v1.0.76 2026-03-20 23:22:20 +00:00
Chris CoutinhoandClaude Opus 4.6 ad4ceaff30 fix: resolve OIDC consent flow 500 errors on NC 32
Root cause: ConsentController::grant() only passed client_id and scope
in the post-consent redirect, relying on PHP session fallback for state,
response_type, redirect_uri etc. On NC 32 (PHP 8.4), session values
were intermittently lost between session->close() and the subsequent GET
request, causing 500 errors from trim(null) / matchRedirectUri(null).

OIDC app fixes:
- Pass all OAuth params in consent redirect URL (eliminates session race)
- Add null safety guard in authorize endpoint (400 instead of 500)

Test infra fixes:
- Wait for OIDC redirect chain to settle before handling consent screen
  (fixes "Execution context was destroyed" Playwright errors)
- Capture nextcloud.log in CI failure artifacts for PHP error debugging

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 16:47:20 +01:00
Chris CoutinhoandClaude Opus 4.6 d9b010ab26 fix(ci): build OIDC app for all test modes including single-user
The OIDC submodule volume mount is on the base app service, so all
modes mount it. Without composer install, the post-install hook enables
a broken app (missing vendor/autoload.php), causing Nextcloud to fail.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 10:34:10 +01:00
Chris CoutinhoandClaude Opus 4.6 7a2280a981 fix: patch OIDC consent flow regression and add CI build step
The OIDC app 1.16.2 broke the consent flow by only falling back to
session params when client_id is missing. After consent, the redirect
includes client_id and scope but loses state, response_type, and
redirect_uri — causing a 500. The submodule fix restores per-param
session fallback when ANY critical param is missing.

Also adds a CI build step for the OIDC app (composer + npm) so the
JS assets (oidc-consent.js, oidc-redirect.js) are available in OAuth
test profiles.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-17 10:00:48 +01:00
renovate-bot-cbcoutinho[bot]andGitHub 355bd1bad3 chore(deps): update astral-sh/setup-uv action to v7.6.0 2026-03-16 17:22:55 +00:00
renovate-bot-cbcoutinho[bot]andGitHub 5823286907 chore(deps): update anthropics/claude-code-action action to v1.0.72 2026-03-14 05:23:04 +00:00
Chris CoutinhoandGitHub cd6f0ffa63 Merge pull request #606 from cbcoutinho/renovate/node-24.x
chore(deps): update dependency node to v24
2026-03-03 12:26:33 +01:00
Chris CoutinhoandGitHub 5d98858bb6 Merge pull request #603 from cbcoutinho/renovate/docker.io-library-nextcloud-33.0.0
chore(deps): update docker.io/library/nextcloud:33.0.0 docker digest to d53f6cb
2026-03-03 12:26:07 +01:00
renovate-bot-cbcoutinho[bot]andGitHub 059f37d093 chore(deps): update dependency node to v24 2026-03-03 11:18:05 +00:00
renovate-bot-cbcoutinho[bot]andGitHub 28ad0aefbf chore(deps): update docker.io/library/nextcloud docker tag to v31.0.14 2026-03-03 11:17:49 +00:00
renovate-bot-cbcoutinho[bot]andGitHub 6ce9599757 chore(deps): update docker.io/library/nextcloud:33.0.0 docker digest to d53f6cb 2026-03-03 11:17:25 +00:00
Chris CoutinhoandGitHub 45cc4c68fc Merge pull request #589 from cbcoutinho/feat/docker-compose-profiles-login-flow
feat: Docker Compose profiles and Login Flow v2 integration tests
2026-03-03 09:41:48 +01:00
renovate-bot-cbcoutinho[bot]andGitHub a5d2025797 chore(deps): update anthropics/claude-code-action action to v1.0.66 2026-03-02 17:17:24 +00:00
Chris CoutinhoandClaude Opus 4.6 f43343356e fix: address review feedback — security, caching, CI 429 retry
- Add 429 retry with exponential backoff to register_client() (fixes CI
  oauth matrix failures from parallel DCR requests)
- Make client_id, redirect_uri, and PKCE mandatory at token endpoint
- Add null-checks for discovery_url and OAuth credentials in proxy flows
- Add OIDC discovery document caching with 5-min TTL
- Add per-IP rate limiting on /oauth/register DCR proxy
- Discover DCR endpoint from OIDC discovery instead of hardcoding
- Extract extract_user_id_from_token to auth/token_utils.py (breaks
  circular imports between server/ and auth/ layers)
- Add TTL scope cache in scope_authorization.py (avoids DB hit per tool)
- Add defense-in-depth scope validation in storage layer
- Broaden elicitation exception handling with graceful fallback
- Add idempotentHint to nc_auth_check_status, return "pending" status
  after accepted elicitation, add polling interval to description
- Change ALL_SUPPORTED_SCOPES from tuple to frozenset for O(1) lookups
- Replace Optional[str] with str | None throughout config.py
- Use default_factory for ProxyCodeEntry/ASProxySession dataclasses
- Add proxy code/session cleanup to background loop
- Fix OIDC verification CI step to only run for oauth/login-flow modes
- Add unit tests for access.py REST endpoints (10 tests)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 17:22:23 +01:00
Chris CoutinhoandClaude Opus 4.6 0a53aa5fcd ci: enable Playwright browser tests in GitHub Actions
The GITHUB_ACTIONS skip was added before Playwright automation existed,
when tests required manual browser interaction. Now that Playwright
handles the OAuth flow programmatically, the skip is unnecessary —
GitHub Actions fully supports Playwright with localhost networking.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 16:09:14 +01:00
Chris CoutinhoandClaude Opus 4.6 abd43f8028 ci: disable NC 33 matrix until upstream apps support it
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 15:57:21 +01:00
renovate-bot-cbcoutinho[bot]andGitHub c8ebd9c089 chore(deps): update anthropics/claude-code-action action to v1.0.65 2026-03-02 11:15:16 +00:00
Chris Coutinho 5947fff13f chore: revert 2026-03-02 11:28:56 +01:00
Chris Coutinho a9e5c687b8 ci: Ignore oauth and multi-user-basic in integration testing matrix to reduce github ci usage 2026-03-02 11:27:37 +01:00
Chris CoutinhoandClaude Opus 4.6 d09ebf20cc feat(ci): add Nextcloud version matrix (NC 31, 32, 33)
- Add cross-product matrix (3 versions x 4 auth modes = 12 CI jobs)
- Parameterize Nextcloud image in docker-compose.yml via NEXTCLOUD_IMAGE env var
- Pin NC 31.0.8, 32.0.6, 33.0.0 with SHA digests in workflow
- Add Renovate customManagers to auto-update NC images in workflow
- Fix Astrolabe install hook to prefer volume mount over app store
- Bump Astrolabe submodule to support NC 33 (max-version 31→33)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-02 11:13:38 +01:00
Chris CoutinhoandClaude Opus 4.6 1a6ce0fa7d fix: address PR review issues for Login Flow v2
- Fix circular dependency in scope_authorization: auth tools requiring
  only identity scopes (openid/profile/email) now bypass the login flow
  provisioning check, so unprovisioned users can call provisioning tools
- Fix no-op detection in nc_auth_update_scopes: NULL scopes (legacy "all")
  now correctly map to ALL_SUPPORTED_SCOPES instead of empty set
- Fix get_app_password_with_scopes swallowing exceptions: re-raise instead
  of returning None, matching sibling methods
- Add missing audit logging to update_app_password_scopes,
  delete_login_flow_session, and delete_expired_login_flow_sessions
- Pin setup-uv to v7.3.1 in CI unit-test job (was v7.3.0)
- Add FastMCP type annotation to register_auth_tools parameter
- Log warning when user accepts elicitation without checking acknowledged box

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 19:02:30 +01:00
Chris CoutinhoandClaude Opus 4.6 bd69e68dd5 ci: enable Playwright install for multi-user-basic CI job
Astrolabe tests moved to multi_user_basic markers use Playwright browser
automation, so the CI matrix entry needs needs-playwright: true.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 18:01:54 +01:00
Chris Coutinho 148573e28b Merge remote-tracking branch 'origin/master' into feat/docker-compose-profiles-login-flow 2026-03-01 17:26:05 +01:00
Chris CoutinhoandGitHub b86e798ba8 Merge pull request #592 from cbcoutinho/renovate/anthropics-claude-code-action-1.x
chore(deps): update anthropics/claude-code-action action to v1.0.64
2026-03-01 17:25:47 +01:00
Chris CoutinhoandGitHub 6bfde0de1f Merge pull request #596 from cbcoutinho/renovate/major-github-artifact-actions
chore(deps): update actions/upload-artifact action to v7
2026-03-01 17:22:58 +01:00
renovate-bot-cbcoutinho[bot]andGitHub 6ba598afd1 chore(deps): update actions/upload-artifact action to v7 2026-03-01 16:03:54 +00:00
renovate-bot-cbcoutinho[bot]andGitHub 3da6feba41 chore(deps): update astral-sh/setup-uv action to v7.3.1 2026-03-01 16:03:20 +00:00
renovate-bot-cbcoutinho[bot]andGitHub 1224090469 chore(deps): update anthropics/claude-code-action action to v1.0.64 2026-03-01 16:03:13 +00:00
Chris CoutinhoandClaude Opus 4.6 db1e0606ad fix: address PR #589 review feedback (round 2)
Consolidate three independent RefreshTokenStorage lazy singletons into a
single lock-protected get_shared_storage() function, eliminating race
conditions on concurrent first-access. Remove blanket try/except in
_get_stored_scopes so storage errors propagate as proper MCP errors
instead of silently triggering "please provision" messages. Handle
declined/cancelled elicitation results in Login Flow tools by cleaning up
sessions and returning clear status. Add update_app_password_scopes() to
avoid unnecessary decrypt/re-encrypt when only scopes change. Add
unprovisioned-user early exit and no-op detection to nc_auth_update_scopes.
Remove four dead config fields and misleading NEXTCLOUD_PASSWORD deprecation
warning. Add periodic login flow session cleanup task. Generate separate
Fernet keys per service. Add board cleanup in deck integration test. Gate
CI unit tests on linting and skip Astrolabe build for single-user profile.
Fix test markers from oauth to multi_user_basic for astrolabe integration
tests. Update login_flow.py docstrings to document outbound HTTP calls.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 16:35:31 +01:00
Chris CoutinhoandClaude Opus 4.6 33cf0fee9b fix(ci): remove dev OIDC mount to fix HTTP 500 in single-user/multi-user-basic
The dev OIDC app was mounted for all profiles but composer install only
ran for Playwright profiles, causing a missing vendor/autoload.php fatal
error that broke all /apps/* and /ocs/* routes. The hook script already
has app store fallback logic, so removing the dev mount is sufficient.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 12:28:01 +01:00
Chris CoutinhoandClaude Opus 4.6 b2fd4da9fe fix(ci): fix health check timeout and per-profile MCP server URL routing
The Nextcloud health check expected HTTP 401 from serverinfo, but NC 32
returns 200 — causing 5-minute timeouts. Switch to /status.php with
"installed":true check (matches Docker healthcheck). Also route the
correct MCP_SERVER_URL per CI matrix profile into the app container so
Astrolabe connects to the right service, and make the init script
gracefully skip when the var is unset.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 11:30:07 +01:00
Chris CoutinhoandClaude Opus 4.6 16cd2e27cb fix(ci): fix PHP gating, add multi-user-basic matrix entry, upload debug artifacts
PHP setup was gated behind needs-playwright but Astrolabe build needs
composer unconditionally. Add multi-user-basic CI matrix entry with
proper marker filtering. Upload Playwright screenshots and service logs
as artifacts on failure for easier debugging.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 11:02:39 +01:00
Chris CoutinhoandClaude Opus 4.6 e28af5453b fix: address PR #589 review feedback for Login Flow v2
- Fix data loss in nc_auth_update_scopes: remove premature
  delete_app_password call; old password stays valid until upsert
  replaces it on successful re-provisioning
- Replace assert with proper error return in nc_auth_check_status
- Add lazy singleton for RefreshTokenStorage in auth_tools,
  scope_authorization, and context to avoid per-call re-initialization
- Centralize _is_login_flow_mode() to get_settings().enable_login_flow
  and remove duplicate definitions and per-call os.getenv reads
- Add dev-only comment to TOKEN_ENCRYPTION_KEY in docker-compose.yml
- Gate OIDC build steps in CI behind matrix.needs-playwright
- Add diagnostic step reporting Playwright skip count in CI

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 10:08:55 +01:00
Chris CoutinhoandClaude Opus 4.6 989749530c fix(ci): fix integration test collection and skip Playwright in CI
- Add @pytest.mark.oauth to OAuth-dependent tests in
  test_scope_authorization.py so they're excluded from single-user job
- Add module-level pytestmark to test_introspection_authorization.py
- Fix single-user marker expression to also exclude oauth smoke tests
- Add --ignore paths for multi-user, qdrant, and RAG evaluation tests
- Uncomment GITHUB_ACTIONS skip in oauth_callback_server fixture
- Add GITHUB_ACTIONS skip to login_flow_oauth_token fixture
- Mount third_party/oidc volume in docker-compose.yml app service
- Add OIDC diagnostic step in CI for playwright jobs

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 09:17:03 +01:00