@@ -43,7 +43,7 @@ public class GitResponse
4343 private readonly Dictionary < string , string > _state = new ( StringComparer . Ordinal ) ;
4444 private ReadOnlyDictionary < string , string > _stateView ;
4545
46- private GitResponse ( ICredential credential , bool isContinue , bool isCancelled , bool isYielded )
46+ private GitResponse ( ICredential credential , bool isEphemeral = false , string authType = null , bool isContinue = false , bool isCancelled = false , bool isYielded = false )
4747 {
4848 // At most one of Continue, Cancel, Yield may be set (Ok is "none of them").
4949 if ( ( isContinue && isCancelled ) ||
@@ -71,6 +71,9 @@ private GitResponse(ICredential credential, bool isContinue, bool isCancelled, b
7171 }
7272
7373 Credential = credential ;
74+ IsCredentialEphemeral = isEphemeral ;
75+ AuthType = authType ;
76+
7477 IsContinue = isContinue ;
7578 IsCancelled = isCancelled ;
7679 IsYielded = isYielded ;
@@ -81,15 +84,15 @@ private GitResponse(ICredential credential, bool isContinue, bool isCancelled, b
8184 /// </summary>
8285 /// <remarks>Equivalent to <see cref="Ok(ICredential)"/>.</remarks>
8386 public GitResponse ( ICredential credential )
84- : this ( credential , isContinue : false , isCancelled : false , isYielded : false )
87+ : this ( credential , authType : null )
8588 {
8689 }
8790
8891 /// <summary>
8992 /// Construct a successful response carrying the given credential.
9093 /// </summary>
91- public static GitResponse Ok ( ICredential credential ) =>
92- new GitResponse ( credential , isContinue : false , isCancelled : false , isYielded : false ) ;
94+ public static GitResponse Ok ( ICredential credential , bool isEphemeral = false , string authtype = null ) =>
95+ new ( credential , isEphemeral : isEphemeral , authType : authtype ) ;
9396
9497 /// <summary>
9598 /// Construct a successful response carrying the given credential and
@@ -101,8 +104,8 @@ public static GitResponse Ok(ICredential credential) =>
101104 /// multistage HTTP authentication (NTLM/Kerberos) and any flow where the
102105 /// helper wants to be invoked again after the next server response.
103106 /// </remarks>
104- public static GitResponse Continue ( ICredential credential ) =>
105- new GitResponse ( credential , isContinue : true , isCancelled : false , isYielded : false ) ;
107+ public static GitResponse Continue ( ICredential credential , bool isEphemeral = false , string authType = null ) =>
108+ new ( credential , isEphemeral : isEphemeral , authType : authType , isContinue : true ) ;
106109
107110 /// <summary>
108111 /// Construct a cancellation response: the provider declined to produce a
@@ -117,7 +120,7 @@ public static GitResponse Continue(ICredential credential) =>
117120 /// cancelled response are ignored.
118121 /// </remarks>
119122 public static GitResponse Cancel ( ) =>
120- new GitResponse ( credential : null , isContinue : false , isCancelled : true , isYielded : false ) ;
123+ new GitResponse ( credential : null , isCancelled : true ) ;
121124
122125 /// <summary>
123126 /// Construct a yielded response: the provider has nothing to contribute
@@ -132,14 +135,24 @@ public static GitResponse Cancel() =>
132135 /// set on a yielded response are ignored.
133136 /// </remarks>
134137 public static GitResponse Yield ( ) =>
135- new GitResponse ( credential : null , isContinue : false , isCancelled : false , isYielded : true ) ;
138+ new GitResponse ( credential : null , isYielded : true ) ;
136139
137140 /// <summary>
138141 /// The credential resolved or generated for the request, or <see langword="null"/>
139142 /// when <see cref="IsCancelled"/> or <see cref="IsYielded"/> is <see langword="true"/>.
140143 /// </summary>
141144 public ICredential Credential { get ; }
142145
146+ /// <summary>
147+ /// The credential is ephemeral (or generated) and not to be stored on success.
148+ /// </summary>
149+ public bool IsCredentialEphemeral { get ; }
150+
151+ /// <summary>
152+ /// The special Autorization type for the supplied credential.
153+ /// </summary>
154+ public string AuthType { get ; }
155+
143156 /// <summary>
144157 /// <see langword="true"/> when the provider expects a further round of
145158 /// authentication. The command layer translates this into a <c>continue=1</c>
0 commit comments