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

Optimize the Python sample #1269

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rayluo
Copy link
Member

@rayluo rayluo commented Feb 23, 2024

Reason for Change:

The previous sample was a proof-of-concept which only worked as a one-off script, and inefficiently. Problems include:

  • Even if you rerun the script immediately, a new file I/O and new http I/O would incur.
  • If a real app changes the previous sample into a long-lived daemon, the federation assertion would soon become outdated because the sample never reloads the assertion.

After this PR, the sample, if being used as a long-lived daemon, will automatically attempt token search from cache, and automatically reload the assertion when cache misses.

No.

No.

Requirements

  • squashed commits
  • included documentation
  • added unit tests and e2e tests (if applicable).

Issue Fixed:

Please answer the following questions with yes/no:

Does this change contain code from or inspired by another project? If so, did you notify the maintainers and provide attribution?

  • yes
  • no

Notes for Reviewers:
I do not have an AKS environment to actually run this change. The repo owner shall be able to test that part.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 51.66%. Comparing base (94283c5) to head (660d364).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1269   +/-   ##
=======================================
  Coverage   51.66%   51.66%           
=======================================
  Files          53       53           
  Lines        2938     2938           
=======================================
  Hits         1518     1518           
  Misses       1378     1378           
  Partials       42       42           

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

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.

2 participants