Skip to content

Commit

Permalink
[#2792] Bug/Domain Approval Removal (#2848)
Browse files Browse the repository at this point in the history
- Invalidate icla/ecla resolved by searching email against domain

Signed-off-by: nickmango <[email protected]>
  • Loading branch information
nickmango authored Apr 2, 2021
1 parent 7269605 commit 54ab0cc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cla-backend-go/signatures/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -2518,7 +2518,9 @@ func (repo repository) verifyUserApprovals(ctx context.Context, userID, signatur

if approvalList.Criteria == utils.EmailDomainCriteria {
// Handle Domains
if utils.StringInSlice(getBestEmail(user), approvalList.DomainApprovals) {
email := getBestEmail(user)
domain := strings.Split(email, "@")[1]
if utils.StringInSlice(domain, approvalList.DomainApprovals) {
if !utils.StringInSlice(user.GithubUsername, approvalList.GitHubUsernameApprovals) && !utils.StringInSlice(getBestEmail(user), approvalList.EmailApprovals) {
//Invalidate record
note := fmt.Sprintf("Signature invalidated (approved set to false) by %s due to %s removal", utils.GetBestUsername(claManager), utils.EmailDomainCriteria)
Expand Down

0 comments on commit 54ab0cc

Please sign in to comment.