feat(api-tokens): replace include_revoked boolean with StatusFilter enum#2746
Merged
Merged
Conversation
Introduce a StatusFilter enum in APITokenServiceListRequest with three values: ACTIVE (default), REVOKED, and ALL. The previous boolean include_revoked field is marked deprecated. The biz layer APITokenListFilters gains a StatusFilter typed field, replacing IncludeRevoked bool. The data layer query is updated to apply the appropriate Ent predicate per filter value. The CLI gains a --status flag accepting active/revoked/all. The --all flag is deprecated and maps to --status all at runtime. Closes chainloop-dev#2745 Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
STATUS_FILTER_ACTIVE = 0 is intentional: active tokens are the safe default, matching proto3 zero-value semantics and preserving backward compatibility with existing callers. Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
Signed-off-by: Miguel Martinez <miguel@chainloop.dev>
Piskoo
approved these changes
Feb 17, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
StatusFilterenum inAPITokenServiceListRequest(proto) with three values:ACTIVE(default/0),REVOKED, andALLbool include_revokedfield in the proto (kept for backward compatibility)APITokenListFiltersto use the typedAPITokenStatusFilterinstead ofIncludeRevoked boolRevokedAtIsNil(),RevokedAtNotNil(), or no predicate depending on the filter--status active|revoked|allflag tochainloop api-token list; deprecates--all(maps to--status all)Examples
List only active tokens (default behaviour, unchanged):
List only revoked tokens (new):
List all tokens regardless of status (replaces --all):
Using the deprecated --all flag still works but prints a warning:
Closes #2745