Skip to content

BearerAuth Bearer Authentication Handler - #1953

Open
bmos wants to merge 37 commits into
move-coop:mainfrom
bmos:bearer_auth
Open

bmos wants to merge 37 commits into
move-coop:mainfrom
bmos:bearer_auth

Conversation

@bmos

@bmos bmos commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

What is this change?

  • Requests authentication handlers can be a useful way to handle common authorization solutions, and we have multiple connectors that all use header-based authentication tokens. Many with the exact same "Authorization": "Bearer API_KEY" format.

  • Add generic authentication handler for requests to support header-based token authentication without manually editing headers. Example:

    import requests
    from parsons.utilities.bearer_auth import BearerAuth
    
    auth = BearerAuth("YOUR API KEY HERE")
    res = requests.get("https://api.example.com/", auth=auth)
    
    print(res.request.headers["Authorization"])  # Output is "Bearer YOUR API KEY HERE"
  • Update existing connectors that use header-based token authentication to use this requests-native approach.

Considerations for discussion

  • Are we happy with the name BearerAuth or should it be something else since not all implementations use "Bearer" as the token name?

How to test the changes (if needed)

  • CI tests should be adequate

Breaking Changes

Breaking changes are changes to our public API which may require existing users to change their code. If there are no breaking changes, any existing parsons user should not need to do anything after updating their parsons version.

Does this PR introduce breaking changes?
  • label: Breaking change — This PR introduces one or more breaking changes.
  • label: Non-breaking change — This PR does not introduce one or more breaking changes.

Details (if needed)

  • All class properties that aren't used anymore have been marked as deprecated, with their functionality preserved.
  • The only edge-case where a breaking change could be interpreted to have occurred would be if a user was manually extracting the api key/token from where it was previously hard-coded into a headers dictionary, although I would not say this is a part of our public API.

@github-actions github-actions Bot added testing Work type - writing or changing code tests for core Parsons features or Parsons connectors python Pull requests that update Python code non-breaking-change Status - Indicates that the code in this PR does not have any breaking changes. breaking-change applied only to PRs, indicates when something has a breaking change to be flagged in release notes and removed non-breaking-change Status - Indicates that the code in this PR does not have any breaking changes. breaking-change applied only to PRs, indicates when something has a breaking change to be flagged in release notes labels Sep 9, 2026
@bmos bmos mentioned this pull request Sep 9, 2026
4 tasks
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  parsons/actblue
  actblue.py
  parsons/action_builder
  action_builder.py
  parsons/action_kit
  action_kit.py
  parsons/action_network
  action_network.py
  parsons/airmeet
  airmeet.py
  parsons/auth0
  auth0.py 81, 138-139, 141, 162, 194
  parsons/bloomerang
  bloomerang.py 62
  parsons/community
  community.py 50
  parsons/empower
  empower.py
  parsons/formstack
  formstack.py 36
  parsons/freshdesk
  freshdesk.py
  parsons/github
  github.py
  parsons/hustle
  hustle.py 53, 75-76, 95, 110-114
  parsons/mobilecommons
  mobilecommons.py 50
  parsons/mobilize_america
  ma.py 45
  parsons/nation_builder
  nation_builder.py
  parsons/pdi
  pdi.py 73, 78, 111-115, 126-132
  parsons/quickbase
  quickbase.py
  parsons/quickbooks
  quickbookstime.py 40
  parsons/redash
  redash.py
  parsons/shopify
  shopify.py 54, 56
  parsons/sisense
  sisense.py
  parsons/targetsmart
  targetsmart_api.py
  parsons/turbovote
  turbovote.py
  parsons/utilities
  bearer_auth.py
Project Total  

The report is truncated to 25 files out of 29. To see the full report, please visit the workflow summary page.

This report was generated by python-coverage-comment-action

@bmos
bmos force-pushed the bearer_auth branch 2 times, most recently from 7b0bd9a to 37fd0a0 Compare September 9, 2026 19:29
@shaunagm shaunagm added the highlight in release notes used to flag items to highlight in our release notes communication label Sep 10, 2026
bmos added a commit to bmos/parsons that referenced this pull request Sep 13, 2026
@bmos
bmos force-pushed the bearer_auth branch 6 times, most recently from 19a7e2a to d51fdd4 Compare September 18, 2026 16:13
@github-actions github-actions Bot added the documentation Work type - improvements or additions to documentation label Sep 18, 2026
@github-actions github-actions Bot removed the documentation Work type - improvements or additions to documentation label Sep 18, 2026
Comment thread test/test_utilities/test_bearer_auth.py Fixed
@github-actions github-actions Bot added the documentation Work type - improvements or additions to documentation label Sep 18, 2026
@github-actions github-actions Bot removed the documentation Work type - improvements or additions to documentation label Sep 18, 2026
Comment thread test/test_utilities/test_bearer_auth.py Fixed
bmos added a commit to bmos/parsons that referenced this pull request Sep 18, 2026
bmos added a commit to bmos/parsons that referenced this pull request Sep 19, 2026
bmos added a commit to bmos/parsons that referenced this pull request Sep 19, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Work type - improvements or additions to documentation highlight in release notes used to flag items to highlight in our release notes communication non-breaking-change Status - Indicates that the code in this PR does not have any breaking changes. python Pull requests that update Python code testing Work type - writing or changing code tests for core Parsons features or Parsons connectors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants