| ... | @@ -45,17 +45,17 @@ test { | ... | @@ -45,17 +45,17 @@ test { |
| 45 | const allocator = std.testing.allocator; | 45 | const allocator = std.testing.allocator; |
| 46 | const url = try totp.generateUrl(allocator, "ACME Co", "john.doe@email.com", &from_hex("3dc6caa4824a6d288767b2331e20b43166cb85d9"), .SHA1, 6, 30); | 46 | const url = try totp.generateUrl(allocator, "ACME Co", "john.doe@email.com", &from_hex("3dc6caa4824a6d288767b2331e20b43166cb85d9"), .SHA1, 6, 30); |
| 47 | defer allocator.free(url); | 47 | defer allocator.free(url); |
| 48 | try expect(url).toEqualString("otpauth://totp/ACME%20Co:john.doe@email.com?secret=HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ&algorithm=SHA1&digits=6&period=30"); | 48 | try expect(url).toEqualString("otpauth://totp/ACME%20Co:john.doe@email.com?secret=HXDMVJECJJWSRB3HWIZR4IFUGFTMXBOZ&algorithm=SHA1&digits=6&period=30&issuer=ACME%20Co"); |
| 49 | } | 49 | } |
| 50 | test { | 50 | test { |
| 51 | const allocator = std.testing.allocator; | 51 | const allocator = std.testing.allocator; |
| 52 | const url = try totp.generateUrl(allocator, "Example", "alice@google.com", &from_hex("48656c6c6f21deadbeef"), .SHA1, 6, 30); | 52 | const url = try totp.generateUrl(allocator, "Example", "alice@google.com", &from_hex("48656c6c6f21deadbeef"), .SHA1, 6, 30); |
| 53 | defer allocator.free(url); | 53 | defer allocator.free(url); |
| 54 | try expect(url).toEqualString("otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&algorithm=SHA1&digits=6&period=30"); | 54 | try expect(url).toEqualString("otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&algorithm=SHA1&digits=6&period=30&issuer=Example"); |
| 55 | } | 55 | } |
| 56 | test { | 56 | test { |
| 57 | const allocator = std.testing.allocator; | 57 | const allocator = std.testing.allocator; |
| 58 | const url = try totp.generateUrl(allocator, "otpauth demo", "username@example.org", &from_hex("0000008421d6b5adef7bc6318ce739f7bdefffff"), .SHA1, 6, 30); | 58 | const url = try totp.generateUrl(allocator, "otpauth demo", "username@example.org", &from_hex("0000008421d6b5adef7bc6318ce739f7bdefffff"), .SHA1, 6, 30); |
| 59 | defer allocator.free(url); | 59 | defer allocator.free(url); |
| 60 | try expect(url).toEqualString("otpauth://totp/otpauth%20demo:username@example.org?secret=AAAABBBB22223333YYYYZZZZ66667777&algorithm=SHA1&digits=6&period=30"); | 60 | try expect(url).toEqualString("otpauth://totp/otpauth%20demo:username@example.org?secret=AAAABBBB22223333YYYYZZZZ66667777&algorithm=SHA1&digits=6&period=30&issuer=otpauth%20demo"); |
| 61 | } | 61 | } |