srctree

Gregory Mullen parent 78ca0cd9 3331b7f8
enable stats

inlinesplit
src/main.zig added: 11, removed: 3, total 8
@@ -114,7 +114,7 @@ const Auth = struct {
.ctx = self,
.vtable = .{
.authenticate = null,
.valid = null,
.valid = valid,
.create_session = null,
.get_cookie = null,
.lookup_user = lookupUser,
@@ -122,6 +122,14 @@ const Auth = struct {
};
}
 
pub fn valid(_: *anyopaque, u: *const verse.auth.User) bool {
//const auth: *Auth = @ptrCast(@alignCast(ptr));
if (u.username) |_| {
return true;
}
return false;
}
 
pub fn lookupUser(ptr: *anyopaque, user_id: []const u8) !verse.auth.User {
log.debug("lookup user {s}", .{user_id});
const auth: *Auth = @ptrCast(@alignCast(ptr));
@@ -231,7 +239,7 @@ pub fn main() !void {
.mode = mode,
.auth = mtls.provider(),
.threads = 4,
.stats = true,
.stats = .{ .auth_mode = .sensitive },
}) catch {
if (@errorReturnTrace()) |trace| {
std.debug.dumpStackTrace(trace.*);