Skip to content

Commit 924268c

Browse files
authored
fix: align Confluence PAT auth type with server expectations (sooperset#549)
Change Confluence authentication type from "token" to "pat" to match server-side expectations and maintain consistency with Jira implementation. Previously, Confluence set auth_type="token" for personal access tokens while the server middleware and dependency injection expected "pat". This mismatch caused PAT authentication to fail completely in Confluence Data Center. This change updates: - ConfluenceConfig auth_type Literal from "token" to "pat" - All conditionals checking auth_type from "token" to "pat" - Aligns Confluence with Jira's existing "pat" convention BREAKING CHANGE: Existing configurations using auth_type="token" must be updated to auth_type="pat". Reported-by: Anton Malyshev
1 parent ab41a07 commit 924268c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/mcp_atlassian/confluence/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def __init__(self, config: ConfluenceConfig | None = None) -> None:
5656
cloud=True, # OAuth is only for Cloud
5757
verify_ssl=self.config.ssl_verify,
5858
)
59-
elif self.config.auth_type == "token":
59+
elif self.config.auth_type == "pat":
6060
logger.debug(
6161
f"Initializing Confluence client with Token (PAT) auth. "
6262
f"URL: {self.config.url}, "

src/mcp_atlassian/confluence/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class ConfluenceConfig:
2424
"""
2525

2626
url: str # Base URL for Confluence
27-
auth_type: Literal["basic", "token", "oauth"] # Authentication type
27+
auth_type: Literal["basic", "pat", "oauth"] # Authentication type
2828
username: str | None = None # Email or username
2929
api_token: str | None = None # API token used as password
3030
personal_token: str | None = None # Personal access token (Server/DC)
@@ -93,7 +93,7 @@ def from_env(cls) -> "ConfluenceConfig":
9393
raise ValueError(error_msg)
9494
else: # Server/Data Center
9595
if personal_token:
96-
auth_type = "token"
96+
auth_type = "pat"
9797
elif username and api_token:
9898
# Allow basic auth for Server/DC too
9999
auth_type = "basic"
@@ -167,7 +167,7 @@ def is_auth_configured(self) -> bool:
167167
# Partial configuration is invalid
168168
logger.warning("Incomplete OAuth configuration detected")
169169
return False
170-
elif self.auth_type == "token":
170+
elif self.auth_type == "pat":
171171
return bool(self.personal_token)
172172
elif self.auth_type == "basic":
173173
return bool(self.username and self.api_token)

0 commit comments

Comments
 (0)