Skip to content

Commit fa713e4

Browse files
Merge pull request #4584 from communitybridge/unicron-fix-dependabot-alerts
Address code scanning issues
2 parents bc9b1a7 + 652592a commit fa713e4

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

cla-backend-go/gitlab_api/client.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ func EncryptAuthInfo(oauthResp *OauthSuccessResponse, gitLabApp *App) (string, e
6666
if err != nil {
6767
return "", fmt.Errorf("problem marshalling oauth resp json, error: %v", err)
6868
}
69+
if len(b) > 64*1024*1024 { // 64 MB limit
70+
return "", fmt.Errorf("oauth response size too large")
71+
}
6972
authInfo := string(b)
7073
//log.Infof("auth info before encrypting : %s", authInfo)
7174

cla-backend-go/v2/gitlab-activity/service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ func (s *service) checkGitLabGroupApproval(ctx context.Context, userName, URL st
722722

723723
log.WithFields(f).Debugf("checking approval list gitlab org criteria : %s for user: %s ", URL, userName)
724724
var searchURL = URL
725-
params := getParams(`(?P<base>\bhttps://gitlab.com/\b)(?P<group>\bgroups\/\b)?(?P<name>\w+)`, URL)
725+
params := getParams(`(?P<base>\bhttps://gitlab\.com/\b)(?P<group>\bgroups\/\b)?(?P<name>\w+)`, URL)
726726
if params[`group`] == "" {
727727
params[`group`] = "groups/"
728728
updated := fmt.Sprintf("%s%s%s", params[`base`], params[`group`], params[`name`])

cla-backend/cla/utils.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,13 +1209,13 @@ def fetch_token(client_id, state, token_url, client_secret, code, redirect_uri=N
12091209
oauth2 = OAuth2Session(client_id, state=state, scope=["user:email"], redirect_uri=redirect_uri)
12101210
else:
12111211
oauth2 = OAuth2Session(client_id, state=state, scope=["user:email"])
1212-
cla.log.debug(
1213-
f"{fn} - oauth2.fetch_token - "
1214-
f"token_url: {token_url}, "
1215-
f"client_id: {client_id}, "
1216-
f"client_secret: {client_secret}, "
1217-
f"code: {code}"
1218-
)
1212+
#cla.log.debug(
1213+
# f"{fn} - oauth2.fetch_token - "
1214+
# f"token_url: {token_url}, "
1215+
# f"client_id: {client_id}, "
1216+
# f"client_secret: {client_secret}, "
1217+
# f"code: {code}"
1218+
#)
12191219
return oauth2.fetch_token(token_url, client_secret=client_secret, code=code)
12201220

12211221

0 commit comments

Comments
 (0)