SIGN IN SIGN UP

[Confluence] Fix pagination for get_all_* methods and unify _get_paged across Cloud/Server (#1616)

* [Confluence] Fix pagination for get_all_* methods and unify _get_paged across Cloud/Server

Fixes #1598
Fixes #1480

- Switch 10 get_all_* methods to use _get_paged for full pagination
- Unify _get_paged into ConfluenceBase (remove Cloud/Server duplicates)
- Handle _links.next as both string and dict formats
- Fix relative pagination URLs by prepending base URL correctly
- Fix Cloud api_root from wiki/api/v2 to wiki/rest/api (endpoints use v1 paths)
- Recognize api.atlassian.com in Cloud detection; support explicit cloud= kwarg
- Add routing tests and pagination edge-case tests for both Cloud and Server

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* [Confluence] Fix CodeQL incomplete URL substring sanitization

Use urlparse to extract and check the hostname directly instead of
naive substring matching, preventing spoofing via paths like
evil.com/atlassian.net/...

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* [Confluence] Simplify PR scope: revert unrelated Cloud API changes

- Revert Cloud api_version from "latest" back to "2" (original)
- Revert Cloud api_root from "wiki/rest/api" back to "wiki/api/v2" (original)
- Revert Cloud URL construction: remove api_root suffix appended to self.url
- Simplify _get_paged relative URL resolution: drop api_root-stripping
  branch (was only needed due to the Cloud URL change) and use
  urlparse(self.url).netloc directly
- Update test_init_defaults assertions to match reverted Cloud defaults

The Cloud api_version/api_root/URL changes were unrelated to #1598 and
constituted a breaking change for existing Cloud users. The complex
api_root stripping logic in _get_paged was a direct consequence of that
change and is no longer needed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Z
Zircoz committed
63e744f89bef206cd5949f3471b1185d897e00ec
Parent: c924704
Committed by GitHub <noreply@github.com> on 3/13/2026, 9:39:39 AM