Skip to content
Sarj Workspace Sync

github-access-audit/service

@sarj-ai/workspace-sync/github-access-audit/service ยท Source

import type { GitHubAccessSnapshot } from "./git-hub-access-audit-client.ts";
import type { GoogleAuthoritySnapshot } from "./google-contracts.ts";
import type { GithubAccessAuditReport } from "./model.ts";
import { type ReviewedGitHubDirectGrantRetention } from "./reviewed-direct-grants.ts";
import { type ReviewedGitHubTeamMembership } from "./reviewed-team-memberships.ts";
export interface GithubAccessAuditPolicy {
activeOutsideRootRemovals: "blocked" | "reviewed";
excludedGroupEmails: readonly string[];
membershipGraceMs: number;
organization: string;
policyVersion: string;
reportsIngestionMarginMs: number;
reviewedDirectGrantRetentions?: readonly ReviewedGitHubDirectGrantRetention[];
reviewedTeamMemberships?: readonly ReviewedGitHubTeamMembership[];
rootGroupEmail: string;
teamMappings: Readonly<Record<string, string>>;
teamPins: Readonly<Record<string, number>>;
unmanagedGithubTeams: readonly string[];
}
export interface GithubAccessAuditSources {
github: {
capture(deadlineAt?: number): Promise<GitHubAccessSnapshot>;
};
google: {
capture(request: {
mappedGroupEmails: readonly string[];
reportsLookbackDays?: number;
rootGroupEmail: string;
}, runId: string, deadlineAt?: number): Promise<GoogleAuthoritySnapshot>;
};
}
export interface IGithubAccessAuditService {
run(runId?: string): Promise<GithubAccessAuditReport>;
}
export declare class GithubAccessAuditService implements IGithubAccessAuditService {
#private;
constructor(sources: GithubAccessAuditSources, policy: GithubAccessAuditPolicy & {
deadlineMs: number;
reportsLookbackDays: number;
});
run(runId?: string): Promise<GithubAccessAuditReport>;
}
export declare function buildGithubAccessAuditReport(google: GoogleAuthoritySnapshot, github: GitHubAccessSnapshot, policy: GithubAccessAuditPolicy, now?: Date, runId?: string): Promise<GithubAccessAuditReport>;