Skip to content

utils.py: fix types in docstrings for base64url_encode/decode #269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2025

Conversation

romanek-adam
Copy link
Contributor

No description provided.

@codecov
Copy link

codecov bot commented Jul 12, 2021

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.94%. Comparing base (be8e914) to head (f5d96d8).
Report is 43 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #269   +/-   ##
=======================================
  Coverage   92.94%   92.94%           
=======================================
  Files          15       15           
  Lines        1418     1418           
=======================================
  Hits         1318     1318           
  Misses        100      100           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@clesiemo3
Copy link

good fix for the same issue I'm having with PyCharm warning that I'm passing bytes as well as my initial confusion getting an exception when passing a string. I'm not sure why this PR hasn't been merged yet.

@asherf asherf closed this May 28, 2025
@asherf asherf reopened this May 28, 2025
@asherf asherf requested a review from Copilot May 28, 2025 17:13
Copy link

@Copilot 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

This PR updates the docstring parameter types for the base64url_encode and base64url_decode helpers to correctly reflect that they operate on bytes, not strings.

  • Changed the input parameter type in both functions from str to bytes in docstrings.
  • Adjusted descriptions to indicate byte inputs rather than string inputs.

@@ -67,7 +67,7 @@ def base64url_decode(input):
"""Helper method to base64url_decode a string.

Args:
input (str): A base64url_encoded string to decode.
input (bytes): A base64url_encoded string (bytes) to decode.
Copy link
Preview

Copilot AI May 28, 2025

Choose a reason for hiding this comment

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

[nitpick] The docstring repeats the type and uses 'base64url_encoded string'; consider simplifying to bytes: base64url-encoded value to decode.

Suggested change
input (bytes): A base64url_encoded string (bytes) to decode.
input (bytes): base64url-encoded value to decode.

Copilot uses AI. Check for mistakes.

@@ -82,7 +82,7 @@ def base64url_encode(input):
"""Helper method to base64url_encode a string.

Args:
input (str): A base64url_encoded string to encode.
input (bytes): A base64url_encoded string (bytes) to encode.
Copy link
Preview

Copilot AI May 28, 2025

Choose a reason for hiding this comment

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

The description incorrectly implies the input is already encoded. It should read something like bytes: raw data to encode using base64url.

Suggested change
input (bytes): A base64url_encoded string (bytes) to encode.
input (bytes): Raw binary data (bytes) to encode using base64url.

Copilot uses AI. Check for mistakes.

@asherf asherf merged commit 50d4390 into mpdavis:master May 28, 2025
20 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