| 3 | #include "jwt/jwt.hpp" |
| 4 | |
| 5 | TEST (DecodeTest, InvalidFinalDotForNoneAlg) |
| 6 | { |
| 7 | using namespace jwt::params; |
| 8 | const char* inv_enc_str = |
| 9 | "eyJhbGciOiJOT05FIiwidHlwIjoiSldUIn0.eyJhdWQiOiJyaWZ0LmlvIiwiZXhwIjoxNTEzODYzMzcxLCJzdWIiOiJub3RoaW5nIG11Y2gifQ"; |
| 10 | |
| 11 | std::error_code ec; |
| 12 | auto obj = jwt::decode(inv_enc_str, algorithms({"none", "HS256"}), ec); |
| 13 | |
| 14 | ASSERT_TRUE (ec); |
| 15 | EXPECT_EQ (ec.value(), static_cast<int>(jwt::DecodeErrc::SignatureFormatError)); |
| 16 | } |
| 17 | |
| 18 | TEST (DecodeTest, DecodeNoneAlgSign) |
| 19 | { |
nothing calls this directly
no test coverage detected