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

fix: updating Konnect auth logic to properly handle geo rewrites #146

Merged
merged 1 commit into from
Nov 21, 2024

Conversation

tjasko
Copy link
Member

@tjasko tjasko commented Nov 19, 2024

Summary

As Konnect's authorization service is not deployed across all regions, the global endpoint is used for certain API calls. When the organization info is fetched, the hostname within the provided base URL is then rewritten to the relevant global endpoint.

This rewrite logic was unable to handle any number of geos, relying on hard coded logic instead for specific geos. This logic has been updated to allow callers of this library to talk to multiple geos; this includes new geos that may not exist as of this writing.

decK will also be updated to use this new change.

Full changelog

  • fix: updating Konnect auth logic to properly handle geo rewrites

Issues resolved

N/A

Documentation

N/A

Testing

  • Unit tests
  • E2E tests
  • Manual testing on Universal
  • Manual testing on Kubernetes

@codecov-commenter
Copy link

codecov-commenter commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 28.77%. Comparing base (e8b77b9) to head (c4dfb8a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #146      +/-   ##
==========================================
+ Coverage   28.50%   28.77%   +0.26%     
==========================================
  Files         106      106              
  Lines       15851    15852       +1     
==========================================
+ Hits         4519     4561      +42     
+ Misses      10869    10812      -57     
- Partials      463      479      +16     

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


🚨 Try these New Features:

Copy link
Member

@pmalek pmalek left a comment

Choose a reason for hiding this comment

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

This looks like it's solving the same problem as Kong/sdk-konnect-go@4f50eb7 for sdk-konnect-go.

BTW: I've just realized now that this project also contains manually maintained Konnect client. Created #147 to migrate off of it to using https://github.com/Kong/sdk-konnect-go/.

@tjasko
Copy link
Member Author

tjasko commented Nov 20, 2024

Thanks @pmalek! Please let me know once we're able to merge & tag this change.

As Konnect's authorization service is not deployed across all regions,
the global endpoint is used for certain API calls. When the organization
info is fetched, the hostname within the provided base URL is then
rewritten to the relevant global endpoint.

This rewrite logic was unable to handle any number of geos, relying on
hard coded logic instead for specific geos. This logic has been updated
to allow callers of this library to talk to multiple geos; this includes
new geos that may not exist as of this writing.
@pmalek pmalek force-pushed the fix/api-endpoint-geo-rewrite branch from 7601574 to c4dfb8a Compare November 21, 2024 09:33
@pmalek pmalek merged commit ae3de6e into Kong:main Nov 21, 2024
13 checks passed
@pmalek
Copy link
Member

pmalek commented Nov 21, 2024

@tjasko merged and released now https://github.com/Kong/go-database-reconciler/releases/tag/v1.16.1

@tjasko tjasko deleted the fix/api-endpoint-geo-rewrite branch November 21, 2024 22:02
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