| 1994 | } |
| 1995 | |
| 1996 | void FlowTransport::loadPublicKeyFile(const std::string& filePath) { |
| 1997 | if (!fileExists(filePath)) { |
| 1998 | throw file_not_found(); |
| 1999 | } |
| 2000 | int64_t const len = fileSize(filePath); |
| 2001 | if (len <= 0) { |
| 2002 | TraceEvent(SevWarn, "AuthzPublicKeySetEmpty").detail("Path", filePath); |
| 2003 | } else if (len > FLOW_KNOBS->PUBLIC_KEY_FILE_MAX_SIZE) { |
| 2004 | throw file_too_large(); |
| 2005 | } else { |
| 2006 | auto json = readFileBytes(filePath, len); |
| 2007 | self->applyPublicKeySet(StringRef(json)); |
| 2008 | } |
| 2009 | } |
| 2010 | |
| 2011 | ACTOR static Future<Void> watchPublicKeyJwksFile(std::string filePath, TransportData* self) { |
| 2012 | state AsyncTrigger fileChanged; |
no test coverage detected