namespace ApiOPE.Security;

public sealed record OpeRequestContext(
    string ClientToken,
    string Resource,
    string Uuid,
    Guid TransactionId,
    long Timestamp,
    string? Version);

public static class OpeRequestContextStore
{
    private static readonly object Key = new();

    public static void Set(HttpContext context, OpeRequestContext requestContext)
        => context.Items[Key] = requestContext;

    public static OpeRequestContext? Get(HttpContext context)
        => context.Items.TryGetValue(Key, out var value) ? value as OpeRequestContext : null;
}
