Skip to content

Conversation

@laura-rodriguez
Copy link
Contributor

@laura-rodriguez laura-rodriguez commented Feb 3, 2025

  • Includes and verifies @TriggerAu 's contribution (Fix issues with the retry logic in the OktaApiClient and OktaRetryApi classes (#61) #62)
  • Drops support for PS 6.x
  • Add tests that verify IWR doesn't throw when getting 4xx responses so proper retry evaluation is performed when it's applicable
  • Update package version to 2.0 in preparation for the upcoming major release
  • Sign third-party unsigned commits
  • Add a new OktaApiException, which is thrown when the Okta API returns 4xx/5xx responses
  • Add tests to verify that Okta Api Exceptions are properly constructed and thrown
  • Add additional tests to cover rate limit scenarios
  • Add (and skip) an E2E test to verify we're properly handling rate limits locally
  • Update readme with error handling info

ℹ️ I've also performed manual E2E tests to verify the proper handling of rate limits when hitting a real server.

Executed manual E2E test: https://github.com/okta/okta-powershell-cli/pull/78/files#diff-732ef03de60594f5094809340a1e6971f5e3f57eefdf712f5970a998e4c0e5b8R357

Fiddler log

A limited Fiddler report is attached to avoid sharing the test org details.

image

The E2E performs a loop of 20 calls to /api/v1/apps (Invoke-OktaListApplications). The report shows that after 10 subsequent calls to the apps API, the request fails with a 429. The Okta.PowerShell module waits and retries accordingly, and the Okta API returns 200 responses for the 10 subsequent calls after the 429 response. In the end, the Okta.PowerShell module made 21 requests to the Okta API (20 successful responses + 1 429 response)

TriggerAu and others added 8 commits February 3, 2025 17:32
…OktaRetryApi classes

* The OktaApiClient class was not correctly handling a non 200 response code
* The OktaRetryApi class was searching for a header field using incorrect classes
* The OktaRetryApi class was trying to parse a Unix Epoch number as a string date
* Also added a verbose message so teh user knows how long they waiting for the retry
…affect the pipeline

- Add unit tests that verify that IWR doesn't throw with 4xx responses so retry logic can be executed if it's applicable
- Drop support for PS 6.x version

Signed-off-by: Laura Rodriguez <rdz.maria.laura@gmail.com>
Signed-off-by: Laura Rodriguez <rdz.maria.laura@gmail.com>
Signed-off-by: Laura Rodriguez <rdz.maria.laura@gmail.com>
Signed-off-by: Laura Rodriguez <rdz.maria.laura@gmail.com>
…s 4xx/5xx responses

- Add tests to verify that Okta Api Exceptions are properly constructed and thrown
- Add additional tests to cover rate limit scenarios
- Add (and skip) an E2E test to verify we're properly handling rate limit locally
- Update readme with error handling info
aniket-okta
aniket-okta previously approved these changes Feb 10, 2025
Copy link
Contributor

@bryanapellanes-okta bryanapellanes-okta left a comment

Choose a reason for hiding this comment

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

Minor suggestion, but LGTM

Co-authored-by: Bryan Apellanes <63638027+bryanapellanes-okta@users.noreply.github.com>
Copy link
Contributor

@bryanapellanes-okta bryanapellanes-okta left a comment

Choose a reason for hiding this comment

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

👍

@laura-rodriguez laura-rodriguez merged commit 9e1e9fd into main Feb 13, 2025
5 checks passed
@laura-rodriguez laura-rodriguez deleted the lr-TriggerAu-Bug_RetryApiIssues-patch-7 branch February 13, 2025 17:33
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