Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/docs_update.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ assignees: ''

Describe what has changed and which documents need updating

* [/docs/doc-to-update.md](https://github.com/linuxfoundation/easycla/blob/master/docs/)
* [/docs/doc-to-update.md](https://github.com/linuxfoundation/easycla/blob/main/docs/)

## Tasks

Expand All @@ -29,7 +29,7 @@ The "done" criteria when this feature or problem is resolved. Such as:

1. Documentation changes submitted as a Pull Request
1. Pull Request Reviewed and Approved by Product Owner
1. Documentation changes merged to 'master' branch
1. Documentation changes merged to 'main' branch

## Images

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ name: "CodeQL"

on:
push:
branches: [master, ]
branches: [main, ]
pull_request:
# The branches below must be a subset of the branches above
branches: [master]
branches: [main]
schedule:
- cron: '0 5 * * 4'

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ cla-backend/run-python-test-example-*.py
out
*.secret
*log*.json
cover.out

# Cypress test outputs
**/cypress/screenshots/
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Introduction to EasyCLA

[![CircleCI](https://circleci.com/gh/communitybridge/easycla.svg?style=svg)](https://circleci.com/gh/communitybridge/easycla)
[![Build Status](https://github.com/linuxfoundation/easycla/actions/workflows/deploy-prod.yml/badge.svg)](https://github.com/linuxfoundation/easycla/actions/workflows/deploy-prod.yml)

The Contributor License Agreement \(CLA\) service of the Linux Foundation lets project contributors read, sign, and submit contributor license agreements easily.

Expand All @@ -10,7 +10,7 @@ This platform supports both GitHub and Gerrit source code repositories. Addition

## Announcements

- 06/10/2020 - We have replaced code references from whitelist to Approved List. This includes package names, code comments, swagger specifications, API endpoints, variable names, and UI components.
- 8/2025 - We have replaced code references from whitelist to Approved List. This includes package names, code comments, swagger specifications, API endpoints, variable names, and UI components.

## Third-party Services

Expand Down
52 changes: 26 additions & 26 deletions cla-backend-go/approval_list/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ import (
// Configure setups handlers on api with service
func Configure(api *operations.ClaAPI, service IService, sessionStore *dynastore.Store, signatureService signatures.SignatureService, eventsService events.Service) {

api.CompanyAddCclaWhitelistRequestHandler = company.AddCclaWhitelistRequestHandlerFunc(
func(params company.AddCclaWhitelistRequestParams) middleware.Responder {
api.CompanyAddCclaAllowlistRequestHandler = company.AddCclaAllowlistRequestHandlerFunc(
func(params company.AddCclaAllowlistRequestParams) middleware.Responder {
reqID := utils.GetRequestID(params.XREQUESTID)
ctx := context.WithValue(context.Background(), utils.XREQUESTID, reqID) // nolint
requestID, err := service.AddCclaApprovalListRequest(ctx, params.CompanyID, params.ProjectID, params.Body)
if err != nil {
return company.NewAddCclaWhitelistRequestBadRequest().WithXRequestID(reqID).WithPayload(errorResponse(err))
return company.NewAddCclaAllowlistRequestBadRequest().WithXRequestID(reqID).WithPayload(errorResponse(err))
}

eventsService.LogEventWithContext(ctx, &events.LogEventArgs{
Expand All @@ -40,16 +40,16 @@ func Configure(api *operations.ClaAPI, service IService, sessionStore *dynastore
EventData: &events.CCLAApprovalListRequestCreatedEventData{RequestID: requestID},
})

return company.NewAddCclaWhitelistRequestOK().WithXRequestID(reqID)
return company.NewAddCclaAllowlistRequestOK().WithXRequestID(reqID)
})

api.CompanyApproveCclaWhitelistRequestHandler = company.ApproveCclaWhitelistRequestHandlerFunc(
func(params company.ApproveCclaWhitelistRequestParams, claUser *user.CLAUser) middleware.Responder {
api.CompanyApproveCclaAllowlistRequestHandler = company.ApproveCclaAllowlistRequestHandlerFunc(
func(params company.ApproveCclaAllowlistRequestParams, claUser *user.CLAUser) middleware.Responder {
reqID := utils.GetRequestID(params.XREQUESTID)
ctx := context.WithValue(context.Background(), utils.XREQUESTID, reqID) // nolint
err := service.ApproveCclaApprovalListRequest(ctx, claUser, params.CompanyID, params.ProjectID, params.RequestID)
if err != nil {
return company.NewApproveCclaWhitelistRequestBadRequest().WithXRequestID(reqID).WithPayload(errorResponse(err))
return company.NewApproveCclaAllowlistRequestBadRequest().WithXRequestID(reqID).WithPayload(errorResponse(err))
}

eventsService.LogEventWithContext(ctx, &events.LogEventArgs{
Expand All @@ -60,16 +60,16 @@ func Configure(api *operations.ClaAPI, service IService, sessionStore *dynastore
EventData: &events.CCLAApprovalListRequestApprovedEventData{RequestID: params.RequestID},
})

return company.NewApproveCclaWhitelistRequestOK().WithXRequestID(reqID)
return company.NewApproveCclaAllowlistRequestOK().WithXRequestID(reqID)
})

api.CompanyRejectCclaWhitelistRequestHandler = company.RejectCclaWhitelistRequestHandlerFunc(
func(params company.RejectCclaWhitelistRequestParams, claUser *user.CLAUser) middleware.Responder {
api.CompanyRejectCclaAllowlistRequestHandler = company.RejectCclaAllowlistRequestHandlerFunc(
func(params company.RejectCclaAllowlistRequestParams, claUser *user.CLAUser) middleware.Responder {
reqID := utils.GetRequestID(params.XREQUESTID)
ctx := context.WithValue(context.Background(), utils.XREQUESTID, reqID) // nolint
err := service.RejectCclaApprovalListRequest(ctx, params.CompanyID, params.ProjectID, params.RequestID)
if err != nil {
return company.NewRejectCclaWhitelistRequestBadRequest().WithXRequestID(reqID).WithPayload(errorResponse(err))
return company.NewRejectCclaAllowlistRequestBadRequest().WithXRequestID(reqID).WithPayload(errorResponse(err))
}

eventsService.LogEventWithContext(ctx, &events.LogEventArgs{
Expand All @@ -80,33 +80,33 @@ func Configure(api *operations.ClaAPI, service IService, sessionStore *dynastore
EventData: &events.CCLAApprovalListRequestRejectedEventData{RequestID: params.RequestID},
})

return company.NewRejectCclaWhitelistRequestOK().WithXRequestID(reqID)
return company.NewRejectCclaAllowlistRequestOK().WithXRequestID(reqID)
})

api.CompanyListCclaWhitelistRequestsHandler = company.ListCclaWhitelistRequestsHandlerFunc(
func(params company.ListCclaWhitelistRequestsParams, claUser *user.CLAUser) middleware.Responder {
api.CompanyListCclaAllowlistRequestsHandler = company.ListCclaAllowlistRequestsHandlerFunc(
func(params company.ListCclaAllowlistRequestsParams, claUser *user.CLAUser) middleware.Responder {
reqID := utils.GetRequestID(params.XREQUESTID)
ctx := context.WithValue(context.Background(), utils.XREQUESTID, reqID) // nolint
f := logrus.Fields{
"functionName": "CompanyListCclaWhitelistRequestsHandler",
"functionName": "CompanyListCclaAllowlistRequestsHandler",
utils.XREQUESTID: ctx.Value(utils.XREQUESTID),
}
log.WithFields(f).Debugf("Invoking ListCclaApprovalListRequests with Company ID: %+v, Project ID: %+v, Status: %+v",
params.CompanyID, params.ProjectID, params.Status)
result, err := service.ListCclaApprovalListRequest(params.CompanyID, params.ProjectID, params.Status)
if err != nil {
return company.NewListCclaWhitelistRequestsBadRequest().WithXRequestID(reqID).WithPayload(errorResponse(err))
return company.NewListCclaAllowlistRequestsBadRequest().WithXRequestID(reqID).WithPayload(errorResponse(err))
}

return company.NewListCclaWhitelistRequestsOK().WithXRequestID(reqID).WithPayload(result)
return company.NewListCclaAllowlistRequestsOK().WithXRequestID(reqID).WithPayload(result)
})

api.CompanyListCclaWhitelistRequestsByCompanyAndProjectHandler = company.ListCclaWhitelistRequestsByCompanyAndProjectHandlerFunc(
func(params company.ListCclaWhitelistRequestsByCompanyAndProjectParams, claUser *user.CLAUser) middleware.Responder {
api.CompanyListCclaAllowlistRequestsByCompanyAndProjectHandler = company.ListCclaAllowlistRequestsByCompanyAndProjectHandlerFunc(
func(params company.ListCclaAllowlistRequestsByCompanyAndProjectParams, claUser *user.CLAUser) middleware.Responder {
reqID := utils.GetRequestID(params.XREQUESTID)
ctx := context.WithValue(context.Background(), utils.XREQUESTID, reqID) // nolint
f := logrus.Fields{
"functionName": "v1.approval_list.handlers.CompanyListCclaWhitelistRequestsByCompanyAndProjectHandler",
"functionName": "v1.approval_list.handlers.CompanyListCclaAllowlistRequestsByCompanyAndProjectHandler",
utils.XREQUESTID: ctx.Value(utils.XREQUESTID),
"companyID": params.CompanyID,
"projectID": params.ProjectID,
Expand All @@ -120,22 +120,22 @@ func Configure(api *operations.ClaAPI, service IService, sessionStore *dynastore
params.CompanyID, params.ProjectID, params.Status)
result, err := service.ListCclaApprovalListRequestByCompanyProjectUser(params.CompanyID, &params.ProjectID, params.Status, nil)
if err != nil {
return company.NewListCclaWhitelistRequestsByCompanyAndProjectBadRequest().WithPayload(errorResponse(err))
return company.NewListCclaAllowlistRequestsByCompanyAndProjectBadRequest().WithPayload(errorResponse(err))
}

return company.NewListCclaWhitelistRequestsByCompanyAndProjectOK().WithPayload(result)
return company.NewListCclaAllowlistRequestsByCompanyAndProjectOK().WithPayload(result)
})

api.CompanyListCclaWhitelistRequestsByCompanyAndProjectAndUserHandler = company.ListCclaWhitelistRequestsByCompanyAndProjectAndUserHandlerFunc(
func(params company.ListCclaWhitelistRequestsByCompanyAndProjectAndUserParams, claUser *user.CLAUser) middleware.Responder {
api.CompanyListCclaAllowlistRequestsByCompanyAndProjectAndUserHandler = company.ListCclaAllowlistRequestsByCompanyAndProjectAndUserHandlerFunc(
func(params company.ListCclaAllowlistRequestsByCompanyAndProjectAndUserParams, claUser *user.CLAUser) middleware.Responder {
log.Debugf("Invoking ListCclaApprovalListRequestByCompanyProjectUser with Company ID: %+v, Project ID: %+v, Status: %+v, User: %+v",
params.CompanyID, params.ProjectID, params.Status, claUser.LFUsername)
result, err := service.ListCclaApprovalListRequestByCompanyProjectUser(params.CompanyID, &params.ProjectID, params.Status, &claUser.LFUsername)
if err != nil {
return company.NewListCclaWhitelistRequestsByCompanyAndProjectAndUserBadRequest().WithPayload(errorResponse(err))
return company.NewListCclaAllowlistRequestsByCompanyAndProjectAndUserBadRequest().WithPayload(errorResponse(err))
}

return company.NewListCclaWhitelistRequestsByCompanyAndProjectAndUserOK().WithPayload(result)
return company.NewListCclaAllowlistRequestsByCompanyAndProjectAndUserOK().WithPayload(result)
})
}

Expand Down
10 changes: 5 additions & 5 deletions cla-backend-go/approval_list/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import (
log "github.com/linuxfoundation/easycla/cla-backend-go/logging"
)

// buildCclaWhitelistRequestsModels builds the request models
func buildCclaWhitelistRequestsModels(results *dynamodb.QueryOutput) ([]models.CclaWhitelistRequest, error) {
requests := make([]models.CclaWhitelistRequest, 0)
// buildCclaAllowlistRequestsModels builds the request models
func buildCclaAllowlistRequestsModels(results *dynamodb.QueryOutput) ([]models.CclaAllowlistRequest, error) {
requests := make([]models.CclaAllowlistRequest, 0)

var itemRequests []CclaWhitelistRequest
var itemRequests []CclaAllowlistRequest

err := dynamodbattribute.UnmarshalListOfMaps(results.Items, &itemRequests)
if err != nil {
Expand All @@ -25,7 +25,7 @@ func buildCclaWhitelistRequestsModels(results *dynamodb.QueryOutput) ([]models.C
return nil, err
}
for _, r := range itemRequests {
requests = append(requests, models.CclaWhitelistRequest{
requests = append(requests, models.CclaAllowlistRequest{
CompanyID: r.CompanyID,
CompanyName: r.CompanyName,
DateCreated: r.DateCreated,
Expand Down
4 changes: 2 additions & 2 deletions cla-backend-go/approval_list/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ type CLARequestModel struct {
Version string `dynamodbav:"version"`
}

// CclaWhitelistRequest data model
type CclaWhitelistRequest struct {
// CclaAllowlistRequest data model
type CclaAllowlistRequest struct {
RequestID string `dynamodbav:"request_id"`
RequestStatus string `dynamodbav:"request_status"`
CompanyID string `dynamodbav:"company_id"`
Expand Down
12 changes: 6 additions & 6 deletions cla-backend-go/approval_list/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ import (
)

const (
// Version is version of CclaWhitelistRequest
// Version is version of CclaAllowlistRequest
Version = "v1"
// StatusPending is status of CclaWhitelistRequest
// StatusPending is status of CclaAllowlistRequest
StatusPending = "pending"

// ProjectIDIndex is the index for for the project_id secondary index
Expand All @@ -39,7 +39,7 @@ type IRepository interface {
GetCclaApprovalListRequest(requestID string) (*CLARequestModel, error)
ApproveCclaApprovalListRequest(requestID string) error
RejectCclaApprovalListRequest(requestID string) error
ListCclaApprovalListRequests(companyID string, projectID, status, userID *string) (*models.CclaWhitelistRequestList, error)
ListCclaApprovalListRequests(companyID string, projectID, status, userID *string) (*models.CclaAllowlistRequestList, error)
GetRequestsByCLAGroup(claGroupID string) ([]CLARequestModel, error)
UpdateRequestsByCLAGroup(model *models2.DBProjectModel) error
}
Expand Down Expand Up @@ -214,7 +214,7 @@ func (repo repository) RejectCclaApprovalListRequest(requestID string) error {
}

// ListCclaApprovalListRequests list the requests for the specified query parameters
func (repo repository) ListCclaApprovalListRequests(companyID string, projectID, status, userID *string) (*models.CclaWhitelistRequestList, error) {
func (repo repository) ListCclaApprovalListRequests(companyID string, projectID, status, userID *string) (*models.CclaAllowlistRequestList, error) {
f := logrus.Fields{
"functionName": "v1.approval_list.repository.ListCclaApprovalListRequests",
"companyID": companyID,
Expand Down Expand Up @@ -282,13 +282,13 @@ func (repo repository) ListCclaApprovalListRequests(companyID string, projectID,
return nil, queryErr
}

list, err := buildCclaWhitelistRequestsModels(queryOutput)
list, err := buildCclaAllowlistRequestsModels(queryOutput)
if err != nil {
log.WithFields(f).WithError(err).Warnf("unmarshall requests error while decoding the response, error: %+v", err)
return nil, err
}

return &models.CclaWhitelistRequestList{List: list}, nil
return &models.CclaAllowlistRequestList{List: list}, nil
}

// GetRequestsByCLAGroup retrieves a list of requests for the specified CLA Group
Expand Down
12 changes: 6 additions & 6 deletions cla-backend-go/approval_list/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ const (

// IService interface defines the service methods/functions
type IService interface {
AddCclaApprovalListRequest(ctx context.Context, companyID string, claGroupID string, args models.CclaWhitelistRequestInput) (string, error)
AddCclaApprovalListRequest(ctx context.Context, companyID string, claGroupID string, args models.CclaAllowlistRequestInput) (string, error)
ApproveCclaApprovalListRequest(ctx context.Context, claUser *user.CLAUser, ClacompanyID, claGroupID, requestID string) error
RejectCclaApprovalListRequest(ctx context.Context, companyID, claGroupID, requestID string) error
ListCclaApprovalListRequest(companyID string, claGroupID, status *string) (*models.CclaWhitelistRequestList, error)
ListCclaApprovalListRequestByCompanyProjectUser(companyID string, claGroupID, status, userID *string) (*models.CclaWhitelistRequestList, error)
ListCclaApprovalListRequest(companyID string, claGroupID, status *string) (*models.CclaAllowlistRequestList, error)
ListCclaApprovalListRequestByCompanyProjectUser(companyID string, claGroupID, status, userID *string) (*models.CclaAllowlistRequestList, error)
}

type service struct {
Expand Down Expand Up @@ -78,7 +78,7 @@ func NewService(repo IRepository, projectsCLAGroupRepository projects_cla_groups
}
}

func (s service) AddCclaApprovalListRequest(ctx context.Context, companyID string, claGroupID string, args models.CclaWhitelistRequestInput) (string, error) {
func (s service) AddCclaApprovalListRequest(ctx context.Context, companyID string, claGroupID string, args models.CclaAllowlistRequestInput) (string, error) {
f := logrus.Fields{
"functionName": "v1.approval_list.service.AddCclaApprovalListRequest",
utils.XREQUESTID: ctx.Value(utils.XREQUESTID),
Expand Down Expand Up @@ -302,12 +302,12 @@ func (s service) RejectCclaApprovalListRequest(ctx context.Context, companyID, c
}

// ListCclaApprovalListRequest is the handler for the list CLA request
func (s service) ListCclaApprovalListRequest(companyID string, claGroupID, status *string) (*models.CclaWhitelistRequestList, error) {
func (s service) ListCclaApprovalListRequest(companyID string, claGroupID, status *string) (*models.CclaAllowlistRequestList, error) {
return s.repo.ListCclaApprovalListRequests(companyID, claGroupID, status, nil)
}

// ListCclaApprovalListRequestByCompanyProjectUser is the handler for the list CLA request
func (s service) ListCclaApprovalListRequestByCompanyProjectUser(companyID string, claGroupID, status, userID *string) (*models.CclaWhitelistRequestList, error) {
func (s service) ListCclaApprovalListRequestByCompanyProjectUser(companyID string, claGroupID, status, userID *string) (*models.CclaAllowlistRequestList, error) {
return s.repo.ListCclaApprovalListRequests(companyID, claGroupID, status, userID)
}

Expand Down
6 changes: 3 additions & 3 deletions cla-backend-go/cmd/repositories/repositories.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ func (t *TestBehaviour) RunGetProtectedBranch(assertBranchProtection *models.Git
return
}

if response.BranchName == nil || *response.BranchName != "master" {
F.AddError("Get Protected Branch - Default Branch Name expected : master")
if response.BranchName == nil || *response.BranchName != "main" {
F.AddError("Get Protected Branch - Default Branch Name expected : main")
}

if len(response.StatusChecks) == 0 {
Expand Down Expand Up @@ -196,7 +196,7 @@ func (t *TestBehaviour) RunUpdateProtectionBranch(msg string, param *models.Gith
})

t.RunGetProtectedBranch(&models.GithubRepositoryBranchProtection{
BranchName: swag.String("master"),
BranchName: swag.String("main"),
EnforceAdmin: *param.EnforceAdmin,
ProtectionEnabled: true,
StatusChecks: param.StatusChecks,
Expand Down
2 changes: 1 addition & 1 deletion cla-backend-go/events/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (repo *repository) CreateEvent(event *models.Event) error {
}
eventID, err := uuid.NewV4()
if err != nil {
log.WithFields(f).WithError(err).Warnf("Unable to generate a UUID for a whitelist request, error: %v", err)
log.WithFields(f).WithError(err).Warnf("Unable to generate a UUID for a allowlist request, error: %v", err)
return err
}

Expand Down
4 changes: 2 additions & 2 deletions cla-backend-go/github/github-schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -11115,7 +11115,7 @@ A Git object ID.
scalar GitObjectID

"""
A fully qualified reference name (e.g. `refs/heads/master`).
A fully qualified reference name (e.g. `refs/heads/main`).
"""
scalar GitRefname @preview(toggledBy: "update-refs-preview")

Expand Down Expand Up @@ -29928,7 +29928,7 @@ type Repository implements Node & PackageOwner & ProjectOwner & RepositoryInfo &
ref(
"""
The ref to retrieve. Fully qualified matches are checked in order
(`refs/heads/master`) before falling back onto checks for short name matches (`master`).
(`refs/heads/main`) before falling back onto checks for short name matches (`main`).
"""
qualifiedName: String!
): Ref
Expand Down
2 changes: 1 addition & 1 deletion cla-backend-go/projects_cla_groups/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type Service struct {
repo Repository
}

// NewService creates a new whitelist service
// NewService creates a new service
func NewService(repo Repository) Service {
return Service{
repo,
Expand Down
Loading
Loading