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

feat: Add scope to CertificateStore with issuerPrivateAddress #228

Merged
merged 2 commits into from
Mar 9, 2022

Conversation

sdsantos
Copy link
Collaborator

@sdsantos sdsantos commented Mar 9, 2022

@Throws(KeyStoreBackendException::class)
suspend fun save(certificate: Certificate, chain: List<Certificate> = emptyList()) {
suspend fun save(
scope: Scope,
Copy link
Member

Choose a reason for hiding this comment

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

In all these methods, I think the scope shouldn't be the first param because it's secondary. For example:

  • save(cert, scope, ...).
  • retrieveLatest(privateAddress, scope, ...)
  • And so on

@@ -8,43 +8,55 @@ import tech.relaycorp.relaynet.wrappers.x509.Certificate

abstract class CertificateStore {

enum class Scope(val value: String) {
Copy link
Member

Choose a reason for hiding this comment

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

For consistency with the rest of the library, can you please make this a top level definition named CertificateScope?


assertEquals(certificate, certificationPath.leafCertificate)
assertEquals(certificateChain, certificationPath.chain)
}

@Test
fun `Existing certification path of another scope should not be returned`() = runBlockingTest {
Copy link
Member

Choose a reason for hiding this comment

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

Please add a test like this for each of the other methods altered in this PR.

@sdsantos sdsantos changed the title feat: Add scope to CertificateStore feat: Add scope to CertificateStore with issuerPrivateAddress Mar 9, 2022
Copy link
Member

@gnarea gnarea left a comment

Choose a reason for hiding this comment

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

Obrigado! LGTM 👍🏾

@gnarea gnarea added the automerge Allow kodiak to automerge commit when all checks pass label Mar 9, 2022
@kodiakhq kodiakhq bot merged commit a1d6a09 into master Mar 9, 2022
@kodiakhq kodiakhq bot deleted the certificate-store-scope branch March 9, 2022 12:08
@github-actions
Copy link

github-actions bot commented Mar 9, 2022

🎉 This PR is included in version 1.63.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Allow kodiak to automerge commit when all checks pass released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants