@@ -70,6 +70,7 @@ use crate::core::compiler::rustdoc::RustdocExternMap;
7070use crate :: core:: shell:: Verbosity ;
7171use crate :: core:: { features, CliUnstable , Shell , SourceId , Workspace , WorkspaceRootConfig } ;
7272use crate :: ops:: { self , RegistryCredentialConfig } ;
73+ use crate :: util:: auth:: Secret ;
7374use crate :: util:: errors:: CargoResult ;
7475use crate :: util:: validate_package_name;
7576use crate :: util:: CanonicalUrl ;
@@ -137,24 +138,15 @@ enum WhyLoad {
137138}
138139
139140/// A previously generated authentication token and the data needed to determine if it can be reused.
141+ #[ derive( Debug ) ]
140142pub struct CredentialCacheValue {
141143 /// If the command line was used to override the token then it must always be reused,
142144 /// even if reading the configuration files would lead to a different value.
143145 pub from_commandline : bool ,
144146 /// If nothing depends on which endpoint is being hit, then we can reuse the token
145147 /// for any future request even if some of the requests involve mutations.
146148 pub independent_of_endpoint : bool ,
147- pub token_value : String ,
148- }
149-
150- impl fmt:: Debug for CredentialCacheValue {
151- /// This manual implementation helps ensure that the token value is redacted from all logs.
152- fn fmt ( & self , f : & mut fmt:: Formatter < ' _ > ) -> fmt:: Result {
153- f. debug_struct ( "CredentialCacheValue" )
154- . field ( "from_commandline" , & self . from_commandline )
155- . field ( "token_value" , & "REDACTED" )
156- . finish ( )
157- }
149+ pub token_value : Secret < String > ,
158150}
159151
160152/// Configuration information for cargo. This is not specific to a build, it is information
0 commit comments