-
Notifications
You must be signed in to change notification settings - Fork 0
feat: implement HKP op=index (#137) #152
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
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a211d66
feat: implement HKP op=index support (#137)
bmarwell 25dd462
fix: address review comments on op=index implementation
bmarwell ded7efa
fix(index): add 'd' flag support and fix N+1 query on op=index
bmarwell dcb9343
fix(index): align review comments - migration note, unverified key fi…
bmarwell 85716c3
fix(index): add Optional-in-record exception, fix options parsing, ad…
bmarwell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...cation-api/src/main/java/io/github/bmarwell/keyserver/application/api/KeyIndexResult.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| /* | ||
| * Copyright (C) 2023-2024 The java-keyserver project team. | ||
| * | ||
| * SPDX-License-Identifier: EUPL-1.2 OR Apache-2.0 | ||
| */ | ||
| package io.github.bmarwell.keyserver.application.api; | ||
|
|
||
| import java.time.OffsetDateTime; | ||
| import java.util.List; | ||
| import java.util.Optional; | ||
|
|
||
| /// Full index entry for one key, used in `op=index` responses. | ||
| /// | ||
| /// Contains the key metadata fields needed for the HKP machine-readable | ||
| /// format (`pub:` line) plus all verified UIDs (`uid:` lines). | ||
| /// Only verified UIDs appear in {@code verifiedUids} — unverified UIDs | ||
| /// are never exposed. | ||
| /// | ||
| /// The {@code disabled} flag is a keyserver-administrative flag (HKP `d`). | ||
| /// It is independent of the OpenPGP {@code revoked} flag: an operator may | ||
| /// disable a key on this server without the key owner having revoked it. | ||
| public record KeyIndexResult( | ||
| String fingerprint, | ||
| int algorithm, | ||
| Optional<Integer> bitStrength, | ||
| OffsetDateTime creationTime, | ||
| Optional<OffsetDateTime> expirationTime, | ||
| boolean revoked, | ||
| boolean disabled, | ||
| List<UidIndexEntry> verifiedUids) {} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...ication-api/src/main/java/io/github/bmarwell/keyserver/application/api/UidIndexEntry.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| /* | ||
| * Copyright (C) 2023-2024 The java-keyserver project team. | ||
| * | ||
| * SPDX-License-Identifier: EUPL-1.2 OR Apache-2.0 | ||
| */ | ||
| package io.github.bmarwell.keyserver.application.api; | ||
|
|
||
| import java.time.OffsetDateTime; | ||
| import java.util.Optional; | ||
|
|
||
| /// Metadata for a single verified UID, used in `op=index` responses. | ||
| /// | ||
| /// All timestamps are `Optional` because UID packets do not always carry | ||
| /// creation/expiration data (older keys often omit them). | ||
| public record UidIndexEntry( | ||
| String uidRaw, | ||
| Optional<OffsetDateTime> creationTime, | ||
| Optional<OffsetDateTime> expirationTime, | ||
| boolean revoked) {} |
15 changes: 15 additions & 0 deletions
15
...lication-api/src/main/java/io/github/bmarwell/keyserver/application/api/package-info.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| /* | ||
| * Copyright (C) 2023-2024 The java-keyserver project team. | ||
| * | ||
| * SPDX-License-Identifier: EUPL-1.2 OR Apache-2.0 | ||
| */ | ||
|
|
||
| /// Primary application port: service interfaces and shared query result types. | ||
| /// | ||
| /// All types in this package are non-null by default (jspecify `@NullMarked`). | ||
| /// Fields and parameters that may be `null` are explicitly annotated with | ||
| /// {@link org.jspecify.annotations.Nullable}. | ||
| @NullMarked | ||
| package io.github.bmarwell.keyserver.application.api; | ||
|
|
||
| import org.jspecify.annotations.NullMarked; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.