| 1 | namespace AgentForge.Abstractions; |
| 2 | |
| 3 | public sealed record ForgeOAuthSignInContext( |
| 4 | string Provider, |
| 5 | string SubjectId, |
| 6 | string Login, |
| 7 | string DisplayName, |
| 8 | string? GitHubAccessToken); |
| 9 | |
| 10 | public sealed record ForgeOAuthSignInDecision(bool Allowed, string? Reason = null) |
| 11 | { |
| 12 | public static ForgeOAuthSignInDecision Allow() => new(true); |
| 13 | |
| 14 | public static ForgeOAuthSignInDecision Deny(string reason) => new(false, reason); |
| 15 | } |
| 16 | |
| 17 | /// <summary>Plugin hook: allow or deny OAuth sign-in before API token is issued.</summary> |
| 18 | public interface IForgeOAuthSignInGate |
| 19 | { |
| 20 | ValueTask<ForgeOAuthSignInDecision> EvaluateAsync( |
| 21 | ForgeOAuthSignInContext context, |
| 22 | CancellationToken cancellationToken); |
| 23 | } |
| 24 | |
View only · write via MCP/CIDE