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

fix: gittar remove skipAuth #1856

Merged
merged 2 commits into from
Sep 15, 2021

Conversation

littlejiancc
Copy link
Contributor

What type of this PR

/kind feature

What this PR does / why we need it:

fix: gittar remove skipAuth

Which issue(s) this PR fixes:

【gittar】鉴权取消skipAuth

  • Fixes #your-issue_number
  • [Erda Cloud Issue Link](paste your link here)

Specified Reviewers:

/assign @sfwn

ChangeLog

Language Changelog
🇺🇸 English gittar remove skipAuth
🇨🇳 中文 取消skipAuth逻辑,使用协议来区分鉴权逻辑

Need cherry-pick to release versions?

Add comment like /cherry-pick release/1.0 when this PR is merged.

For details on the cherry pick process, see the cherry pick requests section under CONTRIBUTING.md.

@erda-bot erda-bot requested a review from sfwn September 14, 2021 07:53
@codecov
Copy link

codecov bot commented Sep 14, 2021

Codecov Report

Merging #1856 (ff40be8) into master (9de2eb2) will increase coverage by 0.03%.
The diff coverage is 35.48%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1856      +/-   ##
==========================================
+ Coverage   14.79%   14.82%   +0.03%     
==========================================
  Files        1128     1130       +2     
  Lines      113494   113925     +431     
==========================================
+ Hits        16787    16893     +106     
- Misses      94816    95125     +309     
- Partials     1891     1907      +16     
Impacted Files Coverage Δ
modules/gittar/auth/auth.go 6.15% <35.48%> (ø)
modules/cmp/component-protocol/cputil/util.go 56.52% <0.00%> (-10.15%) ⬇️
...er/executor/plugins/k8s/clusterinfo/clusterinfo.go 3.84% <0.00%> (-0.97%) ⬇️
modules/cmp/steve/middleware/audit.go 32.07% <0.00%> (-0.19%) ⬇️
...hepa/repository/service/gateway_az_info_service.go 0.00% <0.00%> (ø)
...omponents/cmp-dashboard-nodes/nodeFilter/render.go 37.89% <0.00%> (ø)
...mponents/cmp-dashboard-nodes/common/table/table.go 27.22% <0.00%> (+0.34%) ⬆️
...arios/action/components/actionForm/testplan-run.go 53.48% <0.00%> (+0.98%) ⬆️
...rios/action/components/actionForm/testscene_run.go 39.28% <0.00%> (+1.91%) ⬆️
... and 4 more

@@ -453,3 +446,11 @@ func getOrgIDV3(c *webcontext.Context, orgName string) (int64, error) {
}
return orgID, nil
}

// isGitProtocolRequest if request like git clone,git push... return true
func isGitProtocolRequest(c *webcontext.Context) bool {
Copy link
Member

Choose a reason for hiding this comment

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

add unit test for this function.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

return
}
logrus.Infof("repo: %s userId: %v, username: %s", repoName, userIdStr, userInfoDto.Username)
//校验通过缓存5分钟结果
Copy link
Member

Choose a reason for hiding this comment

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

use english

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@littlejiancc littlejiancc force-pushed the feature/gittar-skip branch 3 times, most recently from 29ac3bb to bacccf7 Compare September 14, 2021 12:03
@sfwn
Copy link
Member

sfwn commented Sep 15, 2021

/approve

@erda-bot erda-bot merged commit 10a8c06 into erda-project:master Sep 15, 2021
@sfwn
Copy link
Member

sfwn commented Sep 15, 2021

/cherry-pick release/1.3

erda-bot pushed a commit to erda-bot/erda that referenced this pull request Sep 15, 2021
* fix: remove skipAuth

* polish the code and add unit test
erda-bot added a commit that referenced this pull request Sep 15, 2021
* fix: remove skipAuth

* polish the code and add unit test

Co-authored-by: littlejian <17816869670@163.com>
@littlejiancc
Copy link
Contributor Author

/cherry-pick release/1.3

@erda-bot
Copy link
Member

Automated cherry pick failed, please resolve the confilcts and create PR manually.
Details:

Auto-merging modules/gittar/auth/auth.go
On branch auto-cherry-pick-pr/release-1.3-1856
You are currently cherry-picking commit 10a8c061.
  (all conflicts fixed: run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Untracked files:
  (use "git add <file>..." to include in what will be committed)
	__cherry_pick_failed_detail.txt

nothing added to commit but untracked files present (use "git add" to track)

@littlejiancc littlejiancc deleted the feature/gittar-skip branch September 24, 2021 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants