Commit 60224e0
committed
introduce PasswordExpiryUTC and OAuthRefreshToken
Add properties ICredential.PasswordExpiryUTC and
ICredential.OAuthRefreshToken. These correspond to Git credential
attributes password_expiry_utc and oauth_refresh_token, see
https://git-scm.com/docs/git-credential#IOFMT. Previously these
attributes were silently disarded.
Plumb these properties from input to host provider to credential store
to output.
Credential store support for these attributes is optional, marked by
new properties ICredentialStore.CanStorePasswordExpiryUTC and
ICredentialStore.CanStoreOAuthRefreshToken. Implement support in
CredentialCacheStore, SecretServiceCollection and
WindowsCredentialManager.
Add method IHostProvider.ValidateCredentialAsync. The default
implementation simply checks expiry.
Improve implementations of GenericHostProvider and GitLabHostProvider.
Previously, GetCredentialAsync saved credentials as a side effect. This
is no longer necessary. The workaround to store OAuth refresh tokens
under a separate service is no longer necessary assuming
CredentialStore.CanStoreOAuthRefreshToken. Querying GitLab to check
token expiration is no longer necessary assuming
CredentialStore.CanStorePasswordExpiryUTC.1 parent 17250be commit 60224e0
File tree
36 files changed
+636
-195
lines changed36 files changed
+636
-195
lines changedLines changed: 9 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| 224 | + | |
224 | 225 | | |
225 | 226 | | |
226 | 227 | | |
227 | 228 | | |
228 | | - | |
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| |||
234 | 234 | | |
235 | 235 | | |
236 | 236 | | |
237 | | - | |
| 237 | + | |
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | | - | |
| 242 | + | |
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
264 | | - | |
| 264 | + | |
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | | - | |
272 | | - | |
273 | 271 | | |
274 | 272 | | |
275 | 273 | | |
| |||
291 | 289 | | |
292 | 290 | | |
293 | 291 | | |
294 | | - | |
| 292 | + | |
295 | 293 | | |
296 | 294 | | |
297 | 295 | | |
298 | 296 | | |
299 | 297 | | |
300 | | - | |
301 | 298 | | |
302 | 299 | | |
303 | 300 | | |
| |||
316 | 313 | | |
317 | 314 | | |
318 | 315 | | |
319 | | - | |
| 316 | + | |
320 | 317 | | |
321 | 318 | | |
322 | 319 | | |
323 | 320 | | |
324 | 321 | | |
325 | 322 | | |
326 | 323 | | |
327 | | - | |
328 | 324 | | |
329 | 325 | | |
330 | 326 | | |
| |||
437 | 433 | | |
438 | 434 | | |
439 | 435 | | |
440 | | - | |
| 436 | + | |
441 | 437 | | |
442 | 438 | | |
443 | 439 | | |
444 | 440 | | |
445 | 441 | | |
446 | | - | |
| 442 | + | |
| 443 | + | |
447 | 444 | | |
448 | 445 | | |
449 | 446 | | |
| |||
551 | 548 | | |
552 | 549 | | |
553 | 550 | | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | 551 | | |
562 | 552 | | |
563 | 553 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
142 | | - | |
143 | | - | |
144 | | - | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
145 | 147 | | |
146 | 148 | | |
147 | 149 | | |
| |||
199 | 201 | | |
200 | 202 | | |
201 | 203 | | |
202 | | - | |
| 204 | + | |
203 | 205 | | |
204 | 206 | | |
205 | 207 | | |
206 | 208 | | |
207 | 209 | | |
208 | 210 | | |
209 | | - | |
| 211 | + | |
210 | 212 | | |
211 | 213 | | |
212 | 214 | | |
213 | | - | |
214 | | - | |
| 215 | + | |
| 216 | + | |
215 | 217 | | |
216 | | - | |
217 | | - | |
218 | | - | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
219 | 223 | | |
220 | 224 | | |
221 | | - | |
| 225 | + | |
222 | 226 | | |
223 | 227 | | |
224 | 228 | | |
| |||
239 | 243 | | |
240 | 244 | | |
241 | 245 | | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
246 | 252 | | |
247 | 253 | | |
248 | | - | |
| 254 | + | |
249 | 255 | | |
250 | 256 | | |
251 | 257 | | |
| |||
333 | 339 | | |
334 | 340 | | |
335 | 341 | | |
336 | | - | |
| 342 | + | |
337 | 343 | | |
338 | 344 | | |
339 | 345 | | |
| |||
450 | 456 | | |
451 | 457 | | |
452 | 458 | | |
453 | | - | |
| 459 | + | |
454 | 460 | | |
455 | 461 | | |
456 | 462 | | |
| |||
473 | 479 | | |
474 | 480 | | |
475 | 481 | | |
| 482 | + | |
| 483 | + | |
476 | 484 | | |
477 | 485 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
| |||
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
19 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
20 | 26 | | |
21 | 27 | | |
22 | 28 | | |
23 | 29 | | |
24 | 30 | | |
25 | 31 | | |
26 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
27 | 35 | | |
28 | 36 | | |
29 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
22 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
| |||
46 | 50 | | |
47 | 51 | | |
48 | 52 | | |
49 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
50 | 56 | | |
51 | 57 | | |
52 | 58 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
205 | 204 | | |
206 | 205 | | |
207 | 206 | | |
| |||
249 | 248 | | |
250 | 249 | | |
251 | 250 | | |
252 | | - | |
| 251 | + | |
253 | 252 | | |
254 | 253 | | |
255 | 254 | | |
| |||
259 | 258 | | |
260 | 259 | | |
261 | 260 | | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
| 261 | + | |
266 | 262 | | |
267 | 263 | | |
268 | 264 | | |
| |||
0 commit comments