/** * GitHub App Authentication * * Generates JWTs and fetches installation access tokens for GitHub Apps. * Installation tokens allow the server to act as the app (not a user), * so PRs and commits are attributed to the app (e.g., "my-app[bot]"). */ import type { Result } from "../types.js"; import type { ResolvedGitHubAppConfig } from "../config/types.js"; /** * Installation token from GitHub */ export interface InstallationToken { token: string; expiresAt: Date; } /** * GitHub App auth error */ export interface AppAuthError { code: "JWT_FAILED" | "API_ERROR" | "NO_INSTALLATION" | "NETWORK_ERROR"; message: string; } /** * Generate a JWT for GitHub App authentication * * The JWT is used to authenticate as the app itself (not an installation). * It's valid for up to 10 minutes. */ export declare function generateAppJWT(config: ResolvedGitHubAppConfig): string; /** * GitHub App token provider * * Manages installation tokens with automatic refresh. * Tokens are cached per-owner and refreshed when they expire. */ export interface GitHubAppTokenProvider { /** * Get an installation token for the given owner. * Returns a cached token if still valid, otherwise fetches a new one. */ getToken(owner: string): Promise>; } /** * Create a GitHub App token provider */ export declare function createGitHubAppTokenProvider(config: ResolvedGitHubAppConfig): GitHubAppTokenProvider; //# sourceMappingURL=app-auth.d.ts.map