| | | 1 | | using ArturRios.Mediator.Command; |
| | | 2 | | |
| | | 3 | | namespace ArturRios.Heimdall.Command.Input; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Intent to authenticate a Google account against a scope (UC-25, FR-GO-03…FR-GO-11) — signing |
| | | 7 | | /// the account up on its first use and signing it in on every later one. Distinct from |
| | | 8 | | /// <see cref="SetGoogleSignInCommand" />, which is UC-24's toggle for whether a scope allows this |
| | | 9 | | /// at all. |
| | | 10 | | /// </summary> |
| | | 11 | | /// <remarks> |
| | | 12 | | /// Carries no acting person: the endpoint is anonymous, and the only identity involved is the one |
| | | 13 | | /// the Google ID token asserts. No validator either — UC-25 defines no <c>400</c> flow and needs |
| | | 14 | | /// none, since an absent token fails verification (AF-25a, 401) and an empty scope identifier |
| | | 15 | | /// matches no scope (AF-25b, 403). Both are outcomes the use case already names. |
| | | 16 | | /// </remarks> |
| | | 17 | | public class GoogleSignInCommand : BaseCommand |
| | | 18 | | { |
| | | 19 | | /// <summary>Public identifier of the scope the account is signing in to (FR-GO-06).</summary> |
| | 186 | 20 | | public Guid ScopeId { get; set; } |
| | | 21 | | |
| | | 22 | | /// <summary>The Google ID token the caller obtained from Google, verified before it is trusted.</summary> |
| | 294 | 23 | | public string IdToken { get; set; } = string.Empty; |
| | | 24 | | |
| | | 25 | | /// <summary> |
| | | 26 | | /// Optional: the nonce the client sent Google when it asked for <see cref="IdToken" />. When |
| | | 27 | | /// present, the token's <c>nonce</c> claim must equal it exactly (FR-GO-20), which binds the |
| | | 28 | | /// token to the client's own sign-in attempt: a client can refuse a token that was not issued |
| | | 29 | | /// for its request. Absent or empty, nothing is compared. Whether a token is accepted rests on |
| | | 30 | | /// its signature, issuer, audience and expiry. |
| | | 31 | | /// </summary> |
| | 169 | 32 | | public string? Nonce { get; set; } |
| | | 33 | | } |