Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add authinfo injector #2149

Merged
merged 4 commits into from
Mar 31, 2023
Merged

feat: add authinfo injector #2149

merged 4 commits into from
Mar 31, 2023

Conversation

jim3ma
Copy link
Member

@jim3ma jim3ma commented Mar 8, 2023

Description

When download with dfget, some config like docker config is in special user's home directory.
For more flexible to fetch auth information, we introduce a new interface AuthInfoInjector.

Source client can register AuthInfoInjector optional. AuthInfoInjector will be invoked before dfget send the download grpc request to daemon. AuthInfoInjector injects auth information into the urlMeta or others.

Related Issue

#2146

Motivation and Context

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation Update (if none of the other choices apply)

Checklist

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

Signed-off-by: Jim Ma <majinjing3@gmail.com>
@jim3ma jim3ma requested a review from a team as a code owner March 8, 2023 09:09
@codecov
Copy link

codecov bot commented Mar 8, 2023

Codecov Report

Merging #2149 (69ac7b3) into main (a2fcca6) will decrease coverage by 0.10%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2149      +/-   ##
==========================================
- Coverage   47.48%   47.39%   -0.10%     
==========================================
  Files         141      141              
  Lines       19329    19354      +25     
==========================================
- Hits         9178     9172       -6     
- Misses       9560     9590      +30     
- Partials      591      592       +1     
Flag Coverage Δ
e2etests ?
unittests 47.39% <0.00%> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
client/dfget/dfget.go 9.29% <0.00%> (-0.36%) ⬇️
pkg/source/source_client_builder.go 0.00% <0.00%> (ø)
scheduler/service/service_v2.go 81.88% <0.00%> (-0.59%) ⬇️
client/daemon/peer/piece_manager.go 52.79% <0.00%> (-0.40%) ⬇️
client/daemon/peer/piece_dispatcher.go 86.58% <0.00%> (+1.21%) ⬆️

Signed-off-by: Jim Ma <majinjing3@gmail.com>
Signed-off-by: Jim Ma <majinjing3@gmail.com>
Signed-off-by: Jim Ma <majinjing3@gmail.com>
Copy link
Member

@gaius-qi gaius-qi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gaius-qi gaius-qi merged commit 4bfdd24 into main Mar 31, 2023
@gaius-qi gaius-qi deleted the feat/authinfo-injector branch March 31, 2023 12:34
MIchaelFU0403 pushed a commit to MIchaelFU0403/Dragonfly2 that referenced this pull request Mar 31, 2023
Signed-off-by: Jim Ma <majinjing3@gmail.com>
Signed-off-by: MIchaelFU0403 <1078537664@qq.com>
lilongfeng0902 pushed a commit to lilongfeng0902/Dragonfly2 that referenced this pull request May 15, 2023
Signed-off-by: Jim Ma <majinjing3@gmail.com>
Signed-off-by: 李龙峰 <lilongfeng@inspur.com>
gaius-qi pushed a commit that referenced this pull request Jun 28, 2023
Signed-off-by: Jim Ma <majinjing3@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants