feat: add Atlassian Cloud API token authentication - #17
Merged
Conversation
- Remove EnvConfig struct and replace with resolve_auth() function that intelligently handles multiple auth methods - Implement priority-based authentication: Personal Access Token (Bearer) takes precedence over Cloud credentials (Basic) - Add resolve_auth() with comprehensive validation that checks for empty and whitespace-only values - Implement RFC 4648 standard Base64 encoding as base64_encode() helper function - Update auth_headers() and binary_auth_headers() to accept pre-formatted Authorization header values - Add 12 comprehensive unit tests covering Base64 encoding edge cases, RFC 4648 test vectors, and authentication scenarios - Improve error messages to specifically identify which authentication variable is missing or misconfigured - Update main.rs to call resolve_auth() and pass Authorization header value to HTTP functions
takeoverjp
approved these changes
Aug 19, 2026
takeoverjp
left a comment
Contributor
There was a problem hiding this comment.
@karangehlod
Thank you very much for your contribution! 🎉
LGTM 👍
I cannot confirm Atlassian Cloud API token authentication, due to lack of environment, but trust you!
Thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for Atlassian Cloud API token authentication (HTTP Basic auth)
alongside existing PAT-based Bearer auth. Cloud users can now authenticate
using their email and API token instead of requiring a Personal Access Token.
Changes
CONFLUENCE2MD_USERNAMEandCONFLUENCE2MD_API_TOKENresolve_auth()replacesget_required_env()with clear error messages/wikicontext path in Cloud URLs (required for Cloud API calls)--helptext documenting all auth optionsTesting
mise run cipasses (fmt, clippy, build, 163 tests, machete)No new dependencies
Base64 encoding implemented inline per project policy.