Commit Graph
2146 Commits
Author SHA1 Message Date
Chris CoutinhoandClaude Opus 4.6 cc6ba65993 fix: address second round of PR review for scope prefix
- Use dynaconf (get_settings()) instead of os.getenv for OIDC_RESOURCE_SERVER_ID
- Re-add Settings field, _field_map entry, and settings.toml default
- Add trailing-slash guard (.rstrip("/")) to prevent double-slash in scopes
- Add double-prefixing guard: skip scopes already carrying the prefix
- Add @pytest.mark.unit to test module
- Add test for already-prefixed scopes
- Document OIDC_RESOURCE_SERVER_ID in docs/configuration.md

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 16:58:29 +02:00
Chris CoutinhoandClaude Opus 4.6 f67d4d1116 fix: address PR review for OIDC scope prefix feature
Add offline_access to OIDC standard scopes exclusion list to prevent it
from being incorrectly prefixed, which would break Cognito refresh token
flows. Extract scope transformation into testable _transform_scopes_for_idp()
helper, add debug logging for prefixed scopes, remove unused Settings field
(oauth_routes.py consistently uses os.getenv), and add unit tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 16:44:08 +02:00
Chris CoutinhoandClaude Opus 4.6 e21ddd91b9 feat: add OIDC resource server scope prefix for Cognito compatibility
When OIDC_RESOURCE_SERVER_ID is set, prefix resource scopes with the
identifier when forwarding to the IdP (e.g., calendar.read becomes
https://example.com/calendar.read). Required for IdPs like AWS Cognito
that mandate {resource_server_id}/{scope} format for custom scopes.
OIDC standard scopes (openid, profile, email) are forwarded as-is.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 16:33:47 +02:00
Chris CoutinhoandGitHub 2f146f8408 Merge pull request #685 from cbcoutinho/chore/remove-helm-chart
chore: remove helm chart (migrated to cbcoutinho/helm-charts)
2026-04-07 16:33:31 +02:00
Chris Coutinho f9f637b1ce Merge remote-tracking branch 'origin/master' into chore/remove-helm-chart 2026-04-07 16:32:53 +02:00
Chris CoutinhoandClaude Opus 4.6 c4b74e7e20 chore: remove helm chart (migrated to cbcoutinho/helm-charts)
The helm chart has been migrated to a dedicated repository at
https://github.com/cbcoutinho/helm-charts. This removes the chart
source, release workflow, bump script, and updates all documentation
to point to the new repository.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 16:31:35 +02:00
github-actions[bot] 1b64b9ffd2 bump: version 0.58.31 → 0.58.32 2026-04-07 13:50:09 +00:00
github-actions[bot] 1276de8e22 bump: version 0.68.4 → 0.69.0 2026-04-07 13:50:09 +00:00
Chris CoutinhoandGitHub 010c598b24 Merge pull request #680 from cbcoutinho/docs/adr-024-dynaconf-config-management
docs: ADR-025 dynaconf configuration management
2026-04-07 15:49:46 +02:00
Chris CoutinhoandClaude Opus 4.6 76b1fc4447 docs: address PR review feedback on ADR-025 dynaconf configuration management
Incorporate reviewer feedback across three review rounds:

- Remove post_hooks from Phase 1 constructor; defer to Phase 4
- Fix Validator syntax: use condition=lambda instead of ne= kwarg
- Add MCP_DEPLOYMENT_MODE validator to catch typos at startup
- Add CRITICAL to LOG_LEVEL validator enum
- Make OTEL_TRACES_SAMPLER_ARG validation conditional on ratio samplers
- Add all missing provider env vars to settings.toml (Bedrock, Anthropic, Ollama, Simple)
- Add provider secrets to .secrets.toml.example
- Fix DynaconfDict import to stable public API path
- Strengthen ignore_unknown_envvars risk: CI lint check mandatory before Phase 2
- Document ValidationError vs ValueError breaking change in Phase 3
- Acknowledge environments=True legacy risk with mitigation
- Address root_path pip-install concern (intentional: pip uses env vars)
- Add enable_token_exchange to adapter example; note exhaustive field mapping
- Clarify Provider Registry is Phase 6 with explanation of os.getenv coexistence
- Improve test isolation fixture with teardown reload + _dynaconf visibility note
- Add Docker Compose volume mount host-file existence note

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 15:48:50 +02:00
github-actions[bot] e24a1c0e84 bump: version 0.58.30 → 0.58.31 2026-04-07 12:18:06 +00:00
github-actions[bot] 806b9decbc bump: version 0.68.3 → 0.68.4 2026-04-07 12:18:05 +00:00
Chris Coutinho 5b093e49b1 Merge remote-tracking branch 'origin/master' into docs/adr-024-dynaconf-config-management 2026-04-07 14:17:57 +02:00
Chris CoutinhoandGitHub 6f16ece92b Merge pull request #682 from cbcoutinho/refactor/scope-separator-colon-to-dot
refactor: change OAuth scope separator from colon to dot
2026-04-07 14:17:46 +02:00
Chris CoutinhoandClaude Opus 4.6 b8b1616897 fix: resolve dynaconf settings.toml not found in non-editable installs
The root_path for dynaconf resolved to site-packages instead of the
application root when installed non-editable (Docker). This caused all
settings without env var overrides to be None, crashing on startup with
a TypeError in chunk size validation.

Fix root_path to fall back to CWD when settings.toml isn't at the
source-tree path, and refactor get_settings() to only pass values
dynaconf actually has — letting Settings dataclass defaults apply for
unconfigured keys. Mount settings.toml into all docker-compose MCP
services as a read-only volume.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 14:17:34 +02:00
github-actions[bot] 44ee72b284 bump: version 0.58.29 → 0.58.30 2026-04-07 10:43:04 +00:00
Chris CoutinhoandGitHub a9344382a7 Merge pull request #684 from cbcoutinho/renovate/docker.io-library-nextcloud-32.0.8
chore(deps): update docker.io/library/nextcloud:32.0.8 docker digest to 509caed
2026-04-07 12:42:48 +02:00
github-actions[bot] ca89a1359d bump: version 0.58.28 → 0.58.29 2026-04-07 10:42:33 +00:00
Chris CoutinhoandGitHub cc40f8f916 Merge pull request #661 from cbcoutinho/renovate/nextcloud-32-32.x
chore(deps): update nextcloud-32 docker tag to v32.0.8
2026-04-07 12:42:17 +02:00
Chris CoutinhoandGitHub c45b8ec3a6 Merge pull request #677 from cbcoutinho/renovate/nextcloud-33-33.x
chore(deps): update nextcloud-33 docker tag to v33.0.2
2026-04-07 12:42:05 +02:00
renovate-bot-cbcoutinho[bot]andGitHub be4aeeb1d5 chore(deps): update nextcloud-33 docker tag to v33.0.2 2026-04-07 10:19:32 +00:00
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
renovate-bot-cbcoutinho[bot]andGitHub 182efd19f7 chore(deps): update docker.io/library/nextcloud:32.0.8 docker digest to 509caed 2026-04-07 10:19:09 +00:00
Chris CoutinhoandClaude Opus 4.6 29fd0486c9 refactor: change OAuth scope separator from colon to dot for IDP compatibility
Many identity providers (AWS Cognito, Okta, Azure AD) reject or mishandle
colons in OAuth scope names. This migrates all custom scopes from
`resource:action` to `resource.action` format (e.g., `notes:read` →
`notes.read`), which is universally accepted and aligns with industry
conventions (Microsoft, Google).

Includes Alembic migration 004 for stored scope strings and ADR-024
documenting the rationale and RFC references.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 10:07:02 +02:00
Chris CoutinhoandClaude Opus 4.6 c8e4cbe825 feat: implement dynaconf configuration management (ADR-024 phases 1-3)
Replace ~80 manual os.getenv() calls in config.py with dynaconf-backed
configuration, enabling TOML file-based config alongside existing env
var support. Zero breaking changes — Settings dataclass interface and
all consumers unchanged.

Phase 1: Create settings.toml with all config keys and defaults,
.secrets.toml.example template, update .gitignore, initialize Dynaconf
instance with envvar_prefix=False and environment section switching.

Phase 2: Wire adapter — replace os.getenv() with _dynaconf.get() in
get_settings(), get_document_processor_config(), and deprecation/
dependency resolution helpers. Automatic type coercion eliminates ~30
manual int()/float()/.lower()=="true" patterns.

Phase 3: Add 12 declarative validators for port ranges, positive
integers, enum constraints, and float ranges. Remove redundant negative
overlap check from Settings.__post_init__.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-07 09:22:19 +02:00
Chris Coutinho f34c74afbc Merge remote-tracking branch 'origin/master' into docs/adr-024-dynaconf-config-management 2026-04-05 19:42:26 +02:00
github-actions[bot] 899b9c7191 bump: version 0.58.27 → 0.58.28 2026-04-05 17:40:51 +00:00
github-actions[bot] 9f632fa960 bump: version 0.68.2 → 0.68.3 2026-04-05 17:40:51 +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
Chris CoutinhoandClaude Opus 4.6 b07b713146 fix: address PR review feedback for client registry and DCR proxy
- Document wildcard scope policy in ClientRegistry class docstring
- Add hostname None guard and IPv6 loopback (::1) to redirect URI validation
- Simplify redirect URI scheme validation into single guard clause
- Add try/finally cleanup to DCR client deletion test
- Validate 302 Location header in unknown client rejection test
- Add unit tests for IPv6 loopback, malformed URIs, and DCR proxy paths

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 19:29:23 +02:00
Chris Coutinho 8e381a943c build: Update lockfile 2026-04-05 19:24:58 +02:00
github-actions[bot] a9ca0ce98f bump: version 0.58.26 → 0.58.27 2026-04-05 16:44:40 +00:00
Chris CoutinhoandGitHub f0c6dd6391 Merge pull request #676 from cbcoutinho/renovate/anthropics-claude-code-action-1.x
chore(deps): update anthropics/claude-code-action action to v1.0.89
2026-04-05 18:44:26 +02:00
Chris CoutinhoandClaude Opus 4.6 e28aa6eb3e docs: address review feedback on ADR-024 dynaconf configuration management
Address all 9 review points from PR #680:
- Fix post_hooks code examples to use correct return-dict signature
- Expand test isolation section with fixture factory, DynaconfDict, and
  reload patterns
- Document ignore_unknown_envvars silent failure mode in Negative
  Consequences and add env var audit to Phase 1 checklist
- Fix NEXTCLOUD_HOST validator to be unconditional (required in all modes)
- Document environments=True edge cases (unset mode, ENV_FOR_DYNACONF
  shadowing)
- Add upper bound to dynaconf version pin (>=3.2.13,<4.0)
- Tighten Pydantic Settings comparison to acknowledge 2.x TOML support
- Make .gitignore additions explicit in Phase 1 checklist
- Clarify that shell-level .env loading still works with load_dotenv=False

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 18:34:11 +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 CoutinhoandClaude Opus 4.6 5d0e4addd0 build: add dynaconf dependency for ADR-024 configuration management
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 15:00:17 +02:00
Chris CoutinhoandClaude Opus 4.6 3c6f67887f docs: address review feedback on ADR-024 dynaconf configuration management
Fix incorrect hook syntax (@hookable.post → Dynaconf(post_hooks=[...])),
broken Qdrant mutual exclusivity validator, missing root_path for settings
file resolution, and empty string defaults that bypass validators. Add test
isolation section, mark Phase 4 as optional/future with risk note, and
correct Pydantic comparison (already a project dependency).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 14:59:42 +02:00
Chris CoutinhoandClaude Opus 4.6 91e7665f41 refactor: consolidate ALLOWED_MCP_CLIENTS and add redirect URI validation
Merge ALLOWED_MCP_CLOUD_CLIENTS into a single ALLOWED_MCP_CLIENTS env var
that supports both simple client IDs and pipe-separated client_id|redirect_uri
entries. Enforce HTTPS for non-localhost redirect URIs, warn on malformed
entries, and use wildcard scopes for all static clients (upstream IdP enforces
actual scopes). Add deprecation warning for the old env var.

Also fixes DCR proxy error messages to reference only ALLOWED_MCP_CLIENTS and
use "Upstream" instead of "Nextcloud" for IdP-agnostic language. Enables
Login Flow v2 + DCR on the mcp-keycloak docker-compose service.

Adds 17 unit tests for ClientRegistry parsing/validation and 7 keycloak
integration tests for DCR lifecycle, AS metadata, and client authorization.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 14:33:29 +02:00
Chris CoutinhoandClaude Opus 4.6 e272a938df docs: add ADR-024 for dynaconf configuration management
Propose migrating from manual os.getenv() calls to dynaconf for
file-based configuration. Key decisions: envvar_prefix=False for
backward compatibility, MCP_DEPLOYMENT_MODE as environment switcher,
TOML settings files with secret separation, and incremental migration
via adapter pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-05 13:43:23 +02:00
Chris CoutinhoandClaude Opus 4.6 2a34015443 fix: support cloud OAuth clients and graceful DCR fallback
Claude AI (web) sends a Cognito-issued client_id with an HTTPS redirect
URI, but the client registry only supported localhost redirect URIs via
ALLOWED_MCP_CLIENTS. Add ALLOWED_MCP_CLOUD_CLIENTS env var for web-based
clients with format "client_id|redirect_uri".

Also fix the DCR proxy to return a clear error when the upstream IdP
(e.g. Cognito) doesn't support dynamic client registration, instead of
silently falling back to a Nextcloud-specific endpoint that fails.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 22:17:01 +02:00
github-actions[bot] 15016ba2f1 bump: version 0.58.25 → 0.58.26 2026-04-04 08:32:02 +00:00
github-actions[bot] cf34f202a6 bump: version 0.68.1 → 0.68.2 2026-04-04 08:32:02 +00: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
github-actions[bot] 1d7c85515a bump: version 0.58.24 → 0.58.25 2026-04-03 07:44:14 +00:00
Chris CoutinhoandGitHub 74f87aa492 Merge pull request #655 from cbcoutinho/renovate/docker.io-library-nextcloud-32.x
chore(deps): update docker.io/library/nextcloud docker tag to v32.0.8
2026-04-03 09:43:59 +02:00
renovate-bot-cbcoutinho[bot]andGitHub 514a4fd7ac chore(deps): update docker.io/library/nextcloud docker tag to v32.0.8 2026-04-03 04:17:09 +00:00
Chris CoutinhoandClaude Opus 4.6 5730313574 refactor: remove RFC 8693 token exchange and Keycloak OAuth implementation
Nextcloud doesn't support OAuth bearer tokens without upstream patches,
making the RFC 8693 token exchange path untestable and dead code.

Removed:
- nextcloud_mcp_server/auth/token_exchange.py (597 lines)
- nextcloud_mcp_server/auth/keycloak_oauth.py (586 lines)
- OAUTH_TOKEN_EXCHANGE deployment mode from AuthMode enum
- get_session_client_from_context() from context_helper.py
- get_session_token() from token_broker.py
- enable_token_exchange / token_exchange_cache_ttl config fields
- oauth_token_exchange_total Prometheus metric
- Keycloak fixture block from tests/conftest.py (~408 lines)
- Token exchange unit tests from test_config_validators.py,
  test_unified_verifier.py, test_management_status_endpoint.py

Preserved:
- Multi-audience OAuth mode (OAUTH_SINGLE_AUDIENCE)
- Login Flow v2 provisioning with elicitation support
- Token broker background token management
- All existing test coverage for non-exchange paths

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 00:22:20 +02:00
github-actions[bot] 8935ce1393 bump: version 0.58.23 → 0.58.24 2026-04-02 09:13:43 +00:00
Chris CoutinhoandGitHub 85c9ad188f Merge pull request #663 from cbcoutinho/renovate/anthropics-claude-code-action-1.x
chore(deps): update anthropics/claude-code-action action to v1.0.85
2026-04-02 11:13:27 +02:00