Skip to content

Commit 3bf7e9a

Browse files
authored
advancedTLS: Add in deprecated name for transitionary period (#7221)
1 parent 6b413c8 commit 3bf7e9a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

security/advancedtls/advancedtls.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,11 @@ type Options struct {
249249
// RevocationOptions is the configurations for certificate revocation checks.
250250
// It could be nil if such checks are not needed.
251251
RevocationOptions *RevocationOptions
252+
// RevocationConfig is the configurations for certificate revocation checks.
253+
// It could be nil if such checks are not needed.
254+
//
255+
// Deprecated: use RevocationOptions instead.
256+
RevocationConfig *RevocationConfig
252257
// MinVersion contains the minimum TLS version that is acceptable.
253258
//
254259
// Deprecated: use MinTLSVersion instead.
@@ -689,6 +694,12 @@ func buildVerifyFunc(c *advancedTLSCreds,
689694
// NewClientCreds uses ClientOptions to construct a TransportCredentials based
690695
// on TLS.
691696
func NewClientCreds(o *Options) (credentials.TransportCredentials, error) {
697+
// TODO(gtcooke94) RevocationConfig is deprecated, eventually remove this block.
698+
// This will ensure that users still explicitly setting RevocationConfig will get
699+
// the setting in the right place.
700+
if o.RevocationConfig != nil {
701+
o.RevocationOptions = o.RevocationConfig
702+
}
692703
conf, err := o.clientConfig()
693704
if err != nil {
694705
return nil, err
@@ -708,6 +719,12 @@ func NewClientCreds(o *Options) (credentials.TransportCredentials, error) {
708719
// NewServerCreds uses ServerOptions to construct a TransportCredentials based
709720
// on TLS.
710721
func NewServerCreds(o *Options) (credentials.TransportCredentials, error) {
722+
// TODO(gtcooke94) RevocationConfig is deprecated, eventually remove this block.
723+
// This will ensure that users still explicitly setting RevocationConfig will get
724+
// the setting in the right place.
725+
if o.RevocationConfig != nil {
726+
o.RevocationOptions = o.RevocationConfig
727+
}
711728
conf, err := o.serverConfig()
712729
if err != nil {
713730
return nil, err

0 commit comments

Comments
 (0)