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 SRV discovery for permissions-api host #98

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

Conversation

mikemrm
Copy link
Contributor

@mikemrm mikemrm commented Nov 27, 2024

To better support failover to other regions without adding load balancer hops and latency, permissions hosts can now support SRV record discovery to discover additional hosts which can serve requests.

SRV records are looked up host configured for the permissions client. The SRV service looked up is permissions-api with protocol tcp. An example SRV lookup request would be for _permissions-api._tcp.iam.example.com. Where iam.example.com is the host configured for permissions.host.

For best backwards compatibility, these SRV records are optional and will fallback to using the value provided in permissions.host.

@codecov-commenter
Copy link

codecov-commenter commented Nov 27, 2024

Codecov Report

Attention: Patch coverage is 64.75827% with 277 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@abb6932). Learn more about missing BASE report.

Files with missing lines Patch % Lines
internal/selecthost/selector.go 72.07% 86 Missing and 7 partials ⚠️
internal/selecthost/options.go 0.00% 84 Missing ⚠️
internal/permissions/config.go 0.00% 59 Missing ⚠️
internal/selecthost/http.go 58.53% 13 Missing and 4 partials ⚠️
internal/selecthost/host.go 93.53% 10 Missing and 3 partials ⚠️
internal/permissions/client.go 0.00% 11 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main      #98   +/-   ##
=======================================
  Coverage        ?   35.33%           
=======================================
  Files           ?       27           
  Lines           ?     1715           
  Branches        ?        0           
=======================================
  Hits            ?      606           
  Misses          ?     1089           
  Partials        ?       20           
Flag Coverage Δ
unittests 35.33% <64.75%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@mikemrm mikemrm force-pushed the support-srv-records branch 3 times, most recently from afa25c0 to 9e4eb16 Compare December 2, 2024 14:22
@mikemrm mikemrm marked this pull request as ready for review December 2, 2024 14:25
@mikemrm mikemrm requested review from a team as code owners December 2, 2024 14:25
@mikemrm mikemrm force-pushed the support-srv-records branch 2 times, most recently from d4d686f to 00b69d2 Compare December 2, 2024 17:03
To better support failover to other regions without adding load balancer hops and latency,
permissions hosts can now support SRV record discovery to discover additional hosts which can serve requests.

SRV records are looked up host configured for the permissions client.
The SRV service looked up is `permissions-api` with protocol `tcp`.
An example SRV lookup request would be for `_permissions-api._tcp.iam.example.com`.
Where `iam.example.com` is the host configured for `permissions.host`.

For best backwards compatibility, these SRV records are optional and will fallback to using the value provided in `permissions.host`.

Additionally, to support retrying on failure, the permissions client was updated to support retrying auth checks if the response was not successful.
This ensures a seamless transition when a host has failed between health checks.

Signed-off-by: Mike Mason <[email protected]>
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