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

Adding provider interface for fetching public keys of a service #2553

Merged
merged 1 commit into from
Mar 14, 2024

Conversation

psasidhar
Copy link
Contributor

@psasidhar psasidhar commented Mar 13, 2024

Description

Adding a provider interface for fetching public keys of a service
Extending Go provider interface with GetSuffixes method

Contribution Checklist:

  • The pull request does not introduce any breaking changes
  • I have read the contribution guidelines.
  • Create an issue and link to the pull request.

Attach Screenshots (Optional)

@@ -64,6 +64,9 @@ type Provider interface {
// GetSuffix returns the suffix for the current provider
GetSuffix() string

// GetSuffixes returns a list of suffixes for the current provider
GetSuffixes() []string
Copy link
Collaborator

Choose a reason for hiding this comment

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

why keep the GetSuffix() api? since this is an internal interface for now and only used within the server, we can just update all the provider implementations to use GetSuffixes() instead of maintaining a deprecated api

@@ -0,0 +1,19 @@
package com.yahoo.athenz.common.server.key;
Copy link
Collaborator

Choose a reason for hiding this comment

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

need the copyright header block

@@ -0,0 +1,28 @@
package com.yahoo.athenz.common.server.key;
Copy link
Collaborator

Choose a reason for hiding this comment

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

need the copyright header block

}

for (ServiceIdentity serviceIdentity: domainData.getServices()) {
if (serviceIdentity.getName().equalsIgnoreCase(domain + "." + service)) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

we should move the "domain + "." + service" outside of the for block so we're not executing for every call in the iteration since the value does not change

@psasidhar psasidhar force-pushed the spl-pvdr branch 3 times, most recently from 1b93b23 to f583b25 Compare March 13, 2024 23:05
Signed-off-by: Sasi Palaka <palakas@yahooinc.com>
@havetisyan havetisyan merged commit 4b25817 into AthenZ:master Mar 14, 2024
1 check passed
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