Skip to content
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

feat: Organizations Api uptake for twilio-python #815

Open
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

AsabuHere
Copy link
Contributor

Fixes

A short description of what this PR does.

Checklist

  • I acknowledge that all my contributions will be made under the project's license
  • I have made a material change to the repo (functionality, testing, spelling, grammar)
  • I have read the Contribution Guidelines and my PR follows them
  • I have titled the PR appropriately
  • I have updated my branch with the main branch
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation about the functionality in the appropriate .md file
  • I have added inline documentation to the code I modified

If you have questions, please file a support ticket, or create a GitHub Issue in this repository.

twilio/authStrategy/authStrategy.py Outdated Show resolved Hide resolved
twilio/authStrategy/authStrategy.py Outdated Show resolved Hide resolved
twilio/base/client_base.py Outdated Show resolved Hide resolved
twilio/http/bearer_token_http_client.py Outdated Show resolved Hide resolved
twilio/base/client_base.py Show resolved Hide resolved
Copy link
Contributor

@tiwarishubham635 tiwarishubham635 left a comment

Choose a reason for hiding this comment

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

LGTM

twilio/base/client_base.py Show resolved Hide resolved
twilio/base/client_base.py Outdated Show resolved Hide resolved
twilio/http/token_manager_initializer.py Outdated Show resolved Hide resolved

if not self.username or not self.password:
raise TwilioException("Credentials are required to create a TwilioClient")
self.credential_provider = credential_provider or None
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Check this with Kridai, if existing customers use TwilioException - this is a breaking change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Check if the exception being thrown as 401 is getting wrapped in TwilioException and being sent to customer

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For the below cases

  • No username password provided
  • Wrong username password provided
    TwilioRestException is thrown now

Is this a breaking change?

twilio/base/client_base.py Outdated Show resolved Hide resolved
twilio/base/client_base.py Outdated Show resolved Hide resolved
twilio/http/http_client.py Outdated Show resolved Hide resolved
twilio/http/http_client.py Outdated Show resolved Hide resolved
from twilio.base.domain import Domain
from typing import Optional
from twilio.rest import Client

Copy link
Contributor Author

Choose a reason for hiding this comment

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

generate from librarian and add it and commit it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

librarian generation has issues currently. This needs to be fixed before generating and adding these files

twilio/http/http_client.py Outdated Show resolved Hide resolved
exp = decoded.get('exp')

if exp is None:
return True # No expiration time present, consider it expired

Check failure

Code scanning / SonarCloud

JWT should be signed and verified High

Don't use a JWT token without verifying its signature. See more on SonarCloud
exp = decoded.get('exp')

if exp is None:
return True # No expiration time present, consider it expired

Check failure

Code scanning / SonarCloud

JWT should be signed and verified

<!--SONAR_ISSUE_KEY:AZJhAlYCyje6SmAfcspM-->Don't use a JWT token without verifying its signature. <p>See more on <a href="https://sonarcloud.io/project/issues?id=twilio_twilio-python&issues=AZJhAlYCyje6SmAfcspM&open=AZJhAlYCyje6SmAfcspM&pullRequest=815">SonarCloud</a></p>
Copy link

sonarcloud bot commented Oct 6, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
18.0% Coverage on New Code (required ≥ 80%)
D Security Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

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