From c1374fa4e8bc664a82c65cb7403ec4f188ff244c Mon Sep 17 00:00:00 2001 From: Gregory Cooke Date: Thu, 9 May 2024 20:11:09 +0000 Subject: [PATCH] add in deprecated name for transition --- security/advancedtls/advancedtls.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/security/advancedtls/advancedtls.go b/security/advancedtls/advancedtls.go index 4becabc830de..444aab72690f 100644 --- a/security/advancedtls/advancedtls.go +++ b/security/advancedtls/advancedtls.go @@ -249,6 +249,11 @@ type Options struct { // RevocationOptions is the configurations for certificate revocation checks. // It could be nil if such checks are not needed. RevocationOptions *RevocationOptions + // RevocationConfig is the configurations for certificate revocation checks. + // It could be nil if such checks are not needed. + // + // Deprecated: use RevocationOptions instead. + RevocationConfig *RevocationConfig // MinVersion contains the minimum TLS version that is acceptable. // // Deprecated: use MinTLSVersion instead. @@ -689,6 +694,12 @@ func buildVerifyFunc(c *advancedTLSCreds, // NewClientCreds uses ClientOptions to construct a TransportCredentials based // on TLS. func NewClientCreds(o *Options) (credentials.TransportCredentials, error) { + // TODO(gtcooke94) RevocationConfig is deprecated, eventually remove this block. + // This will ensure that users still explicitly setting RevocationConfig will get + // the setting in the right place. + if o.RevocationConfig != nil { + o.RevocationOptions = o.RevocationConfig + } conf, err := o.clientConfig() if err != nil { return nil, err @@ -708,6 +719,12 @@ func NewClientCreds(o *Options) (credentials.TransportCredentials, error) { // NewServerCreds uses ServerOptions to construct a TransportCredentials based // on TLS. func NewServerCreds(o *Options) (credentials.TransportCredentials, error) { + // TODO(gtcooke94) RevocationConfig is deprecated, eventually remove this block. + // This will ensure that users still explicitly setting RevocationConfig will get + // the setting in the right place. + if o.RevocationConfig != nil { + o.RevocationOptions = o.RevocationConfig + } conf, err := o.serverConfig() if err != nil { return nil, err