Add probo by default
Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
@@ -34,6 +34,28 @@ import (
|
|||||||
"go.gearno.de/kit/pg"
|
"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 (
|
type (
|
||||||
OrganizationService struct {
|
OrganizationService struct {
|
||||||
svc *TenantService
|
svc *TenantService
|
||||||
@@ -87,6 +109,10 @@ func (s OrganizationService) Create(
|
|||||||
return fmt.Errorf("cannot insert trust center: %w", err)
|
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
|
return nil
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
@@ -254,3 +280,29 @@ func (s OrganizationService) GenerateLogoURL(
|
|||||||
|
|
||||||
return &presignedReq.URL, nil
|
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
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user