diff options
Diffstat (limited to 'octosentry/SecurityEventStore.swift')
| -rw-r--r-- | octosentry/SecurityEventStore.swift | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/octosentry/SecurityEventStore.swift b/octosentry/SecurityEventStore.swift index 26dcc16..8f3d0f5 100644 --- a/octosentry/SecurityEventStore.swift +++ b/octosentry/SecurityEventStore.swift @@ -134,6 +134,16 @@ final class SecurityEventStore { await refresh() } + /// Lists repos the current token can see, for the repo picker (#15). + /// Requires broader repo-access scope — throws if the token only has + /// the default security_events scope. + func fetchAccessibleRepos() async throws -> [String] { + guard let token = KeychainTokenStore.load() else { + throw GitHubAPIError.missingToken + } + return try await GitHubSecurityAPIClient(token: token).fetchAccessibleRepos() + } + /// Local-only triage state (spec §11) — no API write, no scope beyond /// read needed. Removes the event from the active stream. func markSeen(_ eventID: String) async { |
