diff options
author | Tor Brede Vekterli <vekterli@yahooinc.com> | 2022-08-29 17:12:29 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-29 17:12:29 +0200 |
commit | e2d7ac5d88810d34bb05f6dda0d5f1005c065777 (patch) | |
tree | 8edb36ecbe9f7a424997fca2175f26c1fc4c2228 /vespalib | |
parent | 410cbdd6fd35c7ea7919ef842927999064658cd2 (diff) | |
parent | a19652cae9796fed4ae0ac6926910c80a1ec4395 (diff) |
Merge pull request #23832 from vespa-engine/vekterli/capability-filtering-of-content-status-pages
Add capability filtering for content layer status pages and metrics [run-systemtest]
Diffstat (limited to 'vespalib')
4 files changed, 13 insertions, 13 deletions
diff --git a/vespalib/src/tests/net/tls/openssl_impl/openssl_impl_test.cpp b/vespalib/src/tests/net/tls/openssl_impl/openssl_impl_test.cpp index 3d19c335c19..0178443643e 100644 --- a/vespalib/src/tests/net/tls/openssl_impl/openssl_impl_test.cpp +++ b/vespalib/src/tests/net/tls/openssl_impl/openssl_impl_test.cpp @@ -622,8 +622,8 @@ TEST_F("Peer credentials are propagated to CryptoCodec", CertFixture) { auto& client_creds = f.server->peer_credentials(); auto& server_creds = f.client->peer_credentials(); - fprintf(stderr, "Client credentials (observed by server): %s\n", to_string(client_creds).c_str()); - fprintf(stderr, "Server credentials (observed by client): %s\n", to_string(server_creds).c_str()); + fprintf(stderr, "Client credentials (observed by server): %s\n", client_creds.to_string().c_str()); + fprintf(stderr, "Server credentials (observed by client): %s\n", server_creds.to_string().c_str()); EXPECT_EQUAL("rockets.wile.example.com", client_creds.common_name); ASSERT_EQUAL(2u, client_creds.dns_sans.size()); diff --git a/vespalib/src/vespa/vespalib/net/tls/impl/openssl_tls_context_impl.cpp b/vespalib/src/vespa/vespalib/net/tls/impl/openssl_tls_context_impl.cpp index d7977f6cd2a..e088eeb4906 100644 --- a/vespalib/src/vespa/vespalib/net/tls/impl/openssl_tls_context_impl.cpp +++ b/vespalib/src/vespa/vespalib/net/tls/impl/openssl_tls_context_impl.cpp @@ -482,7 +482,7 @@ bool OpenSslTlsContextImpl::verify_trusted_certificate(::X509_STORE_CTX* store_c // Buffer warnings on peer IP address to avoid log flooding. LOGBT(warning, codec_impl.peer_address().ip_address(), "Certificate verification of peer '%s' failed with %s", - codec_impl.peer_address().spec().c_str(), to_string(creds).c_str()); + codec_impl.peer_address().spec().c_str(), creds.to_string().c_str()); return (authz_mode != AuthorizationMode::Enforce); } // Store away credentials and role set for later use by requests that arrive over this connection. diff --git a/vespalib/src/vespa/vespalib/net/tls/peer_credentials.cpp b/vespalib/src/vespa/vespalib/net/tls/peer_credentials.cpp index 9a001e24fea..92854bdd7d5 100644 --- a/vespalib/src/vespa/vespalib/net/tls/peer_credentials.cpp +++ b/vespalib/src/vespa/vespalib/net/tls/peer_credentials.cpp @@ -14,7 +14,7 @@ PeerCredentials& PeerCredentials::operator=(PeerCredentials&&) noexcept = defaul PeerCredentials::~PeerCredentials() = default; std::ostream& operator<<(std::ostream& os, const PeerCredentials& creds) { - os << to_string(creds); + os << creds.to_string(); return os; } @@ -36,20 +36,20 @@ void emit_comma_separated_string_list(asciistream& os, stringref title, } } -vespalib::string to_string(const PeerCredentials& creds) { +vespalib::string PeerCredentials::to_string() const { asciistream os; os << "PeerCredentials("; bool emit_comma = false; - if (!creds.common_name.empty()) { - os << "CN '" << creds.common_name << "'"; + if (!common_name.empty()) { + os << "CN '" << common_name << "'"; emit_comma = true; } - if (!creds.dns_sans.empty()) { - emit_comma_separated_string_list(os, "DNS SANs", creds.dns_sans, emit_comma); + if (!dns_sans.empty()) { + emit_comma_separated_string_list(os, "DNS SANs", dns_sans, emit_comma); emit_comma = true; } - if (!creds.uri_sans.empty()) { - emit_comma_separated_string_list(os, "URI SANs", creds.uri_sans, emit_comma); + if (!uri_sans.empty()) { + emit_comma_separated_string_list(os, "URI SANs", uri_sans, emit_comma); } os << ')'; return os.str(); diff --git a/vespalib/src/vespa/vespalib/net/tls/peer_credentials.h b/vespalib/src/vespa/vespalib/net/tls/peer_credentials.h index b81772d2bce..22c98c023b5 100644 --- a/vespalib/src/vespa/vespalib/net/tls/peer_credentials.h +++ b/vespalib/src/vespa/vespalib/net/tls/peer_credentials.h @@ -23,10 +23,10 @@ struct PeerCredentials { PeerCredentials(PeerCredentials&&) noexcept; PeerCredentials& operator=(PeerCredentials&&) noexcept; ~PeerCredentials(); + + vespalib::string to_string() const; }; std::ostream& operator<<(std::ostream&, const PeerCredentials&); -vespalib::string to_string(const PeerCredentials&); - } |