| 1 | const std = @import("std"); |
| 2 | const oauth2 = @import("oauth2"); |
| 3 | const nio = @import("nio"); |
| 4 | const http = @import("http"); |
| 5 | const json = @import("json"); |
| 6 | |
| 7 | test { |
| 8 | _ = &oauth2.Provider; |
| 9 | _ = &oauth2.Client; |
| 10 | std.testing.refAllDecls(oauth2.providers); |
| 11 | std.testing.refAllDecls(oauth2.dynamic_providers); |
| 12 | _ = &oauth2.providerById; |
| 13 | _ = &oauth2.clientByProviderId; |
| 14 | _ = &oauth2.pek_domain; |
| 15 | } |
| 16 | test { |
| 17 | const S = struct { |
| 18 | pub const callbackPath = "/-/callback"; |
| 19 | pub const doneUrl = "/"; |
| 20 | |
| 21 | pub fn isLoggedIn(_: *http.ServerRequest, _: std.mem.Allocator) !bool { |
| 22 | return false; |
| 23 | } |
| 24 | pub fn saveInfo(_: *http.HeadersMap, _: std.mem.Allocator, _: oauth2.Provider, _: []const u8, _: []const u8, _: json.Document, _: json.Document) !void { |
| 25 | // |
| 26 | } |
| 27 | }; |
| 28 | const H = oauth2.Handlers(S); |
| 29 | std.testing.refAllDecls(oauth2.Handlers(S)); |
| 30 | _ = @TypeOf(H.login(undefined, nio.NullWriter{}, undefined, undefined, undefined, undefined, undefined)); |
| 31 | _ = @TypeOf(H.callback(undefined, nio.NullWriter{}, undefined, undefined, undefined, undefined, undefined)); |
| 32 | } |