Skip to content

Commit efbfbce

Browse files
cbcoutinhoclaude
andcommitted
refactor: Remove NEXTCLOUD_OIDC_CLIENT_STORAGE environment variable
Remove the NEXTCLOUD_OIDC_CLIENT_STORAGE environment variable from all configuration files. OAuth client credentials are now always stored in the SQLite database, with no option to use a custom JSON file path. Changes: - Remove NEXTCLOUD_OIDC_CLIENT_STORAGE from .env.keycloak.sample - Remove NEXTCLOUD_OIDC_CLIENT_STORAGE from docker-compose.yml (mcp-oauth and mcp-keycloak services) - Remove NEXTCLOUD_OIDC_CLIENT_STORAGE from Helm deployment template - Remove NEXTCLOUD_OIDC_CLIENT_STORAGE from test_cli.py test assertions - Remove --headed flag from pytest addopts (use CLI arg instead) This simplifies configuration by enforcing a single storage mechanism (SQLite database) for OAuth client credentials. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 3ca1424 commit efbfbce

File tree

5 files changed

+1
-15
lines changed

5 files changed

+1
-15
lines changed

.env.keycloak.sample

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,6 @@ ENABLE_OFFLINE_ACCESS=true
6868
# Path to SQLite database for token storage
6969
TOKEN_STORAGE_DB=/app/data/tokens.db
7070

71-
# OAuth client storage (for MCP internal use)
72-
NEXTCLOUD_OIDC_CLIENT_STORAGE=/app/.oauth/keycloak_oauth_client.json
73-
7471
# ==============================================================================
7572
# DOCKER COMPOSE NOTES
7673
# ==============================================================================

charts/nextcloud-mcp-server/templates/deployment.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,6 @@ spec:
7878
value: {{ include "nextcloud-mcp-server.mcpServerUrl" . | quote }}
7979
- name: NEXTCLOUD_PUBLIC_ISSUER_URL
8080
value: {{ include "nextcloud-mcp-server.publicIssuerUrl" . | quote }}
81-
- name: NEXTCLOUD_OIDC_CLIENT_STORAGE
82-
value: "/app/.oauth/nextcloud_oauth_client.json"
8381
- name: NEXTCLOUD_OIDC_SCOPES
8482
value: {{ .Values.auth.oauth.scopes | quote }}
8583
{{- if .Values.auth.oauth.clientId }}

docker-compose.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ services:
9494
- NEXTCLOUD_HOST=http://app:80
9595
- NEXTCLOUD_MCP_SERVER_URL=http://localhost:8001
9696
- NEXTCLOUD_PUBLIC_ISSUER_URL=http://localhost:8080
97-
- NEXTCLOUD_OIDC_CLIENT_STORAGE=/app/.oauth/nextcloud_oauth_client.json
9897
- NEXTCLOUD_OIDC_SCOPES=openid profile email notes:read notes:write calendar:read calendar:write contacts:read contacts:write cookbook:read cookbook:write deck:read deck:write tables:read tables:write files:read files:write sharing:read sharing:write todo:read todo:write
9998

10099
# Refresh token storage (ADR-002 Tier 1)
@@ -159,7 +158,6 @@ services:
159158
- ENABLE_OFFLINE_ACCESS=true
160159
- TOKEN_ENCRYPTION_KEY=ESF1BvEQdGYsCluwMx9Cxvw3uh5pFowPH7Rg_nIliyo=
161160
- TOKEN_STORAGE_DB=/app/data/tokens.db
162-
- NEXTCLOUD_OIDC_CLIENT_STORAGE=/app/.oauth/external_idp_oauth_client.json
163161

164162
# OAuth scopes (optional - uses defaults if not specified)
165163
- NEXTCLOUD_OIDC_SCOPES=openid profile email offline_access notes:read notes:write calendar:read calendar:write contacts:read contacts:write cookbook:read cookbook:write deck:read deck:write tables:read tables:write files:read files:write sharing:read sharing:write todo:read todo:write

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Changelog = "https://github.com/cbcoutinho/nextcloud-mcp-server/blob/master/CHAN
4242

4343
[tool.pytest.ini_options]
4444
anyio_mode = "auto"
45-
addopts = "-p no:asyncio -x --headed" # Disable pytest-asyncio plugin, use only anyio
45+
addopts = "-p no:asyncio -x" # Disable pytest-asyncio plugin, use only anyio
4646
log_cli = 1
4747
log_cli_level = "ERROR"
4848
log_level = "ERROR"

tests/test_cli.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ def clean_env(monkeypatch):
2323
"NEXTCLOUD_PASSWORD",
2424
"NEXTCLOUD_OIDC_CLIENT_ID",
2525
"NEXTCLOUD_OIDC_CLIENT_SECRET",
26-
"NEXTCLOUD_OIDC_CLIENT_STORAGE",
2726
"NEXTCLOUD_OIDC_SCOPES",
2827
"NEXTCLOUD_OIDC_TOKEN_TYPE",
2928
"NEXTCLOUD_MCP_SERVER_URL",
@@ -240,9 +239,6 @@ def mock_get_app(*args, **kwargs):
240239
"NEXTCLOUD_OIDC_TOKEN_TYPE"
241240
),
242241
"NEXTCLOUD_MCP_SERVER_URL": os.environ.get("NEXTCLOUD_MCP_SERVER_URL"),
243-
"NEXTCLOUD_OIDC_CLIENT_STORAGE": os.environ.get(
244-
"NEXTCLOUD_OIDC_CLIENT_STORAGE"
245-
),
246242
}
247243
)
248244
raise SystemExit(0)
@@ -267,9 +263,6 @@ def mock_get_app(*args, **kwargs):
267263
)
268264
assert captured_env["NEXTCLOUD_OIDC_TOKEN_TYPE"] == "bearer"
269265
assert captured_env["NEXTCLOUD_MCP_SERVER_URL"] == "http://localhost:8000"
270-
assert (
271-
captured_env["NEXTCLOUD_OIDC_CLIENT_STORAGE"] == ".nextcloud_oauth_client.json"
272-
)
273266

274267

275268
def test_oauth_token_type_case_normalization(runner, clean_env, monkeypatch):

0 commit comments

Comments
 (0)