Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Adding dedicated and efficient DAO method to support listing expired … #1185

Merged
merged 1 commit into from Jan 17, 2023

Conversation

mmontgomery-square
Copy link
Contributor

…secret names

@mmontgomery-square mmontgomery-square requested a review from a team as a code owner January 13, 2023 06:23
@coveralls
Copy link

Coverage Status

Coverage: 77.322% (+0.02%) from 77.302% when pulling 1e35c3f on mmontgomery/datasec-816 into 17ac31e on master.

Comment on lines +280 to +289
public List<String> listExpiringSecretNames(Instant notAfterInclusive) {
List<String> expiringSecretNames = dslContext
.select()
.from(SECRETS)
.where(SECRETS.CURRENT.isNotNull())
.and(SECRETS.EXPIRY.greaterOrEqual(Instant.now().getEpochSecond()))
.and(SECRETS.EXPIRY.lessThan(notAfterInclusive.getEpochSecond()))
.fetch(SECRETS.NAME);
return ImmutableList.copyOf(expiringSecretNames);
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Simple and straightforward.

public Iterable<String> secretListingExpiring(@Auth AutomationClient automationClient, @PathParam("time") Long time) {
public Iterable<String> listExpiringSecretNames(@Auth AutomationClient automationClient, @PathParam("time") Long notAfterInclusiveUnixEpochSeconds) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

With anything that has units or denotes a boundary (or both, in this case) I like the name to be very clear about what it is we're dealing with.

@mmontgomery-square mmontgomery-square merged commit 0a426fc into master Jan 17, 2023
@mmontgomery-square mmontgomery-square deleted the mmontgomery/datasec-816 branch January 17, 2023 17:47
chloe-loo pushed a commit that referenced this pull request Jan 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants