MCPcopy Create free account
hub / github.com/apple/foundationdb / loadPublicKeyFile

Method loadPublicKeyFile

fdbrpc/FlowTransport.actor.cpp:1996–2009  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1994}
1995
1996void 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
2011ACTOR static Future<Void> watchPublicKeyJwksFile(std::string filePath, TransportData* self) {
2012 state AsyncTrigger fileChanged;

Callers 1

mainFunction · 0.80

Calls 7

fileExistsFunction · 0.85
fileSizeFunction · 0.85
TraceEventClass · 0.85
readFileBytesFunction · 0.85
detailMethod · 0.80
applyPublicKeySetMethod · 0.80
StringRefClass · 0.50

Tested by

no test coverage detected