Skip to content

[SDAN-752] Allow Basic auth for ATOM and RSS#1418

Merged
marwoodandrew merged 2 commits intosuperdesk:developfrom
marwoodandrew:SDAN-752
Jan 9, 2026
Merged

[SDAN-752] Allow Basic auth for ATOM and RSS#1418
marwoodandrew merged 2 commits intosuperdesk:developfrom
marwoodandrew:SDAN-752

Conversation

@marwoodandrew
Copy link
Copy Markdown
Contributor

Purpose

Allow the ATOM and RSS News API endpoints to authenticate using Basic Authentication

What has changed

An additional Authentication method has been added to the required endpoints

Steps to test

Use Postman or Curl or similar utility to make requests against the ATOM and RSS endpoints

Checklist

  • This pull request is not adding new forms that use redux
  • This pull request is adding missing TypeScript types to modified code segments where it's easy to do so with confidence
  • This pull request is replacing lodash.get with optional chaining for modified code segments

Resolves: SDAN-752

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 5 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +75 to +82
if supports_basic_auth and auth.lower().startswith("basic"):
base64_payload = auth.split(" ", 1)[1]

credentials_bytes = base64.b64decode(base64_payload)
credentials = credentials_bytes.decode("utf-8")
username, password = credentials.split(":", 1)

return username if username else password
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Basic Auth parsing logic lacks error handling for malformed input. The code should handle potential exceptions from:

  1. auth.split(" ", 1)[1] when there's no space after "Basic"
  2. base64.b64decode(base64_payload) when the payload is invalid base64
  3. credentials_bytes.decode("utf-8") when the decoded bytes are not valid UTF-8
  4. credentials.split(":", 1) when the credentials don't contain a colon

Without proper error handling, malformed Basic Auth headers will cause unhandled exceptions. Consider wrapping this logic in a try-except block and returning None on any parsing errors, allowing the authentication to fail gracefully.

Copilot uses AI. Check for mistakes.
@marwoodandrew marwoodandrew merged commit 0153731 into superdesk:develop Jan 9, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants