From 987c85652c36ae13a91cf4d75b7b226fc441c0fe Mon Sep 17 00:00:00 2001 From: Sacha Al Himdani Date: Thu, 7 Aug 2025 15:33:03 +0200 Subject: [PATCH] Add probo by default Signed-off-by: Sacha Al Himdani --- pkg/probo/organization_service.go | 52 +++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/pkg/probo/organization_service.go b/pkg/probo/organization_service.go index 58a79214b..5f7a3be5c 100644 --- a/pkg/probo/organization_service.go +++ b/pkg/probo/organization_service.go @@ -34,6 +34,28 @@ import ( "go.gearno.de/kit/pg" ) +var ( + proboVendor = struct { + Name string + Description string + LegalName string + HeadquarterAddress string + WebsiteURL string + PrivacyPolicyURL string + TermsOfServiceURL string + SubprocessorsListURL string + }{ + Name: "Probo", + Description: "Probo is an open-source compliance platform that helps startups achieve SOC 2 and ISO 27001 certifications quickly and affordably, with expert guidance and no vendor lock-in.", + LegalName: "Probo Inc.", + HeadquarterAddress: "490 Post St, Suite 640,San Francisco, CA 94102, United States", + WebsiteURL: "https://www.getprobo.com/", + PrivacyPolicyURL: "https://www.getprobo.com/privacy", + TermsOfServiceURL: "https://www.getprobo.com/terms", + SubprocessorsListURL: "https://www.getprobo.com/subprocessors", + } +) + type ( OrganizationService struct { svc *TenantService @@ -87,6 +109,10 @@ func (s OrganizationService) Create( return fmt.Errorf("cannot insert trust center: %w", err) } + if err := s.createProboVendor(ctx, tx, organization, now); err != nil { + return fmt.Errorf("cannot create Probo vendor: %w", err) + } + return nil }, ) @@ -254,3 +280,29 @@ func (s OrganizationService) GenerateLogoURL( return &presignedReq.URL, nil } + +func (s OrganizationService) createProboVendor(ctx context.Context, tx pg.Conn, organization *coredata.Organization, now time.Time) error { + proboData := &coredata.Vendor{ + ID: gid.New(s.svc.scope.GetTenantID(), coredata.VendorEntityType), + TenantID: organization.TenantID, + OrganizationID: organization.ID, + Name: proboVendor.Name, + Description: &proboVendor.Description, + Category: coredata.VendorCategorySecurity, + HeadquarterAddress: &proboVendor.HeadquarterAddress, + LegalName: &proboVendor.LegalName, + WebsiteURL: &proboVendor.WebsiteURL, + PrivacyPolicyURL: &proboVendor.PrivacyPolicyURL, + TermsOfServiceURL: &proboVendor.TermsOfServiceURL, + SubprocessorsListURL: &proboVendor.SubprocessorsListURL, + ShowOnTrustCenter: false, + CreatedAt: now, + UpdatedAt: now, + } + + if err := proboData.Insert(ctx, tx, s.svc.scope); err != nil { + return fmt.Errorf("cannot insert trust center: %w", err) + } + + return nil +}