forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add validation context provider (envoyproxy#4264)
Add certificate validation context config provider and refactor ContextConfigImpl. Make static and inline CertificateValidationContext utilize it. This is independent of PR envoyproxy#4256. Once envoyproxy#4256 is in, next step is to support fetching CertificateValidationContext via validation_context_sds_secret_config. Risk Level: Low Testing: unit test, integration test Docs Changes: N/A Release Notes: N/A Signed-off-by: JimmyCYJ <[email protected]>
- Loading branch information
Showing
22 changed files
with
508 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
#pragma once | ||
|
||
#include <string> | ||
#include <vector> | ||
|
||
#include "envoy/common/pure.h" | ||
|
||
namespace Envoy { | ||
namespace Ssl { | ||
|
||
class CertificateValidationContextConfig { | ||
public: | ||
virtual ~CertificateValidationContextConfig() {} | ||
|
||
/** | ||
* @return The CA certificate to use for peer validation. | ||
*/ | ||
virtual const std::string& caCert() const PURE; | ||
|
||
/** | ||
* @return Path of the CA certificate to use for peer validation or "<inline>" | ||
* if the CA certificate was inlined. | ||
*/ | ||
virtual const std::string& caCertPath() const PURE; | ||
|
||
/** | ||
* @return The CRL to check if a cert is revoked. | ||
*/ | ||
virtual const std::string& certificateRevocationList() const PURE; | ||
|
||
/** | ||
* @return Path of the certificate revocation list, or "<inline>" if the CRL | ||
* was inlined. | ||
*/ | ||
virtual const std::string& certificateRevocationListPath() const PURE; | ||
|
||
/** | ||
* @return The subject alt names to be verified, if enabled. Otherwise, "" | ||
*/ | ||
virtual const std::vector<std::string>& verifySubjectAltNameList() const PURE; | ||
|
||
/** | ||
* @return A list of a hex-encoded SHA-256 certificate hashes to be verified. | ||
*/ | ||
virtual const std::vector<std::string>& verifyCertificateHashList() const PURE; | ||
|
||
/** | ||
* @return A list of a hex-encoded SHA-256 SPKI hashes to be verified. | ||
*/ | ||
virtual const std::vector<std::string>& verifyCertificateSpkiList() const PURE; | ||
|
||
/** | ||
* @return whether to ignore expired certificates (both too new and too old). | ||
*/ | ||
virtual bool allowExpiredCertificate() const PURE; | ||
}; | ||
|
||
typedef std::unique_ptr<CertificateValidationContextConfig> CertificateValidationContextConfigPtr; | ||
|
||
} // namespace Ssl | ||
} // namespace Envoy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.