Skip to content

chore: optimize the Python sample#1269

Merged
enj merged 1 commit intoAzure:mainfrom
rayluo:python-sample-improvement
Apr 22, 2025
Merged

chore: optimize the Python sample#1269
enj merged 1 commit intoAzure:mainfrom
rayluo:python-sample-improvement

Conversation

@rayluo
Copy link
Contributor

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

@rayluo rayluo requested review from aramase and enj as code owners February 23, 2024 21:28
@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.

Signed-off-by: Ray Luo <rayluo.mba@gmail.com>
Signed-off-by: Monis Khan <mok@microsoft.com>
@enj enj force-pushed the python-sample-improvement branch from 254d115 to d80db28 Compare April 22, 2025 14:52
@enj enj changed the title Optimize the Python sample chore: optimize the Python sample Apr 22, 2025
@Azure Azure deleted a comment from azure-pipelines bot Apr 22, 2025
@Azure Azure deleted a comment from azure-pipelines bot Apr 22, 2025
@enj enj merged commit 842268d into Azure:main Apr 22, 2025
12 of 13 checks passed
@rayluo rayluo deleted the python-sample-improvement branch April 22, 2025 16:07
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.

5 participants