zyn.GuardDecision#
pub const GuardDecision = union(enum) {
allow,
unauthenticated,
forbidden,
not_found,
redirect_response: Redirect,
challenge_response: Challenge,
pub const Redirect = struct {
status: std.http.Status,
location: []const u8,
};
pub const Challenge = union(enum) {
basic: Response.BasicChallengeOptions,
bearer: Response.BearerChallengeOptions,
};
pub fn redirect(status: std.http.Status, location: []const u8) GuardDecision;
pub fn challenge(
comptime scheme: Response.ChallengeScheme,
options: switch (scheme) {
.basic => Response.BasicChallengeOptions,
.bearer => Response.BearerChallengeOptions,
},
) GuardDecision;
};