Documentation ¶
Index ¶
- Constants
- func AddNumberAttribute(item map[string]*dynamodb.AttributeValue, key string, value int64)
- func AddStringAttribute(item map[string]*dynamodb.AttributeValue, key string, value string)
- func ArrayStringPointer(input []string) []*string
- func Bool(input bool) *bool
- func BoolValue(input *bool) bool
- func ContextWithRequestAndUser(ctx context.Context, reqID string, authUser *auth.User) context.Context
- func ContextWithUser(ctx context.Context, authUser *auth.User) context.Context
- func CreateEventWrapper(eventType string) *event.Event
- func CurrentSimpleDateTimeString() string
- func CurrentTime() (time.Time, string)
- func CurrentUserInACL(authUser *auth.User, managers []v1Models.User) bool
- func DeleteFromS3(filename string) error
- func DocumentExists(key string) (bool, error)
- func DownloadFromS3(filename string) ([]byte, error)
- func ErrorResponseBadRequest(reqID, msg string) *models.ErrorResponse
- func ErrorResponseBadRequestWithError(reqID, msg string, err error) *models.ErrorResponse
- func ErrorResponseConflict(reqID, msg string) *models.ErrorResponse
- func ErrorResponseConflictWithError(reqID, msg string, err error) *models.ErrorResponse
- func ErrorResponseForbidden(reqID, msg string) *models.ErrorResponse
- func ErrorResponseForbiddenWithError(reqID, msg string, err error) *models.ErrorResponse
- func ErrorResponseInternalServerError(reqID, msg string) *models.ErrorResponse
- func ErrorResponseInternalServerErrorWithError(reqID, msg string, err error) *models.ErrorResponse
- func ErrorResponseNotFound(reqID, msg string) *models.ErrorResponse
- func ErrorResponseNotFoundWithError(reqID, msg string, err error) *models.ErrorResponse
- func ErrorResponseUnauthorized(reqID, msg string) *models.ErrorResponse
- func ErrorResponseUnauthorizedWithError(reqID, msg string, err error) *models.ErrorResponse
- func FindInt64Duplicates(a, b []int64) []int64
- func FmtDuration(d time.Duration) string
- func FormatTimeString(timeStr string) string
- func GetBestEmail(userModel *models.User) string
- func GetBestUsername(user *models.User) string
- func GetCorporateURL(isV2Project bool) string
- func GetDownloadLink(filename string) (string, error)
- func GetEmailHelpContent(showV2HelpLink bool) string
- func GetEmailSignOffContent() string
- func GetFirstAndLastName(firstAndLastName string) (string, string)
- func GetGithubEvent(xGithubEvent *string) string
- func GetGithubSignature(xGithubSignature *string) string
- func GetHTTPOKResponse(ctx context.Context) events.APIGatewayProxyResponse
- func GetNilSliceIfEmpty(slice []string) []string
- func GetPathFromURL(s3URLHost string) (string, error)
- func GetProjectParentSFID(project *models.ProjectOutputDetailed) string
- func GetProperty(property string) string
- func GetRequestID(reqID *string) string
- func GetUserEmailFromContext(ctx context.Context) string
- func GetUserNameFromContext(ctx context.Context) string
- func HostInSlice(a string, list []string) bool
- func Int64(v int64) *int64
- func Int64Value(input *int64) int64
- func IsProjectCategory(project *models.ProjectOutputDetailed, parent *models.ProjectOutputDetailed) bool
- func IsProjectHasRootParent(project *models.ProjectOutputDetailed) bool
- func IsProjectHaveChildren(project *models.ProjectOutputDetailed) bool
- func IsProjectHaveParent(project *models.ProjectOutputDetailed) bool
- func IsSalesForceID(id string) bool
- func IsStandaloneProject(project *models.ProjectOutputDetailed) bool
- func IsUUIDv4(id string) bool
- func IsUserAdmin(user *auth.User) bool
- func IsUserAuthorizedForAnyProjectOrganization(ctx context.Context, user *auth.User, projectSFIDs []string, ...) bool
- func IsUserAuthorizedForAnyProjects(ctx context.Context, user *auth.User, projectSFIDs []string, ...) bool
- func IsUserAuthorizedForOrganization(ctx context.Context, user *auth.User, companySFID string, ...) bool
- func IsUserAuthorizedForProject(ctx context.Context, user *auth.User, projectSFID string, ...) bool
- func IsUserAuthorizedForProjectOrganization(ctx context.Context, user *auth.User, projectSFID, companySFID string, ...) bool
- func IsUserAuthorizedForProjectOrganizationTree(ctx context.Context, user *auth.User, projectSFID, companySFID string, ...) bool
- func IsUserAuthorizedForProjectTree(ctx context.Context, user *auth.User, projectSFID string, ...) bool
- func NewContext() context.Context
- func NewContextFromParent(ctx context.Context) context.Context
- func NewContextWithUser(authUser *auth.User) context.Context
- func ParseDateTime(dateTimeStr string) (time.Time, error)
- func ParseString(regEx, val string) (paramsMap map[string]string)
- func RemoveDuplicates(list []string) []string
- func RemoveItemsFromList(existingList, removeEntries []string) []string
- func RenderTemplate(claGroupVersion, templateName, templateStr string, params interface{}) (string, error)
- func SendEmail(subject string, body string, recipients []string) error
- func SetAuthUserProperties(authUser *auth.User, xUserName *string, xEmail *string)
- func SetEmailSender(es EmailSender)
- func SetS3Storage(awsSession *session.Session, bucketName string)
- func SetSnsEmailSender(awsSession *session.Session, snsEventTopicARN string, ...)
- func SignedCLAFilename(projectID string, claType string, identifier string, signatureID string) string
- func SignedClaGroupZipFilename(projectID string, claType string) string
- func SliceDifference(a, b []string) []string
- func StringInSlice(a string, list []string) bool
- func StringRef(input string) *string
- func StringValue(input *string) string
- func TimeToString(t time.Time) string
- func ToEmailEvent(sender *string, recipients []string, subject *string, emailBody *string) *emailevent.EmailEvent
- func ToEmailTemplateEvent(sender *string, recipients []string, subject *string, emailBody *string, ...) *emailevent.EmailEvent
- func ToV1ErrorResponse(err *models.ErrorResponse) *v1Models.ErrorResponse
- func TrimRemoveTrailingComma(input string) string
- func TrimSpaceFromItems(arr []string) []string
- func UploadFileToS3(file *os.File, projectID string, claType string, identifier string, ...) error
- func UploadToS3(body []byte, projectID string, claType string, identifier string, ...) error
- func ValidCompanyName(name string) bool
- func ValidDomain(domain string, allowWildcard bool) (string, bool)
- func ValidEmail(email string) bool
- func ValidGitHubOrg(githubOrg string) (string, bool)
- func ValidGitHubUsername(githubUsername string) (string, bool)
- func ValidGitlabOrg(gitlabOrg string) (string, bool)
- func ValidGitlabUsername(gitlabUsername string) (string, bool)
- func ValidWebsite(website string) bool
- func ValidateAutoEnabledClaGroupID(autoEnabled bool, autoEnabledClaGroupID string) bool
- func WatermarkPdf(pdf []byte, text string) ([]byte, error)
- type CLAGroupCCLANotConfigured
- type CLAGroupICLANotConfigured
- type CLAGroupNameConflict
- type CLAGroupNotFound
- type CLAManagerError
- type CompanyAdminNotFound
- type CompanyNotFound
- type ConversionError
- type DynamoUpdateExpression
- type EmailSender
- type EnrollError
- type EnrollValidationError
- type GitHubOrgNotFound
- type GitHubRepositoryExists
- type GitHubRepositoryNotFound
- type GitLabDuplicateRepositoriesFound
- type GitLabRepositoryExists
- type GitLabRepositoryNotFound
- type InvalidCLAType
- type InvalidRepositoryTypeError
- type MockEmailSender
- type ProjectCLAGroupMappingNotFound
- type ProjectConflict
- type ProjectSummary
- type S3Client
- func (s3c *S3Client) Delete(filename string) error
- func (s3c *S3Client) Download(filename string) ([]byte, error)
- func (s3c *S3Client) GetPresignedURL(filename string) (string, error)
- func (s3c *S3Client) KeyExists(key string) (bool, error)
- func (s3c *S3Client) Upload(fileContent []byte, projectID string, claType string, identifier string, ...) error
- func (s3c *S3Client) UploadFile(file *os.File, projectID string, claType string, identifier string, ...) error
- type S3Storage
- type SFProjectNotFound
- type Service
- type StringSet
- type UserNotFound
Constants ¶
const ( // Connected status Connected = "connected" // PartialConnection status PartialConnection = "partial_connection" // ConnectionFailure status ConnectionFailure = "connection_failure" // NoConnection status NoConnection = "no_connection" )
const ( // V1 is the version 1 identifier V1 = "v1" // V2 is the version 2 identifier V2 = "v2" )
const ( // ALLOW_ADMIN_SCOPE indicates that a given permissions check allows for admins to access to that resource ALLOW_ADMIN_SCOPE = true // nolint // DISALLOW_ADMIN_SCOPE indicates that a given permissions check does not allow for admins to access to that resource DISALLOW_ADMIN_SCOPE = false // nolint )
const AddApprovals = "AddApprovals"
AddApprovals is an action for adding approvals
const CLADesigneeRole = "cla-manager-designee"
CLADesigneeRole CLA manager designee role identifier
const CLAManagerRole = "cla-manager"
CLAManagerRole CLA manager role identifier
const CLAProjectManagerRole = "project-manager"
CLAProjectManagerRole CLA project manager role identifier
const CLASignatoryRole = "cla-signatory"
CLASignatoryRole CLA signatory role identifier
const ClaTypeCCLA = "ccla"
ClaTypeCCLA represents corporate CLA records (includes approval lists)
const ClaTypeECLA = "ecla"
ClaTypeECLA represents employee contributor CLA records (acknowledgements)
const ClaTypeICLA = "icla"
ClaTypeICLA represents individual contributor CLA records
const CompanyAdminRole = "company-admin"
CompanyAdminRole Company admin for user
const ContactRole = "contact"
ContactRole contact role for user
const CtxAuthUser = "authUser"
CtxAuthUser the key for the authenticated user in the context
const DomainApprovalCriteria = "domain"
const EasyCLA400BadRequest = "EasyCLA - 400 Bad Request"
EasyCLA400BadRequest common string for handler bad request error messages
EasyCLA401Unauthorized common string for handler unauthorized error messages
const EasyCLA403Forbidden = "EasyCLA - 403 Forbidden"
EasyCLA403Forbidden common string for handler forbidden error messages
const EasyCLA404NotFound = "EasyCLA - 404 Not Found"
EasyCLA404NotFound common string for handler not found error messages
const EasyCLA409Conflict = "EasyCLA - 409 Conflict"
EasyCLA409Conflict common string for handler conflict error messages
const EasyCLA500InternalServerError = "EasyCLA - 500 Internal Server Error"
EasyCLA500InternalServerError common string for handler internal server error messages
const EmailApprovalCriteria = "email"
const EmailCriteria = "Email Criteria"
EmailCriteria represents approvals based on email addresses
const EmailDomainCriteria = "Email Domain Criteria"
EmailDomainCriteria represents approval based on email domain
const EmailLabel = "Email Address"
EmailLabel represents LF/EasyCLA Email address
const FileTypeCSV = "csv"
FileTypeCSV is the csv file type
const FileTypePDF = "pdf"
FileTypePDF is the pdf file type
const GitHubBotName = "EasyCLA"
GitHubBotName is the name of the GitHub bot
const GitHubEmailLabel = "GitHub Email Address"
GitHubEmailLabel represents the GH Email label used for email
const GitHubOrgCriteria = "GitHub Org Criteria"
GitHubOrgCriteria represents approvals based on GitHub org membership
const GitHubRepositoryType = "GitHub"
GitHubRepositoryType representing the GitLab repository type
const GitHubType = "github"
GitHubType is the repository type identifier for github
const GitHubUserLabel = "GitHub Username"
GitHubUserLabel represents the GH username Label used for email
const GitHubUsernameCriteria = "GitHubUsername"
GitHubUsernameCriteria represents criteria based on GitHub username
const GitLab = "GitLab"
GitLab is the GitLab spelled out with the proper case
const GitLabDuplicateRepoFound = "Duplicate GitLab repositories were found"
GitLabDuplicateRepoFound is a string that indicates that duplicate GitLab repositories were found
const GitLabEmailLabel = "GitLab Email Address"
GitLabEmailLabel represents the GitLab Email label used for email
const GitLabLower = "gitlab"
GitLabLower is the GitLab spelled out in lower case
const GitLabRepoExists = "GitLab repository exists"
GitLabRepoExists is a string that indicates the GitLab repository already exists
const GitLabRepoNotFound = "GitLab repository not found"
GitLabRepoNotFound is a string that indicates the GitLab repository is not found
const GitLabRepositoryType = "GitLab"
GitLabRepositoryType representing the GitLab repository type
const GitLabUserLabel = "GitLab Username"
GitLabUserLabel represents the GitLab username Label used for email
const GithubBranchProtectionPatternAll = "**/**"
GithubBranchProtectionPatternAll is Github Branch Protection Pattern that matches all branches
const GithubOrgApprovalCriteria = "githubOrg"
const GithubRepoExists = "GitHub repository exists"
GithubRepoExists is a string that indicates the GitHub repository already exists
const GithubRepoNotFound = "GitHub repository not found"
GithubRepoNotFound is a string that indicates the GitHub repository is not found
const GithubUsernameApprovalCriteria = "githubUsername"
const GitlabOrgApprovalCriteria = "gitlabOrg"
const GitlabOrgCriteria = "Gitlab Org Criteria"
GitlabOrgCriteria represents approvals based on gitlab org group membership
const GitlabUsernameApprovalCriteria = "gitlabUsername"
const GitlabUsernameCriteria = "GitHubUsername"
GitlabUsernameCriteria represents criteria based on gitlab username
const LFProjectsLLC = "LF Projects, LLC"
LFProjectsLLC is the LF project LLC name of the super parent for many Salesforce Foundations/Project Groups
const Lead = "lead"
Lead representing type of user
const PresignedURLValidity = 15 * time.Minute
PresignedURLValidity is time for which s3 url will remain valid
const ProjectFundedSupportedByParent = "Supported by Parent Project"
ProjectFundedSupportedByParent is a constant that represents a SF project that is funded by the parent
const ProjectOrgScope = "project|organization"
ProjectOrgScope is the ACS project + organiztion scope
const ProjectScope = "project"
ProjectScope is the ACS project scope
const ProjectTypeProject = "Project"
ProjectTypeProject is a salesforce Project that is of Project type
const ProjectTypeProjectGroup = "Project Group"
ProjectTypeProjectGroup is the string that represents the Project Group type in a Project Service record
const ProjectUnfunded = "Unfunded"
ProjectUnfunded is a constant that represents a SF project that is unfunded
const RecordAdded = "INSERT"
RecordAdded dynami event on adding a record
const RecordDeleted = "REMOVE"
RecordDeleted dynamo event for deleting a record
const RecordModified = "MODIFY"
RecordModified dynamo event on modifying a record
const RemoveApprovals = "RemoveApprovals"
RemoveApprovals is an action for removing approvals
const SignatureQueryDefaultActive = "active"
SignatureQueryDefaultActive the signature query default active value - A flag to indicate how a default signature query should return data - show only 'active' signatures or 'all' signatures when no other query signed/approved params are provided
const SignatureQueryDefaultAll = "all"
SignatureQueryDefaultAll the signature query default active value - A flag to indicate how a default signature query should return data - show only 'active' signatures or 'all' signatures when no other query signed/approved params are provided
const SignatureReferenceTypeCompany = "company"
SignatureReferenceTypeCompany is the signature reference type for corporate signatures - signed by CLA Signatories, managed by CLA Managers
const SignatureReferenceTypeUser = "user"
SignatureReferenceTypeUser is the signature reference type for user signatures - individual and employee
const SignatureTypeCCLA = "ccla"
SignatureTypeCCLA is the ccla signature type in the DB
const SignatureTypeCLA = "cla"
SignatureTypeCLA is the cla signature type in the DB
const SortOrderAscending = "asc"
SortOrderAscending ascending sort order constant
const SortOrderDescending = "desc"
SortOrderDescending descending sort order constant
const String400 = "400"
String400 string version of 400 - http bad request
const String401 = "401"
String401 string version of 401 - http unauthorized
const String403 = "403"
String403 string version of 403 - http forbidden
const String404 = "404"
String404 string version of 404 - http not found
const String409 = "409"
String409 string version of 409 - http conflict
const String500 = "500"
String500 string version of 500 - http internal server error
const TheLinuxFoundation = "The Linux Foundation"
TheLinuxFoundation is the name of the super parent for many Salesforce Foundations/Project Groups
const UserLabel = "Username"
UserLabel represents the LF/EasyCLA username
const XREQUESTID = "x-request-id"
XREQUESTID is the client request id - used to trace a client request through the system/logs
const XREQUESTIDKey contextKey = "x-request-id"
Variables ¶
This section is empty.
Functions ¶
func AddNumberAttribute ¶
func AddNumberAttribute(item map[string]*dynamodb.AttributeValue, key string, value int64)
AddNumberAttribute adds number attribute to dynamodb input map
func AddStringAttribute ¶
func AddStringAttribute(item map[string]*dynamodb.AttributeValue, key string, value string)
AddStringAttribute adds string attribute to dynamodb input map
func ArrayStringPointer ¶
ArrayStringPointer converts Array string to Array string pointer
func ContextWithRequestAndUser ¶
func ContextWithRequestAndUser(ctx context.Context, reqID string, authUser *auth.User) context.Context
ContextWithRequestAndUser returns a new context with the specified request ID and user
func ContextWithUser ¶
ContextWithUser returns a new context with the specified user
func CreateEventWrapper ¶
CreateEventWrapper creates a new event with the specified event type
func CurrentSimpleDateTimeString ¶
func CurrentSimpleDateTimeString() string
CurrentSimpleDateTimeString returns the current UTC time and current Time in the "2006-01-02T15:04:05Z" format
func CurrentTime ¶
CurrentTime returns the current UTC time and current Time in the RFC3339 format
func CurrentUserInACL ¶
CurrentUserInACL is a helper function to determine if the current logged in user is in the specified CLA Manager list
func DocumentExists ¶
func DownloadFromS3 ¶
DownloadFromS3 downloads file from s3
func ErrorResponseBadRequest ¶
func ErrorResponseBadRequest(reqID, msg string) *models.ErrorResponse
ErrorResponseBadRequest Helper function to generate a bad request error response
func ErrorResponseBadRequestWithError ¶
func ErrorResponseBadRequestWithError(reqID, msg string, err error) *models.ErrorResponse
ErrorResponseBadRequestWithError Helper function to generate a bad request error response
func ErrorResponseConflict ¶
func ErrorResponseConflict(reqID, msg string) *models.ErrorResponse
ErrorResponseConflict Helper function to generate a conflict error response
func ErrorResponseConflictWithError ¶
func ErrorResponseConflictWithError(reqID, msg string, err error) *models.ErrorResponse
ErrorResponseConflictWithError Helper function to generate a conflict error message
func ErrorResponseForbidden ¶
func ErrorResponseForbidden(reqID, msg string) *models.ErrorResponse
ErrorResponseForbidden Helper function to generate a forbidden error response
func ErrorResponseForbiddenWithError ¶
func ErrorResponseForbiddenWithError(reqID, msg string, err error) *models.ErrorResponse
ErrorResponseForbiddenWithError Helper function to generate a forbidden error response
func ErrorResponseInternalServerError ¶
func ErrorResponseInternalServerError(reqID, msg string) *models.ErrorResponse
ErrorResponseInternalServerError Helper function to generate an internal server error response
func ErrorResponseInternalServerErrorWithError ¶
func ErrorResponseInternalServerErrorWithError(reqID, msg string, err error) *models.ErrorResponse
ErrorResponseInternalServerErrorWithError Helper function to generate an internal server error response
func ErrorResponseNotFound ¶
func ErrorResponseNotFound(reqID, msg string) *models.ErrorResponse
ErrorResponseNotFound Helper function to generate a not found error response
func ErrorResponseNotFoundWithError ¶
func ErrorResponseNotFoundWithError(reqID, msg string, err error) *models.ErrorResponse
ErrorResponseNotFoundWithError Helper function to generate a not found error response
func ErrorResponseUnauthorized ¶
func ErrorResponseUnauthorized(reqID, msg string) *models.ErrorResponse
ErrorResponseUnauthorized Helper function to generate an unauthorized error response
func ErrorResponseUnauthorizedWithError ¶
func ErrorResponseUnauthorizedWithError(reqID, msg string, err error) *models.ErrorResponse
ErrorResponseUnauthorizedWithError Helper function to generate an unauthorized error response
func FindInt64Duplicates ¶
FindInt64Duplicates returns true if the two lists include any duplicates, false otherwise. Returns the duplicates
func FmtDuration ¶
FmtDuration is a helper function to format a duration in the HH:MM:SS.sss format
func FormatTimeString ¶
FormatTimeString converts the time string into the "standard" RFC3339 format
func GetBestEmail ¶
GetBestEmail is a helper function to return the best email address for the user model
func GetBestUsername ¶
GetBestUsername gets best username of CLA User
func GetCorporateURL ¶
GetCorporateURL returns the corporate URL based on the specified flag
func GetDownloadLink ¶
GetDownloadLink provides presigned s3 url
func GetEmailHelpContent ¶
GetEmailHelpContent returns the standard email help paragraph details.
func GetEmailSignOffContent ¶
func GetEmailSignOffContent() string
GetEmailSignOffContent returns the standard email sign-off details
func GetFirstAndLastName ¶
GetFirstAndLastName parses the user's name into first and last strings
func GetGithubEvent ¶
GetGithubEvent helper function to get the github Event Type from the session
func GetGithubSignature ¶
GetGithubSignature helper function to get the github Event Type from the session
func GetHTTPOKResponse ¶
func GetHTTPOKResponse(ctx context.Context) events.APIGatewayProxyResponse
GetHTTPOKResponse : return Get HTTP Success Response
func GetNilSliceIfEmpty ¶
GetNilSliceIfEmpty returns a nil reference is the specified slice is empty, otherwise returns a reference to the original slice
func GetPathFromURL ¶
GetPathFromURL helper function to extract the path from the S3 URL
func GetProjectParentSFID ¶
func GetProjectParentSFID(project *models.ProjectOutputDetailed) string
GetProjectParentSFID returns the project parent SFID if available, otherwise returns empty string
func GetProperty ¶
GetProperty is a common routine to bind and return the specified environment variable
func GetRequestID ¶
GetRequestID helper function to get the request ID from the session
func GetUserEmailFromContext ¶
GetUserEmailFromContext returns the user's email from the context
func GetUserNameFromContext ¶
GetUserNameFromContext returns the user's name from the context
func HostInSlice ¶
HostInSlice returns true if the specified host value exists in the slice, otherwise returns false
func Int64Value ¶
Int64Value function convert int64 pointer to string
func IsProjectCategory ¶
func IsProjectCategory(project *models.ProjectOutputDetailed, parent *models.ProjectOutputDetailed) bool
IsProjectCategory determines if a given project is categorised as cla project sfid
func IsProjectHasRootParent ¶
func IsProjectHasRootParent(project *models.ProjectOutputDetailed) bool
IsProjectHasRootParent determines if a given project has a root parent. A root parent is a parent that is empty parent or the parent is TLF or LFProjects
func IsProjectHaveChildren ¶
func IsProjectHaveChildren(project *models.ProjectOutputDetailed) bool
IsProjectHaveChildren determines if a given project has children
func IsProjectHaveParent ¶
func IsProjectHaveParent(project *models.ProjectOutputDetailed) bool
IsProjectHaveParent returns true if the specified project has a parent
func IsSalesForceID ¶
IsSalesForceID returns true if the specified ID is a SalesForce formatted ID, otherwise returns false
func IsStandaloneProject ¶
func IsStandaloneProject(project *models.ProjectOutputDetailed) bool
IsStandaloneProject determines if a given project is a standalone project. A standalone project is a project with no parent or the parent is TLF/LFProjects and does not have any children
func IsUUIDv4 ¶
IsUUIDv4 returns true if the specified ID is in the UUIDv4 format, otherwise returns false
func IsUserAdmin ¶
IsUserAdmin helper function for determining if the user is an admin
func IsUserAuthorizedForAnyProjectOrganization ¶
func IsUserAuthorizedForAnyProjectOrganization(ctx context.Context, user *auth.User, projectSFIDs []string, companySFID string, adminScopeAllowed bool) bool
IsUserAuthorizedForAnyProjectOrganization helper function for determining if the user is authorized for any of the specified projects with scope of project + organization
func IsUserAuthorizedForAnyProjects ¶
func IsUserAuthorizedForAnyProjects(ctx context.Context, user *auth.User, projectSFIDs []string, adminScopeAllowed bool) bool
IsUserAuthorizedForAnyProjects helper function for determining if the user is authorized for any of the specified projects
func IsUserAuthorizedForOrganization ¶
func IsUserAuthorizedForOrganization(ctx context.Context, user *auth.User, companySFID string, adminScopeAllowed bool) bool
IsUserAuthorizedForOrganization helper function for determining if the user is authorized for this company
func IsUserAuthorizedForProject ¶
func IsUserAuthorizedForProject(ctx context.Context, user *auth.User, projectSFID string, adminScopeAllowed bool) bool
IsUserAuthorizedForProject helper function for determining if the user is authorized for this project
func IsUserAuthorizedForProjectOrganization ¶
func IsUserAuthorizedForProjectOrganization(ctx context.Context, user *auth.User, projectSFID, companySFID string, adminScopeAllowed bool) bool
IsUserAuthorizedForProjectOrganization helper function for determining if the user is authorized for this project organization scope
func IsUserAuthorizedForProjectOrganizationTree ¶
func IsUserAuthorizedForProjectOrganizationTree(ctx context.Context, user *auth.User, projectSFID, companySFID string, adminScopeAllowed bool) bool
IsUserAuthorizedForProjectOrganizationTree helper function for determining if the user is authorized for this project organization scope and nested projects/orgs
func IsUserAuthorizedForProjectTree ¶
func IsUserAuthorizedForProjectTree(ctx context.Context, user *auth.User, projectSFID string, adminScopeAllowed bool) bool
IsUserAuthorizedForProjectTree helper function for determining if the user is authorized for this project hierarchy/tree
func NewContext ¶
NewContext returns a new context object with a new request ID
func NewContextFromParent ¶
NewContextFromParent returns a new context object with a new request ID based on the parent
func NewContextWithUser ¶
NewContextWithUser returns a new context with a newly generated request ID and the specified user
func ParseDateTime ¶
ParseDateTime attempts to convert the string to one of our supported date time formats
func ParseString ¶
ParseString parses a string and returns group values defined in the regex
func RemoveDuplicates ¶
RemoveDuplicates removes any duplicate entries in the provided list and returns a new list
func RemoveItemsFromList ¶
RemoveItemsFromList given a list, removes the specified entries from that list
func RenderTemplate ¶
func RenderTemplate(claGroupVersion, templateName, templateStr string, params interface{}) (string, error)
RenderTemplate renders the template for given template with given params
func SetAuthUserProperties ¶
SetAuthUserProperties adds username and email to auth user
func SetEmailSender ¶
func SetEmailSender(es EmailSender)
SetEmailSender sets up default email sender
func SetS3Storage ¶
SetS3Storage set default S3Storage
func SetSnsEmailSender ¶
func SetSnsEmailSender(awsSession *session.Session, snsEventTopicARN string, senderEmailAddress string)
SetSnsEmailSender set sns as mechanism to send email
func SignedCLAFilename ¶
func SignedCLAFilename(projectID string, claType string, identifier string, signatureID string) string
SignedCLAFilename provide s3 bucket url
func SignedClaGroupZipFilename ¶
SignedClaGroupZipFilename provides s3 bucket url of zip of pdf
func SliceDifference ¶
SliceDifference returns the entries that are different between the two slices
func StringInSlice ¶
StringInSlice returns true if the specified string value exists in the slice, otherwise returns false
func StringValue ¶
StringValue function convert string pointer to string
func TimeToString ¶
TimeToString returns time in the RFC3339 format
func ToEmailEvent ¶
func ToEmailEvent(sender *string, recipients []string, subject *string, emailBody *string) *emailevent.EmailEvent
ToEmailEvent creates an email event model from the email details
func ToEmailTemplateEvent ¶
func ToEmailTemplateEvent(sender *string, recipients []string, subject *string, emailBody *string, templateName string) *emailevent.EmailEvent
ToEmailTemplateEvent creates an email event model from the email details
func ToV1ErrorResponse ¶
func ToV1ErrorResponse(err *models.ErrorResponse) *v1Models.ErrorResponse
ToV1ErrorResponse is a wrapper function to convert a v2 swagger error response to a v1 swagger error response
func TrimRemoveTrailingComma ¶
TrimRemoveTrailingComma trims the whitespace on the specified string and removes the trailing comma
func TrimSpaceFromItems ¶
TrimSpaceFromItems is a helper function to trim space on array items
func UploadFileToS3 ¶
func UploadFileToS3(file *os.File, projectID string, claType string, identifier string, signatureID string) error
UploadFileToS3 uploads file to s3 storage at path contract-group/<project-ID>/<claType>/<identifier>/<signatureID>.pdf claType should be cla or ccla identifier can be user-id or company-id
func UploadToS3 ¶
func UploadToS3(body []byte, projectID string, claType string, identifier string, signatureID string) error
UploadToS3 uploads file to s3 storage at path contract-group/<project-ID>/<claType>/<identifier>/<signatureID>.pdf claType should be cla or ccla identifier can be user-id or company-id
func ValidCompanyName ¶
ValidCompanyName is a routine to indicate if the regex is a valid company name
func ValidDomain ¶
ValidDomain tests the specified domain string, returns true if domain is valid, returns false otherwise
func ValidEmail ¶
ValidEmail tests the specified email string, returns true if email is valid, returns false otherwise
func ValidGitHubOrg ¶
ValidGitHubOrg tests the specified GitHub Organization string, returns true if valid, returns false otherwise
func ValidGitHubUsername ¶
ValidGitHubUsername tests the specified GitHub username string, returns true if valid, returns false otherwise
func ValidGitlabOrg ¶
ValidGitlabOrg tests the specified Gitlab Organization string, returns true if valid, returns false otherwise
func ValidGitlabUsername ¶
ValidGitlabUsername tests the specified Gitlab username string, returns true if valid, returns false otherwise
func ValidWebsite ¶
ValidWebsite is a routine to indicate if the website is a valid URL
func ValidateAutoEnabledClaGroupID ¶
ValidateAutoEnabledClaGroupID checks for validation if autoEnabled flag is on autoEnabledClaGroupID is enabled as well
Types ¶
type CLAGroupCCLANotConfigured ¶
CLAGroupCCLANotConfigured is an error model for CLA Group CCLA not configured
func (*CLAGroupCCLANotConfigured) Error ¶
func (e *CLAGroupCCLANotConfigured) Error() string
Error is an error string function for CLA Group CCLA not configured
func (*CLAGroupCCLANotConfigured) Unwrap ¶
func (e *CLAGroupCCLANotConfigured) Unwrap() error
Unwrap method returns its contained error
type CLAGroupICLANotConfigured ¶
CLAGroupICLANotConfigured is an error model for CLA Group ICLA not configured
func (*CLAGroupICLANotConfigured) Error ¶
func (e *CLAGroupICLANotConfigured) Error() string
Error is an error string function for CLA Group ICLA not configured
func (*CLAGroupICLANotConfigured) Unwrap ¶
func (e *CLAGroupICLANotConfigured) Unwrap() error
Unwrap method returns its contained error
type CLAGroupNameConflict ¶
CLAGroupNameConflict is an error model for CLA Group name conflicts
func (*CLAGroupNameConflict) Error ¶
func (e *CLAGroupNameConflict) Error() string
Error is an error string function for CLA Group not found errors
func (*CLAGroupNameConflict) Unwrap ¶
func (e *CLAGroupNameConflict) Unwrap() error
Unwrap method returns its contained error
type CLAGroupNotFound ¶
CLAGroupNotFound is an error model for CLA Group not found errors
func (*CLAGroupNotFound) Error ¶
func (e *CLAGroupNotFound) Error() string
Error is an error string function for CLA Group not found errors
func (*CLAGroupNotFound) Unwrap ¶
func (e *CLAGroupNotFound) Unwrap() error
Unwrap method returns its contained error
type CLAManagerError ¶
CLAManagerError is an error model for when a CLA Manager error occurs
func (*CLAManagerError) Error ¶
func (e *CLAManagerError) Error() string
Error is an error string function for the CLAManagerError model
func (*CLAManagerError) Unwrap ¶
func (e *CLAManagerError) Unwrap() error
Unwrap method returns its contained error
type CompanyAdminNotFound ¶
CompanyAdminNotFound is an error model for Salesforce Project not found errors
func (*CompanyAdminNotFound) Error ¶
func (e *CompanyAdminNotFound) Error() string
Error is an error string function for the CompanyAdminNotFound model
func (*CompanyAdminNotFound) Unwrap ¶
func (e *CompanyAdminNotFound) Unwrap() error
Unwrap method returns its contained error
type CompanyNotFound ¶
type CompanyNotFound struct { Message string CompanyID string CompanySFID string CompanyName string CompanySigningEntityName string Err error }
CompanyNotFound is an error model for company not found errors
func (*CompanyNotFound) Error ¶
func (e *CompanyNotFound) Error() string
Error is an error string function for the CompanyNotFound model
func (*CompanyNotFound) Unwrap ¶
func (e *CompanyNotFound) Unwrap() error
Unwrap method returns its contained error
type ConversionError ¶
ConversionError is an error model for representing conversion errors
func (*ConversionError) Error ¶
func (e *ConversionError) Error() string
Error is an error string function for Salesforce Project not found errors
func (*ConversionError) Unwrap ¶
func (e *ConversionError) Unwrap() error
Unwrap method returns its contained error
type DynamoUpdateExpression ¶
type DynamoUpdateExpression struct { Expression string ExpressionAttributeNames map[string]*string ExpressionAttributeValues map[string]*dynamodb.AttributeValue }
DynamoUpdateExpression helps build update expression
func NewDynamoUpdateExpression ¶
func NewDynamoUpdateExpression() *DynamoUpdateExpression
NewDynamoUpdateExpression create DynamoUpdateExpression builder
func (*DynamoUpdateExpression) AddAttributeName ¶
func (d *DynamoUpdateExpression) AddAttributeName(name, columName string, condition bool)
AddAttributeName adds the attribute if condition satisfied
func (*DynamoUpdateExpression) AddAttributeValue ¶
func (d *DynamoUpdateExpression) AddAttributeValue(name string, val *dynamodb.AttributeValue, condition bool)
AddAttributeValue adds the attribute value if condition satisfied
func (*DynamoUpdateExpression) AddUpdateExpression ¶
func (d *DynamoUpdateExpression) AddUpdateExpression(columnUpdateExp string, condition bool)
AddUpdateExpression the update expression if condition satisfied
type EmailSender ¶
EmailSender contains method to send email
func GetEmailSender ¶
func GetEmailSender() EmailSender
GetEmailSender returns back the current email sender
type EnrollError ¶
EnrollError is an error model for representing enroll/un-enroll errors
func (*EnrollError) Error ¶
func (e *EnrollError) Error() string
Error is an error string function for enroll/un-enroll error
func (*EnrollError) Unwrap ¶
func (e *EnrollError) Unwrap() error
Unwrap method returns its contained error
type EnrollValidationError ¶
EnrollValidationError is an error model for representing enroll/un-enroll validation errors
func (*EnrollValidationError) Error ¶
func (e *EnrollValidationError) Error() string
Error is an error string function for enroll/un-enroll validation error
func (*EnrollValidationError) Unwrap ¶
func (e *EnrollValidationError) Unwrap() error
Unwrap method returns its contained error
type GitHubOrgNotFound ¶
GitHubOrgNotFound is an error model for GitHub Organization not found errors
func (*GitHubOrgNotFound) Error ¶
func (e *GitHubOrgNotFound) Error() string
Error is an error string function for project CLA Group not found errors
func (*GitHubOrgNotFound) Unwrap ¶
func (e *GitHubOrgNotFound) Unwrap() error
Unwrap method returns its contained error
type GitHubRepositoryExists ¶
GitHubRepositoryExists is an error model for when a GitHub repository already exists
func (*GitHubRepositoryExists) Error ¶
func (e *GitHubRepositoryExists) Error() string
Error is an error string function for the GitHubRepositoryExists model
func (*GitHubRepositoryExists) Unwrap ¶
func (e *GitHubRepositoryExists) Unwrap() error
Unwrap method returns its contained error
type GitHubRepositoryNotFound ¶
GitHubRepositoryNotFound is an error model for a GitHub repository not found
func (*GitHubRepositoryNotFound) Error ¶
func (e *GitHubRepositoryNotFound) Error() string
Error is an error string function for the GitHubRepositoryNotFound model
func (*GitHubRepositoryNotFound) Unwrap ¶
func (e *GitHubRepositoryNotFound) Unwrap() error
Unwrap method returns its contained error
type GitLabDuplicateRepositoriesFound ¶
type GitLabDuplicateRepositoriesFound struct { Message string RepositoryName string RepositoryExternalID int64 Err error }
GitLabDuplicateRepositoriesFound is an error model for a GitLab duplicate repositories found
func (*GitLabDuplicateRepositoriesFound) Error ¶
func (e *GitLabDuplicateRepositoriesFound) Error() string
Error is an error string function for the GitLabDuplicateRepositoriesFound model
func (*GitLabDuplicateRepositoriesFound) Unwrap ¶
func (e *GitLabDuplicateRepositoriesFound) Unwrap() error
Unwrap method returns its contained error
type GitLabRepositoryExists ¶
GitLabRepositoryExists is an error model for when a GitHub repository already exists
func (*GitLabRepositoryExists) Error ¶
func (e *GitLabRepositoryExists) Error() string
Error is an error string function for the GitLabRepositoryExists model
func (*GitLabRepositoryExists) Unwrap ¶
func (e *GitLabRepositoryExists) Unwrap() error
Unwrap method returns its contained error
type GitLabRepositoryNotFound ¶
type GitLabRepositoryNotFound struct { Message string OrganizationName string RepositoryName string RepositoryExternalID int64 ProjectSFID string CLAGroupID string Err error }
GitLabRepositoryNotFound is an error model for a GitLab repository not found
func (*GitLabRepositoryNotFound) Error ¶
func (e *GitLabRepositoryNotFound) Error() string
Error is an error string function for the GitHubRepositoryNotFound model
func (*GitLabRepositoryNotFound) Unwrap ¶
func (e *GitLabRepositoryNotFound) Unwrap() error
Unwrap method returns its contained error
type InvalidCLAType ¶
InvalidCLAType is an error model for invalid CLA types, usually the CLA type is one of: utils.{ClaTypeICLA,ClaTypeECLA,ClaTypeCCLA}
func (*InvalidCLAType) Error ¶
func (e *InvalidCLAType) Error() string
Error is an error string function for CLA Group not found errors
func (*InvalidCLAType) Unwrap ¶
func (e *InvalidCLAType) Unwrap() error
Unwrap method returns its contained error
type InvalidRepositoryTypeError ¶
InvalidRepositoryTypeError is an error model for an invalid repository type
func (*InvalidRepositoryTypeError) Error ¶
func (e *InvalidRepositoryTypeError) Error() string
Error is an error string function for the InvalidRepositoryTypeError model
func (*InvalidRepositoryTypeError) Unwrap ¶
func (e *InvalidRepositoryTypeError) Unwrap() error
Unwrap method returns its contained error
type ProjectCLAGroupMappingNotFound ¶
ProjectCLAGroupMappingNotFound is an error model for project CLA Group not found errors
func (*ProjectCLAGroupMappingNotFound) Error ¶
func (e *ProjectCLAGroupMappingNotFound) Error() string
Error is an error string function for project CLA Group not found errors
func (*ProjectCLAGroupMappingNotFound) Unwrap ¶
func (e *ProjectCLAGroupMappingNotFound) Unwrap() error
Unwrap method returns its contained error
type ProjectConflict ¶
type ProjectConflict struct { Message string ProjectA ProjectSummary ProjectB ProjectSummary Err error }
ProjectConflict is an error model for project conflict
func (*ProjectConflict) Error ¶
func (e *ProjectConflict) Error() string
Error is an error string function for CLA Group not found errors
func (*ProjectConflict) Unwrap ¶
func (e *ProjectConflict) Unwrap() error
Unwrap method returns its contained error
type ProjectSummary ¶
ProjectSummary is a quick data model for the project name and ID
type S3Client ¶
type S3Client struct { BucketName string // contains filtered or unexported fields }
S3Client struct provide methods to interact with s3
func (*S3Client) GetPresignedURL ¶
GetPresignedURL provided presigned url for download
func (*S3Client) Upload ¶
func (s3c *S3Client) Upload(fileContent []byte, projectID string, claType string, identifier string, signatureID string) error
Upload file to s3 storage at path contract-group/<project-ID>/<claType>/<identifier>/<signatureID>.pdf claType should be cla or ccla identifier can be user-id or company-id
type S3Storage ¶
type S3Storage interface { Upload(fileContent []byte, projectID string, claType string, identifier string, signatureID string) error UploadFile(file *os.File, projectID string, claType string, identifier string, signatureID string) error Download(filename string) ([]byte, error) Delete(filename string) error GetPresignedURL(filename string) (string, error) KeyExists(key string) (bool, error) }
S3Storage provides methods to handle s3 storage
type SFProjectNotFound ¶
SFProjectNotFound is an error model for Salesforce Project not found errors
func (*SFProjectNotFound) Error ¶
func (e *SFProjectNotFound) Error() string
Error is an error string function for Salesforce Project not found errors
func (*SFProjectNotFound) Unwrap ¶
func (e *SFProjectNotFound) Unwrap() error
Unwrap method returns its contained error
type StringSet ¶
type StringSet struct {
// contains filtered or unexported fields
}
StringSet contains string set
func NewStringSetFromStringArray ¶
NewStringSetFromStringArray create string set from string array
type UserNotFound ¶
type UserNotFound struct { Message string UserLFID string UserName string UserEmail string Err error }
UserNotFound is an error model for users not found errors
func (*UserNotFound) Error ¶
func (e *UserNotFound) Error() string
Error is an error string function for the CompanyNotFound model
func (*UserNotFound) Unwrap ¶
func (e *UserNotFound) Unwrap() error
Unwrap method returns its contained error
Source Files ¶
- auth_user.go
- autoenable.go
- cla_user.go
- const.go
- constants.go
- context.go
- conversion.go
- dynamodb_update.go
- email.go
- errors.go
- events.go
- lambda.go
- list_utils.go
- pdf.go
- project_helpers.go
- properties.go
- regex.go
- requests.go
- responses.go
- s3.go
- signature_utils.go
- string_set.go
- string_utils.go
- url.go
- utils.go
- utils_user_auth_standalone.go
- validators.go