| 76 | }; |
| 77 | |
| 78 | TempTestDataFile::TempTestDataFile(const std::string& contents) |
| 79 | : name_("/tmp/jwks_XXXXXX") { |
| 80 | string created_filename; |
| 81 | WritableFileOptions opts; |
| 82 | opts.is_sensitive = false; |
| 83 | Status status; |
| 84 | status = Env::Default()->NewTempWritableFile(opts, &name_[0], &created_filename, &tmp_file_); |
| 85 | if (!status.ok()) { |
| 86 | std::cerr << Substitute("Error creating temp file: $0", created_filename); |
| 87 | } |
| 88 | |
| 89 | status = WriteStringToFile(Env::Default(), contents, created_filename); |
| 90 | if (!status.ok()) { |
| 91 | std::cerr << Substitute("Error writing contents to temp file: $0", created_filename); |
| 92 | } |
| 93 | |
| 94 | name_ = created_filename; |
| 95 | } |
| 96 | |
| 97 | TEST(JwtUtilTest, LoadJwksFile) { |
| 98 | // Load JWKS from file. |
nothing calls this directly
no test coverage detected