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

Add support for get_app() with App authentication #2549

Merged
merged 5 commits into from Jun 16, 2023

Commits on Jun 16, 2023

  1. support get_app() for App authentication mode

    An authenticated app can call `/app` to get details about itself.
    
    Authentication must be done using jwt for authentication or it will fail with
    an error like https://gist.github.com/chantra/209819389b2dec6cc6e03a13d301f5e5
    chantra committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    33421c8 View commit details
    Browse the repository at this point in the history
  2. * move assertWarning and assertWarnings into BasicTestCase so w…

    …e can re-use it across tests.
    
    * assert deprecation warning and transparently call GithubIntegration.get_app() when no slug is provided
    * check that deprecation warning happens in test case
    * assert that auth is an AppAuth in GithubIntegration and test it
    chantra committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    8ad7598 View commit details
    Browse the repository at this point in the history
  3. Replace datetime.utcnow() with datetime.timezone.utc

    https://docs.python.org/dev/whatsnew/3.12.html
    
    > datetime.datetime’s utcnow() and utcfromtimestamp() are deprecated and will be removed in a future version. Instead, use timezone-aware objects to represent datetimes in UTC: respectively, call now() and fromtimestamp() with the tz parameter set to datetime.UTC. (Contributed by Paul Ganssle in gh-103857.)
    
    `datetime.UTC is new in 3.11, but is essentially an alias to datetime.timezone.utc
    
    This change replaces the occurences of utcnow() with datetime.timezone.utc so it works on older python releases.
    chantra committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    3f08319 View commit details
    Browse the repository at this point in the history
  4. Introduce assertWarningIn helper

    In some cases, some deprecation messages may be generated by third-party libraries depedending
    on the python version we are using.
    
    This is a problem when we want to insure that a specific message is raised.
    
    This change introduce `assertWarningIn`, which will check if a specific deprecation warning
    is in the list of warnings.
    chantra committed Jun 16, 2023
    Configuration menu
    Copy the full SHA
    b086b2e View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    88df8f4 View commit details
    Browse the repository at this point in the history