Rename GraphQL APIs to compliance portal
Update console, visitor, MCP, and Slack API surfaces so schemas and resolvers use the Compliance Portal naming consistently. Signed-off-by: Bryan Frimin <bryan@probo.com>
This commit is contained in:
@@ -68,7 +68,7 @@ type (
|
|||||||
ResourceAlias *resourcealias.Service
|
ResourceAlias *resourcealias.Service
|
||||||
File *filemanager.Service
|
File *filemanager.Service
|
||||||
IAM *iam.Service
|
IAM *iam.Service
|
||||||
Trust *visitor.Service
|
Visitor *visitor.Service
|
||||||
ESign *esign.Service
|
ESign *esign.Service
|
||||||
Management *management.Service
|
Management *management.Service
|
||||||
CertManager *certmanager.Service
|
CertManager *certmanager.Service
|
||||||
@@ -242,12 +242,12 @@ func NewServer(cfg Config) (*Server, error) {
|
|||||||
slackHandler: slack_v1.NewMux(
|
slackHandler: slack_v1.NewMux(
|
||||||
cfg.Logger.Named("slack.v1"),
|
cfg.Logger.Named("slack.v1"),
|
||||||
cfg.Slack,
|
cfg.Slack,
|
||||||
cfg.Trust,
|
cfg.Visitor,
|
||||||
),
|
),
|
||||||
connectHandler: connect_v1.NewMux(
|
connectHandler: connect_v1.NewMux(
|
||||||
cfg.Logger.Named("connect.v1"),
|
cfg.Logger.Named("connect.v1"),
|
||||||
cfg.IAM,
|
cfg.IAM,
|
||||||
cfg.Trust,
|
cfg.Visitor,
|
||||||
cfg.Cookie,
|
cfg.Cookie,
|
||||||
cfg.TokenSecret,
|
cfg.TokenSecret,
|
||||||
cfg.File,
|
cfg.File,
|
||||||
@@ -257,7 +257,7 @@ func NewServer(cfg Config) (*Server, error) {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err := cfg.Trust.GetPortalByDomainName(ctx, host)
|
_, err := cfg.Visitor.GetPortalByDomainName(ctx, host)
|
||||||
|
|
||||||
return err == nil
|
return err == nil
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -31,10 +31,10 @@ type (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
identityContextKey = &ctxKey{name: "identity"}
|
identityContextKey = &ctxKey{name: "identity"}
|
||||||
sessionContextKey = &ctxKey{name: "session"}
|
sessionContextKey = &ctxKey{name: "session"}
|
||||||
apiKeyContextKey = &ctxKey{name: "api_key"}
|
apiKeyContextKey = &ctxKey{name: "api_key"}
|
||||||
trustCenterKey = &ctxKey{name: "trust_center"}
|
compliancePortalKey = &ctxKey{name: "compliance_portal"}
|
||||||
)
|
)
|
||||||
|
|
||||||
func SessionFromContext(ctx context.Context) *coredata.Session {
|
func SessionFromContext(ctx context.Context) *coredata.Session {
|
||||||
|
|||||||
@@ -29,11 +29,11 @@ import (
|
|||||||
"go.probo.inc/probo/pkg/server/gqlutils"
|
"go.probo.inc/probo/pkg/server/gqlutils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewCompliancePagePresenceMiddleware() func(next http.Handler) http.Handler {
|
func NewCompliancePortalPresenceMiddleware() func(next http.Handler) http.Handler {
|
||||||
return func(next http.Handler) http.Handler {
|
return func(next http.Handler) http.Handler {
|
||||||
return http.HandlerFunc(
|
return http.HandlerFunc(
|
||||||
func(w http.ResponseWriter, r *http.Request) {
|
func(w http.ResponseWriter, r *http.Request) {
|
||||||
compliancePage := CompliancePageFromContext(r.Context())
|
compliancePage := CompliancePortalFromContext(r.Context())
|
||||||
|
|
||||||
if compliancePage == nil {
|
if compliancePage == nil {
|
||||||
httpserver.RenderJSON(
|
httpserver.RenderJSON(
|
||||||
@@ -29,16 +29,16 @@ import (
|
|||||||
type ctxKey struct{ name string }
|
type ctxKey struct{ name string }
|
||||||
|
|
||||||
var (
|
var (
|
||||||
compliancePageKey = &ctxKey{name: "compliance_page"}
|
compliancePortalKey = &ctxKey{name: "compliance_portal"}
|
||||||
compliancePageBaseURLKey = &ctxKey{name: "compliance_page_base_url"}
|
compliancePortalBaseURLKey = &ctxKey{name: "compliance_portal_base_url"}
|
||||||
)
|
)
|
||||||
|
|
||||||
func CompliancePageFromContext(ctx context.Context) *coredata.TrustCenter {
|
func CompliancePortalFromContext(ctx context.Context) *coredata.CompliancePortal {
|
||||||
page, _ := ctx.Value(compliancePageKey).(*coredata.TrustCenter)
|
page, _ := ctx.Value(compliancePortalKey).(*coredata.CompliancePortal)
|
||||||
return page
|
return page
|
||||||
}
|
}
|
||||||
|
|
||||||
func CompliancePageBaseURLFromContext(ctx context.Context) *string {
|
func CompliancePortalBaseURLFromContext(ctx context.Context) *string {
|
||||||
page, _ := ctx.Value(compliancePageBaseURLKey).(*string)
|
page, _ := ctx.Value(compliancePortalBaseURLKey).(*string)
|
||||||
return page
|
return page
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,15 +28,15 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type Handler struct {
|
type Handler struct {
|
||||||
trustService *visitor.Service
|
visitor *visitor.Service
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewHandler(trustService *visitor.Service) *Handler {
|
func NewHandler(visitorSvc *visitor.Service) *Handler {
|
||||||
return &Handler{trustService: trustService}
|
return &Handler{visitor: visitorSvc}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *Handler) HandleLLMsTxt(w http.ResponseWriter, r *http.Request) {
|
func (h *Handler) HandleLLMsTxt(w http.ResponseWriter, r *http.Request) {
|
||||||
tc := CompliancePageFromContext(r.Context())
|
tc := CompliancePortalFromContext(r.Context())
|
||||||
if tc == nil {
|
if tc == nil {
|
||||||
http.Error(w, "not found", http.StatusNotFound)
|
http.Error(w, "not found", http.StatusNotFound)
|
||||||
return
|
return
|
||||||
@@ -46,19 +46,19 @@ func (h *Handler) HandleLLMsTxt(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
scope := coredata.NewScopeFromObjectID(tc.ID)
|
scope := coredata.NewScopeFromObjectID(tc.ID)
|
||||||
|
|
||||||
if err := h.trustService.RenderCompliancePageMarkdown(r.Context(), w, tc.ID, scope); err != nil {
|
if err := h.visitor.RenderCompliancePortalMarkdown(r.Context(), w, tc.ID, scope); err != nil {
|
||||||
http.Error(w, "internal server error", http.StatusInternalServerError)
|
http.Error(w, "internal server error", http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *Handler) HandleRobotsTxt(w http.ResponseWriter, r *http.Request) {
|
func (h *Handler) HandleRobotsTxt(w http.ResponseWriter, r *http.Request) {
|
||||||
tc := CompliancePageFromContext(r.Context())
|
tc := CompliancePortalFromContext(r.Context())
|
||||||
if tc == nil {
|
if tc == nil {
|
||||||
http.Error(w, "not found", http.StatusNotFound)
|
http.Error(w, "not found", http.StatusNotFound)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
baseURL := CompliancePageBaseURLFromContext(r.Context())
|
baseURL := CompliancePortalBaseURLFromContext(r.Context())
|
||||||
if baseURL == nil {
|
if baseURL == nil {
|
||||||
http.Error(w, "not found", http.StatusNotFound)
|
http.Error(w, "not found", http.StatusNotFound)
|
||||||
return
|
return
|
||||||
@@ -66,19 +66,19 @@ func (h *Handler) HandleRobotsTxt(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
|
w.Header().Set("Content-Type", "text/plain; charset=utf-8")
|
||||||
|
|
||||||
if err := h.trustService.RenderRobotsTxt(r.Context(), w, tc.SearchEngineIndexing, *baseURL); err != nil {
|
if err := h.visitor.RenderRobotsTxt(r.Context(), w, tc.SearchEngineIndexing, *baseURL); err != nil {
|
||||||
http.Error(w, "internal server error", http.StatusInternalServerError)
|
http.Error(w, "internal server error", http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *Handler) HandleSitemap(w http.ResponseWriter, r *http.Request) {
|
func (h *Handler) HandleSitemap(w http.ResponseWriter, r *http.Request) {
|
||||||
tc := CompliancePageFromContext(r.Context())
|
tc := CompliancePortalFromContext(r.Context())
|
||||||
if tc == nil {
|
if tc == nil {
|
||||||
http.Error(w, "not found", http.StatusNotFound)
|
http.Error(w, "not found", http.StatusNotFound)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
baseURL := CompliancePageBaseURLFromContext(r.Context())
|
baseURL := CompliancePortalBaseURLFromContext(r.Context())
|
||||||
if baseURL == nil {
|
if baseURL == nil {
|
||||||
http.Error(w, "not found", http.StatusNotFound)
|
http.Error(w, "not found", http.StatusNotFound)
|
||||||
return
|
return
|
||||||
@@ -88,7 +88,7 @@ func (h *Handler) HandleSitemap(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
scope := coredata.NewScopeFromObjectID(tc.ID)
|
scope := coredata.NewScopeFromObjectID(tc.ID)
|
||||||
|
|
||||||
if err := h.trustService.RenderSitemap(r.Context(), w, tc.ID, scope, *baseURL); err != nil {
|
if err := h.visitor.RenderSitemap(r.Context(), w, tc.ID, scope, *baseURL); err != nil {
|
||||||
http.Error(w, "internal server error", http.StatusInternalServerError)
|
http.Error(w, "internal server error", http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ import (
|
|||||||
"go.probo.inc/probo/pkg/server/gqlutils"
|
"go.probo.inc/probo/pkg/server/gqlutils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewMemberProvisioningMiddleware(trustSvc *visitor.Service, logger *log.Logger) func(next http.Handler) http.Handler {
|
func NewMemberProvisioningMiddleware(visitorSvc *visitor.Service, logger *log.Logger) func(next http.Handler) http.Handler {
|
||||||
return func(next http.Handler) http.Handler {
|
return func(next http.Handler) http.Handler {
|
||||||
return http.HandlerFunc(
|
return http.HandlerFunc(
|
||||||
func(w http.ResponseWriter, r *http.Request) {
|
func(w http.ResponseWriter, r *http.Request) {
|
||||||
@@ -44,9 +44,9 @@ func NewMemberProvisioningMiddleware(trustSvc *visitor.Service, logger *log.Logg
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
compliancePage := CompliancePageFromContext(r.Context())
|
compliancePage := CompliancePortalFromContext(r.Context())
|
||||||
|
|
||||||
if _, err := trustSvc.ProvisionPortalMember(ctx, compliancePage.ID, identity.ID); err != nil {
|
if _, err := visitorSvc.ProvisionPortalMember(ctx, compliancePage.ID, identity.ID); err != nil {
|
||||||
logger.ErrorCtx(ctx, "cannot provision member", log.Error(err))
|
logger.ErrorCtx(ctx, "cannot provision member", log.Error(err))
|
||||||
httpserver.RenderJSON(
|
httpserver.RenderJSON(
|
||||||
w,
|
w,
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import (
|
|||||||
"go.probo.inc/probo/pkg/server/gqlutils"
|
"go.probo.inc/probo/pkg/server/gqlutils"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewSNIMiddleware(trustSvc *visitor.Service) func(next http.Handler) http.Handler {
|
func NewSNIMiddleware(visitorSvc *visitor.Service) func(next http.Handler) http.Handler {
|
||||||
return func(next http.Handler) http.Handler {
|
return func(next http.Handler) http.Handler {
|
||||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
ctx := r.Context()
|
ctx := r.Context()
|
||||||
@@ -44,7 +44,7 @@ func NewSNIMiddleware(trustSvc *visitor.Service) func(next http.Handler) http.Ha
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
compliancePage, err := trustSvc.GetPortalByDomainName(ctx, r.TLS.ServerName)
|
compliancePage, err := visitorSvc.GetPortalByDomainName(ctx, r.TLS.ServerName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(err, visitor.ErrPageNotFound) {
|
if errors.Is(err, visitor.ErrPageNotFound) {
|
||||||
next.ServeHTTP(w, r)
|
next.ServeHTTP(w, r)
|
||||||
@@ -68,7 +68,7 @@ func NewSNIMiddleware(trustSvc *visitor.Service) func(next http.Handler) http.Ha
|
|||||||
// page is only ever served under a single origin. ACME HTTP-01
|
// page is only ever served under a single origin. ACME HTTP-01
|
||||||
// challenges are handled upstream and never reach this middleware.
|
// challenges are handled upstream and never reach this middleware.
|
||||||
if !strings.HasPrefix(r.URL.Path, "/.well-known/") {
|
if !strings.HasPrefix(r.URL.Path, "/.well-known/") {
|
||||||
canonicalHost, err := trustSvc.GetPortalEffectiveCanonicalHost(ctx, compliancePage.ID)
|
canonicalHost, err := visitorSvc.GetPortalEffectiveCanonicalHost(ctx, compliancePage.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
httpserver.RenderJSON(
|
httpserver.RenderJSON(
|
||||||
w,
|
w,
|
||||||
@@ -106,13 +106,13 @@ func NewSNIMiddleware(trustSvc *visitor.Service) func(next http.Handler) http.Ha
|
|||||||
|
|
||||||
ctx = context.WithValue(
|
ctx = context.WithValue(
|
||||||
ctx,
|
ctx,
|
||||||
compliancePageBaseURLKey,
|
compliancePortalBaseURLKey,
|
||||||
&baseURLString,
|
&baseURLString,
|
||||||
)
|
)
|
||||||
r = r.WithContext(ctx)
|
r = r.WithContext(ctx)
|
||||||
|
|
||||||
if compliancePage.Active {
|
if compliancePage.Active {
|
||||||
ctx = context.WithValue(ctx, compliancePageKey, compliancePage)
|
ctx = context.WithValue(ctx, compliancePortalKey, compliancePage)
|
||||||
next.ServeHTTP(w, r.WithContext(ctx))
|
next.ServeHTTP(w, r.WithContext(ctx))
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ func (r *mutationResolver) UpdateFullName(ctx context.Context, input types.Updat
|
|||||||
return nil, gqlutils.Unauthenticatedf(ctx, "authentication is required to request access")
|
return nil, gqlutils.Unauthenticatedf(ctx, "authentication is required to request access")
|
||||||
}
|
}
|
||||||
|
|
||||||
compliancePage := complianceportal.CompliancePageFromContext(ctx)
|
compliancePage := complianceportal.CompliancePortalFromContext(ctx)
|
||||||
|
|
||||||
profile, err := r.iam.OrganizationService.GetProfileForIdentityAndOrganization(ctx, identity.ID, compliancePage.OrganizationID)
|
profile, err := r.iam.OrganizationService.GetProfileForIdentityAndOrganization(ctx, identity.ID, compliancePage.OrganizationID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -43,13 +43,13 @@ func (r *queryResolver) Viewer(ctx context.Context) (*types.Identity, error) {
|
|||||||
// Node is the resolver for the node field.
|
// Node is the resolver for the node field.
|
||||||
func (r *queryResolver) Node(ctx context.Context, id gid.GID) (types.Node, error) {
|
func (r *queryResolver) Node(ctx context.Context, id gid.GID) (types.Node, error) {
|
||||||
scope := coredata.NewScopeFromObjectID(id)
|
scope := coredata.NewScopeFromObjectID(id)
|
||||||
trustService := r.trust
|
visitorService := r.visitor
|
||||||
|
|
||||||
switch id.EntityType() {
|
switch id.EntityType() {
|
||||||
case coredata.DocumentEntityType:
|
case coredata.DocumentEntityType:
|
||||||
trustCenter := complianceportal.CompliancePageFromContext(ctx)
|
compliancePortal := complianceportal.CompliancePortalFromContext(ctx)
|
||||||
|
|
||||||
document, err := trustService.GetDocument(ctx, scope, trustCenter.OrganizationID, id)
|
document, err := visitorService.GetDocument(ctx, scope, compliancePortal.OrganizationID, id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(err, visitor.ErrDocumentNotFound) || errors.Is(err, visitor.ErrDocumentNotVisible) || errors.Is(err, coredata.ErrResourceNotFound) {
|
if errors.Is(err, visitor.ErrDocumentNotFound) || errors.Is(err, visitor.ErrDocumentNotVisible) || errors.Is(err, coredata.ErrResourceNotFound) {
|
||||||
return nil, gqlutils.NotFoundf(ctx, "node %q not found", id)
|
return nil, gqlutils.NotFoundf(ctx, "node %q not found", id)
|
||||||
@@ -67,7 +67,7 @@ func (r *queryResolver) Node(ctx context.Context, id gid.GID) (types.Node, error
|
|||||||
return types.NewDocument(document), nil
|
return types.NewDocument(document), nil
|
||||||
|
|
||||||
case coredata.FrameworkEntityType:
|
case coredata.FrameworkEntityType:
|
||||||
framework, err := trustService.GetFramework(ctx, scope, id)
|
framework, err := visitorService.GetFramework(ctx, scope, id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.logger.ErrorCtx(ctx, "cannot get framework", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot get framework", log.Error(err))
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
@@ -76,9 +76,9 @@ func (r *queryResolver) Node(ctx context.Context, id gid.GID) (types.Node, error
|
|||||||
return types.NewFramework(framework), nil
|
return types.NewFramework(framework), nil
|
||||||
|
|
||||||
case coredata.FileEntityType:
|
case coredata.FileEntityType:
|
||||||
trustCenter := complianceportal.CompliancePageFromContext(ctx)
|
compliancePortal := complianceportal.CompliancePortalFromContext(ctx)
|
||||||
|
|
||||||
file, err := trustService.GetReport(ctx, scope, trustCenter.OrganizationID, id)
|
file, err := visitorService.GetReport(ctx, scope, compliancePortal.OrganizationID, id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(err, visitor.ErrReportNotFound) || errors.Is(err, coredata.ErrResourceNotFound) {
|
if errors.Is(err, visitor.ErrReportNotFound) || errors.Is(err, coredata.ErrResourceNotFound) {
|
||||||
return nil, gqlutils.NotFoundf(ctx, "node %q not found", id)
|
return nil, gqlutils.NotFoundf(ctx, "node %q not found", id)
|
||||||
@@ -92,7 +92,7 @@ func (r *queryResolver) Node(ctx context.Context, id gid.GID) (types.Node, error
|
|||||||
return types.NewAuditReport(file), nil
|
return types.NewAuditReport(file), nil
|
||||||
|
|
||||||
case coredata.AuditEntityType:
|
case coredata.AuditEntityType:
|
||||||
audit, err := trustService.GetAudit(ctx, scope, id)
|
audit, err := visitorService.GetAudit(ctx, scope, id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.logger.ErrorCtx(ctx, "cannot get audit", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot get audit", log.Error(err))
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
@@ -101,7 +101,7 @@ func (r *queryResolver) Node(ctx context.Context, id gid.GID) (types.Node, error
|
|||||||
return types.NewAudit(audit), nil
|
return types.NewAudit(audit), nil
|
||||||
|
|
||||||
case coredata.ThirdPartyEntityType:
|
case coredata.ThirdPartyEntityType:
|
||||||
thirdParty, err := trustService.GetThirdParty(ctx, scope, id)
|
thirdParty, err := visitorService.GetThirdParty(ctx, scope, id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.logger.ErrorCtx(ctx, "cannot get thirdParty", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot get thirdParty", log.Error(err))
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
@@ -109,39 +109,39 @@ func (r *queryResolver) Node(ctx context.Context, id gid.GID) (types.Node, error
|
|||||||
|
|
||||||
return types.NewSubprocessor(thirdParty), nil
|
return types.NewSubprocessor(thirdParty), nil
|
||||||
|
|
||||||
case coredata.TrustCenterEntityType:
|
case coredata.CompliancePortalEntityType:
|
||||||
trustCenter, err := trustService.GetPortal(ctx, scope, id)
|
compliancePortal, err := visitorService.GetPortal(ctx, scope, id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.logger.ErrorCtx(ctx, "cannot get trust center", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot get compliance portal", log.Error(err))
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
return types.NewTrustCenter(trustCenter), nil
|
return types.NewCompliancePortal(compliancePortal), nil
|
||||||
|
|
||||||
case coredata.TrustCenterReferenceEntityType:
|
case coredata.CompliancePortalReferenceEntityType:
|
||||||
reference, err := trustService.GetPortalReference(ctx, scope, id)
|
reference, err := visitorService.GetPortalReference(ctx, scope, id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.logger.ErrorCtx(ctx, "cannot get trust center reference", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot get compliance portal reference", log.Error(err))
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
return types.NewTrustCenterReference(reference), nil
|
return types.NewCompliancePortalReference(reference), nil
|
||||||
|
|
||||||
case coredata.TrustCenterFileEntityType:
|
case coredata.CompliancePortalFileEntityType:
|
||||||
trustCenter := complianceportal.CompliancePageFromContext(ctx)
|
compliancePortal := complianceportal.CompliancePortalFromContext(ctx)
|
||||||
|
|
||||||
trustCenterFile, err := trustService.GetPortalFile(ctx, scope, trustCenter.OrganizationID, id)
|
portalFile, err := visitorService.GetPortalFile(ctx, scope, compliancePortal.OrganizationID, id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(err, visitor.ErrPortalFileNotFound) || errors.Is(err, visitor.ErrPortalFileNotVisible) {
|
if errors.Is(err, visitor.ErrPortalFileNotFound) || errors.Is(err, visitor.ErrPortalFileNotVisible) {
|
||||||
return nil, gqlutils.NotFoundf(ctx, "node %q not found", id)
|
return nil, gqlutils.NotFoundf(ctx, "node %q not found", id)
|
||||||
}
|
}
|
||||||
|
|
||||||
r.logger.ErrorCtx(ctx, "cannot get trust center file", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot get compliance portal file", log.Error(err))
|
||||||
|
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
return types.NewTrustCenterFile(trustCenterFile), nil
|
return types.NewCompliancePortalFile(portalFile), nil
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return nil, gqlutils.NotFoundf(ctx, "node %q not found", id)
|
return nil, gqlutils.NotFoundf(ctx, "node %q not found", id)
|
||||||
@@ -152,8 +152,8 @@ func (r *queryResolver) Node(ctx context.Context, id gid.GID) (types.Node, error
|
|||||||
func (r *queryResolver) AliasedNode(ctx context.Context, alias string) (types.Node, error) {
|
func (r *queryResolver) AliasedNode(ctx context.Context, alias string) (types.Node, error) {
|
||||||
resourceID, err := gid.ParseGID(alias)
|
resourceID, err := gid.ParseGID(alias)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
trustCenter := complianceportal.CompliancePageFromContext(ctx)
|
compliancePortal := complianceportal.CompliancePortalFromContext(ctx)
|
||||||
scope := coredata.NewScopeFromObjectID(trustCenter.ID)
|
scope := coredata.NewScopeFromObjectID(compliancePortal.ID)
|
||||||
|
|
||||||
resourceID, err = r.resourceAlias.ResolveAlias(
|
resourceID, err = r.resourceAlias.ResolveAlias(
|
||||||
ctx,
|
ctx,
|
||||||
@@ -174,22 +174,20 @@ func (r *queryResolver) AliasedNode(ctx context.Context, alias string) (types.No
|
|||||||
return r.Node(ctx, resourceID)
|
return r.Node(ctx, resourceID)
|
||||||
}
|
}
|
||||||
|
|
||||||
// CurrentTrustCenter is the resolver for the currentTrustCenter field.
|
// CurrentCompliancePortal is the resolver for the currentCompliancePortal field.
|
||||||
func (r *queryResolver) CurrentTrustCenter(ctx context.Context) (*types.TrustCenter, error) {
|
func (r *queryResolver) CurrentCompliancePortal(ctx context.Context) (*types.CompliancePortal, error) {
|
||||||
trustCenter := complianceportal.CompliancePageFromContext(ctx)
|
compliancePortal := complianceportal.CompliancePortalFromContext(ctx)
|
||||||
|
|
||||||
scope := coredata.NewScopeFromObjectID(trustCenter.ID)
|
scope := coredata.NewScopeFromObjectID(compliancePortal.ID)
|
||||||
trustService := r.trust
|
visitorService := r.visitor
|
||||||
|
|
||||||
var err error
|
compliancePortal, err := visitorService.GetPortal(ctx, scope, compliancePortal.ID)
|
||||||
|
|
||||||
trustCenter, err = trustService.GetPortal(ctx, scope, trustCenter.ID)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.logger.ErrorCtx(ctx, "cannot get trust center", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot get compliance portal", log.Error(err))
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
return types.NewTrustCenter(trustCenter), nil
|
return types.NewCompliancePortal(compliancePortal), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// OidcProviders is the resolver for the oidcProviders field.
|
// OidcProviders is the resolver for the oidcProviders field.
|
||||||
@@ -225,10 +223,10 @@ func (r *queryResolver) MyRightsRequests(ctx context.Context, first *int, after
|
|||||||
return types.NewRightsRequestConnection(emptyPage), nil
|
return types.NewRightsRequestConnection(emptyPage), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
compliancePage := complianceportal.CompliancePageFromContext(ctx)
|
compliancePage := complianceportal.CompliancePortalFromContext(ctx)
|
||||||
scope := coredata.NewScopeFromObjectID(compliancePage.OrganizationID)
|
scope := coredata.NewScopeFromObjectID(compliancePage.OrganizationID)
|
||||||
|
|
||||||
result, err := r.trust.ListRightsRequestsForOrganizationIDAndContact(
|
result, err := r.visitor.ListRightsRequestsForOrganizationIDAndContact(
|
||||||
ctx,
|
ctx,
|
||||||
scope,
|
scope,
|
||||||
compliancePage.OrganizationID,
|
compliancePage.OrganizationID,
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ func NewBrandDarkLogoHandler(logger *log.Logger, fileManager *filemanager.Servic
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (h *brandLogoHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
func (h *brandLogoHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
compliancePage := complianceportal.CompliancePageFromContext(r.Context())
|
compliancePage := complianceportal.CompliancePortalFromContext(r.Context())
|
||||||
if compliancePage == nil {
|
if compliancePage == nil {
|
||||||
httpserver.RenderError(w, http.StatusNotFound, errNotFound)
|
httpserver.RenderError(w, http.StatusNotFound, errNotFound)
|
||||||
return
|
return
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -26,12 +26,12 @@ type Query {
|
|||||||
viewer: Identity
|
viewer: Identity
|
||||||
node(id: ID!): Node
|
node(id: ID!): Node
|
||||||
aliasedNode(alias: String!): Node
|
aliasedNode(alias: String!): Node
|
||||||
currentTrustCenter: TrustCenter
|
currentCompliancePortal: CompliancePortal
|
||||||
oidcProviders: [OIDCProviderInfo!]!
|
oidcProviders: [OIDCProviderInfo!]!
|
||||||
@goField(forceResolver: true)
|
@goField(forceResolver: true)
|
||||||
@authentication(required: OPTIONAL)
|
@authentication(required: OPTIONAL)
|
||||||
|
|
||||||
# The current viewer's own data subject requests for this trust center,
|
# The current viewer's own data subject requests for this compliance portal,
|
||||||
# scoped by their verified email. Returns an empty connection for guests so
|
# scoped by their verified email. Returns an empty connection for guests so
|
||||||
# the portal can still render its empty state.
|
# the portal can still render its empty state.
|
||||||
myRightsRequests(
|
myRightsRequests(
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
type TrustCenter implements Node {
|
type CompliancePortal implements Node {
|
||||||
id: ID!
|
id: ID!
|
||||||
active: Boolean!
|
active: Boolean!
|
||||||
slug: String!
|
slug: String!
|
||||||
@@ -20,7 +20,7 @@ type TrustCenter implements Node {
|
|||||||
after: CursorKey
|
after: CursorKey
|
||||||
last: Int
|
last: Int
|
||||||
before: CursorKey
|
before: CursorKey
|
||||||
filter: TrustCenterVisibilityFilter
|
filter: CompliancePortalVisibilityFilter
|
||||||
): DocumentConnection! @goField(forceResolver: true)
|
): DocumentConnection! @goField(forceResolver: true)
|
||||||
|
|
||||||
audits(
|
audits(
|
||||||
@@ -28,7 +28,7 @@ type TrustCenter implements Node {
|
|||||||
after: CursorKey
|
after: CursorKey
|
||||||
last: Int
|
last: Int
|
||||||
before: CursorKey
|
before: CursorKey
|
||||||
filter: TrustCenterVisibilityFilter
|
filter: CompliancePortalVisibilityFilter
|
||||||
): AuditConnection! @goField(forceResolver: true)
|
): AuditConnection! @goField(forceResolver: true)
|
||||||
|
|
||||||
subprocessors(
|
subprocessors(
|
||||||
@@ -49,7 +49,7 @@ type TrustCenter implements Node {
|
|||||||
after: CursorKey
|
after: CursorKey
|
||||||
last: Int
|
last: Int
|
||||||
before: CursorKey
|
before: CursorKey
|
||||||
): TrustCenterReferenceConnection! @goField(forceResolver: true)
|
): CompliancePortalReferenceConnection! @goField(forceResolver: true)
|
||||||
|
|
||||||
commitmentGroups(
|
commitmentGroups(
|
||||||
first: Int
|
first: Int
|
||||||
@@ -58,13 +58,13 @@ type TrustCenter implements Node {
|
|||||||
before: CursorKey
|
before: CursorKey
|
||||||
): CompliancePortalCommitmentGroupConnection! @goField(forceResolver: true)
|
): CompliancePortalCommitmentGroupConnection! @goField(forceResolver: true)
|
||||||
|
|
||||||
trustCenterFiles(
|
compliancePortalFiles(
|
||||||
first: Int
|
first: Int
|
||||||
after: CursorKey
|
after: CursorKey
|
||||||
last: Int
|
last: Int
|
||||||
before: CursorKey
|
before: CursorKey
|
||||||
filter: TrustCenterVisibilityFilter
|
filter: CompliancePortalVisibilityFilter
|
||||||
): TrustCenterFileConnection! @goField(forceResolver: true)
|
): CompliancePortalFileConnection! @goField(forceResolver: true)
|
||||||
|
|
||||||
complianceFrameworks(
|
complianceFrameworks(
|
||||||
first: Int
|
first: Int
|
||||||
@@ -109,16 +109,16 @@ enum DocumentType
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
enum TrustCenterVisibility
|
enum CompliancePortalVisibility
|
||||||
@goModel(model: "go.probo.inc/probo/pkg/coredata.TrustCenterVisibility") {
|
@goModel(model: "go.probo.inc/probo/pkg/coredata.CompliancePortalVisibility") {
|
||||||
PRIVATE
|
PRIVATE
|
||||||
@goEnum(value: "go.probo.inc/probo/pkg/coredata.TrustCenterVisibilityPrivate")
|
@goEnum(value: "go.probo.inc/probo/pkg/coredata.CompliancePortalVisibilityPrivate")
|
||||||
PUBLIC
|
PUBLIC
|
||||||
@goEnum(value: "go.probo.inc/probo/pkg/coredata.TrustCenterVisibilityPublic")
|
@goEnum(value: "go.probo.inc/probo/pkg/coredata.CompliancePortalVisibilityPublic")
|
||||||
}
|
}
|
||||||
|
|
||||||
input TrustCenterVisibilityFilter {
|
input CompliancePortalVisibilityFilter {
|
||||||
visibility: TrustCenterVisibility
|
visibility: CompliancePortalVisibility
|
||||||
}
|
}
|
||||||
|
|
||||||
type Document implements Node @nda {
|
type Document implements Node @nda {
|
||||||
@@ -291,7 +291,7 @@ type SubprocessorEdge @nda {
|
|||||||
node: Subprocessor!
|
node: Subprocessor!
|
||||||
}
|
}
|
||||||
|
|
||||||
type TrustCenterReference implements Node @nda {
|
type CompliancePortalReference implements Node @nda {
|
||||||
id: ID!
|
id: ID!
|
||||||
name: String!
|
name: String!
|
||||||
description: String
|
description: String
|
||||||
@@ -299,14 +299,14 @@ type TrustCenterReference implements Node @nda {
|
|||||||
logo: File! @goField(forceResolver: true)
|
logo: File! @goField(forceResolver: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
type TrustCenterReferenceConnection @nda {
|
type CompliancePortalReferenceConnection @nda {
|
||||||
edges: [TrustCenterReferenceEdge!]!
|
edges: [CompliancePortalReferenceEdge!]!
|
||||||
pageInfo: PageInfo!
|
pageInfo: PageInfo!
|
||||||
}
|
}
|
||||||
|
|
||||||
type TrustCenterReferenceEdge @nda {
|
type CompliancePortalReferenceEdge @nda {
|
||||||
cursor: CursorKey!
|
cursor: CursorKey!
|
||||||
node: TrustCenterReference!
|
node: CompliancePortalReference!
|
||||||
}
|
}
|
||||||
|
|
||||||
enum CompliancePortalCommitmentIcon
|
enum CompliancePortalCommitmentIcon
|
||||||
@@ -394,7 +394,7 @@ type CompliancePortalCommitmentEdge {
|
|||||||
node: CompliancePortalCommitment!
|
node: CompliancePortalCommitment!
|
||||||
}
|
}
|
||||||
|
|
||||||
type TrustCenterFile implements Node @nda {
|
type CompliancePortalFile implements Node @nda {
|
||||||
id: ID!
|
id: ID!
|
||||||
name: String!
|
name: String!
|
||||||
category: String!
|
category: String!
|
||||||
@@ -403,14 +403,14 @@ type TrustCenterFile implements Node @nda {
|
|||||||
access: DocumentAccess @goField(forceResolver: true)
|
access: DocumentAccess @goField(forceResolver: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
type TrustCenterFileConnection @nda {
|
type CompliancePortalFileConnection @nda {
|
||||||
edges: [TrustCenterFileEdge!]!
|
edges: [CompliancePortalFileEdge!]!
|
||||||
pageInfo: PageInfo!
|
pageInfo: PageInfo!
|
||||||
}
|
}
|
||||||
|
|
||||||
type TrustCenterFileEdge @nda {
|
type CompliancePortalFileEdge @nda {
|
||||||
cursor: CursorKey!
|
cursor: CursorKey!
|
||||||
node: TrustCenterFile!
|
node: CompliancePortalFile!
|
||||||
}
|
}
|
||||||
|
|
||||||
type ComplianceCustomLink implements Node {
|
type ComplianceCustomLink implements Node {
|
||||||
@@ -430,7 +430,7 @@ type ComplianceCustomLinkEdge {
|
|||||||
node: ComplianceCustomLink!
|
node: ComplianceCustomLink!
|
||||||
}
|
}
|
||||||
|
|
||||||
type TrustCenterAccess implements Node {
|
type CompliancePortalAccess implements Node {
|
||||||
id: ID!
|
id: ID!
|
||||||
email: EmailAddr!
|
email: EmailAddr!
|
||||||
name: String!
|
name: String!
|
||||||
@@ -440,23 +440,23 @@ type TrustCenterAccess implements Node {
|
|||||||
|
|
||||||
enum DocumentAccessStatus
|
enum DocumentAccessStatus
|
||||||
@goModel(
|
@goModel(
|
||||||
model: "go.probo.inc/probo/pkg/coredata.TrustCenterDocumentAccessStatus"
|
model: "go.probo.inc/probo/pkg/coredata.CompliancePortalDocumentAccessStatus"
|
||||||
) {
|
) {
|
||||||
REQUESTED
|
REQUESTED
|
||||||
@goEnum(
|
@goEnum(
|
||||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterDocumentAccessStatusRequested"
|
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalDocumentAccessStatusRequested"
|
||||||
)
|
)
|
||||||
GRANTED
|
GRANTED
|
||||||
@goEnum(
|
@goEnum(
|
||||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterDocumentAccessStatusGranted"
|
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalDocumentAccessStatusGranted"
|
||||||
)
|
)
|
||||||
REJECTED
|
REJECTED
|
||||||
@goEnum(
|
@goEnum(
|
||||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterDocumentAccessStatusRejected"
|
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalDocumentAccessStatusRejected"
|
||||||
)
|
)
|
||||||
REVOKED
|
REVOKED
|
||||||
@goEnum(
|
@goEnum(
|
||||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterDocumentAccessStatusRevoked"
|
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalDocumentAccessStatusRevoked"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -474,9 +474,9 @@ extend type Mutation {
|
|||||||
exportReportPDF(input: ExportReportPDFInput!): ExportReportPDFPayload!
|
exportReportPDF(input: ExportReportPDFInput!): ExportReportPDFPayload!
|
||||||
@authentication(required: OPTIONAL) @nda
|
@authentication(required: OPTIONAL) @nda
|
||||||
|
|
||||||
exportTrustCenterFile(
|
exportCompliancePortalFile(
|
||||||
input: ExportTrustCenterFileInput!
|
input: ExportCompliancePortalFileInput!
|
||||||
): ExportTrustCenterFilePayload! @authentication(required: OPTIONAL) @nda
|
): ExportCompliancePortalFilePayload! @authentication(required: OPTIONAL) @nda
|
||||||
|
|
||||||
requestDocumentAccess(
|
requestDocumentAccess(
|
||||||
input: RequestDocumentAccessInput!
|
input: RequestDocumentAccessInput!
|
||||||
@@ -486,8 +486,8 @@ extend type Mutation {
|
|||||||
input: RequestReportAccessInput!
|
input: RequestReportAccessInput!
|
||||||
): RequestReportAccessPayload! @authentication(required: PRESENT) @nda
|
): RequestReportAccessPayload! @authentication(required: PRESENT) @nda
|
||||||
|
|
||||||
requestTrustCenterFileAccess(
|
requestCompliancePortalFileAccess(
|
||||||
input: RequestTrustCenterFileAccessInput!
|
input: RequestCompliancePortalFileAccessInput!
|
||||||
): RequestFileAccessPayload! @authentication(required: PRESENT) @nda
|
): RequestFileAccessPayload! @authentication(required: PRESENT) @nda
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -500,11 +500,11 @@ type RequestReportAccessPayload {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type RequestFileAccessPayload {
|
type RequestFileAccessPayload {
|
||||||
file: TrustCenterFile
|
file: CompliancePortalFile
|
||||||
}
|
}
|
||||||
|
|
||||||
type RequestAccessesPayload {
|
type RequestAccessesPayload {
|
||||||
trustCenterAccess: TrustCenterAccess!
|
compliancePortalAccess: CompliancePortalAccess!
|
||||||
}
|
}
|
||||||
|
|
||||||
input ExportDocumentPDFInput {
|
input ExportDocumentPDFInput {
|
||||||
@@ -523,12 +523,12 @@ input RequestReportAccessInput {
|
|||||||
reportId: ID!
|
reportId: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
input RequestTrustCenterFileAccessInput {
|
input RequestCompliancePortalFileAccessInput {
|
||||||
trustCenterFileId: ID!
|
compliancePortalFileId: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
input ExportTrustCenterFileInput {
|
input ExportCompliancePortalFileInput {
|
||||||
trustCenterFileId: ID!
|
compliancePortalFileId: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
type ExportDocumentPDFPayload {
|
type ExportDocumentPDFPayload {
|
||||||
@@ -539,6 +539,6 @@ type ExportReportPDFPayload {
|
|||||||
data: String!
|
data: String!
|
||||||
}
|
}
|
||||||
|
|
||||||
type ExportTrustCenterFilePayload {
|
type ExportCompliancePortalFilePayload {
|
||||||
data: String!
|
data: String!
|
||||||
}
|
}
|
||||||
@@ -41,7 +41,7 @@ import (
|
|||||||
|
|
||||||
func NewGraphQLHandler(
|
func NewGraphQLHandler(
|
||||||
iamSvc *iam.Service,
|
iamSvc *iam.Service,
|
||||||
trustSvc *visitor.Service,
|
visitorSvc *visitor.Service,
|
||||||
resourceAliasSvc *resourcealias.Service,
|
resourceAliasSvc *resourcealias.Service,
|
||||||
fileManagerSvc *filemanager.Service,
|
fileManagerSvc *filemanager.Service,
|
||||||
esignSvc *esign.Service,
|
esignSvc *esign.Service,
|
||||||
@@ -55,7 +55,7 @@ func NewGraphQLHandler(
|
|||||||
config := schema.Config{
|
config := schema.Config{
|
||||||
Resolvers: &Resolver{
|
Resolvers: &Resolver{
|
||||||
iam: iamSvc,
|
iam: iamSvc,
|
||||||
trust: trustSvc,
|
visitor: visitorSvc,
|
||||||
resourceAlias: resourceAliasSvc,
|
resourceAlias: resourceAliasSvc,
|
||||||
fileManager: fileManagerSvc,
|
fileManager: fileManagerSvc,
|
||||||
esign: esignSvc,
|
esign: esignSvc,
|
||||||
@@ -65,7 +65,7 @@ func NewGraphQLHandler(
|
|||||||
sessionCookie: authn.NewCookie(&cookieConfig),
|
sessionCookie: authn.NewCookie(&cookieConfig),
|
||||||
},
|
},
|
||||||
Directives: schema.DirectiveRoot{
|
Directives: schema.DirectiveRoot{
|
||||||
Nda: newNDADirective(logger, trustSvc, esignSvc),
|
Nda: newNDADirective(logger, visitorSvc, esignSvc),
|
||||||
Authentication: authentication.Directive,
|
Authentication: authentication.Directive,
|
||||||
SessionOnly: session.Directive,
|
SessionOnly: session.Directive,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ import (
|
|||||||
|
|
||||||
// SubscribeToMailingList is the resolver for the subscribeToMailingList field.
|
// SubscribeToMailingList is the resolver for the subscribeToMailingList field.
|
||||||
func (r *mutationResolver) SubscribeToMailingList(ctx context.Context) (*types.SubscribeToMailingListPayload, error) {
|
func (r *mutationResolver) SubscribeToMailingList(ctx context.Context) (*types.SubscribeToMailingListPayload, error) {
|
||||||
trustCenter := complianceportal.CompliancePageFromContext(ctx)
|
compliancePortal := complianceportal.CompliancePortalFromContext(ctx)
|
||||||
if trustCenter.MailingListID == nil {
|
if compliancePortal.MailingListID == nil {
|
||||||
return nil, gqlutils.NotFoundf(ctx, "mailing list not found")
|
return nil, gqlutils.NotFoundf(ctx, "mailing list not found")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -30,7 +30,7 @@ func (r *mutationResolver) SubscribeToMailingList(ctx context.Context) (*types.S
|
|||||||
subscriber, err := r.mailman.CreateSubscriber(
|
subscriber, err := r.mailman.CreateSubscriber(
|
||||||
ctx,
|
ctx,
|
||||||
&mailman.CreateSubscriberRequest{
|
&mailman.CreateSubscriberRequest{
|
||||||
MailingListID: *trustCenter.MailingListID,
|
MailingListID: *compliancePortal.MailingListID,
|
||||||
Email: identity.EmailAddress,
|
Email: identity.EmailAddress,
|
||||||
FullName: identity.FullName,
|
FullName: identity.FullName,
|
||||||
},
|
},
|
||||||
@@ -56,14 +56,14 @@ func (r *mutationResolver) SubscribeToMailingList(ctx context.Context) (*types.S
|
|||||||
|
|
||||||
// UnsubscribeFromMailingList is the resolver for the unsubscribeFromMailingList field.
|
// UnsubscribeFromMailingList is the resolver for the unsubscribeFromMailingList field.
|
||||||
func (r *mutationResolver) UnsubscribeFromMailingList(ctx context.Context) (*types.UnsubscribeFromMailingListPayload, error) {
|
func (r *mutationResolver) UnsubscribeFromMailingList(ctx context.Context) (*types.UnsubscribeFromMailingListPayload, error) {
|
||||||
trustCenter := complianceportal.CompliancePageFromContext(ctx)
|
compliancePortal := complianceportal.CompliancePortalFromContext(ctx)
|
||||||
if trustCenter.MailingListID == nil {
|
if compliancePortal.MailingListID == nil {
|
||||||
return nil, gqlutils.NotFoundf(ctx, "mailing list not found")
|
return nil, gqlutils.NotFoundf(ctx, "mailing list not found")
|
||||||
}
|
}
|
||||||
|
|
||||||
identity := authn.IdentityFromContext(ctx)
|
identity := authn.IdentityFromContext(ctx)
|
||||||
|
|
||||||
subscriber, err := r.mailman.GetSubscriber(ctx, *trustCenter.MailingListID, identity.EmailAddress)
|
subscriber, err := r.mailman.GetSubscriber(ctx, *compliancePortal.MailingListID, identity.EmailAddress)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.logger.ErrorCtx(ctx, "cannot get mailing list subscription", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot get mailing list subscription", log.Error(err))
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ func NewMux(cfg MuxConfig) (http.Handler, error) {
|
|||||||
|
|
||||||
r.Group(
|
r.Group(
|
||||||
func(r chi.Router) {
|
func(r chi.Router) {
|
||||||
r.Use(complianceportal.NewCompliancePagePresenceMiddleware())
|
r.Use(complianceportal.NewCompliancePortalPresenceMiddleware())
|
||||||
|
|
||||||
r.Method(http.MethodGet, complianceportal.CIMDMetadataPath, NewOAuthClientMetadataHandler(cfg.Visitor))
|
r.Method(http.MethodGet, complianceportal.CIMDMetadataPath, NewOAuthClientMetadataHandler(cfg.Visitor))
|
||||||
r.Method(http.MethodGet, complianceportal.BrandLogoPath, NewBrandLogoHandler(cfg.Logger, cfg.File))
|
r.Method(http.MethodGet, complianceportal.BrandLogoPath, NewBrandLogoHandler(cfg.Logger, cfg.File))
|
||||||
@@ -128,12 +128,12 @@ func NewMux(cfg MuxConfig) (http.Handler, error) {
|
|||||||
|
|
||||||
func compliancePageHeadData() HeadDataFunc {
|
func compliancePageHeadData() HeadDataFunc {
|
||||||
return func(r *http.Request) HeadData {
|
return func(r *http.Request) HeadData {
|
||||||
tc := complianceportal.CompliancePageFromContext(r.Context())
|
tc := complianceportal.CompliancePortalFromContext(r.Context())
|
||||||
if tc == nil {
|
if tc == nil {
|
||||||
return HeadData{Title: "Compliance Page"}
|
return HeadData{Title: "Compliance Page"}
|
||||||
}
|
}
|
||||||
|
|
||||||
compliancePageBaseURL := complianceportal.CompliancePageBaseURLFromContext(r.Context())
|
compliancePageBaseURL := complianceportal.CompliancePortalBaseURLFromContext(r.Context())
|
||||||
|
|
||||||
description := tc.Title + " Compliance Page"
|
description := tc.Title + " Compliance Page"
|
||||||
if tc.Description != nil && *tc.Description != "" {
|
if tc.Description != nil && *tc.Description != "" {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ import (
|
|||||||
|
|
||||||
func newNDADirective(
|
func newNDADirective(
|
||||||
logger *log.Logger,
|
logger *log.Logger,
|
||||||
trustSvc *visitor.Service,
|
visitorSvc *visitor.Service,
|
||||||
esignSvc *esign.Service,
|
esignSvc *esign.Service,
|
||||||
) func(ctx context.Context, obj any, next graphql.Resolver) (any, error) {
|
) func(ctx context.Context, obj any, next graphql.Resolver) (any, error) {
|
||||||
return func(ctx context.Context, obj any, next graphql.Resolver) (any, error) {
|
return func(ctx context.Context, obj any, next graphql.Resolver) (any, error) {
|
||||||
@@ -44,13 +44,13 @@ func newNDADirective(
|
|||||||
return next(ctx)
|
return next(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
compliancePage := complianceportal.CompliancePageFromContext(ctx)
|
compliancePage := complianceportal.CompliancePortalFromContext(ctx)
|
||||||
if compliancePage == nil {
|
if compliancePage == nil {
|
||||||
logger.ErrorCtx(ctx, "cannot get compliance page from context")
|
logger.ErrorCtx(ctx, "cannot get compliance page from context")
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
membership, err := trustSvc.GetPortalMembership(ctx, compliancePage.ID, identity.ID)
|
membership, err := visitorSvc.GetPortalMembership(ctx, compliancePage.ID, identity.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.ErrorCtx(ctx, "cannot get compliance page membership", log.Error(err))
|
logger.ErrorCtx(ctx, "cannot get compliance page membership", log.Error(err))
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
|
|||||||
@@ -23,9 +23,9 @@ import (
|
|||||||
// AcceptElectronicSignature is the resolver for the acceptElectronicSignature field.
|
// AcceptElectronicSignature is the resolver for the acceptElectronicSignature field.
|
||||||
func (r *mutationResolver) AcceptElectronicSignature(ctx context.Context, input types.AcceptElectronicSignatureInput) (*types.AcceptElectronicSignaturePayload, error) {
|
func (r *mutationResolver) AcceptElectronicSignature(ctx context.Context, input types.AcceptElectronicSignatureInput) (*types.AcceptElectronicSignaturePayload, error) {
|
||||||
var (
|
var (
|
||||||
identity = authn.IdentityFromContext(ctx)
|
identity = authn.IdentityFromContext(ctx)
|
||||||
httpReq = gqlutils.HTTPRequestFromContext(ctx)
|
httpReq = gqlutils.HTTPRequestFromContext(ctx)
|
||||||
trustCenter = complianceportal.CompliancePageFromContext(ctx)
|
compliancePortal = complianceportal.CompliancePortalFromContext(ctx)
|
||||||
)
|
)
|
||||||
|
|
||||||
signerIP, _, _ := net.SplitHostPort(httpReq.RemoteAddr)
|
signerIP, _, _ := net.SplitHostPort(httpReq.RemoteAddr)
|
||||||
@@ -33,7 +33,7 @@ func (r *mutationResolver) AcceptElectronicSignature(ctx context.Context, input
|
|||||||
signerIP = httpReq.RemoteAddr
|
signerIP = httpReq.RemoteAddr
|
||||||
}
|
}
|
||||||
|
|
||||||
scope := coredata.NewScopeFromObjectID(trustCenter.ID)
|
scope := coredata.NewScopeFromObjectID(compliancePortal.ID)
|
||||||
|
|
||||||
signature, err := r.esign.AcceptSignature(
|
signature, err := r.esign.AcceptSignature(
|
||||||
ctx,
|
ctx,
|
||||||
@@ -59,9 +59,9 @@ func (r *mutationResolver) AcceptElectronicSignature(ctx context.Context, input
|
|||||||
// RecordSigningEvent is the resolver for the recordSigningEvent field.
|
// RecordSigningEvent is the resolver for the recordSigningEvent field.
|
||||||
func (r *mutationResolver) RecordSigningEvent(ctx context.Context, input types.RecordSigningEventInput) (*types.RecordSigningEventPayload, error) {
|
func (r *mutationResolver) RecordSigningEvent(ctx context.Context, input types.RecordSigningEventInput) (*types.RecordSigningEventPayload, error) {
|
||||||
var (
|
var (
|
||||||
identity = authn.IdentityFromContext(ctx)
|
identity = authn.IdentityFromContext(ctx)
|
||||||
httpReq = gqlutils.HTTPRequestFromContext(ctx)
|
httpReq = gqlutils.HTTPRequestFromContext(ctx)
|
||||||
trustCenter = complianceportal.CompliancePageFromContext(ctx)
|
compliancePortal = complianceportal.CompliancePortalFromContext(ctx)
|
||||||
)
|
)
|
||||||
|
|
||||||
actorIP, _, _ := net.SplitHostPort(httpReq.RemoteAddr)
|
actorIP, _, _ := net.SplitHostPort(httpReq.RemoteAddr)
|
||||||
@@ -69,7 +69,7 @@ func (r *mutationResolver) RecordSigningEvent(ctx context.Context, input types.R
|
|||||||
actorIP = httpReq.RemoteAddr
|
actorIP = httpReq.RemoteAddr
|
||||||
}
|
}
|
||||||
|
|
||||||
scope := coredata.NewScopeFromObjectID(trustCenter.ID)
|
scope := coredata.NewScopeFromObjectID(compliancePortal.ID)
|
||||||
|
|
||||||
if err := r.esign.RecordEvent(
|
if err := r.esign.RecordEvent(
|
||||||
ctx,
|
ctx,
|
||||||
@@ -92,13 +92,13 @@ func (r *mutationResolver) RecordSigningEvent(ctx context.Context, input types.R
|
|||||||
|
|
||||||
// FileURL is the resolver for the fileUrl field.
|
// FileURL is the resolver for the fileUrl field.
|
||||||
func (r *nonDisclosureAgreementResolver) FileURL(ctx context.Context, obj *types.NonDisclosureAgreement) (string, error) {
|
func (r *nonDisclosureAgreementResolver) FileURL(ctx context.Context, obj *types.NonDisclosureAgreement) (string, error) {
|
||||||
trustCenter := complianceportal.CompliancePageFromContext(ctx)
|
compliancePortal := complianceportal.CompliancePortalFromContext(ctx)
|
||||||
|
|
||||||
if identity := authn.IdentityFromContext(ctx); identity != nil && r.esign != nil {
|
if identity := authn.IdentityFromContext(ctx); identity != nil && r.esign != nil {
|
||||||
scope := coredata.NewScopeFromObjectID(trustCenter.ID)
|
scope := coredata.NewScopeFromObjectID(compliancePortal.ID)
|
||||||
trustService := r.trust
|
visitorService := r.visitor
|
||||||
|
|
||||||
access, err := trustService.GetPortalAccess(ctx, scope, trustCenter.ID, identity.ID)
|
access, err := visitorService.GetPortalAccess(ctx, scope, compliancePortal.ID, identity.ID)
|
||||||
if err == nil && access.ElectronicSignatureID != nil {
|
if err == nil && access.ElectronicSignatureID != nil {
|
||||||
fileURL, err := r.esign.GenerateSignatureFileURL(ctx, *access.ElectronicSignatureID, 15*time.Minute)
|
fileURL, err := r.esign.GenerateSignatureFileURL(ctx, *access.ElectronicSignatureID, 15*time.Minute)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
@@ -109,10 +109,10 @@ func (r *nonDisclosureAgreementResolver) FileURL(ctx context.Context, obj *types
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
scope := coredata.NewScopeFromObjectID(trustCenter.ID)
|
scope := coredata.NewScopeFromObjectID(compliancePortal.ID)
|
||||||
trustService := r.trust
|
visitorService := r.visitor
|
||||||
|
|
||||||
fileURL, err := trustService.GeneratePortalNDAFileURL(ctx, scope, trustCenter.ID, 15*time.Minute)
|
fileURL, err := visitorService.GeneratePortalNDAFileURL(ctx, scope, compliancePortal.ID, 15*time.Minute)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", gqlutils.Internal(ctx)
|
return "", gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
@@ -127,11 +127,11 @@ func (r *nonDisclosureAgreementResolver) ViewerSignature(ctx context.Context, ob
|
|||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
trustCenter := complianceportal.CompliancePageFromContext(ctx)
|
compliancePortal := complianceportal.CompliancePortalFromContext(ctx)
|
||||||
scope := coredata.NewScopeFromObjectID(trustCenter.ID)
|
scope := coredata.NewScopeFromObjectID(compliancePortal.ID)
|
||||||
trustService := r.trust
|
visitorService := r.visitor
|
||||||
|
|
||||||
access, err := trustService.GetPortalAccess(ctx, scope, trustCenter.ID, identity.ID)
|
access, err := visitorService.GetPortalAccess(ctx, scope, compliancePortal.ID, identity.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,9 +92,9 @@ func (h *OAuthCallbackHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
portal := complianceportal.CompliancePageFromContext(ctx)
|
portal := complianceportal.CompliancePortalFromContext(ctx)
|
||||||
|
|
||||||
portalBaseURL := complianceportal.CompliancePageBaseURLFromContext(ctx)
|
portalBaseURL := complianceportal.CompliancePortalBaseURLFromContext(ctx)
|
||||||
if portal == nil || portalBaseURL == nil {
|
if portal == nil || portalBaseURL == nil {
|
||||||
httpserver.RenderError(w, http.StatusNotFound, errNotFound)
|
httpserver.RenderError(w, http.StatusNotFound, errNotFound)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ func NewOAuthClientMetadataHandler(visitorSvc *visitor.Service) http.Handler {
|
|||||||
func (h *oauthClientMetadataHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
func (h *oauthClientMetadataHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
ctx := r.Context()
|
ctx := r.Context()
|
||||||
|
|
||||||
compliancePage := complianceportal.CompliancePageFromContext(ctx)
|
compliancePage := complianceportal.CompliancePortalFromContext(ctx)
|
||||||
baseURL := complianceportal.CompliancePageBaseURLFromContext(ctx)
|
baseURL := complianceportal.CompliancePortalBaseURLFromContext(ctx)
|
||||||
|
|
||||||
if compliancePage == nil || baseURL == nil {
|
if compliancePage == nil || baseURL == nil {
|
||||||
httpserver.RenderError(w, http.StatusNotFound, errNotFound)
|
httpserver.RenderError(w, http.StatusNotFound, errNotFound)
|
||||||
|
|||||||
@@ -58,8 +58,8 @@ func NewOAuthInitiateHandler(
|
|||||||
func (h *OAuthInitiateHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
func (h *OAuthInitiateHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||||
ctx := r.Context()
|
ctx := r.Context()
|
||||||
|
|
||||||
compliancePage := complianceportal.CompliancePageFromContext(ctx)
|
compliancePage := complianceportal.CompliancePortalFromContext(ctx)
|
||||||
portalBaseURL := complianceportal.CompliancePageBaseURLFromContext(ctx)
|
portalBaseURL := complianceportal.CompliancePortalBaseURLFromContext(ctx)
|
||||||
|
|
||||||
if compliancePage == nil || portalBaseURL == nil {
|
if compliancePage == nil || portalBaseURL == nil {
|
||||||
httpserver.RenderError(w, http.StatusNotFound, errNotFound)
|
httpserver.RenderError(w, http.StatusNotFound, errNotFound)
|
||||||
|
|||||||
@@ -17,8 +17,6 @@
|
|||||||
package complianceportal_v1
|
package complianceportal_v1
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"time"
|
|
||||||
|
|
||||||
"go.gearno.de/kit/log"
|
"go.gearno.de/kit/log"
|
||||||
"go.probo.inc/probo/pkg/baseurl"
|
"go.probo.inc/probo/pkg/baseurl"
|
||||||
"go.probo.inc/probo/pkg/complianceportal/visitor"
|
"go.probo.inc/probo/pkg/complianceportal/visitor"
|
||||||
@@ -31,19 +29,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
TrustAuthConfig struct {
|
|
||||||
CookieName string
|
|
||||||
CookieDomain string
|
|
||||||
CookieDuration time.Duration
|
|
||||||
TokenDuration time.Duration
|
|
||||||
ReportURLDuration time.Duration
|
|
||||||
Scope string
|
|
||||||
TokenType string
|
|
||||||
CookieSecure bool
|
|
||||||
}
|
|
||||||
|
|
||||||
Resolver struct {
|
Resolver struct {
|
||||||
trust *visitor.Service
|
visitor *visitor.Service
|
||||||
resourceAlias *resourcealias.Service
|
resourceAlias *resourcealias.Service
|
||||||
fileManager *filemanager.Service
|
fileManager *filemanager.Service
|
||||||
esign *esign.Service
|
esign *esign.Service
|
||||||
|
|||||||
@@ -34,8 +34,8 @@ func (r *Resolver) ResourceAliasResolver(
|
|||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
storageResourceID gid.GID,
|
storageResourceID gid.GID,
|
||||||
) (*string, error) {
|
) (*string, error) {
|
||||||
trustCenter := complianceportal.CompliancePageFromContext(ctx)
|
compliancePortal := complianceportal.CompliancePortalFromContext(ctx)
|
||||||
scope := coredata.NewScopeFromObjectID(trustCenter.ID)
|
scope := coredata.NewScopeFromObjectID(compliancePortal.ID)
|
||||||
|
|
||||||
alias, err := r.resourceAlias.GetByResourceID(ctx, scope, storageResourceID)
|
alias, err := r.resourceAlias.GetByResourceID(ctx, scope, storageResourceID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
|
|
||||||
"go.gearno.de/kit/log"
|
"go.gearno.de/kit/log"
|
||||||
trust "go.probo.inc/probo/pkg/complianceportal/visitor"
|
"go.probo.inc/probo/pkg/complianceportal/visitor"
|
||||||
"go.probo.inc/probo/pkg/coredata"
|
"go.probo.inc/probo/pkg/coredata"
|
||||||
"go.probo.inc/probo/pkg/server/api/authn"
|
"go.probo.inc/probo/pkg/server/api/authn"
|
||||||
"go.probo.inc/probo/pkg/server/api/complianceportal"
|
"go.probo.inc/probo/pkg/server/api/complianceportal"
|
||||||
@@ -26,13 +26,13 @@ func (r *mutationResolver) CreateRightsRequest(ctx context.Context, input types.
|
|||||||
return nil, gqlutils.Unauthenticatedf(ctx, "a verified email is required to submit a request")
|
return nil, gqlutils.Unauthenticatedf(ctx, "a verified email is required to submit a request")
|
||||||
}
|
}
|
||||||
|
|
||||||
compliancePage := complianceportal.CompliancePageFromContext(ctx)
|
compliancePage := complianceportal.CompliancePortalFromContext(ctx)
|
||||||
scope := coredata.NewScopeFromObjectID(compliancePage.OrganizationID)
|
scope := coredata.NewScopeFromObjectID(compliancePage.OrganizationID)
|
||||||
|
|
||||||
rightsRequest, err := r.trust.CreateRightsRequest(
|
rightsRequest, err := r.visitor.CreateRightsRequest(
|
||||||
ctx,
|
ctx,
|
||||||
scope,
|
scope,
|
||||||
&trust.CreateRightsRequest{
|
&visitor.CreateRightsRequest{
|
||||||
OrganizationID: compliancePage.OrganizationID,
|
OrganizationID: compliancePage.OrganizationID,
|
||||||
RequestType: input.RequestType,
|
RequestType: input.RequestType,
|
||||||
DataSubject: input.DataSubject,
|
DataSubject: input.DataSubject,
|
||||||
|
|||||||
@@ -24,16 +24,16 @@ import (
|
|||||||
"go.probo.inc/probo/pkg/coredata"
|
"go.probo.inc/probo/pkg/coredata"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewTrustCenter(tc *coredata.TrustCenter) *TrustCenter {
|
func NewCompliancePortal(cp *coredata.CompliancePortal) *CompliancePortal {
|
||||||
return &TrustCenter{
|
return &CompliancePortal{
|
||||||
ID: tc.ID,
|
ID: cp.ID,
|
||||||
Active: tc.Active,
|
Active: cp.Active,
|
||||||
Slug: tc.Slug,
|
Slug: cp.Slug,
|
||||||
Title: tc.Title,
|
Title: cp.Title,
|
||||||
Description: tc.Description,
|
Description: cp.Description,
|
||||||
WebsiteURL: tc.WebsiteURL,
|
WebsiteURL: cp.WebsiteURL,
|
||||||
Email: tc.Email,
|
Email: cp.Email,
|
||||||
HeadquarterAddress: tc.HeadquarterAddress,
|
HeadquarterAddress: cp.HeadquarterAddress,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,31 +25,34 @@ import (
|
|||||||
"go.probo.inc/probo/pkg/page"
|
"go.probo.inc/probo/pkg/page"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewTrustCenterFileConnection(
|
func NewCompliancePortalFileConnection(
|
||||||
p *page.Page[*coredata.TrustCenterFile, coredata.TrustCenterFileOrderField],
|
p *page.Page[*coredata.CompliancePortalFile, coredata.CompliancePortalFileOrderField],
|
||||||
) *TrustCenterFileConnection {
|
) *CompliancePortalFileConnection {
|
||||||
edges := make([]*TrustCenterFileEdge, len(p.Data))
|
edges := make([]*CompliancePortalFileEdge, len(p.Data))
|
||||||
for i, trustCenterFile := range p.Data {
|
for i, portalFile := range p.Data {
|
||||||
edges[i] = NewTrustCenterFileEdge(trustCenterFile, p.Cursor.OrderBy.Field)
|
edges[i] = NewCompliancePortalFileEdge(portalFile, p.Cursor.OrderBy.Field)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &TrustCenterFileConnection{
|
return &CompliancePortalFileConnection{
|
||||||
Edges: edges,
|
Edges: edges,
|
||||||
PageInfo: NewPageInfo(p),
|
PageInfo: NewPageInfo(p),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewTrustCenterFile(f *coredata.TrustCenterFile) *TrustCenterFile {
|
func NewCompliancePortalFile(f *coredata.CompliancePortalFile) *CompliancePortalFile {
|
||||||
return &TrustCenterFile{
|
return &CompliancePortalFile{
|
||||||
ID: f.ID,
|
ID: f.ID,
|
||||||
Name: f.Name,
|
Name: f.Name,
|
||||||
Category: f.Category,
|
Category: f.Category,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewTrustCenterFileEdge(f *coredata.TrustCenterFile, orderField coredata.TrustCenterFileOrderField) *TrustCenterFileEdge {
|
func NewCompliancePortalFileEdge(
|
||||||
return &TrustCenterFileEdge{
|
f *coredata.CompliancePortalFile,
|
||||||
Node: NewTrustCenterFile(f),
|
orderField coredata.CompliancePortalFileOrderField,
|
||||||
|
) *CompliancePortalFileEdge {
|
||||||
|
return &CompliancePortalFileEdge{
|
||||||
|
Node: NewCompliancePortalFile(f),
|
||||||
Cursor: f.CursorKey(orderField),
|
Cursor: f.CursorKey(orderField),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -25,31 +25,36 @@ import (
|
|||||||
"go.probo.inc/probo/pkg/page"
|
"go.probo.inc/probo/pkg/page"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewTrustCenterReference(tcc *coredata.TrustCenterReference) *TrustCenterReference {
|
func NewCompliancePortalReference(ref *coredata.CompliancePortalReference) *CompliancePortalReference {
|
||||||
return &TrustCenterReference{
|
return &CompliancePortalReference{
|
||||||
ID: tcc.ID,
|
ID: ref.ID,
|
||||||
Name: tcc.Name,
|
Name: ref.Name,
|
||||||
Description: tcc.Description,
|
Description: ref.Description,
|
||||||
WebsiteURL: tcc.WebsiteURL,
|
WebsiteURL: ref.WebsiteURL,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewTrustCenterReferenceConnection(p *page.Page[*coredata.TrustCenterReference, coredata.TrustCenterReferenceOrderField]) *TrustCenterReferenceConnection {
|
func NewCompliancePortalReferenceConnection(
|
||||||
edges := make([]*TrustCenterReferenceEdge, len(p.Data))
|
p *page.Page[*coredata.CompliancePortalReference, coredata.CompliancePortalReferenceOrderField],
|
||||||
|
) *CompliancePortalReferenceConnection {
|
||||||
|
edges := make([]*CompliancePortalReferenceEdge, len(p.Data))
|
||||||
|
|
||||||
for i, item := range p.Data {
|
for i, item := range p.Data {
|
||||||
edges[i] = NewTrustCenterReferenceEdge(item, p.Cursor.OrderBy.Field)
|
edges[i] = NewCompliancePortalReferenceEdge(item, p.Cursor.OrderBy.Field)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &TrustCenterReferenceConnection{
|
return &CompliancePortalReferenceConnection{
|
||||||
Edges: edges,
|
Edges: edges,
|
||||||
PageInfo: NewPageInfo(p),
|
PageInfo: NewPageInfo(p),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewTrustCenterReferenceEdge(tcc *coredata.TrustCenterReference, orderBy coredata.TrustCenterReferenceOrderField) *TrustCenterReferenceEdge {
|
func NewCompliancePortalReferenceEdge(
|
||||||
return &TrustCenterReferenceEdge{
|
ref *coredata.CompliancePortalReference,
|
||||||
Cursor: tcc.CursorKey(orderBy),
|
orderBy coredata.CompliancePortalReferenceOrderField,
|
||||||
Node: NewTrustCenterReference(tcc),
|
) *CompliancePortalReferenceEdge {
|
||||||
|
return &CompliancePortalReferenceEdge{
|
||||||
|
Cursor: ref.CursorKey(orderBy),
|
||||||
|
Node: NewCompliancePortalReference(ref),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -78,7 +78,7 @@ type (
|
|||||||
func NewMux(
|
func NewMux(
|
||||||
logger *log.Logger,
|
logger *log.Logger,
|
||||||
svc *iam.Service,
|
svc *iam.Service,
|
||||||
trustSvc *visitor.Service,
|
visitorSvc *visitor.Service,
|
||||||
cookieConfig securecookie.Config,
|
cookieConfig securecookie.Config,
|
||||||
tokenSecret string,
|
tokenSecret string,
|
||||||
fileManagerSvc *filemanager.Service,
|
fileManagerSvc *filemanager.Service,
|
||||||
|
|||||||
@@ -379,13 +379,13 @@ func (r *mutationResolver) CreateAudit(ctx context.Context, input types.CreateAu
|
|||||||
}
|
}
|
||||||
|
|
||||||
req := probo.CreateAuditRequest{
|
req := probo.CreateAuditRequest{
|
||||||
OrganizationID: input.OrganizationID,
|
OrganizationID: input.OrganizationID,
|
||||||
FrameworkID: input.FrameworkID,
|
FrameworkID: input.FrameworkID,
|
||||||
Name: input.Name,
|
Name: input.Name,
|
||||||
ValidFrom: input.ValidFrom,
|
ValidFrom: input.ValidFrom,
|
||||||
ValidUntil: input.ValidUntil,
|
ValidUntil: input.ValidUntil,
|
||||||
State: input.State,
|
State: input.State,
|
||||||
TrustCenterVisibility: input.TrustCenterVisibility,
|
CompliancePortalVisibility: input.CompliancePortalVisibility,
|
||||||
}
|
}
|
||||||
|
|
||||||
audit, err := r.probo.Audits.Create(ctx, scope, &req)
|
audit, err := r.probo.Audits.Create(ctx, scope, &req)
|
||||||
@@ -435,12 +435,12 @@ func (r *mutationResolver) UpdateAudit(ctx context.Context, input types.UpdateAu
|
|||||||
}
|
}
|
||||||
|
|
||||||
req := probo.UpdateAuditRequest{
|
req := probo.UpdateAuditRequest{
|
||||||
ID: input.ID,
|
ID: input.ID,
|
||||||
Name: gqlutils.UnwrapOmittable(input.Name),
|
Name: gqlutils.UnwrapOmittable(input.Name),
|
||||||
ValidFrom: input.ValidFrom,
|
ValidFrom: input.ValidFrom,
|
||||||
ValidUntil: input.ValidUntil,
|
ValidUntil: input.ValidUntil,
|
||||||
State: input.State,
|
State: input.State,
|
||||||
TrustCenterVisibility: input.TrustCenterVisibility,
|
CompliancePortalVisibility: input.CompliancePortalVisibility,
|
||||||
}
|
}
|
||||||
|
|
||||||
audit, err := r.probo.Audits.Update(ctx, scope, &req)
|
audit, err := r.probo.Audits.Update(ctx, scope, &req)
|
||||||
|
|||||||
@@ -334,25 +334,25 @@ func (r *queryResolver) Node(ctx context.Context, id gid.GID) (types.Node, error
|
|||||||
|
|
||||||
return types.NewTransferImpactAssessment(tia), nil
|
return types.NewTransferImpactAssessment(tia), nil
|
||||||
}
|
}
|
||||||
case coredata.TrustCenterEntityType:
|
case coredata.CompliancePortalEntityType:
|
||||||
action = management.ActionCompliancePortalGet
|
action = management.ActionCompliancePortalGet
|
||||||
loadNode = func(ctx context.Context, scope *coredata.Scope, id gid.GID) (types.Node, error) {
|
loadNode = func(ctx context.Context, scope *coredata.Scope, id gid.GID) (types.Node, error) {
|
||||||
trustCenter, err := r.management.Get(ctx, scope, id)
|
compliancePortal, err := r.management.Get(ctx, scope, id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return types.NewTrustCenter(trustCenter), nil
|
return types.NewCompliancePortal(compliancePortal), nil
|
||||||
}
|
}
|
||||||
case coredata.TrustCenterAccessEntityType:
|
case coredata.CompliancePortalAccessEntityType:
|
||||||
action = management.ActionCompliancePortalAccessGet
|
action = management.ActionCompliancePortalAccessGet
|
||||||
loadNode = func(ctx context.Context, scope *coredata.Scope, id gid.GID) (types.Node, error) {
|
loadNode = func(ctx context.Context, scope *coredata.Scope, id gid.GID) (types.Node, error) {
|
||||||
trustCenterAccess, err := r.management.GetAccess(ctx, scope, id)
|
compliancePortalAccess, err := r.management.GetAccess(ctx, scope, id)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return types.NewTrustCenterAccess(trustCenterAccess), nil
|
return types.NewCompliancePortalAccess(compliancePortalAccess), nil
|
||||||
}
|
}
|
||||||
case coredata.RightsRequestEntityType:
|
case coredata.RightsRequestEntityType:
|
||||||
action = probo.ActionRightsRequestGet
|
action = probo.ActionRightsRequestGet
|
||||||
|
|||||||
@@ -154,17 +154,17 @@ func (r *customDomainResolver) Permission(ctx context.Context, obj *types.Custom
|
|||||||
return r.Resolver.Permission(ctx, obj, action)
|
return r.Resolver.Permission(ctx, obj, action)
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateTrustCenter is the resolver for the updateTrustCenter field.
|
// UpdateCompliancePortal is the resolver for the updateCompliancePortal field.
|
||||||
func (r *mutationResolver) UpdateTrustCenter(ctx context.Context, input types.UpdateTrustCenterInput) (*types.UpdateTrustCenterPayload, error) {
|
func (r *mutationResolver) UpdateCompliancePortal(ctx context.Context, input types.UpdateCompliancePortalInput) (*types.UpdateCompliancePortalPayload, error) {
|
||||||
scope, err := r.authorize(ctx, input.TrustCenterID, management.ActionCompliancePortalUpdate)
|
scope, err := r.authorize(ctx, input.CompliancePortalID, management.ActionCompliancePortalUpdate)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
trustCenter, _, err := r.management.Update(
|
compliancePortal, _, err := r.management.Update(
|
||||||
ctx, scope,
|
ctx, scope,
|
||||||
&management.UpdateRequest{
|
&management.UpdateRequest{
|
||||||
ID: input.TrustCenterID,
|
ID: input.CompliancePortalID,
|
||||||
Active: input.Active,
|
Active: input.Active,
|
||||||
SearchEngineIndexing: input.SearchEngineIndexing,
|
SearchEngineIndexing: input.SearchEngineIndexing,
|
||||||
Description: gqlutils.UnwrapOmittable(input.Description),
|
Description: gqlutils.UnwrapOmittable(input.Description),
|
||||||
@@ -179,29 +179,29 @@ func (r *mutationResolver) UpdateTrustCenter(ctx context.Context, input types.Up
|
|||||||
return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors)
|
return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors)
|
||||||
}
|
}
|
||||||
|
|
||||||
r.logger.ErrorCtx(ctx, "cannot update trust center", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot update compliance portal", log.Error(err))
|
||||||
|
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &types.UpdateTrustCenterPayload{
|
return &types.UpdateCompliancePortalPayload{
|
||||||
TrustCenter: types.NewTrustCenter(trustCenter),
|
CompliancePortal: types.NewCompliancePortal(compliancePortal),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// UploadTrustCenterNda is the resolver for the uploadTrustCenterNDA field.
|
// UploadCompliancePortalNda is the resolver for the uploadCompliancePortalNDA field.
|
||||||
func (r *mutationResolver) UploadTrustCenterNda(ctx context.Context, input types.UploadTrustCenterNDAInput) (*types.UploadTrustCenterNDAPayload, error) {
|
func (r *mutationResolver) UploadCompliancePortalNda(ctx context.Context, input types.UploadCompliancePortalNDAInput) (*types.UploadCompliancePortalNDAPayload, error) {
|
||||||
scope, err := r.authorize(ctx, input.TrustCenterID, management.ActionCompliancePortalNonDisclosureAgreementUpload)
|
scope, err := r.authorize(ctx, input.CompliancePortalID, management.ActionCompliancePortalNonDisclosureAgreementUpload)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
trustCenter, _, err := r.management.UploadNDA(
|
compliancePortal, _, err := r.management.UploadNDA(
|
||||||
ctx, scope,
|
ctx, scope,
|
||||||
&management.UploadNDARequest{
|
&management.UploadNDARequest{
|
||||||
TrustCenterID: input.TrustCenterID,
|
CompliancePortalID: input.CompliancePortalID,
|
||||||
File: input.File.File,
|
File: input.File.File,
|
||||||
FileName: input.FileName,
|
FileName: input.FileName,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -209,43 +209,43 @@ func (r *mutationResolver) UploadTrustCenterNda(ctx context.Context, input types
|
|||||||
return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors)
|
return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors)
|
||||||
}
|
}
|
||||||
|
|
||||||
r.logger.ErrorCtx(ctx, "cannot upload trust center NDA", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot upload compliance portal NDA", log.Error(err))
|
||||||
|
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &types.UploadTrustCenterNDAPayload{
|
return &types.UploadCompliancePortalNDAPayload{
|
||||||
TrustCenter: types.NewTrustCenter(trustCenter),
|
CompliancePortal: types.NewCompliancePortal(compliancePortal),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteTrustCenterNda is the resolver for the deleteTrustCenterNDA field.
|
// DeleteCompliancePortalNda is the resolver for the deleteCompliancePortalNDA field.
|
||||||
func (r *mutationResolver) DeleteTrustCenterNda(ctx context.Context, input types.DeleteTrustCenterNDAInput) (*types.DeleteTrustCenterNDAPayload, error) {
|
func (r *mutationResolver) DeleteCompliancePortalNda(ctx context.Context, input types.DeleteCompliancePortalNDAInput) (*types.DeleteCompliancePortalNDAPayload, error) {
|
||||||
scope, err := r.authorize(ctx, input.TrustCenterID, management.ActionCompliancePortalNonDisclosureAgreementDelete)
|
scope, err := r.authorize(ctx, input.CompliancePortalID, management.ActionCompliancePortalNonDisclosureAgreementDelete)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
trustCenter, _, err := r.management.DeleteNDA(ctx, scope, input.TrustCenterID)
|
compliancePortal, _, err := r.management.DeleteNDA(ctx, scope, input.CompliancePortalID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.logger.ErrorCtx(ctx, "cannot delete trust center NDA", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot delete compliance portal NDA", log.Error(err))
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &types.DeleteTrustCenterNDAPayload{
|
return &types.DeleteCompliancePortalNDAPayload{
|
||||||
TrustCenter: types.NewTrustCenter(trustCenter),
|
CompliancePortal: types.NewCompliancePortal(compliancePortal),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateTrustCenterBrand is the resolver for the updateTrustCenterBrand field.
|
// UpdateCompliancePortalBrand is the resolver for the updateCompliancePortalBrand field.
|
||||||
func (r *mutationResolver) UpdateTrustCenterBrand(ctx context.Context, input types.UpdateTrustCenterBrandInput) (*types.UpdateTrustCenterBrandPayload, error) {
|
func (r *mutationResolver) UpdateCompliancePortalBrand(ctx context.Context, input types.UpdateCompliancePortalBrandInput) (*types.UpdateCompliancePortalBrandPayload, error) {
|
||||||
scope, err := r.authorize(ctx, input.TrustCenterID, management.ActionCompliancePortalUpdate)
|
scope, err := r.authorize(ctx, input.CompliancePortalID, management.ActionCompliancePortalUpdate)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
req := &management.UpdateBrandRequest{
|
req := &management.UpdateBrandRequest{
|
||||||
TrustCenterID: input.TrustCenterID,
|
CompliancePortalID: input.CompliancePortalID,
|
||||||
}
|
}
|
||||||
|
|
||||||
if input.LogoFile.IsSet() {
|
if input.LogoFile.IsSet() {
|
||||||
@@ -282,24 +282,24 @@ func (r *mutationResolver) UpdateTrustCenterBrand(ctx context.Context, input typ
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
trustCenter, _, err := r.management.UpdateBrand(ctx, scope, req)
|
compliancePortal, _, err := r.management.UpdateBrand(ctx, scope, req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if validationErrors, ok := errors.AsType[validator.ValidationErrors](err); ok {
|
if validationErrors, ok := errors.AsType[validator.ValidationErrors](err); ok {
|
||||||
return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors)
|
return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors)
|
||||||
}
|
}
|
||||||
|
|
||||||
r.logger.ErrorCtx(ctx, "cannot update trust center brand", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot update compliance portal brand", log.Error(err))
|
||||||
|
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &types.UpdateTrustCenterBrandPayload{
|
return &types.UpdateCompliancePortalBrandPayload{
|
||||||
TrustCenter: types.NewTrustCenter(trustCenter),
|
CompliancePortal: types.NewCompliancePortal(compliancePortal),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateTrustCenterAccess is the resolver for the updateTrustCenterAccess field.
|
// UpdateCompliancePortalAccess is the resolver for the updateCompliancePortalAccess field.
|
||||||
func (r *mutationResolver) UpdateTrustCenterAccess(ctx context.Context, input types.UpdateTrustCenterAccessInput) (*types.UpdateTrustCenterAccessPayload, error) {
|
func (r *mutationResolver) UpdateCompliancePortalAccess(ctx context.Context, input types.UpdateCompliancePortalAccessInput) (*types.UpdateCompliancePortalAccessPayload, error) {
|
||||||
scope, err := r.authorize(ctx, input.ID, management.ActionCompliancePortalAccessUpdate)
|
scope, err := r.authorize(ctx, input.ID, management.ActionCompliancePortalAccessUpdate)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -325,7 +325,7 @@ func (r *mutationResolver) UpdateTrustCenterAccess(ctx context.Context, input ty
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, fileAccess := range input.TrustCenterFiles {
|
for _, fileAccess := range input.CompliancePortalFiles {
|
||||||
fileAccesses = append(fileAccesses, management.UpdateDocumentAccessRequest{
|
fileAccesses = append(fileAccesses, management.UpdateDocumentAccessRequest{
|
||||||
ID: fileAccess.ID,
|
ID: fileAccess.ID,
|
||||||
Status: fileAccess.Status,
|
Status: fileAccess.Status,
|
||||||
@@ -335,10 +335,10 @@ func (r *mutationResolver) UpdateTrustCenterAccess(ctx context.Context, input ty
|
|||||||
access, err := r.management.UpdateAccess(
|
access, err := r.management.UpdateAccess(
|
||||||
ctx, scope,
|
ctx, scope,
|
||||||
&management.UpdateAccessRequest{
|
&management.UpdateAccessRequest{
|
||||||
ID: input.ID,
|
ID: input.ID,
|
||||||
DocumentAccesses: documentAccesses,
|
DocumentAccesses: documentAccesses,
|
||||||
ReportAccesses: reportAccesses,
|
ReportAccesses: reportAccesses,
|
||||||
TrustCenterFileAccesses: fileAccesses,
|
CompliancePortalFileAccesses: fileAccesses,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -346,36 +346,36 @@ func (r *mutationResolver) UpdateTrustCenterAccess(ctx context.Context, input ty
|
|||||||
return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors)
|
return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors)
|
||||||
}
|
}
|
||||||
|
|
||||||
r.logger.ErrorCtx(ctx, "cannot update trust center access", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot update compliance portal access", log.Error(err))
|
||||||
|
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &types.UpdateTrustCenterAccessPayload{
|
return &types.UpdateCompliancePortalAccessPayload{
|
||||||
TrustCenterAccess: types.NewTrustCenterAccess(access),
|
CompliancePortalAccess: types.NewCompliancePortalAccess(access),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteTrustCenterAccess is the resolver for the deleteTrustCenterAccess field.
|
// DeleteCompliancePortalAccess is the resolver for the deleteCompliancePortalAccess field.
|
||||||
func (r *mutationResolver) DeleteTrustCenterAccess(ctx context.Context, input types.DeleteTrustCenterAccessInput) (*types.DeleteTrustCenterAccessPayload, error) {
|
func (r *mutationResolver) DeleteCompliancePortalAccess(ctx context.Context, input types.DeleteCompliancePortalAccessInput) (*types.DeleteCompliancePortalAccessPayload, error) {
|
||||||
scope, err := r.authorize(ctx, input.ID, management.ActionCompliancePortalAccessDelete)
|
scope, err := r.authorize(ctx, input.ID, management.ActionCompliancePortalAccessDelete)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := r.management.DeleteAccess(ctx, scope, input.ID); err != nil {
|
if err := r.management.DeleteAccess(ctx, scope, input.ID); err != nil {
|
||||||
r.logger.ErrorCtx(ctx, "cannot delete trust center access", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot delete compliance portal access", log.Error(err))
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &types.DeleteTrustCenterAccessPayload{
|
return &types.DeleteCompliancePortalAccessPayload{
|
||||||
DeletedTrustCenterAccessID: input.ID,
|
DeletedCompliancePortalAccessID: input.ID,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateTrustCenterReference is the resolver for the createTrustCenterReference field.
|
// CreateCompliancePortalReference is the resolver for the createCompliancePortalReference field.
|
||||||
func (r *mutationResolver) CreateTrustCenterReference(ctx context.Context, input types.CreateTrustCenterReferenceInput) (*types.CreateTrustCenterReferencePayload, error) {
|
func (r *mutationResolver) CreateCompliancePortalReference(ctx context.Context, input types.CreateCompliancePortalReferenceInput) (*types.CreateCompliancePortalReferencePayload, error) {
|
||||||
scope, err := r.authorize(ctx, input.TrustCenterID, management.ActionCompliancePortalReferenceCreate)
|
scope, err := r.authorize(ctx, input.CompliancePortalID, management.ActionCompliancePortalReferenceCreate)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -383,10 +383,10 @@ func (r *mutationResolver) CreateTrustCenterReference(ctx context.Context, input
|
|||||||
reference, err := r.management.CreateReference(
|
reference, err := r.management.CreateReference(
|
||||||
ctx, scope,
|
ctx, scope,
|
||||||
&management.CreateReferenceRequest{
|
&management.CreateReferenceRequest{
|
||||||
TrustCenterID: input.TrustCenterID,
|
CompliancePortalID: input.CompliancePortalID,
|
||||||
Name: input.Name,
|
Name: input.Name,
|
||||||
Description: input.Description,
|
Description: input.Description,
|
||||||
WebsiteURL: input.WebsiteURL,
|
WebsiteURL: input.WebsiteURL,
|
||||||
LogoFile: management.File{
|
LogoFile: management.File{
|
||||||
Content: input.LogoFile.File,
|
Content: input.LogoFile.File,
|
||||||
Filename: input.LogoFile.Filename,
|
Filename: input.LogoFile.Filename,
|
||||||
@@ -400,18 +400,18 @@ func (r *mutationResolver) CreateTrustCenterReference(ctx context.Context, input
|
|||||||
return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors)
|
return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors)
|
||||||
}
|
}
|
||||||
|
|
||||||
r.logger.ErrorCtx(ctx, "cannot create trust center reference", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot create compliance portal reference", log.Error(err))
|
||||||
|
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &types.CreateTrustCenterReferencePayload{
|
return &types.CreateCompliancePortalReferencePayload{
|
||||||
TrustCenterReferenceEdge: types.NewTrustCenterReferenceEdge(reference, coredata.TrustCenterReferenceOrderFieldRank),
|
CompliancePortalReferenceEdge: types.NewCompliancePortalReferenceEdge(reference, coredata.CompliancePortalReferenceOrderFieldRank),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateTrustCenterReference is the resolver for the updateTrustCenterReference field.
|
// UpdateCompliancePortalReference is the resolver for the updateCompliancePortalReference field.
|
||||||
func (r *mutationResolver) UpdateTrustCenterReference(ctx context.Context, input types.UpdateTrustCenterReferenceInput) (*types.UpdateTrustCenterReferencePayload, error) {
|
func (r *mutationResolver) UpdateCompliancePortalReference(ctx context.Context, input types.UpdateCompliancePortalReferenceInput) (*types.UpdateCompliancePortalReferencePayload, error) {
|
||||||
scope, err := r.authorize(ctx, input.ID, management.ActionCompliancePortalReferenceUpdate)
|
scope, err := r.authorize(ctx, input.ID, management.ActionCompliancePortalReferenceUpdate)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -440,36 +440,36 @@ func (r *mutationResolver) UpdateTrustCenterReference(ctx context.Context, input
|
|||||||
return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors)
|
return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors)
|
||||||
}
|
}
|
||||||
|
|
||||||
r.logger.ErrorCtx(ctx, "cannot update trust center reference", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot update compliance portal reference", log.Error(err))
|
||||||
|
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &types.UpdateTrustCenterReferencePayload{
|
return &types.UpdateCompliancePortalReferencePayload{
|
||||||
TrustCenterReference: types.NewTrustCenterReference(reference),
|
CompliancePortalReference: types.NewCompliancePortalReference(reference),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteTrustCenterReference is the resolver for the deleteTrustCenterReference field.
|
// DeleteCompliancePortalReference is the resolver for the deleteCompliancePortalReference field.
|
||||||
func (r *mutationResolver) DeleteTrustCenterReference(ctx context.Context, input types.DeleteTrustCenterReferenceInput) (*types.DeleteTrustCenterReferencePayload, error) {
|
func (r *mutationResolver) DeleteCompliancePortalReference(ctx context.Context, input types.DeleteCompliancePortalReferenceInput) (*types.DeleteCompliancePortalReferencePayload, error) {
|
||||||
scope, err := r.authorize(ctx, input.ID, management.ActionCompliancePortalReferenceDelete)
|
scope, err := r.authorize(ctx, input.ID, management.ActionCompliancePortalReferenceDelete)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := r.management.DeleteReference(ctx, scope, input.ID); err != nil {
|
if err := r.management.DeleteReference(ctx, scope, input.ID); err != nil {
|
||||||
r.logger.ErrorCtx(ctx, "cannot delete trust center reference", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot delete compliance portal reference", log.Error(err))
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &types.DeleteTrustCenterReferencePayload{
|
return &types.DeleteCompliancePortalReferencePayload{
|
||||||
DeletedTrustCenterReferenceID: input.ID,
|
DeletedCompliancePortalReferenceID: input.ID,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateCompliancePortalCommitmentGroup is the resolver for the createCompliancePortalCommitmentGroup field.
|
// CreateCompliancePortalCommitmentGroup is the resolver for the createCompliancePortalCommitmentGroup field.
|
||||||
func (r *mutationResolver) CreateCompliancePortalCommitmentGroup(ctx context.Context, input types.CreateCompliancePortalCommitmentGroupInput) (*types.CreateCompliancePortalCommitmentGroupPayload, error) {
|
func (r *mutationResolver) CreateCompliancePortalCommitmentGroup(ctx context.Context, input types.CreateCompliancePortalCommitmentGroupInput) (*types.CreateCompliancePortalCommitmentGroupPayload, error) {
|
||||||
scope, err := r.authorize(ctx, input.TrustCenterID, management.ActionCompliancePortalCommitmentGroupCreate)
|
scope, err := r.authorize(ctx, input.CompliancePortalID, management.ActionCompliancePortalCommitmentGroupCreate)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -477,9 +477,9 @@ func (r *mutationResolver) CreateCompliancePortalCommitmentGroup(ctx context.Con
|
|||||||
group, err := r.management.CreateCommitmentGroup(
|
group, err := r.management.CreateCommitmentGroup(
|
||||||
ctx, scope,
|
ctx, scope,
|
||||||
&management.CreateCompliancePortalCommitmentGroupRequest{
|
&management.CreateCompliancePortalCommitmentGroupRequest{
|
||||||
TrustCenterID: input.TrustCenterID,
|
CompliancePortalID: input.CompliancePortalID,
|
||||||
Title: input.Title,
|
Title: input.Title,
|
||||||
Description: input.Description,
|
Description: input.Description,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -629,7 +629,7 @@ func (r *mutationResolver) DeleteCompliancePortalCommitment(ctx context.Context,
|
|||||||
|
|
||||||
// CreateComplianceFramework is the resolver for the createComplianceFramework field.
|
// CreateComplianceFramework is the resolver for the createComplianceFramework field.
|
||||||
func (r *mutationResolver) CreateComplianceFramework(ctx context.Context, input types.CreateComplianceFrameworkInput) (*types.CreateComplianceFrameworkPayload, error) {
|
func (r *mutationResolver) CreateComplianceFramework(ctx context.Context, input types.CreateComplianceFrameworkInput) (*types.CreateComplianceFrameworkPayload, error) {
|
||||||
scope, err := r.authorize(ctx, input.TrustCenterID, management.ActionComplianceFrameworkCreate)
|
scope, err := r.authorize(ctx, input.CompliancePortalID, management.ActionComplianceFrameworkCreate)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -637,8 +637,8 @@ func (r *mutationResolver) CreateComplianceFramework(ctx context.Context, input
|
|||||||
cf, err := r.management.CreateFramework(
|
cf, err := r.management.CreateFramework(
|
||||||
ctx, scope,
|
ctx, scope,
|
||||||
&management.CreateFrameworkRequest{
|
&management.CreateFrameworkRequest{
|
||||||
TrustCenterID: input.TrustCenterID,
|
CompliancePortalID: input.CompliancePortalID,
|
||||||
FrameworkID: input.FrameworkID,
|
FrameworkID: input.FrameworkID,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -711,7 +711,7 @@ func (r *mutationResolver) DeleteComplianceFramework(ctx context.Context, input
|
|||||||
|
|
||||||
// CreateComplianceCustomLink is the resolver for the createComplianceCustomLink field.
|
// CreateComplianceCustomLink is the resolver for the createComplianceCustomLink field.
|
||||||
func (r *mutationResolver) CreateComplianceCustomLink(ctx context.Context, input types.CreateComplianceCustomLinkInput) (*types.CreateComplianceCustomLinkPayload, error) {
|
func (r *mutationResolver) CreateComplianceCustomLink(ctx context.Context, input types.CreateComplianceCustomLinkInput) (*types.CreateComplianceCustomLinkPayload, error) {
|
||||||
scope, err := r.authorize(ctx, input.TrustCenterID, management.ActionComplianceCustomLinkCreate)
|
scope, err := r.authorize(ctx, input.CompliancePortalID, management.ActionComplianceCustomLinkCreate)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -719,9 +719,9 @@ func (r *mutationResolver) CreateComplianceCustomLink(ctx context.Context, input
|
|||||||
item, err := r.management.CreateCustomLink(
|
item, err := r.management.CreateCustomLink(
|
||||||
ctx, scope,
|
ctx, scope,
|
||||||
&management.CreateCustomLinkRequest{
|
&management.CreateCustomLinkRequest{
|
||||||
TrustCenterID: input.TrustCenterID,
|
CompliancePortalID: input.CompliancePortalID,
|
||||||
Name: input.Name,
|
Name: input.Name,
|
||||||
URL: input.URL,
|
URL: input.URL,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -789,8 +789,8 @@ func (r *mutationResolver) DeleteComplianceCustomLink(ctx context.Context, input
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateTrustCenterFile is the resolver for the createTrustCenterFile field.
|
// CreateCompliancePortalFile is the resolver for the createCompliancePortalFile field.
|
||||||
func (r *mutationResolver) CreateTrustCenterFile(ctx context.Context, input types.CreateTrustCenterFileInput) (*types.CreateTrustCenterFilePayload, error) {
|
func (r *mutationResolver) CreateCompliancePortalFile(ctx context.Context, input types.CreateCompliancePortalFileInput) (*types.CreateCompliancePortalFilePayload, error) {
|
||||||
scope, err := r.authorize(ctx, input.OrganizationID, management.ActionCompliancePortalFileCreate)
|
scope, err := r.authorize(ctx, input.OrganizationID, management.ActionCompliancePortalFileCreate)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -808,7 +808,7 @@ func (r *mutationResolver) CreateTrustCenterFile(ctx context.Context, input type
|
|||||||
Size: input.File.Size,
|
Size: input.File.Size,
|
||||||
ContentType: input.File.ContentType,
|
ContentType: input.File.ContentType,
|
||||||
},
|
},
|
||||||
TrustCenterVisibility: input.TrustCenterVisibility,
|
CompliancePortalVisibility: input.CompliancePortalVisibility,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -816,18 +816,18 @@ func (r *mutationResolver) CreateTrustCenterFile(ctx context.Context, input type
|
|||||||
return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors)
|
return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors)
|
||||||
}
|
}
|
||||||
|
|
||||||
r.logger.ErrorCtx(ctx, "cannot create trust center file", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot create compliance portal file", log.Error(err))
|
||||||
|
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &types.CreateTrustCenterFilePayload{
|
return &types.CreateCompliancePortalFilePayload{
|
||||||
TrustCenterFileEdge: types.NewTrustCenterFileEdge(file, coredata.TrustCenterFileOrderFieldCreatedAt),
|
CompliancePortalFileEdge: types.NewCompliancePortalFileEdge(file, coredata.CompliancePortalFileOrderFieldCreatedAt),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateTrustCenterFile is the resolver for the updateTrustCenterFile field.
|
// UpdateCompliancePortalFile is the resolver for the updateCompliancePortalFile field.
|
||||||
func (r *mutationResolver) UpdateTrustCenterFile(ctx context.Context, input types.UpdateTrustCenterFileInput) (*types.UpdateTrustCenterFilePayload, error) {
|
func (r *mutationResolver) UpdateCompliancePortalFile(ctx context.Context, input types.UpdateCompliancePortalFileInput) (*types.UpdateCompliancePortalFilePayload, error) {
|
||||||
scope, err := r.authorize(ctx, input.ID, management.ActionCompliancePortalFileUpdate)
|
scope, err := r.authorize(ctx, input.ID, management.ActionCompliancePortalFileUpdate)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -836,10 +836,10 @@ func (r *mutationResolver) UpdateTrustCenterFile(ctx context.Context, input type
|
|||||||
file, err := r.management.UpdateFile(
|
file, err := r.management.UpdateFile(
|
||||||
ctx, scope,
|
ctx, scope,
|
||||||
&management.UpdateFileRequest{
|
&management.UpdateFileRequest{
|
||||||
ID: input.ID,
|
ID: input.ID,
|
||||||
Name: input.Name,
|
Name: input.Name,
|
||||||
Category: input.Category,
|
Category: input.Category,
|
||||||
TrustCenterVisibility: input.TrustCenterVisibility,
|
CompliancePortalVisibility: input.CompliancePortalVisibility,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -847,18 +847,18 @@ func (r *mutationResolver) UpdateTrustCenterFile(ctx context.Context, input type
|
|||||||
return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors)
|
return nil, gqlutils.InvalidValidationErrors(ctx, validationErrors)
|
||||||
}
|
}
|
||||||
|
|
||||||
r.logger.ErrorCtx(ctx, "cannot update trust center file", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot update compliance portal file", log.Error(err))
|
||||||
|
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &types.UpdateTrustCenterFilePayload{
|
return &types.UpdateCompliancePortalFilePayload{
|
||||||
TrustCenterFile: types.NewTrustCenterFile(file),
|
CompliancePortalFile: types.NewCompliancePortalFile(file),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetTrustCenterFile is the resolver for the getTrustCenterFile field.
|
// GetCompliancePortalFile is the resolver for the getCompliancePortalFile field.
|
||||||
func (r *mutationResolver) GetTrustCenterFile(ctx context.Context, input types.GetTrustCenterFileInput) (*types.GetTrustCenterFilePayload, error) {
|
func (r *mutationResolver) GetCompliancePortalFile(ctx context.Context, input types.GetCompliancePortalFileInput) (*types.GetCompliancePortalFilePayload, error) {
|
||||||
scope, err := r.authorize(ctx, input.ID, management.ActionCompliancePortalFileGet)
|
scope, err := r.authorize(ctx, input.ID, management.ActionCompliancePortalFileGet)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -866,42 +866,42 @@ func (r *mutationResolver) GetTrustCenterFile(ctx context.Context, input types.G
|
|||||||
|
|
||||||
file, err := r.management.GetFile(ctx, scope, input.ID)
|
file, err := r.management.GetFile(ctx, scope, input.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.logger.ErrorCtx(ctx, "cannot get trust center file", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot get compliance portal file", log.Error(err))
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &types.GetTrustCenterFilePayload{
|
return &types.GetCompliancePortalFilePayload{
|
||||||
TrustCenterFile: types.NewTrustCenterFile(file),
|
CompliancePortalFile: types.NewCompliancePortalFile(file),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteTrustCenterFile is the resolver for the deleteTrustCenterFile field.
|
// DeleteCompliancePortalFile is the resolver for the deleteCompliancePortalFile field.
|
||||||
func (r *mutationResolver) DeleteTrustCenterFile(ctx context.Context, input types.DeleteTrustCenterFileInput) (*types.DeleteTrustCenterFilePayload, error) {
|
func (r *mutationResolver) DeleteCompliancePortalFile(ctx context.Context, input types.DeleteCompliancePortalFileInput) (*types.DeleteCompliancePortalFilePayload, error) {
|
||||||
scope, err := r.authorize(ctx, input.ID, management.ActionCompliancePortalFileDelete)
|
scope, err := r.authorize(ctx, input.ID, management.ActionCompliancePortalFileDelete)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := r.management.DeleteFile(ctx, scope, input.ID); err != nil {
|
if err := r.management.DeleteFile(ctx, scope, input.ID); err != nil {
|
||||||
r.logger.ErrorCtx(ctx, "cannot delete trust center file", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot delete compliance portal file", log.Error(err))
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &types.DeleteTrustCenterFilePayload{
|
return &types.DeleteCompliancePortalFilePayload{
|
||||||
DeletedTrustCenterFileID: input.ID,
|
DeletedCompliancePortalFileID: input.ID,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// CreateCustomDomain is the resolver for the createCustomDomain field.
|
// CreateCustomDomain is the resolver for the createCustomDomain field.
|
||||||
func (r *mutationResolver) CreateCustomDomain(ctx context.Context, input types.CreateCustomDomainInput) (*types.CreateCustomDomainPayload, error) {
|
func (r *mutationResolver) CreateCustomDomain(ctx context.Context, input types.CreateCustomDomainInput) (*types.CreateCustomDomainPayload, error) {
|
||||||
scope, err := r.authorize(ctx, input.TrustCenterID, management.ActionCustomDomainCreate)
|
scope, err := r.authorize(ctx, input.CompliancePortalID, management.ActionCustomDomainCreate)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
domain, err := r.management.AddCustomDomain(
|
domain, err := r.management.AddCustomDomain(
|
||||||
ctx, scope,
|
ctx, scope,
|
||||||
input.TrustCenterID,
|
input.CompliancePortalID,
|
||||||
input.Domain,
|
input.Domain,
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -946,7 +946,7 @@ func (r *mutationResolver) DeleteCustomDomain(ctx context.Context, input types.D
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Logo is the resolver for the logo field.
|
// Logo is the resolver for the logo field.
|
||||||
func (r *trustCenterResolver) Logo(ctx context.Context, obj *types.TrustCenter) (*types.File, error) {
|
func (r *compliancePortalResolver) Logo(ctx context.Context, obj *types.CompliancePortal) (*types.File, error) {
|
||||||
if _, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalGet); err != nil {
|
if _, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalGet); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -959,7 +959,7 @@ func (r *trustCenterResolver) Logo(ctx context.Context, obj *types.TrustCenter)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// DarkLogo is the resolver for the darkLogo field.
|
// DarkLogo is the resolver for the darkLogo field.
|
||||||
func (r *trustCenterResolver) DarkLogo(ctx context.Context, obj *types.TrustCenter) (*types.File, error) {
|
func (r *compliancePortalResolver) DarkLogo(ctx context.Context, obj *types.CompliancePortal) (*types.File, error) {
|
||||||
if _, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalGet); err != nil {
|
if _, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalGet); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -972,7 +972,7 @@ func (r *trustCenterResolver) DarkLogo(ctx context.Context, obj *types.TrustCent
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Nda is the resolver for the nda field.
|
// Nda is the resolver for the nda field.
|
||||||
func (r *trustCenterResolver) Nda(ctx context.Context, obj *types.TrustCenter) (*types.File, error) {
|
func (r *compliancePortalResolver) Nda(ctx context.Context, obj *types.CompliancePortal) (*types.File, error) {
|
||||||
hasPermission, err := r.Resolver.Permission(ctx, obj, management.ActionCompliancePortalGetNda)
|
hasPermission, err := r.Resolver.Permission(ctx, obj, management.ActionCompliancePortalGetNda)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.logger.ErrorCtx(ctx, "cannot authorize", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot authorize", log.Error(err))
|
||||||
@@ -987,19 +987,19 @@ func (r *trustCenterResolver) Nda(ctx context.Context, obj *types.TrustCenter) (
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Organization is the resolver for the organization field.
|
// Organization is the resolver for the organization field.
|
||||||
func (r *trustCenterResolver) Organization(ctx context.Context, obj *types.TrustCenter) (*types.Organization, error) {
|
func (r *compliancePortalResolver) Organization(ctx context.Context, obj *types.CompliancePortal) (*types.Organization, error) {
|
||||||
scope, err := r.authorize(ctx, obj.ID, probo.ActionOrganizationGet)
|
scope, err := r.authorize(ctx, obj.ID, probo.ActionOrganizationGet)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
trustCenter, err := r.management.Get(ctx, scope, obj.ID)
|
compliancePortal, err := r.management.Get(ctx, scope, obj.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.logger.ErrorCtx(ctx, "cannot get trust center", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot get compliance portal", log.Error(err))
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
organization, err := r.probo.Organizations.Get(ctx, scope, trustCenter.OrganizationID)
|
organization, err := r.probo.Organizations.Get(ctx, scope, compliancePortal.OrganizationID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(err, coredata.ErrResourceNotFound) {
|
if errors.Is(err, coredata.ErrResourceNotFound) {
|
||||||
return nil, gqlutils.NotFound(ctx, err)
|
return nil, gqlutils.NotFound(ctx, err)
|
||||||
@@ -1014,19 +1014,19 @@ func (r *trustCenterResolver) Organization(ctx context.Context, obj *types.Trust
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Accesses is the resolver for the accesses field.
|
// Accesses is the resolver for the accesses field.
|
||||||
func (r *trustCenterResolver) Accesses(ctx context.Context, obj *types.TrustCenter, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.TrustCenterAccessOrderField]) (*types.TrustCenterAccessConnection, error) {
|
func (r *compliancePortalResolver) Accesses(ctx context.Context, obj *types.CompliancePortal, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.CompliancePortalAccessOrderField]) (*types.CompliancePortalAccessConnection, error) {
|
||||||
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalAccessList)
|
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalAccessList)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
pageOrderBy := page.OrderBy[coredata.TrustCenterAccessOrderField]{
|
pageOrderBy := page.OrderBy[coredata.CompliancePortalAccessOrderField]{
|
||||||
Field: coredata.TrustCenterAccessOrderFieldCreatedAt,
|
Field: coredata.CompliancePortalAccessOrderFieldCreatedAt,
|
||||||
Direction: page.OrderDirectionDesc,
|
Direction: page.OrderDirectionDesc,
|
||||||
}
|
}
|
||||||
|
|
||||||
if orderBy != nil {
|
if orderBy != nil {
|
||||||
pageOrderBy = page.OrderBy[coredata.TrustCenterAccessOrderField]{
|
pageOrderBy = page.OrderBy[coredata.CompliancePortalAccessOrderField]{
|
||||||
Field: orderBy.Field,
|
Field: orderBy.Field,
|
||||||
Direction: orderBy.Direction,
|
Direction: orderBy.Direction,
|
||||||
}
|
}
|
||||||
@@ -1036,27 +1036,27 @@ func (r *trustCenterResolver) Accesses(ctx context.Context, obj *types.TrustCent
|
|||||||
|
|
||||||
result, err := r.management.ListAccesses(ctx, scope, obj.ID, cursor)
|
result, err := r.management.ListAccesses(ctx, scope, obj.ID, cursor)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.logger.ErrorCtx(ctx, "cannot list trust center accesses", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot list compliance portal accesses", log.Error(err))
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
return types.NewTrustCenterAccessConnection(result), nil
|
return types.NewCompliancePortalAccessConnection(result), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// References is the resolver for the references field.
|
// References is the resolver for the references field.
|
||||||
func (r *trustCenterResolver) References(ctx context.Context, obj *types.TrustCenter, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.TrustCenterReferenceOrderField]) (*types.TrustCenterReferenceConnection, error) {
|
func (r *compliancePortalResolver) References(ctx context.Context, obj *types.CompliancePortal, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.CompliancePortalReferenceOrderField]) (*types.CompliancePortalReferenceConnection, error) {
|
||||||
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalReferenceList)
|
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalReferenceList)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
pageOrderBy := page.OrderBy[coredata.TrustCenterReferenceOrderField]{
|
pageOrderBy := page.OrderBy[coredata.CompliancePortalReferenceOrderField]{
|
||||||
Field: coredata.TrustCenterReferenceOrderFieldRank,
|
Field: coredata.CompliancePortalReferenceOrderFieldRank,
|
||||||
Direction: page.OrderDirectionAsc,
|
Direction: page.OrderDirectionAsc,
|
||||||
}
|
}
|
||||||
|
|
||||||
if orderBy != nil {
|
if orderBy != nil {
|
||||||
pageOrderBy = page.OrderBy[coredata.TrustCenterReferenceOrderField]{
|
pageOrderBy = page.OrderBy[coredata.CompliancePortalReferenceOrderField]{
|
||||||
Field: orderBy.Field,
|
Field: orderBy.Field,
|
||||||
Direction: orderBy.Direction,
|
Direction: orderBy.Direction,
|
||||||
}
|
}
|
||||||
@@ -1066,15 +1066,15 @@ func (r *trustCenterResolver) References(ctx context.Context, obj *types.TrustCe
|
|||||||
|
|
||||||
result, err := r.management.ListReferences(ctx, scope, obj.ID, cursor)
|
result, err := r.management.ListReferences(ctx, scope, obj.ID, cursor)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.logger.ErrorCtx(ctx, "cannot list trust center references", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot list compliance portal references", log.Error(err))
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
return types.NewTrustCenterReferenceConnection(result, obj.ID), nil
|
return types.NewCompliancePortalReferenceConnection(result, obj.ID), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// CommitmentGroups is the resolver for the commitmentGroups field.
|
// CommitmentGroups is the resolver for the commitmentGroups field.
|
||||||
func (r *trustCenterResolver) CommitmentGroups(ctx context.Context, obj *types.TrustCenter, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.CompliancePortalCommitmentGroupOrderField]) (*types.CompliancePortalCommitmentGroupConnection, error) {
|
func (r *compliancePortalResolver) CommitmentGroups(ctx context.Context, obj *types.CompliancePortal, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.CompliancePortalCommitmentGroupOrderField]) (*types.CompliancePortalCommitmentGroupConnection, error) {
|
||||||
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalCommitmentGroupList)
|
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalCommitmentGroupList)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -1104,7 +1104,7 @@ func (r *trustCenterResolver) CommitmentGroups(ctx context.Context, obj *types.T
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ComplianceFrameworks is the resolver for the complianceFrameworks field.
|
// ComplianceFrameworks is the resolver for the complianceFrameworks field.
|
||||||
func (r *trustCenterResolver) ComplianceFrameworks(ctx context.Context, obj *types.TrustCenter, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.ComplianceFrameworkOrderField]) (*types.ComplianceFrameworkConnection, error) {
|
func (r *compliancePortalResolver) ComplianceFrameworks(ctx context.Context, obj *types.CompliancePortal, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.ComplianceFrameworkOrderField]) (*types.ComplianceFrameworkConnection, error) {
|
||||||
scope, err := r.authorize(ctx, obj.ID, management.ActionComplianceFrameworkList)
|
scope, err := r.authorize(ctx, obj.ID, management.ActionComplianceFrameworkList)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -1134,7 +1134,7 @@ func (r *trustCenterResolver) ComplianceFrameworks(ctx context.Context, obj *typ
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CustomLinks is the resolver for the customLinks field.
|
// CustomLinks is the resolver for the customLinks field.
|
||||||
func (r *trustCenterResolver) CustomLinks(ctx context.Context, obj *types.TrustCenter, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.ComplianceCustomLinkOrderField]) (*types.ComplianceCustomLinkConnection, error) {
|
func (r *compliancePortalResolver) CustomLinks(ctx context.Context, obj *types.CompliancePortal, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.ComplianceCustomLinkOrderField]) (*types.ComplianceCustomLinkConnection, error) {
|
||||||
scope, err := r.authorize(ctx, obj.ID, management.ActionComplianceCustomLinkList)
|
scope, err := r.authorize(ctx, obj.ID, management.ActionComplianceCustomLinkList)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -1164,7 +1164,7 @@ func (r *trustCenterResolver) CustomLinks(ctx context.Context, obj *types.TrustC
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MailingList is the resolver for the mailingList field.
|
// MailingList is the resolver for the mailingList field.
|
||||||
func (r *trustCenterResolver) MailingList(ctx context.Context, obj *types.TrustCenter) (*types.MailingList, error) {
|
func (r *compliancePortalResolver) MailingList(ctx context.Context, obj *types.CompliancePortal) (*types.MailingList, error) {
|
||||||
scope, err := r.authorize(ctx, obj.ID, management.ActionMailingListSubscriberList)
|
scope, err := r.authorize(ctx, obj.ID, management.ActionMailingListSubscriberList)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -1176,7 +1176,7 @@ func (r *trustCenterResolver) MailingList(ctx context.Context, obj *types.TrustC
|
|||||||
|
|
||||||
ml, err := r.management.GetMailingList(ctx, scope, obj.ID)
|
ml, err := r.management.GetMailingList(ctx, scope, obj.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.logger.ErrorCtx(ctx, "cannot get mailing list for trust center", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot get mailing list for compliance portal", log.Error(err))
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1188,7 +1188,7 @@ func (r *trustCenterResolver) MailingList(ctx context.Context, obj *types.TrustC
|
|||||||
}
|
}
|
||||||
|
|
||||||
// DefaultDomain is the resolver for the defaultDomain field.
|
// DefaultDomain is the resolver for the defaultDomain field.
|
||||||
func (r *trustCenterResolver) DefaultDomain(ctx context.Context, obj *types.TrustCenter) (*types.CustomDomain, error) {
|
func (r *compliancePortalResolver) DefaultDomain(ctx context.Context, obj *types.CompliancePortal) (*types.CustomDomain, error) {
|
||||||
if obj.DefaultDomain == nil {
|
if obj.DefaultDomain == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
@@ -1213,7 +1213,7 @@ func (r *trustCenterResolver) DefaultDomain(ctx context.Context, obj *types.Trus
|
|||||||
}
|
}
|
||||||
|
|
||||||
// CustomDomain is the resolver for the customDomain field.
|
// CustomDomain is the resolver for the customDomain field.
|
||||||
func (r *trustCenterResolver) CustomDomain(ctx context.Context, obj *types.TrustCenter) (*types.CustomDomain, error) {
|
func (r *compliancePortalResolver) CustomDomain(ctx context.Context, obj *types.CompliancePortal) (*types.CustomDomain, error) {
|
||||||
if obj.CustomDomain == nil {
|
if obj.CustomDomain == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
@@ -1238,7 +1238,7 @@ func (r *trustCenterResolver) CustomDomain(ctx context.Context, obj *types.Trust
|
|||||||
}
|
}
|
||||||
|
|
||||||
// PublicURL is the resolver for the publicUrl field.
|
// PublicURL is the resolver for the publicUrl field.
|
||||||
func (r *trustCenterResolver) PublicURL(ctx context.Context, obj *types.TrustCenter) (string, error) {
|
func (r *compliancePortalResolver) PublicURL(ctx context.Context, obj *types.CompliancePortal) (string, error) {
|
||||||
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalGet)
|
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalGet)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
@@ -1246,7 +1246,7 @@ func (r *trustCenterResolver) PublicURL(ctx context.Context, obj *types.TrustCen
|
|||||||
|
|
||||||
publicURL, err := r.management.PublicURL(ctx, scope, obj.ID)
|
publicURL, err := r.management.PublicURL(ctx, scope, obj.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.logger.ErrorCtx(ctx, "cannot resolve trust center public url", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot resolve compliance portal public url", log.Error(err))
|
||||||
return "", gqlutils.Internal(ctx)
|
return "", gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1254,12 +1254,12 @@ func (r *trustCenterResolver) PublicURL(ctx context.Context, obj *types.TrustCen
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Permission is the resolver for the permission field.
|
// Permission is the resolver for the permission field.
|
||||||
func (r *trustCenterResolver) Permission(ctx context.Context, obj *types.TrustCenter, action string) (bool, error) {
|
func (r *compliancePortalResolver) Permission(ctx context.Context, obj *types.CompliancePortal, action string) (bool, error) {
|
||||||
return r.Resolver.Permission(ctx, obj, action)
|
return r.Resolver.Permission(ctx, obj, action)
|
||||||
}
|
}
|
||||||
|
|
||||||
// NdaSignature is the resolver for the ndaSignature field.
|
// NdaSignature is the resolver for the ndaSignature field.
|
||||||
func (r *trustCenterAccessResolver) NdaSignature(ctx context.Context, obj *types.TrustCenterAccess) (*types.ElectronicSignature, error) {
|
func (r *compliancePortalAccessResolver) NdaSignature(ctx context.Context, obj *types.CompliancePortalAccess) (*types.ElectronicSignature, error) {
|
||||||
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalAccessGet)
|
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalAccessGet)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -1267,7 +1267,7 @@ func (r *trustCenterAccessResolver) NdaSignature(ctx context.Context, obj *types
|
|||||||
|
|
||||||
access, err := r.management.GetAccess(ctx, scope, obj.ID)
|
access, err := r.management.GetAccess(ctx, scope, obj.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("cannot load trust center access: %w", err)
|
return nil, fmt.Errorf("cannot load compliance portal access: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if access.ElectronicSignatureID == nil {
|
if access.ElectronicSignatureID == nil {
|
||||||
@@ -1283,7 +1283,7 @@ func (r *trustCenterAccessResolver) NdaSignature(ctx context.Context, obj *types
|
|||||||
}
|
}
|
||||||
|
|
||||||
// PendingRequestCount is the resolver for the pendingRequestCount field.
|
// PendingRequestCount is the resolver for the pendingRequestCount field.
|
||||||
func (r *trustCenterAccessResolver) PendingRequestCount(ctx context.Context, obj *types.TrustCenterAccess) (int, error) {
|
func (r *compliancePortalAccessResolver) PendingRequestCount(ctx context.Context, obj *types.CompliancePortalAccess) (int, error) {
|
||||||
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalAccessGet)
|
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalAccessGet)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
@@ -1299,7 +1299,7 @@ func (r *trustCenterAccessResolver) PendingRequestCount(ctx context.Context, obj
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ActiveCount is the resolver for the activeCount field.
|
// ActiveCount is the resolver for the activeCount field.
|
||||||
func (r *trustCenterAccessResolver) ActiveCount(ctx context.Context, obj *types.TrustCenterAccess) (int, error) {
|
func (r *compliancePortalAccessResolver) ActiveCount(ctx context.Context, obj *types.CompliancePortalAccess) (int, error) {
|
||||||
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalAccessGet)
|
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalAccessGet)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
@@ -1315,7 +1315,7 @@ func (r *trustCenterAccessResolver) ActiveCount(ctx context.Context, obj *types.
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Profile is the resolver for the profile field.
|
// Profile is the resolver for the profile field.
|
||||||
func (r *trustCenterAccessResolver) Profile(ctx context.Context, obj *types.TrustCenterAccess) (*types.Profile, error) {
|
func (r *compliancePortalAccessResolver) Profile(ctx context.Context, obj *types.CompliancePortalAccess) (*types.Profile, error) {
|
||||||
if _, err := r.authorize(ctx, obj.ID, iam.ActionMembershipProfileGet); err != nil {
|
if _, err := r.authorize(ctx, obj.ID, iam.ActionMembershipProfileGet); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -1335,19 +1335,19 @@ func (r *trustCenterAccessResolver) Profile(ctx context.Context, obj *types.Trus
|
|||||||
}
|
}
|
||||||
|
|
||||||
// AvailableDocumentAccesses is the resolver for the availableDocumentAccesses field.
|
// AvailableDocumentAccesses is the resolver for the availableDocumentAccesses field.
|
||||||
func (r *trustCenterAccessResolver) AvailableDocumentAccesses(ctx context.Context, obj *types.TrustCenterAccess, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.TrustCenterDocumentAccessOrderField]) (*types.TrustCenterDocumentAccessConnection, error) {
|
func (r *compliancePortalAccessResolver) AvailableDocumentAccesses(ctx context.Context, obj *types.CompliancePortalAccess, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.CompliancePortalDocumentAccessOrderField]) (*types.CompliancePortalDocumentAccessConnection, error) {
|
||||||
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalAccessGet)
|
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalAccessGet)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
pageOrderBy := page.OrderBy[coredata.TrustCenterDocumentAccessOrderField]{
|
pageOrderBy := page.OrderBy[coredata.CompliancePortalDocumentAccessOrderField]{
|
||||||
Field: coredata.TrustCenterDocumentAccessOrderFieldCreatedAt,
|
Field: coredata.CompliancePortalDocumentAccessOrderFieldCreatedAt,
|
||||||
Direction: page.OrderDirectionDesc,
|
Direction: page.OrderDirectionDesc,
|
||||||
}
|
}
|
||||||
|
|
||||||
if orderBy != nil {
|
if orderBy != nil {
|
||||||
pageOrderBy = page.OrderBy[coredata.TrustCenterDocumentAccessOrderField]{
|
pageOrderBy = page.OrderBy[coredata.CompliancePortalDocumentAccessOrderField]{
|
||||||
Field: orderBy.Field,
|
Field: orderBy.Field,
|
||||||
Direction: orderBy.Direction,
|
Direction: orderBy.Direction,
|
||||||
}
|
}
|
||||||
@@ -1357,20 +1357,20 @@ func (r *trustCenterAccessResolver) AvailableDocumentAccesses(ctx context.Contex
|
|||||||
|
|
||||||
result, err := r.management.ListAvailableDocumentAccesses(ctx, scope, obj.ID, cursor)
|
result, err := r.management.ListAvailableDocumentAccesses(ctx, scope, obj.ID, cursor)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.logger.ErrorCtx(ctx, "cannot list trust center document accesses", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot list compliance portal document accesses", log.Error(err))
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
return types.NewTrustCenterDocumentAccessConnection(result, obj, obj.ID), nil
|
return types.NewCompliancePortalDocumentAccessConnection(result, obj, obj.ID), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Permission is the resolver for the permission field.
|
// Permission is the resolver for the permission field.
|
||||||
func (r *trustCenterAccessResolver) Permission(ctx context.Context, obj *types.TrustCenterAccess, action string) (bool, error) {
|
func (r *compliancePortalAccessResolver) Permission(ctx context.Context, obj *types.CompliancePortalAccess, action string) (bool, error) {
|
||||||
return r.Resolver.Permission(ctx, obj, action)
|
return r.Resolver.Permission(ctx, obj, action)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Document is the resolver for the document field.
|
// Document is the resolver for the document field.
|
||||||
func (r *trustCenterDocumentAccessResolver) Document(ctx context.Context, obj *types.TrustCenterDocumentAccess) (*types.Document, error) {
|
func (r *compliancePortalDocumentAccessResolver) Document(ctx context.Context, obj *types.CompliancePortalDocumentAccess) (*types.Document, error) {
|
||||||
scope, err := r.authorize(ctx, obj.ID, probo.ActionDocumentGet)
|
scope, err := r.authorize(ctx, obj.ID, probo.ActionDocumentGet)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -1395,7 +1395,7 @@ func (r *trustCenterDocumentAccessResolver) Document(ctx context.Context, obj *t
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ReportFile is the resolver for the reportFile field.
|
// ReportFile is the resolver for the reportFile field.
|
||||||
func (r *trustCenterDocumentAccessResolver) ReportFile(ctx context.Context, obj *types.TrustCenterDocumentAccess) (*types.File, error) {
|
func (r *compliancePortalDocumentAccessResolver) ReportFile(ctx context.Context, obj *types.CompliancePortalDocumentAccess) (*types.File, error) {
|
||||||
if obj.ReportFile == nil {
|
if obj.ReportFile == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
@@ -1421,7 +1421,7 @@ func (r *trustCenterDocumentAccessResolver) ReportFile(ctx context.Context, obj
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Audit is the resolver for the audit field.
|
// Audit is the resolver for the audit field.
|
||||||
func (r *trustCenterDocumentAccessResolver) Audit(ctx context.Context, obj *types.TrustCenterDocumentAccess) (*types.Audit, error) {
|
func (r *compliancePortalDocumentAccessResolver) Audit(ctx context.Context, obj *types.CompliancePortalDocumentAccess) (*types.Audit, error) {
|
||||||
scope, err := r.authorize(ctx, obj.ID, probo.ActionAuditGet)
|
scope, err := r.authorize(ctx, obj.ID, probo.ActionAuditGet)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -1445,28 +1445,28 @@ func (r *trustCenterDocumentAccessResolver) Audit(ctx context.Context, obj *type
|
|||||||
return types.NewAudit(audit), nil
|
return types.NewAudit(audit), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// TrustCenterFile is the resolver for the trustCenterFile field.
|
// CompliancePortalFile is the resolver for the compliancePortalFile field.
|
||||||
func (r *trustCenterDocumentAccessResolver) TrustCenterFile(ctx context.Context, obj *types.TrustCenterDocumentAccess) (*types.TrustCenterFile, error) {
|
func (r *compliancePortalDocumentAccessResolver) CompliancePortalFile(ctx context.Context, obj *types.CompliancePortalDocumentAccess) (*types.CompliancePortalFile, error) {
|
||||||
scope, err := r.authorize(ctx, obj.TrustCenterAccessID, management.ActionCompliancePortalFileGet)
|
scope, err := r.authorize(ctx, obj.CompliancePortalAccessID, management.ActionCompliancePortalFileGet)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if obj.TrustCenterFileID == nil {
|
if obj.CompliancePortalFileID == nil {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
trustCenterFile, err := r.management.GetFile(ctx, scope, *obj.TrustCenterFileID)
|
compliancePortalFile, err := r.management.GetFile(ctx, scope, *obj.CompliancePortalFileID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.logger.ErrorCtx(ctx, "cannot load trust center file", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot load compliance portal file", log.Error(err))
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
return types.NewTrustCenterFile(trustCenterFile), nil
|
return types.NewCompliancePortalFile(compliancePortalFile), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// TotalCount is the resolver for the totalCount field.
|
// TotalCount is the resolver for the totalCount field.
|
||||||
func (r *trustCenterDocumentAccessConnectionResolver) TotalCount(ctx context.Context, obj *types.TrustCenterDocumentAccessConnection) (int, error) {
|
func (r *compliancePortalDocumentAccessConnectionResolver) TotalCount(ctx context.Context, obj *types.CompliancePortalDocumentAccessConnection) (int, error) {
|
||||||
scope, err := r.authorize(ctx, obj.ParentID, management.ActionCompliancePortalDocumentAccessList)
|
scope, err := r.authorize(ctx, obj.ParentID, management.ActionCompliancePortalDocumentAccessList)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
@@ -1474,7 +1474,7 @@ func (r *trustCenterDocumentAccessConnectionResolver) TotalCount(ctx context.Con
|
|||||||
|
|
||||||
count, err := r.management.CountDocumentAccesses(ctx, scope, obj.ParentID)
|
count, err := r.management.CountDocumentAccesses(ctx, scope, obj.ParentID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.logger.ErrorCtx(ctx, "cannot count trust center document accesses", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot count compliance portal document accesses", log.Error(err))
|
||||||
return 0, gqlutils.Internal(ctx)
|
return 0, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1482,7 +1482,7 @@ func (r *trustCenterDocumentAccessConnectionResolver) TotalCount(ctx context.Con
|
|||||||
}
|
}
|
||||||
|
|
||||||
// File is the resolver for the file field.
|
// File is the resolver for the file field.
|
||||||
func (r *trustCenterFileResolver) File(ctx context.Context, obj *types.TrustCenterFile) (*types.File, error) {
|
func (r *compliancePortalFileResolver) File(ctx context.Context, obj *types.CompliancePortalFile) (*types.File, error) {
|
||||||
if _, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalFileGetFileUrl); err != nil {
|
if _, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalFileGetFileUrl); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -1491,7 +1491,7 @@ func (r *trustCenterFileResolver) File(ctx context.Context, obj *types.TrustCent
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Alias is the resolver for the alias field.
|
// Alias is the resolver for the alias field.
|
||||||
func (r *trustCenterFileResolver) Alias(ctx context.Context, obj *types.TrustCenterFile) (*string, error) {
|
func (r *compliancePortalFileResolver) Alias(ctx context.Context, obj *types.CompliancePortalFile) (*string, error) {
|
||||||
scope, err := r.authorize(ctx, obj.ID, resourcealias.ActionAliasGet)
|
scope, err := r.authorize(ctx, obj.ID, resourcealias.ActionAliasGet)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -1501,19 +1501,19 @@ func (r *trustCenterFileResolver) Alias(ctx context.Context, obj *types.TrustCen
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Organization is the resolver for the organization field.
|
// Organization is the resolver for the organization field.
|
||||||
func (r *trustCenterFileResolver) Organization(ctx context.Context, obj *types.TrustCenterFile) (*types.Organization, error) {
|
func (r *compliancePortalFileResolver) Organization(ctx context.Context, obj *types.CompliancePortalFile) (*types.Organization, error) {
|
||||||
scope, err := r.authorize(ctx, obj.ID, probo.ActionOrganizationGet)
|
scope, err := r.authorize(ctx, obj.ID, probo.ActionOrganizationGet)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
trustCenterFile, err := r.management.GetFile(ctx, scope, obj.ID)
|
compliancePortalFile, err := r.management.GetFile(ctx, scope, obj.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.logger.ErrorCtx(ctx, "cannot get trust center file", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot get compliance portal file", log.Error(err))
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
organization, err := r.probo.Organizations.Get(ctx, scope, trustCenterFile.OrganizationID)
|
organization, err := r.probo.Organizations.Get(ctx, scope, compliancePortalFile.OrganizationID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if errors.Is(err, coredata.ErrResourceNotFound) {
|
if errors.Is(err, coredata.ErrResourceNotFound) {
|
||||||
return nil, gqlutils.NotFound(ctx, err)
|
return nil, gqlutils.NotFound(ctx, err)
|
||||||
@@ -1528,12 +1528,12 @@ func (r *trustCenterFileResolver) Organization(ctx context.Context, obj *types.T
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Permission is the resolver for the permission field.
|
// Permission is the resolver for the permission field.
|
||||||
func (r *trustCenterFileResolver) Permission(ctx context.Context, obj *types.TrustCenterFile, action string) (bool, error) {
|
func (r *compliancePortalFileResolver) Permission(ctx context.Context, obj *types.CompliancePortalFile, action string) (bool, error) {
|
||||||
return r.Resolver.Permission(ctx, obj, action)
|
return r.Resolver.Permission(ctx, obj, action)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TotalCount is the resolver for the totalCount field.
|
// TotalCount is the resolver for the totalCount field.
|
||||||
func (r *trustCenterFileConnectionResolver) TotalCount(ctx context.Context, obj *types.TrustCenterFileConnection) (int, error) {
|
func (r *compliancePortalFileConnectionResolver) TotalCount(ctx context.Context, obj *types.CompliancePortalFileConnection) (int, error) {
|
||||||
scope, err := r.authorize(ctx, obj.ParentID, management.ActionCompliancePortalFileList)
|
scope, err := r.authorize(ctx, obj.ParentID, management.ActionCompliancePortalFileList)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
@@ -1541,7 +1541,7 @@ func (r *trustCenterFileConnectionResolver) TotalCount(ctx context.Context, obj
|
|||||||
|
|
||||||
count, err := r.management.CountFilesForOrganizationID(ctx, scope, obj.ParentID)
|
count, err := r.management.CountFilesForOrganizationID(ctx, scope, obj.ParentID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.logger.ErrorCtx(ctx, "cannot count trust center files", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot count compliance portal files", log.Error(err))
|
||||||
return 0, gqlutils.Internal(ctx)
|
return 0, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1549,7 +1549,7 @@ func (r *trustCenterFileConnectionResolver) TotalCount(ctx context.Context, obj
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Logo is the resolver for the logo field.
|
// Logo is the resolver for the logo field.
|
||||||
func (r *trustCenterReferenceResolver) Logo(ctx context.Context, obj *types.TrustCenterReference) (*types.File, error) {
|
func (r *compliancePortalReferenceResolver) Logo(ctx context.Context, obj *types.CompliancePortalReference) (*types.File, error) {
|
||||||
if _, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalReferenceGetLogoUrl); err != nil {
|
if _, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalReferenceGetLogoUrl); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
@@ -1558,12 +1558,12 @@ func (r *trustCenterReferenceResolver) Logo(ctx context.Context, obj *types.Trus
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Permission is the resolver for the permission field.
|
// Permission is the resolver for the permission field.
|
||||||
func (r *trustCenterReferenceResolver) Permission(ctx context.Context, obj *types.TrustCenterReference, action string) (bool, error) {
|
func (r *compliancePortalReferenceResolver) Permission(ctx context.Context, obj *types.CompliancePortalReference, action string) (bool, error) {
|
||||||
return r.Resolver.Permission(ctx, obj, action)
|
return r.Resolver.Permission(ctx, obj, action)
|
||||||
}
|
}
|
||||||
|
|
||||||
// TotalCount is the resolver for the totalCount field.
|
// TotalCount is the resolver for the totalCount field.
|
||||||
func (r *trustCenterReferenceConnectionResolver) TotalCount(ctx context.Context, obj *types.TrustCenterReferenceConnection) (int, error) {
|
func (r *compliancePortalReferenceConnectionResolver) TotalCount(ctx context.Context, obj *types.CompliancePortalReferenceConnection) (int, error) {
|
||||||
scope, err := r.authorize(ctx, obj.ParentID, management.ActionCompliancePortalReferenceList)
|
scope, err := r.authorize(ctx, obj.ParentID, management.ActionCompliancePortalReferenceList)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
@@ -1571,7 +1571,7 @@ func (r *trustCenterReferenceConnectionResolver) TotalCount(ctx context.Context,
|
|||||||
|
|
||||||
count, err := r.management.CountReferences(ctx, scope, obj.ParentID)
|
count, err := r.management.CountReferences(ctx, scope, obj.ParentID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.logger.ErrorCtx(ctx, "cannot count trust center references", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot count compliance portal references", log.Error(err))
|
||||||
return 0, gqlutils.Internal(ctx)
|
return 0, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1611,42 +1611,44 @@ func (r *Resolver) CompliancePortalCommitmentGroupConnection() schema.Compliance
|
|||||||
// CustomDomain returns schema.CustomDomainResolver implementation.
|
// CustomDomain returns schema.CustomDomainResolver implementation.
|
||||||
func (r *Resolver) CustomDomain() schema.CustomDomainResolver { return &customDomainResolver{r} }
|
func (r *Resolver) CustomDomain() schema.CustomDomainResolver { return &customDomainResolver{r} }
|
||||||
|
|
||||||
// TrustCenter returns schema.TrustCenterResolver implementation.
|
// CompliancePortal returns schema.CompliancePortalResolver implementation.
|
||||||
func (r *Resolver) TrustCenter() schema.TrustCenterResolver { return &trustCenterResolver{r} }
|
func (r *Resolver) CompliancePortal() schema.CompliancePortalResolver {
|
||||||
|
return &compliancePortalResolver{r}
|
||||||
// TrustCenterAccess returns schema.TrustCenterAccessResolver implementation.
|
|
||||||
func (r *Resolver) TrustCenterAccess() schema.TrustCenterAccessResolver {
|
|
||||||
return &trustCenterAccessResolver{r}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// TrustCenterDocumentAccess returns schema.TrustCenterDocumentAccessResolver implementation.
|
// CompliancePortalAccess returns schema.CompliancePortalAccessResolver implementation.
|
||||||
func (r *Resolver) TrustCenterDocumentAccess() schema.TrustCenterDocumentAccessResolver {
|
func (r *Resolver) CompliancePortalAccess() schema.CompliancePortalAccessResolver {
|
||||||
return &trustCenterDocumentAccessResolver{r}
|
return &compliancePortalAccessResolver{r}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TrustCenterDocumentAccessConnection returns schema.TrustCenterDocumentAccessConnectionResolver implementation.
|
// CompliancePortalDocumentAccess returns schema.CompliancePortalDocumentAccessResolver implementation.
|
||||||
func (r *Resolver) TrustCenterDocumentAccessConnection() schema.TrustCenterDocumentAccessConnectionResolver {
|
func (r *Resolver) CompliancePortalDocumentAccess() schema.CompliancePortalDocumentAccessResolver {
|
||||||
return &trustCenterDocumentAccessConnectionResolver{r}
|
return &compliancePortalDocumentAccessResolver{r}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TrustCenterFile returns schema.TrustCenterFileResolver implementation.
|
// CompliancePortalDocumentAccessConnection returns schema.CompliancePortalDocumentAccessConnectionResolver implementation.
|
||||||
func (r *Resolver) TrustCenterFile() schema.TrustCenterFileResolver {
|
func (r *Resolver) CompliancePortalDocumentAccessConnection() schema.CompliancePortalDocumentAccessConnectionResolver {
|
||||||
return &trustCenterFileResolver{r}
|
return &compliancePortalDocumentAccessConnectionResolver{r}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TrustCenterFileConnection returns schema.TrustCenterFileConnectionResolver implementation.
|
// CompliancePortalFile returns schema.CompliancePortalFileResolver implementation.
|
||||||
func (r *Resolver) TrustCenterFileConnection() schema.TrustCenterFileConnectionResolver {
|
func (r *Resolver) CompliancePortalFile() schema.CompliancePortalFileResolver {
|
||||||
return &trustCenterFileConnectionResolver{r}
|
return &compliancePortalFileResolver{r}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TrustCenterReference returns schema.TrustCenterReferenceResolver implementation.
|
// CompliancePortalFileConnection returns schema.CompliancePortalFileConnectionResolver implementation.
|
||||||
func (r *Resolver) TrustCenterReference() schema.TrustCenterReferenceResolver {
|
func (r *Resolver) CompliancePortalFileConnection() schema.CompliancePortalFileConnectionResolver {
|
||||||
return &trustCenterReferenceResolver{r}
|
return &compliancePortalFileConnectionResolver{r}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TrustCenterReferenceConnection returns schema.TrustCenterReferenceConnectionResolver implementation.
|
// CompliancePortalReference returns schema.CompliancePortalReferenceResolver implementation.
|
||||||
func (r *Resolver) TrustCenterReferenceConnection() schema.TrustCenterReferenceConnectionResolver {
|
func (r *Resolver) CompliancePortalReference() schema.CompliancePortalReferenceResolver {
|
||||||
return &trustCenterReferenceConnectionResolver{r}
|
return &compliancePortalReferenceResolver{r}
|
||||||
|
}
|
||||||
|
|
||||||
|
// CompliancePortalReferenceConnection returns schema.CompliancePortalReferenceConnectionResolver implementation.
|
||||||
|
func (r *Resolver) CompliancePortalReferenceConnection() schema.CompliancePortalReferenceConnectionResolver {
|
||||||
|
return &compliancePortalReferenceConnectionResolver{r}
|
||||||
}
|
}
|
||||||
|
|
||||||
type (
|
type (
|
||||||
@@ -1657,12 +1659,12 @@ type (
|
|||||||
compliancePortalCommitmentGroupResolver struct{ *Resolver }
|
compliancePortalCommitmentGroupResolver struct{ *Resolver }
|
||||||
compliancePortalCommitmentGroupConnectionResolver struct{ *Resolver }
|
compliancePortalCommitmentGroupConnectionResolver struct{ *Resolver }
|
||||||
customDomainResolver struct{ *Resolver }
|
customDomainResolver struct{ *Resolver }
|
||||||
trustCenterResolver struct{ *Resolver }
|
compliancePortalResolver struct{ *Resolver }
|
||||||
trustCenterAccessResolver struct{ *Resolver }
|
compliancePortalAccessResolver struct{ *Resolver }
|
||||||
trustCenterDocumentAccessResolver struct{ *Resolver }
|
compliancePortalDocumentAccessResolver struct{ *Resolver }
|
||||||
trustCenterDocumentAccessConnectionResolver struct{ *Resolver }
|
compliancePortalDocumentAccessConnectionResolver struct{ *Resolver }
|
||||||
trustCenterFileResolver struct{ *Resolver }
|
compliancePortalFileResolver struct{ *Resolver }
|
||||||
trustCenterFileConnectionResolver struct{ *Resolver }
|
compliancePortalFileConnectionResolver struct{ *Resolver }
|
||||||
trustCenterReferenceResolver struct{ *Resolver }
|
compliancePortalReferenceResolver struct{ *Resolver }
|
||||||
trustCenterReferenceConnectionResolver struct{ *Resolver }
|
compliancePortalReferenceConnectionResolver struct{ *Resolver }
|
||||||
)
|
)
|
||||||
@@ -847,13 +847,13 @@ func (r *mutationResolver) CreateDocument(ctx context.Context, input types.Creat
|
|||||||
document, documentVersion, err := r.probo.Documents.Create(
|
document, documentVersion, err := r.probo.Documents.Create(
|
||||||
ctx, scope,
|
ctx, scope,
|
||||||
probo.CreateDocumentRequest{
|
probo.CreateDocumentRequest{
|
||||||
OrganizationID: input.OrganizationID,
|
OrganizationID: input.OrganizationID,
|
||||||
Title: input.Title,
|
Title: input.Title,
|
||||||
Content: content,
|
Content: content,
|
||||||
Classification: input.Classification,
|
Classification: input.Classification,
|
||||||
DocumentType: input.DocumentType,
|
DocumentType: input.DocumentType,
|
||||||
TrustCenterVisibility: input.TrustCenterVisibility,
|
CompliancePortalVisibility: input.CompliancePortalVisibility,
|
||||||
DefaultApproverIDs: input.DefaultApproverIds,
|
DefaultApproverIDs: input.DefaultApproverIds,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -891,13 +891,13 @@ func (r *mutationResolver) UpdateDocument(ctx context.Context, input types.Updat
|
|||||||
document, documentVersion, draftCreated, err := r.probo.Documents.Update(
|
document, documentVersion, draftCreated, err := r.probo.Documents.Update(
|
||||||
ctx, scope,
|
ctx, scope,
|
||||||
probo.UpdateDocumentRequest{
|
probo.UpdateDocumentRequest{
|
||||||
DocumentID: input.ID,
|
DocumentID: input.ID,
|
||||||
Title: input.Title,
|
Title: input.Title,
|
||||||
Content: input.Content,
|
Content: input.Content,
|
||||||
Classification: input.Classification,
|
Classification: input.Classification,
|
||||||
DocumentType: input.DocumentType,
|
DocumentType: input.DocumentType,
|
||||||
TrustCenterVisibility: input.TrustCenterVisibility,
|
CompliancePortalVisibility: input.CompliancePortalVisibility,
|
||||||
DefaultApproverIDs: defaultApproverIDs,
|
DefaultApproverIDs: defaultApproverIDs,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ type Audit implements Node {
|
|||||||
filter: FindingFilter
|
filter: FindingFilter
|
||||||
): FindingConnection @goField(forceResolver: true)
|
): FindingConnection @goField(forceResolver: true)
|
||||||
|
|
||||||
trustCenterVisibility: TrustCenterVisibility!
|
compliancePortalVisibility: CompliancePortalVisibility!
|
||||||
createdAt: Datetime!
|
createdAt: Datetime!
|
||||||
updatedAt: Datetime!
|
updatedAt: Datetime!
|
||||||
|
|
||||||
@@ -276,7 +276,7 @@ input CreateAuditInput {
|
|||||||
validFrom: Datetime
|
validFrom: Datetime
|
||||||
validUntil: Datetime
|
validUntil: Datetime
|
||||||
state: AuditState
|
state: AuditState
|
||||||
trustCenterVisibility: TrustCenterVisibility
|
compliancePortalVisibility: CompliancePortalVisibility
|
||||||
file: Upload
|
file: Upload
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -286,7 +286,7 @@ input UpdateAuditInput {
|
|||||||
validFrom: Datetime
|
validFrom: Datetime
|
||||||
validUntil: Datetime
|
validUntil: Datetime
|
||||||
state: AuditState
|
state: AuditState
|
||||||
trustCenterVisibility: TrustCenterVisibility
|
compliancePortalVisibility: CompliancePortalVisibility
|
||||||
}
|
}
|
||||||
|
|
||||||
input DeleteAuditInput {
|
input DeleteAuditInput {
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
enum TrustCenterVisibility
|
enum CompliancePortalVisibility
|
||||||
@goModel(model: "go.probo.inc/probo/pkg/coredata.TrustCenterVisibility") {
|
@goModel(model: "go.probo.inc/probo/pkg/coredata.CompliancePortalVisibility") {
|
||||||
NONE
|
NONE
|
||||||
@goEnum(
|
@goEnum(
|
||||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterVisibilityNone"
|
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalVisibilityNone"
|
||||||
)
|
)
|
||||||
PRIVATE
|
PRIVATE
|
||||||
@goEnum(
|
@goEnum(
|
||||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterVisibilityPrivate"
|
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalVisibilityPrivate"
|
||||||
)
|
)
|
||||||
PUBLIC
|
PUBLIC
|
||||||
@goEnum(
|
@goEnum(
|
||||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterVisibilityPublic"
|
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalVisibilityPublic"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -28,81 +28,81 @@ enum SearchEngineIndexing
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
enum TrustCenterDocumentAccessStatus
|
enum CompliancePortalDocumentAccessStatus
|
||||||
@goModel(
|
@goModel(
|
||||||
model: "go.probo.inc/probo/pkg/coredata.TrustCenterDocumentAccessStatus"
|
model: "go.probo.inc/probo/pkg/coredata.CompliancePortalDocumentAccessStatus"
|
||||||
) {
|
) {
|
||||||
REQUESTED
|
REQUESTED
|
||||||
@goEnum(
|
@goEnum(
|
||||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterDocumentAccessStatusRequested"
|
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalDocumentAccessStatusRequested"
|
||||||
)
|
)
|
||||||
GRANTED
|
GRANTED
|
||||||
@goEnum(
|
@goEnum(
|
||||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterDocumentAccessStatusGranted"
|
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalDocumentAccessStatusGranted"
|
||||||
)
|
)
|
||||||
REJECTED
|
REJECTED
|
||||||
@goEnum(
|
@goEnum(
|
||||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterDocumentAccessStatusRejected"
|
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalDocumentAccessStatusRejected"
|
||||||
)
|
)
|
||||||
REVOKED
|
REVOKED
|
||||||
@goEnum(
|
@goEnum(
|
||||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterDocumentAccessStatusRevoked"
|
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalDocumentAccessStatusRevoked"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
enum TrustCenterAccessOrderField
|
enum CompliancePortalAccessOrderField
|
||||||
@goModel(
|
@goModel(
|
||||||
model: "go.probo.inc/probo/pkg/coredata.TrustCenterAccessOrderField"
|
model: "go.probo.inc/probo/pkg/coredata.CompliancePortalAccessOrderField"
|
||||||
) {
|
) {
|
||||||
CREATED_AT
|
CREATED_AT
|
||||||
@goEnum(
|
@goEnum(
|
||||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterAccessOrderFieldCreatedAt"
|
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalAccessOrderFieldCreatedAt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
enum TrustCenterAccessState
|
enum CompliancePortalAccessState
|
||||||
@goModel(
|
@goModel(
|
||||||
model: "go.probo.inc/probo/pkg/coredata.TrustCenterAccessState"
|
model: "go.probo.inc/probo/pkg/coredata.CompliancePortalAccessState"
|
||||||
) {
|
) {
|
||||||
ACTIVE
|
ACTIVE
|
||||||
@goEnum(
|
@goEnum(
|
||||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterAccessStateActive"
|
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalAccessStateActive"
|
||||||
)
|
)
|
||||||
INACTIVE
|
INACTIVE
|
||||||
@goEnum(
|
@goEnum(
|
||||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterAccessStateInactive"
|
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalAccessStateInactive"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
enum TrustCenterDocumentAccessOrderField
|
enum CompliancePortalDocumentAccessOrderField
|
||||||
@goModel(
|
@goModel(
|
||||||
model: "go.probo.inc/probo/pkg/coredata.TrustCenterDocumentAccessOrderField"
|
model: "go.probo.inc/probo/pkg/coredata.CompliancePortalDocumentAccessOrderField"
|
||||||
) {
|
) {
|
||||||
CREATED_AT
|
CREATED_AT
|
||||||
@goEnum(
|
@goEnum(
|
||||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterDocumentAccessOrderFieldCreatedAt"
|
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalDocumentAccessOrderFieldCreatedAt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
enum TrustCenterReferenceOrderField
|
enum CompliancePortalReferenceOrderField
|
||||||
@goModel(
|
@goModel(
|
||||||
model: "go.probo.inc/probo/pkg/coredata.TrustCenterReferenceOrderField"
|
model: "go.probo.inc/probo/pkg/coredata.CompliancePortalReferenceOrderField"
|
||||||
) {
|
) {
|
||||||
RANK
|
RANK
|
||||||
@goEnum(
|
@goEnum(
|
||||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterReferenceOrderFieldRank"
|
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalReferenceOrderFieldRank"
|
||||||
)
|
)
|
||||||
NAME
|
NAME
|
||||||
@goEnum(
|
@goEnum(
|
||||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterReferenceOrderFieldName"
|
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalReferenceOrderFieldName"
|
||||||
)
|
)
|
||||||
CREATED_AT
|
CREATED_AT
|
||||||
@goEnum(
|
@goEnum(
|
||||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterReferenceOrderFieldCreatedAt"
|
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalReferenceOrderFieldCreatedAt"
|
||||||
)
|
)
|
||||||
UPDATED_AT
|
UPDATED_AT
|
||||||
@goEnum(
|
@goEnum(
|
||||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterReferenceOrderFieldUpdatedAt"
|
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalReferenceOrderFieldUpdatedAt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -230,21 +230,21 @@ enum ComplianceFrameworkVisibility
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
enum TrustCenterFileOrderField
|
enum CompliancePortalFileOrderField
|
||||||
@goModel(
|
@goModel(
|
||||||
model: "go.probo.inc/probo/pkg/coredata.TrustCenterFileOrderField"
|
model: "go.probo.inc/probo/pkg/coredata.CompliancePortalFileOrderField"
|
||||||
) {
|
) {
|
||||||
NAME
|
NAME
|
||||||
@goEnum(
|
@goEnum(
|
||||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterFileOrderFieldName"
|
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalFileOrderFieldName"
|
||||||
)
|
)
|
||||||
CREATED_AT
|
CREATED_AT
|
||||||
@goEnum(
|
@goEnum(
|
||||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterFileOrderFieldCreatedAt"
|
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalFileOrderFieldCreatedAt"
|
||||||
)
|
)
|
||||||
UPDATED_AT
|
UPDATED_AT
|
||||||
@goEnum(
|
@goEnum(
|
||||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterFileOrderFieldUpdatedAt"
|
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalFileOrderFieldUpdatedAt"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -266,28 +266,28 @@ enum SSLStatus
|
|||||||
@goEnum(value: "go.probo.inc/probo/pkg/coredata.CertificateStatusFailed")
|
@goEnum(value: "go.probo.inc/probo/pkg/coredata.CertificateStatusFailed")
|
||||||
}
|
}
|
||||||
|
|
||||||
input TrustCenterAccessOrder
|
input CompliancePortalAccessOrder
|
||||||
@goModel(
|
@goModel(
|
||||||
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.TrustCenterAccessOrderBy"
|
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.CompliancePortalAccessOrderBy"
|
||||||
) {
|
) {
|
||||||
direction: OrderDirection!
|
direction: OrderDirection!
|
||||||
field: TrustCenterAccessOrderField!
|
field: CompliancePortalAccessOrderField!
|
||||||
}
|
}
|
||||||
|
|
||||||
input TrustCenterDocumentAccessOrder
|
input CompliancePortalDocumentAccessOrder
|
||||||
@goModel(
|
@goModel(
|
||||||
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.TrustCenterDocumentAccessOrderBy"
|
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.CompliancePortalDocumentAccessOrderBy"
|
||||||
) {
|
) {
|
||||||
direction: OrderDirection!
|
direction: OrderDirection!
|
||||||
field: TrustCenterDocumentAccessOrderField!
|
field: CompliancePortalDocumentAccessOrderField!
|
||||||
}
|
}
|
||||||
|
|
||||||
input TrustCenterReferenceOrder
|
input CompliancePortalReferenceOrder
|
||||||
@goModel(
|
@goModel(
|
||||||
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.TrustCenterReferenceOrderBy"
|
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.CompliancePortalReferenceOrderBy"
|
||||||
) {
|
) {
|
||||||
direction: OrderDirection!
|
direction: OrderDirection!
|
||||||
field: TrustCenterReferenceOrderField!
|
field: CompliancePortalReferenceOrderField!
|
||||||
}
|
}
|
||||||
|
|
||||||
input CompliancePortalCommitmentGroupOrder
|
input CompliancePortalCommitmentGroupOrder
|
||||||
@@ -306,12 +306,12 @@ input CompliancePortalCommitmentOrder
|
|||||||
field: CompliancePortalCommitmentOrderField!
|
field: CompliancePortalCommitmentOrderField!
|
||||||
}
|
}
|
||||||
|
|
||||||
input TrustCenterFileOrder
|
input CompliancePortalFileOrder
|
||||||
@goModel(
|
@goModel(
|
||||||
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.TrustCenterFileOrderBy"
|
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.CompliancePortalFileOrderBy"
|
||||||
) {
|
) {
|
||||||
direction: OrderDirection!
|
direction: OrderDirection!
|
||||||
field: TrustCenterFileOrderField!
|
field: CompliancePortalFileOrderField!
|
||||||
}
|
}
|
||||||
|
|
||||||
input ComplianceCustomLinkOrder
|
input ComplianceCustomLinkOrder
|
||||||
@@ -330,9 +330,9 @@ input ComplianceFrameworkOrder
|
|||||||
field: ComplianceFrameworkOrderField!
|
field: ComplianceFrameworkOrderField!
|
||||||
}
|
}
|
||||||
|
|
||||||
type TrustCenter implements Node
|
type CompliancePortal implements Node
|
||||||
@goModel(
|
@goModel(
|
||||||
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.TrustCenter"
|
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.CompliancePortal"
|
||||||
) {
|
) {
|
||||||
id: ID!
|
id: ID!
|
||||||
active: Boolean!
|
active: Boolean!
|
||||||
@@ -354,16 +354,16 @@ type TrustCenter implements Node
|
|||||||
after: CursorKey
|
after: CursorKey
|
||||||
last: Int
|
last: Int
|
||||||
before: CursorKey
|
before: CursorKey
|
||||||
orderBy: TrustCenterAccessOrder
|
orderBy: CompliancePortalAccessOrder
|
||||||
): TrustCenterAccessConnection! @goField(forceResolver: true)
|
): CompliancePortalAccessConnection! @goField(forceResolver: true)
|
||||||
|
|
||||||
references(
|
references(
|
||||||
first: Int
|
first: Int
|
||||||
after: CursorKey
|
after: CursorKey
|
||||||
last: Int
|
last: Int
|
||||||
before: CursorKey
|
before: CursorKey
|
||||||
orderBy: TrustCenterReferenceOrder
|
orderBy: CompliancePortalReferenceOrder
|
||||||
): TrustCenterReferenceConnection! @goField(forceResolver: true)
|
): CompliancePortalReferenceConnection! @goField(forceResolver: true)
|
||||||
|
|
||||||
commitmentGroups(
|
commitmentGroups(
|
||||||
first: Int
|
first: Int
|
||||||
@@ -400,17 +400,17 @@ type TrustCenter implements Node
|
|||||||
permission(action: String!): Boolean! @goField(forceResolver: true)
|
permission(action: String!): Boolean! @goField(forceResolver: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
type TrustCenterConnection {
|
type CompliancePortalConnection {
|
||||||
edges: [TrustCenterEdge!]!
|
edges: [CompliancePortalEdge!]!
|
||||||
pageInfo: PageInfo!
|
pageInfo: PageInfo!
|
||||||
}
|
}
|
||||||
|
|
||||||
type TrustCenterEdge {
|
type CompliancePortalEdge {
|
||||||
cursor: CursorKey!
|
cursor: CursorKey!
|
||||||
node: TrustCenter!
|
node: CompliancePortal!
|
||||||
}
|
}
|
||||||
|
|
||||||
type TrustCenterAccess implements Node {
|
type CompliancePortalAccess implements Node {
|
||||||
id: ID!
|
id: ID!
|
||||||
ndaSignature: ElectronicSignature @goField(forceResolver: true)
|
ndaSignature: ElectronicSignature @goField(forceResolver: true)
|
||||||
createdAt: Datetime!
|
createdAt: Datetime!
|
||||||
@@ -427,49 +427,49 @@ type TrustCenterAccess implements Node {
|
|||||||
after: CursorKey
|
after: CursorKey
|
||||||
last: Int
|
last: Int
|
||||||
before: CursorKey
|
before: CursorKey
|
||||||
orderBy: TrustCenterDocumentAccessOrder
|
orderBy: CompliancePortalDocumentAccessOrder
|
||||||
): TrustCenterDocumentAccessConnection! @goField(forceResolver: true)
|
): CompliancePortalDocumentAccessConnection! @goField(forceResolver: true)
|
||||||
|
|
||||||
permission(action: String!): Boolean! @goField(forceResolver: true)
|
permission(action: String!): Boolean! @goField(forceResolver: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
type TrustCenterDocumentAccess
|
type CompliancePortalDocumentAccess
|
||||||
@goModel(
|
@goModel(
|
||||||
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.TrustCenterDocumentAccess"
|
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.CompliancePortalDocumentAccess"
|
||||||
) {
|
) {
|
||||||
id: ID!
|
id: ID!
|
||||||
status: TrustCenterDocumentAccessStatus!
|
status: CompliancePortalDocumentAccessStatus!
|
||||||
document: Document @goField(forceResolver: true)
|
document: Document @goField(forceResolver: true)
|
||||||
reportFile: File @goField(forceResolver: true)
|
reportFile: File @goField(forceResolver: true)
|
||||||
audit: Audit @goField(forceResolver: true)
|
audit: Audit @goField(forceResolver: true)
|
||||||
trustCenterFile: TrustCenterFile @goField(forceResolver: true)
|
compliancePortalFile: CompliancePortalFile @goField(forceResolver: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
type TrustCenterDocumentAccessConnection
|
type CompliancePortalDocumentAccessConnection
|
||||||
@goModel(
|
@goModel(
|
||||||
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.TrustCenterDocumentAccessConnection"
|
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.CompliancePortalDocumentAccessConnection"
|
||||||
) {
|
) {
|
||||||
totalCount: Int! @goField(forceResolver: true)
|
totalCount: Int! @goField(forceResolver: true)
|
||||||
edges: [TrustCenterDocumentAccessEdge!]!
|
edges: [CompliancePortalDocumentAccessEdge!]!
|
||||||
pageInfo: PageInfo!
|
pageInfo: PageInfo!
|
||||||
}
|
}
|
||||||
|
|
||||||
type TrustCenterDocumentAccessEdge {
|
type CompliancePortalDocumentAccessEdge {
|
||||||
cursor: CursorKey!
|
cursor: CursorKey!
|
||||||
node: TrustCenterDocumentAccess!
|
node: CompliancePortalDocumentAccess!
|
||||||
}
|
}
|
||||||
|
|
||||||
type TrustCenterAccessConnection {
|
type CompliancePortalAccessConnection {
|
||||||
edges: [TrustCenterAccessEdge!]!
|
edges: [CompliancePortalAccessEdge!]!
|
||||||
pageInfo: PageInfo!
|
pageInfo: PageInfo!
|
||||||
}
|
}
|
||||||
|
|
||||||
type TrustCenterAccessEdge {
|
type CompliancePortalAccessEdge {
|
||||||
cursor: CursorKey!
|
cursor: CursorKey!
|
||||||
node: TrustCenterAccess!
|
node: CompliancePortalAccess!
|
||||||
}
|
}
|
||||||
|
|
||||||
type TrustCenterReference implements Node {
|
type CompliancePortalReference implements Node {
|
||||||
id: ID!
|
id: ID!
|
||||||
name: String!
|
name: String!
|
||||||
description: String
|
description: String
|
||||||
@@ -482,18 +482,18 @@ type TrustCenterReference implements Node {
|
|||||||
permission(action: String!): Boolean! @goField(forceResolver: true)
|
permission(action: String!): Boolean! @goField(forceResolver: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
type TrustCenterReferenceConnection
|
type CompliancePortalReferenceConnection
|
||||||
@goModel(
|
@goModel(
|
||||||
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.TrustCenterReferenceConnection"
|
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.CompliancePortalReferenceConnection"
|
||||||
) {
|
) {
|
||||||
totalCount: Int! @goField(forceResolver: true)
|
totalCount: Int! @goField(forceResolver: true)
|
||||||
edges: [TrustCenterReferenceEdge!]!
|
edges: [CompliancePortalReferenceEdge!]!
|
||||||
pageInfo: PageInfo!
|
pageInfo: PageInfo!
|
||||||
}
|
}
|
||||||
|
|
||||||
type TrustCenterReferenceEdge {
|
type CompliancePortalReferenceEdge {
|
||||||
cursor: CursorKey!
|
cursor: CursorKey!
|
||||||
node: TrustCenterReference!
|
node: CompliancePortalReference!
|
||||||
}
|
}
|
||||||
|
|
||||||
type CompliancePortalCommitmentGroup implements Node {
|
type CompliancePortalCommitmentGroup implements Node {
|
||||||
@@ -605,12 +605,12 @@ type ComplianceCustomLinkEdge {
|
|||||||
node: ComplianceCustomLink!
|
node: ComplianceCustomLink!
|
||||||
}
|
}
|
||||||
|
|
||||||
type TrustCenterFile implements Node {
|
type CompliancePortalFile implements Node {
|
||||||
id: ID!
|
id: ID!
|
||||||
name: String!
|
name: String!
|
||||||
category: String!
|
category: String!
|
||||||
file: File! @goField(forceResolver: true)
|
file: File! @goField(forceResolver: true)
|
||||||
trustCenterVisibility: TrustCenterVisibility!
|
compliancePortalVisibility: CompliancePortalVisibility!
|
||||||
alias: String @goField(forceResolver: true)
|
alias: String @goField(forceResolver: true)
|
||||||
createdAt: Datetime!
|
createdAt: Datetime!
|
||||||
updatedAt: Datetime!
|
updatedAt: Datetime!
|
||||||
@@ -619,18 +619,18 @@ type TrustCenterFile implements Node {
|
|||||||
permission(action: String!): Boolean! @goField(forceResolver: true)
|
permission(action: String!): Boolean! @goField(forceResolver: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
type TrustCenterFileConnection
|
type CompliancePortalFileConnection
|
||||||
@goModel(
|
@goModel(
|
||||||
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.TrustCenterFileConnection"
|
model: "go.probo.inc/probo/pkg/server/api/console/v1/types.CompliancePortalFileConnection"
|
||||||
) {
|
) {
|
||||||
totalCount: Int! @goField(forceResolver: true)
|
totalCount: Int! @goField(forceResolver: true)
|
||||||
edges: [TrustCenterFileEdge!]!
|
edges: [CompliancePortalFileEdge!]!
|
||||||
pageInfo: PageInfo!
|
pageInfo: PageInfo!
|
||||||
}
|
}
|
||||||
|
|
||||||
type TrustCenterFileEdge {
|
type CompliancePortalFileEdge {
|
||||||
cursor: CursorKey!
|
cursor: CursorKey!
|
||||||
node: TrustCenterFile!
|
node: CompliancePortalFile!
|
||||||
}
|
}
|
||||||
|
|
||||||
type CustomDomain implements Node {
|
type CustomDomain implements Node {
|
||||||
@@ -662,31 +662,31 @@ type DNSRecordInstruction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
extend type Mutation {
|
extend type Mutation {
|
||||||
updateTrustCenter(input: UpdateTrustCenterInput!): UpdateTrustCenterPayload!
|
updateCompliancePortal(input: UpdateCompliancePortalInput!): UpdateCompliancePortalPayload!
|
||||||
uploadTrustCenterNDA(
|
uploadCompliancePortalNDA(
|
||||||
input: UploadTrustCenterNDAInput!
|
input: UploadCompliancePortalNDAInput!
|
||||||
): UploadTrustCenterNDAPayload!
|
): UploadCompliancePortalNDAPayload!
|
||||||
deleteTrustCenterNDA(
|
deleteCompliancePortalNDA(
|
||||||
input: DeleteTrustCenterNDAInput!
|
input: DeleteCompliancePortalNDAInput!
|
||||||
): DeleteTrustCenterNDAPayload!
|
): DeleteCompliancePortalNDAPayload!
|
||||||
updateTrustCenterBrand(
|
updateCompliancePortalBrand(
|
||||||
input: UpdateTrustCenterBrandInput!
|
input: UpdateCompliancePortalBrandInput!
|
||||||
): UpdateTrustCenterBrandPayload!
|
): UpdateCompliancePortalBrandPayload!
|
||||||
updateTrustCenterAccess(
|
updateCompliancePortalAccess(
|
||||||
input: UpdateTrustCenterAccessInput!
|
input: UpdateCompliancePortalAccessInput!
|
||||||
): UpdateTrustCenterAccessPayload!
|
): UpdateCompliancePortalAccessPayload!
|
||||||
deleteTrustCenterAccess(
|
deleteCompliancePortalAccess(
|
||||||
input: DeleteTrustCenterAccessInput!
|
input: DeleteCompliancePortalAccessInput!
|
||||||
): DeleteTrustCenterAccessPayload!
|
): DeleteCompliancePortalAccessPayload!
|
||||||
createTrustCenterReference(
|
createCompliancePortalReference(
|
||||||
input: CreateTrustCenterReferenceInput!
|
input: CreateCompliancePortalReferenceInput!
|
||||||
): CreateTrustCenterReferencePayload!
|
): CreateCompliancePortalReferencePayload!
|
||||||
updateTrustCenterReference(
|
updateCompliancePortalReference(
|
||||||
input: UpdateTrustCenterReferenceInput!
|
input: UpdateCompliancePortalReferenceInput!
|
||||||
): UpdateTrustCenterReferencePayload!
|
): UpdateCompliancePortalReferencePayload!
|
||||||
deleteTrustCenterReference(
|
deleteCompliancePortalReference(
|
||||||
input: DeleteTrustCenterReferenceInput!
|
input: DeleteCompliancePortalReferenceInput!
|
||||||
): DeleteTrustCenterReferencePayload!
|
): DeleteCompliancePortalReferencePayload!
|
||||||
createCompliancePortalCommitmentGroup(
|
createCompliancePortalCommitmentGroup(
|
||||||
input: CreateCompliancePortalCommitmentGroupInput!
|
input: CreateCompliancePortalCommitmentGroupInput!
|
||||||
): CreateCompliancePortalCommitmentGroupPayload!
|
): CreateCompliancePortalCommitmentGroupPayload!
|
||||||
@@ -723,18 +723,18 @@ extend type Mutation {
|
|||||||
deleteComplianceCustomLink(
|
deleteComplianceCustomLink(
|
||||||
input: DeleteComplianceCustomLinkInput!
|
input: DeleteComplianceCustomLinkInput!
|
||||||
): DeleteComplianceCustomLinkPayload!
|
): DeleteComplianceCustomLinkPayload!
|
||||||
createTrustCenterFile(
|
createCompliancePortalFile(
|
||||||
input: CreateTrustCenterFileInput!
|
input: CreateCompliancePortalFileInput!
|
||||||
): CreateTrustCenterFilePayload!
|
): CreateCompliancePortalFilePayload!
|
||||||
updateTrustCenterFile(
|
updateCompliancePortalFile(
|
||||||
input: UpdateTrustCenterFileInput!
|
input: UpdateCompliancePortalFileInput!
|
||||||
): UpdateTrustCenterFilePayload!
|
): UpdateCompliancePortalFilePayload!
|
||||||
getTrustCenterFile(
|
getCompliancePortalFile(
|
||||||
input: GetTrustCenterFileInput!
|
input: GetCompliancePortalFileInput!
|
||||||
): GetTrustCenterFilePayload!
|
): GetCompliancePortalFilePayload!
|
||||||
deleteTrustCenterFile(
|
deleteCompliancePortalFile(
|
||||||
input: DeleteTrustCenterFileInput!
|
input: DeleteCompliancePortalFileInput!
|
||||||
): DeleteTrustCenterFilePayload!
|
): DeleteCompliancePortalFilePayload!
|
||||||
createCustomDomain(
|
createCustomDomain(
|
||||||
input: CreateCustomDomainInput!
|
input: CreateCustomDomainInput!
|
||||||
): CreateCustomDomainPayload!
|
): CreateCustomDomainPayload!
|
||||||
@@ -743,8 +743,8 @@ extend type Mutation {
|
|||||||
): DeleteCustomDomainPayload!
|
): DeleteCustomDomainPayload!
|
||||||
}
|
}
|
||||||
|
|
||||||
input UpdateTrustCenterInput {
|
input UpdateCompliancePortalInput {
|
||||||
trustCenterId: ID!
|
compliancePortalId: ID!
|
||||||
active: Boolean
|
active: Boolean
|
||||||
searchEngineIndexing: SearchEngineIndexing
|
searchEngineIndexing: SearchEngineIndexing
|
||||||
title: String
|
title: String
|
||||||
@@ -754,49 +754,49 @@ input UpdateTrustCenterInput {
|
|||||||
headquarterAddress: String @goField(omittable: true)
|
headquarterAddress: String @goField(omittable: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
input UploadTrustCenterNDAInput {
|
input UploadCompliancePortalNDAInput {
|
||||||
trustCenterId: ID!
|
compliancePortalId: ID!
|
||||||
fileName: String!
|
fileName: String!
|
||||||
file: Upload!
|
file: Upload!
|
||||||
}
|
}
|
||||||
|
|
||||||
input DeleteTrustCenterNDAInput {
|
input DeleteCompliancePortalNDAInput {
|
||||||
trustCenterId: ID!
|
compliancePortalId: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
input UpdateTrustCenterBrandInput {
|
input UpdateCompliancePortalBrandInput {
|
||||||
trustCenterId: ID!
|
compliancePortalId: ID!
|
||||||
logoFile: Upload @goField(omittable: true)
|
logoFile: Upload @goField(omittable: true)
|
||||||
darkLogoFile: Upload @goField(omittable: true)
|
darkLogoFile: Upload @goField(omittable: true)
|
||||||
}
|
}
|
||||||
|
|
||||||
input TrustCenterDocumentAccessInput {
|
input CompliancePortalDocumentAccessInput {
|
||||||
id: ID!
|
id: ID!
|
||||||
status: TrustCenterDocumentAccessStatus!
|
status: CompliancePortalDocumentAccessStatus!
|
||||||
}
|
}
|
||||||
|
|
||||||
input UpdateTrustCenterAccessInput {
|
input UpdateCompliancePortalAccessInput {
|
||||||
id: ID!
|
id: ID!
|
||||||
name: String
|
name: String
|
||||||
state: TrustCenterAccessState
|
state: CompliancePortalAccessState
|
||||||
documents: [TrustCenterDocumentAccessInput!]
|
documents: [CompliancePortalDocumentAccessInput!]
|
||||||
reports: [TrustCenterDocumentAccessInput!]
|
reports: [CompliancePortalDocumentAccessInput!]
|
||||||
trustCenterFiles: [TrustCenterDocumentAccessInput!]
|
compliancePortalFiles: [CompliancePortalDocumentAccessInput!]
|
||||||
}
|
}
|
||||||
|
|
||||||
input DeleteTrustCenterAccessInput {
|
input DeleteCompliancePortalAccessInput {
|
||||||
id: ID!
|
id: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
input CreateTrustCenterReferenceInput {
|
input CreateCompliancePortalReferenceInput {
|
||||||
trustCenterId: ID!
|
compliancePortalId: ID!
|
||||||
name: String!
|
name: String!
|
||||||
description: String
|
description: String
|
||||||
websiteUrl: String!
|
websiteUrl: String!
|
||||||
logoFile: Upload!
|
logoFile: Upload!
|
||||||
}
|
}
|
||||||
|
|
||||||
input UpdateTrustCenterReferenceInput {
|
input UpdateCompliancePortalReferenceInput {
|
||||||
id: ID!
|
id: ID!
|
||||||
name: String
|
name: String
|
||||||
description: String @goField(omittable: true)
|
description: String @goField(omittable: true)
|
||||||
@@ -805,12 +805,12 @@ input UpdateTrustCenterReferenceInput {
|
|||||||
rank: Int
|
rank: Int
|
||||||
}
|
}
|
||||||
|
|
||||||
input DeleteTrustCenterReferenceInput {
|
input DeleteCompliancePortalReferenceInput {
|
||||||
id: ID!
|
id: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
input CreateCompliancePortalCommitmentGroupInput {
|
input CreateCompliancePortalCommitmentGroupInput {
|
||||||
trustCenterId: ID!
|
compliancePortalId: ID!
|
||||||
title: String!
|
title: String!
|
||||||
description: String!
|
description: String!
|
||||||
}
|
}
|
||||||
@@ -848,7 +848,7 @@ input DeleteCompliancePortalCommitmentInput {
|
|||||||
}
|
}
|
||||||
|
|
||||||
input CreateComplianceFrameworkInput {
|
input CreateComplianceFrameworkInput {
|
||||||
trustCenterId: ID!
|
compliancePortalId: ID!
|
||||||
frameworkId: ID!
|
frameworkId: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -862,7 +862,7 @@ input DeleteComplianceFrameworkInput {
|
|||||||
}
|
}
|
||||||
|
|
||||||
input CreateComplianceCustomLinkInput {
|
input CreateComplianceCustomLinkInput {
|
||||||
trustCenterId: ID!
|
compliancePortalId: ID!
|
||||||
name: String!
|
name: String!
|
||||||
url: String!
|
url: String!
|
||||||
}
|
}
|
||||||
@@ -878,31 +878,31 @@ input DeleteComplianceCustomLinkInput {
|
|||||||
id: ID!
|
id: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
input CreateTrustCenterFileInput {
|
input CreateCompliancePortalFileInput {
|
||||||
organizationId: ID!
|
organizationId: ID!
|
||||||
name: String!
|
name: String!
|
||||||
category: String!
|
category: String!
|
||||||
file: Upload!
|
file: Upload!
|
||||||
trustCenterVisibility: TrustCenterVisibility!
|
compliancePortalVisibility: CompliancePortalVisibility!
|
||||||
}
|
}
|
||||||
|
|
||||||
input UpdateTrustCenterFileInput {
|
input UpdateCompliancePortalFileInput {
|
||||||
id: ID!
|
id: ID!
|
||||||
name: String
|
name: String
|
||||||
category: String
|
category: String
|
||||||
trustCenterVisibility: TrustCenterVisibility
|
compliancePortalVisibility: CompliancePortalVisibility
|
||||||
}
|
}
|
||||||
|
|
||||||
input GetTrustCenterFileInput {
|
input GetCompliancePortalFileInput {
|
||||||
id: ID!
|
id: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
input DeleteTrustCenterFileInput {
|
input DeleteCompliancePortalFileInput {
|
||||||
id: ID!
|
id: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
input CreateCustomDomainInput {
|
input CreateCustomDomainInput {
|
||||||
trustCenterId: ID!
|
compliancePortalId: ID!
|
||||||
domain: String!
|
domain: String!
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -910,40 +910,40 @@ input DeleteCustomDomainInput {
|
|||||||
customDomainId: ID!
|
customDomainId: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateTrustCenterPayload {
|
type UpdateCompliancePortalPayload {
|
||||||
trustCenter: TrustCenter!
|
compliancePortal: CompliancePortal!
|
||||||
}
|
}
|
||||||
|
|
||||||
type UploadTrustCenterNDAPayload {
|
type UploadCompliancePortalNDAPayload {
|
||||||
trustCenter: TrustCenter!
|
compliancePortal: CompliancePortal!
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteTrustCenterNDAPayload {
|
type DeleteCompliancePortalNDAPayload {
|
||||||
trustCenter: TrustCenter!
|
compliancePortal: CompliancePortal!
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateTrustCenterBrandPayload {
|
type UpdateCompliancePortalBrandPayload {
|
||||||
trustCenter: TrustCenter!
|
compliancePortal: CompliancePortal!
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateTrustCenterAccessPayload {
|
type UpdateCompliancePortalAccessPayload {
|
||||||
trustCenterAccess: TrustCenterAccess!
|
compliancePortalAccess: CompliancePortalAccess!
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteTrustCenterAccessPayload {
|
type DeleteCompliancePortalAccessPayload {
|
||||||
deletedTrustCenterAccessId: ID!
|
deletedCompliancePortalAccessId: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateTrustCenterReferencePayload {
|
type CreateCompliancePortalReferencePayload {
|
||||||
trustCenterReferenceEdge: TrustCenterReferenceEdge!
|
compliancePortalReferenceEdge: CompliancePortalReferenceEdge!
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateTrustCenterReferencePayload {
|
type UpdateCompliancePortalReferencePayload {
|
||||||
trustCenterReference: TrustCenterReference!
|
compliancePortalReference: CompliancePortalReference!
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteTrustCenterReferencePayload {
|
type DeleteCompliancePortalReferencePayload {
|
||||||
deletedTrustCenterReferenceId: ID!
|
deletedCompliancePortalReferenceId: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateCompliancePortalCommitmentGroupPayload {
|
type CreateCompliancePortalCommitmentGroupPayload {
|
||||||
@@ -994,20 +994,20 @@ type DeleteComplianceCustomLinkPayload {
|
|||||||
deletedComplianceCustomLinkId: ID!
|
deletedComplianceCustomLinkId: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateTrustCenterFilePayload {
|
type CreateCompliancePortalFilePayload {
|
||||||
trustCenterFileEdge: TrustCenterFileEdge!
|
compliancePortalFileEdge: CompliancePortalFileEdge!
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpdateTrustCenterFilePayload {
|
type UpdateCompliancePortalFilePayload {
|
||||||
trustCenterFile: TrustCenterFile!
|
compliancePortalFile: CompliancePortalFile!
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetTrustCenterFilePayload {
|
type GetCompliancePortalFilePayload {
|
||||||
trustCenterFile: TrustCenterFile!
|
compliancePortalFile: CompliancePortalFile!
|
||||||
}
|
}
|
||||||
|
|
||||||
type DeleteTrustCenterFilePayload {
|
type DeleteCompliancePortalFilePayload {
|
||||||
deletedTrustCenterFileId: ID!
|
deletedCompliancePortalFileId: ID!
|
||||||
}
|
}
|
||||||
|
|
||||||
type CreateCustomDomainPayload {
|
type CreateCustomDomainPayload {
|
||||||
@@ -268,7 +268,7 @@ type Document implements Node {
|
|||||||
id: ID!
|
id: ID!
|
||||||
currentPublishedMajor: Int
|
currentPublishedMajor: Int
|
||||||
currentPublishedMinor: Int
|
currentPublishedMinor: Int
|
||||||
trustCenterVisibility: TrustCenterVisibility!
|
compliancePortalVisibility: CompliancePortalVisibility!
|
||||||
alias: String @goField(forceResolver: true)
|
alias: String @goField(forceResolver: true)
|
||||||
organization: Organization! @goField(forceResolver: true)
|
organization: Organization! @goField(forceResolver: true)
|
||||||
|
|
||||||
@@ -592,7 +592,7 @@ input CreateDocumentInput {
|
|||||||
content: String
|
content: String
|
||||||
documentType: DocumentType!
|
documentType: DocumentType!
|
||||||
classification: DocumentClassification!
|
classification: DocumentClassification!
|
||||||
trustCenterVisibility: TrustCenterVisibility
|
compliancePortalVisibility: CompliancePortalVisibility
|
||||||
defaultApproverIds: [ID!]
|
defaultApproverIds: [ID!]
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -602,7 +602,7 @@ input UpdateDocumentInput {
|
|||||||
content: String
|
content: String
|
||||||
classification: DocumentClassification
|
classification: DocumentClassification
|
||||||
documentType: DocumentType
|
documentType: DocumentType
|
||||||
trustCenterVisibility: TrustCenterVisibility
|
compliancePortalVisibility: CompliancePortalVisibility
|
||||||
defaultApproverIds: [ID!]
|
defaultApproverIds: [ID!]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -314,14 +314,14 @@ type Organization implements Node {
|
|||||||
orderBy: AgentRunOrder
|
orderBy: AgentRunOrder
|
||||||
): AgentRunConnection! @goField(forceResolver: true)
|
): AgentRunConnection! @goField(forceResolver: true)
|
||||||
|
|
||||||
trustCenter: TrustCenter @goField(forceResolver: true)
|
compliancePortal: CompliancePortal @goField(forceResolver: true)
|
||||||
trustCenterFiles(
|
compliancePortalFiles(
|
||||||
first: Int
|
first: Int
|
||||||
after: CursorKey
|
after: CursorKey
|
||||||
last: Int
|
last: Int
|
||||||
before: CursorKey
|
before: CursorKey
|
||||||
orderBy: TrustCenterFileOrder
|
orderBy: CompliancePortalFileOrder
|
||||||
): TrustCenterFileConnection! @goField(forceResolver: true)
|
): CompliancePortalFileConnection! @goField(forceResolver: true)
|
||||||
|
|
||||||
cookieBanners(
|
cookieBanners(
|
||||||
first: Int
|
first: Int
|
||||||
|
|||||||
@@ -302,7 +302,7 @@ type ThirdParty implements Node {
|
|||||||
headquarterAddress: String
|
headquarterAddress: String
|
||||||
legalName: String
|
legalName: String
|
||||||
websiteUrl: String
|
websiteUrl: String
|
||||||
showOnTrustCenter: Boolean!
|
showOnCompliancePortal: Boolean!
|
||||||
level: Int!
|
level: Int!
|
||||||
|
|
||||||
parentThirdParty: ThirdParty @goField(forceResolver: true)
|
parentThirdParty: ThirdParty @goField(forceResolver: true)
|
||||||
@@ -566,7 +566,7 @@ input UpdateThirdPartyInput {
|
|||||||
trustPageUrl: String @goField(omittable: true)
|
trustPageUrl: String @goField(omittable: true)
|
||||||
businessOwnerId: ID @goField(omittable: true)
|
businessOwnerId: ID @goField(omittable: true)
|
||||||
securityOwnerId: ID @goField(omittable: true)
|
securityOwnerId: ID @goField(omittable: true)
|
||||||
showOnTrustCenter: Boolean
|
showOnCompliancePortal: Boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
input DeleteThirdPartyInput {
|
input DeleteThirdPartyInput {
|
||||||
|
|||||||
@@ -1157,36 +1157,36 @@ func (r *organizationResolver) AgentRuns(ctx context.Context, obj *types.Organiz
|
|||||||
return types.NewAgentRunConnection(page, r, obj.ID), nil
|
return types.NewAgentRunConnection(page, r, obj.ID), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// TrustCenter is the resolver for the trustCenter field.
|
// CompliancePortal is the resolver for the compliancePortal field.
|
||||||
func (r *organizationResolver) TrustCenter(ctx context.Context, obj *types.Organization) (*types.TrustCenter, error) {
|
func (r *organizationResolver) CompliancePortal(ctx context.Context, obj *types.Organization) (*types.CompliancePortal, error) {
|
||||||
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalGet)
|
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalGet)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
trustCenter, err := r.management.GetByOrganizationID(ctx, scope, obj.ID)
|
compliancePortal, err := r.management.GetByOrganizationID(ctx, scope, obj.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.logger.ErrorCtx(ctx, "cannot get trust center", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot get compliance portal", log.Error(err))
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
return types.NewTrustCenter(trustCenter), nil
|
return types.NewCompliancePortal(compliancePortal), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// TrustCenterFiles is the resolver for the trustCenterFiles field.
|
// CompliancePortalFiles is the resolver for the compliancePortalFiles field.
|
||||||
func (r *organizationResolver) TrustCenterFiles(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.TrustCenterFileOrderField]) (*types.TrustCenterFileConnection, error) {
|
func (r *organizationResolver) CompliancePortalFiles(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.OrderBy[coredata.CompliancePortalFileOrderField]) (*types.CompliancePortalFileConnection, error) {
|
||||||
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalFileList)
|
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalFileList)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
pageOrderBy := page.OrderBy[coredata.TrustCenterFileOrderField]{
|
pageOrderBy := page.OrderBy[coredata.CompliancePortalFileOrderField]{
|
||||||
Field: coredata.TrustCenterFileOrderFieldCreatedAt,
|
Field: coredata.CompliancePortalFileOrderFieldCreatedAt,
|
||||||
Direction: page.OrderDirectionDesc,
|
Direction: page.OrderDirectionDesc,
|
||||||
}
|
}
|
||||||
|
|
||||||
if orderBy != nil {
|
if orderBy != nil {
|
||||||
pageOrderBy = page.OrderBy[coredata.TrustCenterFileOrderField]{
|
pageOrderBy = page.OrderBy[coredata.CompliancePortalFileOrderField]{
|
||||||
Field: orderBy.Field,
|
Field: orderBy.Field,
|
||||||
Direction: orderBy.Direction,
|
Direction: orderBy.Direction,
|
||||||
}
|
}
|
||||||
@@ -1194,13 +1194,13 @@ func (r *organizationResolver) TrustCenterFiles(ctx context.Context, obj *types.
|
|||||||
|
|
||||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||||
|
|
||||||
pageResult, err := r.management.ListFilesForOrganizationID(ctx, scope, obj.ID, cursor, &coredata.TrustCenterFileFilter{})
|
pageResult, err := r.management.ListFilesForOrganizationID(ctx, scope, obj.ID, cursor, &coredata.CompliancePortalFileFilter{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.logger.ErrorCtx(ctx, "cannot list organization trust center files", log.Error(err))
|
r.logger.ErrorCtx(ctx, "cannot list organization compliance portal files", log.Error(err))
|
||||||
return nil, gqlutils.Internal(ctx)
|
return nil, gqlutils.Internal(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
return types.NewTrustCenterFileConnection(pageResult, obj.ID), nil
|
return types.NewCompliancePortalFileConnection(pageResult, obj.ID), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// CookieBanners is the resolver for the cookieBanners field.
|
// CookieBanners is the resolver for the cookieBanners field.
|
||||||
|
|||||||
@@ -142,7 +142,7 @@ func (r *mutationResolver) UpdateThirdParty(ctx context.Context, input types.Upd
|
|||||||
Certifications: input.Certifications,
|
Certifications: input.Certifications,
|
||||||
BusinessOwnerID: gqlutils.UnwrapOmittable(input.BusinessOwnerID),
|
BusinessOwnerID: gqlutils.UnwrapOmittable(input.BusinessOwnerID),
|
||||||
SecurityOwnerID: gqlutils.UnwrapOmittable(input.SecurityOwnerID),
|
SecurityOwnerID: gqlutils.UnwrapOmittable(input.SecurityOwnerID),
|
||||||
ShowOnTrustCenter: input.ShowOnTrustCenter,
|
ShowOnCompliancePortal: input.ShowOnCompliancePortal,
|
||||||
Countries: input.Countries,
|
Countries: input.Countries,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -74,13 +74,13 @@ func NewAudit(a *coredata.Audit) *Audit {
|
|||||||
Framework: &Framework{
|
Framework: &Framework{
|
||||||
ID: a.FrameworkID,
|
ID: a.FrameworkID,
|
||||||
},
|
},
|
||||||
ValidFrom: a.ValidFrom,
|
ValidFrom: a.ValidFrom,
|
||||||
ValidUntil: a.ValidUntil,
|
ValidUntil: a.ValidUntil,
|
||||||
State: a.State,
|
State: a.State,
|
||||||
Name: a.Name,
|
Name: a.Name,
|
||||||
TrustCenterVisibility: a.TrustCenterVisibility,
|
CompliancePortalVisibility: a.CompliancePortalVisibility,
|
||||||
CreatedAt: a.CreatedAt,
|
CreatedAt: a.CreatedAt,
|
||||||
UpdatedAt: a.UpdatedAt,
|
UpdatedAt: a.UpdatedAt,
|
||||||
}
|
}
|
||||||
|
|
||||||
if a.ReportFileID != nil {
|
if a.ReportFileID != nil {
|
||||||
|
|||||||
96
pkg/server/api/console/v1/types/compliance_portal.go
Normal file
96
pkg/server/api/console/v1/types/compliance_portal.go
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
// Copyright (c) 2025-2026 Probo Inc <hello@probo.com>.
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
// of this software and associated documentation files (the "Software"), to deal
|
||||||
|
// in the Software without restriction, including without limitation the rights
|
||||||
|
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
// copies of the Software, and to permit persons to whom the Software is
|
||||||
|
// furnished to do so, subject to the following conditions:
|
||||||
|
//
|
||||||
|
// The above copyright notice and this permission notice shall be included in
|
||||||
|
// all copies or substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
// SOFTWARE.
|
||||||
|
|
||||||
|
package types
|
||||||
|
|
||||||
|
import (
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"go.probo.inc/probo/pkg/coredata"
|
||||||
|
"go.probo.inc/probo/pkg/gid"
|
||||||
|
)
|
||||||
|
|
||||||
|
type CompliancePortal struct {
|
||||||
|
ID gid.GID `json:"id"`
|
||||||
|
Active bool `json:"active"`
|
||||||
|
SearchEngineIndexing coredata.SearchEngineIndexing `json:"searchEngineIndexing"`
|
||||||
|
Logo *File `json:"logo,omitempty"`
|
||||||
|
DarkLogo *File `json:"darkLogo,omitempty"`
|
||||||
|
Nda *File `json:"nda,omitempty"`
|
||||||
|
Description *string `json:"description,omitempty"`
|
||||||
|
WebsiteURL *string `json:"websiteUrl,omitempty"`
|
||||||
|
Email *string `json:"email,omitempty"`
|
||||||
|
HeadquarterAddress *string `json:"headquarterAddress,omitempty"`
|
||||||
|
Title string `json:"title"`
|
||||||
|
CreatedAt time.Time `json:"createdAt"`
|
||||||
|
UpdatedAt time.Time `json:"updatedAt"`
|
||||||
|
Organization *Organization `json:"organization"`
|
||||||
|
Accesses *CompliancePortalAccessConnection `json:"accesses"`
|
||||||
|
References *CompliancePortalReferenceConnection `json:"references"`
|
||||||
|
ComplianceFrameworks *ComplianceFrameworkConnection `json:"complianceFrameworks"`
|
||||||
|
CustomLinks *ComplianceCustomLinkConnection `json:"customLinks"`
|
||||||
|
MailingList *MailingList `json:"mailingList,omitempty"`
|
||||||
|
DefaultDomain *CustomDomain `json:"defaultDomain,omitempty"`
|
||||||
|
CustomDomain *CustomDomain `json:"customDomain,omitempty"`
|
||||||
|
Permission bool `json:"permission"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (CompliancePortal) IsNode() {}
|
||||||
|
func (t CompliancePortal) GetID() gid.GID { return t.ID }
|
||||||
|
|
||||||
|
func NewCompliancePortal(tc *coredata.CompliancePortal) *CompliancePortal {
|
||||||
|
compliancePortal := &CompliancePortal{
|
||||||
|
ID: tc.ID,
|
||||||
|
Organization: &Organization{
|
||||||
|
ID: tc.OrganizationID,
|
||||||
|
},
|
||||||
|
Active: tc.Active,
|
||||||
|
SearchEngineIndexing: tc.SearchEngineIndexing,
|
||||||
|
Description: tc.Description,
|
||||||
|
WebsiteURL: tc.WebsiteURL,
|
||||||
|
Email: tc.Email,
|
||||||
|
HeadquarterAddress: tc.HeadquarterAddress,
|
||||||
|
Title: tc.Title,
|
||||||
|
CreatedAt: tc.CreatedAt,
|
||||||
|
UpdatedAt: tc.UpdatedAt,
|
||||||
|
}
|
||||||
|
|
||||||
|
if tc.LogoFileID != nil {
|
||||||
|
compliancePortal.Logo = &File{ID: *tc.LogoFileID}
|
||||||
|
}
|
||||||
|
|
||||||
|
if tc.DarkLogoFileID != nil {
|
||||||
|
compliancePortal.DarkLogo = &File{ID: *tc.DarkLogoFileID}
|
||||||
|
}
|
||||||
|
|
||||||
|
if tc.NonDisclosureAgreementFileID != nil {
|
||||||
|
compliancePortal.Nda = &File{ID: *tc.NonDisclosureAgreementFileID}
|
||||||
|
}
|
||||||
|
|
||||||
|
if tc.DefaultDomainID != nil {
|
||||||
|
compliancePortal.DefaultDomain = &CustomDomain{ID: *tc.DefaultDomainID}
|
||||||
|
}
|
||||||
|
|
||||||
|
if tc.CustomDomainID != nil {
|
||||||
|
compliancePortal.CustomDomain = &CustomDomain{ID: *tc.CustomDomainID}
|
||||||
|
}
|
||||||
|
|
||||||
|
return compliancePortal
|
||||||
|
}
|
||||||
@@ -25,32 +25,32 @@ import (
|
|||||||
"go.probo.inc/probo/pkg/page"
|
"go.probo.inc/probo/pkg/page"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TrustCenterAccessOrderBy = OrderBy[coredata.TrustCenterAccessOrderField]
|
type CompliancePortalAccessOrderBy = OrderBy[coredata.CompliancePortalAccessOrderField]
|
||||||
|
|
||||||
func NewTrustCenterAccessConnection(
|
func NewCompliancePortalAccessConnection(
|
||||||
page *page.Page[*coredata.TrustCenterAccess, coredata.TrustCenterAccessOrderField],
|
page *page.Page[*coredata.CompliancePortalAccess, coredata.CompliancePortalAccessOrderField],
|
||||||
) *TrustCenterAccessConnection {
|
) *CompliancePortalAccessConnection {
|
||||||
var edges = make([]*TrustCenterAccessEdge, len(page.Data))
|
var edges = make([]*CompliancePortalAccessEdge, len(page.Data))
|
||||||
|
|
||||||
for i := range edges {
|
for i := range edges {
|
||||||
edges[i] = NewTrustCenterAccessEdge(page.Data[i], page.Cursor.OrderBy.Field)
|
edges[i] = NewCompliancePortalAccessEdge(page.Data[i], page.Cursor.OrderBy.Field)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &TrustCenterAccessConnection{
|
return &CompliancePortalAccessConnection{
|
||||||
Edges: edges,
|
Edges: edges,
|
||||||
PageInfo: NewPageInfo(page),
|
PageInfo: NewPageInfo(page),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewTrustCenterAccessEdge(tca *coredata.TrustCenterAccess, orderBy coredata.TrustCenterAccessOrderField) *TrustCenterAccessEdge {
|
func NewCompliancePortalAccessEdge(tca *coredata.CompliancePortalAccess, orderBy coredata.CompliancePortalAccessOrderField) *CompliancePortalAccessEdge {
|
||||||
return &TrustCenterAccessEdge{
|
return &CompliancePortalAccessEdge{
|
||||||
Cursor: tca.CursorKey(orderBy),
|
Cursor: tca.CursorKey(orderBy),
|
||||||
Node: NewTrustCenterAccess(tca),
|
Node: NewCompliancePortalAccess(tca),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewTrustCenterAccess(tca *coredata.TrustCenterAccess) *TrustCenterAccess {
|
func NewCompliancePortalAccess(tca *coredata.CompliancePortalAccess) *CompliancePortalAccess {
|
||||||
return &TrustCenterAccess{
|
return &CompliancePortalAccess{
|
||||||
ID: tca.ID,
|
ID: tca.ID,
|
||||||
OrganizationID: tca.OrganizationID,
|
OrganizationID: tca.OrganizationID,
|
||||||
IdentityID: tca.IdentityID,
|
IdentityID: tca.IdentityID,
|
||||||
@@ -0,0 +1,121 @@
|
|||||||
|
// Copyright (c) 2025-2026 Probo Inc <hello@probo.com>.
|
||||||
|
//
|
||||||
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
// of this software and associated documentation files (the "Software"), to deal
|
||||||
|
// in the Software without restriction, including without limitation the rights
|
||||||
|
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
// copies of the Software, and to permit persons to whom the Software is
|
||||||
|
// furnished to do so, subject to the following conditions:
|
||||||
|
//
|
||||||
|
// The above copyright notice and this permission notice shall be included in
|
||||||
|
// all copies or substantial portions of the Software.
|
||||||
|
//
|
||||||
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
// SOFTWARE.
|
||||||
|
|
||||||
|
package types
|
||||||
|
|
||||||
|
import (
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"go.probo.inc/probo/pkg/coredata"
|
||||||
|
"go.probo.inc/probo/pkg/gid"
|
||||||
|
"go.probo.inc/probo/pkg/page"
|
||||||
|
)
|
||||||
|
|
||||||
|
type (
|
||||||
|
CompliancePortalDocumentAccessOrderBy = OrderBy[coredata.CompliancePortalDocumentAccessOrderField]
|
||||||
|
|
||||||
|
CompliancePortalDocumentAccessConnection struct {
|
||||||
|
TotalCount int
|
||||||
|
Edges []*CompliancePortalDocumentAccessEdge
|
||||||
|
PageInfo PageInfo
|
||||||
|
|
||||||
|
Resolver any
|
||||||
|
ParentID gid.GID
|
||||||
|
}
|
||||||
|
|
||||||
|
CompliancePortalDocumentAccess struct {
|
||||||
|
ID gid.GID `json:"id"`
|
||||||
|
OrganizationID gid.GID `json:"-"`
|
||||||
|
Status coredata.CompliancePortalDocumentAccessStatus `json:"status"`
|
||||||
|
CreatedAt time.Time `json:"createdAt"`
|
||||||
|
UpdatedAt time.Time `json:"updatedAt"`
|
||||||
|
CompliancePortalAccess *CompliancePortalAccess `json:"compliancePortalAccess"`
|
||||||
|
Document *Document `json:"document,omitempty"`
|
||||||
|
ReportFile *File `json:"reportFile,omitempty"`
|
||||||
|
CompliancePortalFile *CompliancePortalFile `json:"compliancePortalFile,omitempty"`
|
||||||
|
|
||||||
|
// Internal fields used by resolvers
|
||||||
|
CompliancePortalAccessID gid.GID `json:"-"`
|
||||||
|
DocumentID *gid.GID `json:"-"`
|
||||||
|
ReportFileID *gid.GID `json:"-"`
|
||||||
|
CompliancePortalFileID *gid.GID `json:"-"`
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
func NewCompliancePortalDocumentAccess(tcda *coredata.CompliancePortalDocumentAccess) *CompliancePortalDocumentAccess {
|
||||||
|
object := &CompliancePortalDocumentAccess{
|
||||||
|
ID: tcda.ID,
|
||||||
|
OrganizationID: tcda.OrganizationID,
|
||||||
|
Status: tcda.Status,
|
||||||
|
CreatedAt: tcda.CreatedAt,
|
||||||
|
UpdatedAt: tcda.UpdatedAt,
|
||||||
|
CompliancePortalAccessID: tcda.CompliancePortalAccessID,
|
||||||
|
DocumentID: tcda.DocumentID,
|
||||||
|
ReportFileID: tcda.ReportFileID,
|
||||||
|
CompliancePortalFileID: tcda.CompliancePortalFileID,
|
||||||
|
}
|
||||||
|
|
||||||
|
if tcda.DocumentID != nil {
|
||||||
|
object.Document = &Document{
|
||||||
|
ID: *tcda.DocumentID,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if tcda.ReportFileID != nil {
|
||||||
|
object.ReportFile = &File{
|
||||||
|
ID: *tcda.ReportFileID,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if tcda.CompliancePortalFileID != nil {
|
||||||
|
object.CompliancePortalFile = &CompliancePortalFile{
|
||||||
|
ID: *tcda.CompliancePortalFileID,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return object
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewCompliancePortalDocumentAccessConnection(
|
||||||
|
p *page.Page[*coredata.CompliancePortalDocumentAccess, coredata.CompliancePortalDocumentAccessOrderField],
|
||||||
|
parentType any,
|
||||||
|
parentID gid.GID,
|
||||||
|
) *CompliancePortalDocumentAccessConnection {
|
||||||
|
var edges = make([]*CompliancePortalDocumentAccessEdge, len(p.Data))
|
||||||
|
|
||||||
|
for i := range edges {
|
||||||
|
edges[i] = NewCompliancePortalDocumentAccessEdge(p.Data[i], p.Cursor.OrderBy.Field)
|
||||||
|
}
|
||||||
|
|
||||||
|
return &CompliancePortalDocumentAccessConnection{
|
||||||
|
Edges: edges,
|
||||||
|
PageInfo: *NewPageInfo(p),
|
||||||
|
|
||||||
|
Resolver: parentType,
|
||||||
|
ParentID: parentID,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewCompliancePortalDocumentAccessEdge(access *coredata.CompliancePortalDocumentAccess, orderBy coredata.CompliancePortalDocumentAccessOrderField) *CompliancePortalDocumentAccessEdge {
|
||||||
|
return &CompliancePortalDocumentAccessEdge{
|
||||||
|
Cursor: access.CursorKey(orderBy),
|
||||||
|
Node: NewCompliancePortalDocumentAccess(access),
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -26,50 +26,50 @@ import (
|
|||||||
"go.probo.inc/probo/pkg/page"
|
"go.probo.inc/probo/pkg/page"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TrustCenterFileOrderBy = OrderBy[coredata.TrustCenterFileOrderField]
|
type CompliancePortalFileOrderBy = OrderBy[coredata.CompliancePortalFileOrderField]
|
||||||
|
|
||||||
type TrustCenterFileConnection struct {
|
type CompliancePortalFileConnection struct {
|
||||||
TotalCount int `json:"totalCount"`
|
TotalCount int `json:"totalCount"`
|
||||||
Edges []*TrustCenterFileEdge `json:"edges"`
|
Edges []*CompliancePortalFileEdge `json:"edges"`
|
||||||
PageInfo *PageInfo `json:"pageInfo"`
|
PageInfo *PageInfo `json:"pageInfo"`
|
||||||
ParentID gid.GID `json:"-"`
|
ParentID gid.GID `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewTrustCenterFile(tcf *coredata.TrustCenterFile) *TrustCenterFile {
|
func NewCompliancePortalFile(tcf *coredata.CompliancePortalFile) *CompliancePortalFile {
|
||||||
return &TrustCenterFile{
|
return &CompliancePortalFile{
|
||||||
ID: tcf.ID,
|
ID: tcf.ID,
|
||||||
Name: tcf.Name,
|
Name: tcf.Name,
|
||||||
Category: tcf.Category,
|
Category: tcf.Category,
|
||||||
File: &File{ID: tcf.FileID},
|
File: &File{ID: tcf.FileID},
|
||||||
TrustCenterVisibility: tcf.TrustCenterVisibility,
|
CompliancePortalVisibility: tcf.CompliancePortalVisibility,
|
||||||
CreatedAt: tcf.CreatedAt,
|
CreatedAt: tcf.CreatedAt,
|
||||||
UpdatedAt: tcf.UpdatedAt,
|
UpdatedAt: tcf.UpdatedAt,
|
||||||
Organization: &Organization{
|
Organization: &Organization{
|
||||||
ID: tcf.OrganizationID,
|
ID: tcf.OrganizationID,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewTrustCenterFileConnection(
|
func NewCompliancePortalFileConnection(
|
||||||
p *page.Page[*coredata.TrustCenterFile, coredata.TrustCenterFileOrderField],
|
p *page.Page[*coredata.CompliancePortalFile, coredata.CompliancePortalFileOrderField],
|
||||||
parentID gid.GID,
|
parentID gid.GID,
|
||||||
) *TrustCenterFileConnection {
|
) *CompliancePortalFileConnection {
|
||||||
var edges = make([]*TrustCenterFileEdge, len(p.Data))
|
var edges = make([]*CompliancePortalFileEdge, len(p.Data))
|
||||||
|
|
||||||
for i := range edges {
|
for i := range edges {
|
||||||
edges[i] = NewTrustCenterFileEdge(p.Data[i], p.Cursor.OrderBy.Field)
|
edges[i] = NewCompliancePortalFileEdge(p.Data[i], p.Cursor.OrderBy.Field)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &TrustCenterFileConnection{
|
return &CompliancePortalFileConnection{
|
||||||
Edges: edges,
|
Edges: edges,
|
||||||
PageInfo: NewPageInfo(p),
|
PageInfo: NewPageInfo(p),
|
||||||
ParentID: parentID,
|
ParentID: parentID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewTrustCenterFileEdge(tcf *coredata.TrustCenterFile, orderBy coredata.TrustCenterFileOrderField) *TrustCenterFileEdge {
|
func NewCompliancePortalFileEdge(tcf *coredata.CompliancePortalFile, orderBy coredata.CompliancePortalFileOrderField) *CompliancePortalFileEdge {
|
||||||
return &TrustCenterFileEdge{
|
return &CompliancePortalFileEdge{
|
||||||
Cursor: tcf.CursorKey(orderBy),
|
Cursor: tcf.CursorKey(orderBy),
|
||||||
Node: NewTrustCenterFile(tcf),
|
Node: NewCompliancePortalFile(tcf),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -26,17 +26,17 @@ import (
|
|||||||
"go.probo.inc/probo/pkg/page"
|
"go.probo.inc/probo/pkg/page"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TrustCenterReferenceOrderBy = OrderBy[coredata.TrustCenterReferenceOrderField]
|
type CompliancePortalReferenceOrderBy = OrderBy[coredata.CompliancePortalReferenceOrderField]
|
||||||
|
|
||||||
type TrustCenterReferenceConnection struct {
|
type CompliancePortalReferenceConnection struct {
|
||||||
TotalCount int `json:"totalCount"`
|
TotalCount int `json:"totalCount"`
|
||||||
Edges []*TrustCenterReferenceEdge `json:"edges"`
|
Edges []*CompliancePortalReferenceEdge `json:"edges"`
|
||||||
PageInfo *PageInfo `json:"pageInfo"`
|
PageInfo *PageInfo `json:"pageInfo"`
|
||||||
ParentID gid.GID `json:"-"`
|
ParentID gid.GID `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewTrustCenterReference(tcc *coredata.TrustCenterReference) *TrustCenterReference {
|
func NewCompliancePortalReference(tcc *coredata.CompliancePortalReference) *CompliancePortalReference {
|
||||||
return &TrustCenterReference{
|
return &CompliancePortalReference{
|
||||||
ID: tcc.ID,
|
ID: tcc.ID,
|
||||||
Name: tcc.Name,
|
Name: tcc.Name,
|
||||||
Description: tcc.Description,
|
Description: tcc.Description,
|
||||||
@@ -48,26 +48,26 @@ func NewTrustCenterReference(tcc *coredata.TrustCenterReference) *TrustCenterRef
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewTrustCenterReferenceConnection(
|
func NewCompliancePortalReferenceConnection(
|
||||||
p *page.Page[*coredata.TrustCenterReference, coredata.TrustCenterReferenceOrderField],
|
p *page.Page[*coredata.CompliancePortalReference, coredata.CompliancePortalReferenceOrderField],
|
||||||
parentID gid.GID,
|
parentID gid.GID,
|
||||||
) *TrustCenterReferenceConnection {
|
) *CompliancePortalReferenceConnection {
|
||||||
var edges = make([]*TrustCenterReferenceEdge, len(p.Data))
|
var edges = make([]*CompliancePortalReferenceEdge, len(p.Data))
|
||||||
|
|
||||||
for i := range edges {
|
for i := range edges {
|
||||||
edges[i] = NewTrustCenterReferenceEdge(p.Data[i], p.Cursor.OrderBy.Field)
|
edges[i] = NewCompliancePortalReferenceEdge(p.Data[i], p.Cursor.OrderBy.Field)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &TrustCenterReferenceConnection{
|
return &CompliancePortalReferenceConnection{
|
||||||
Edges: edges,
|
Edges: edges,
|
||||||
PageInfo: NewPageInfo(p),
|
PageInfo: NewPageInfo(p),
|
||||||
ParentID: parentID,
|
ParentID: parentID,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewTrustCenterReferenceEdge(tcc *coredata.TrustCenterReference, orderBy coredata.TrustCenterReferenceOrderField) *TrustCenterReferenceEdge {
|
func NewCompliancePortalReferenceEdge(tcc *coredata.CompliancePortalReference, orderBy coredata.CompliancePortalReferenceOrderField) *CompliancePortalReferenceEdge {
|
||||||
return &TrustCenterReferenceEdge{
|
return &CompliancePortalReferenceEdge{
|
||||||
Cursor: tcc.CursorKey(orderBy),
|
Cursor: tcc.CursorKey(orderBy),
|
||||||
Node: NewTrustCenterReference(tcc),
|
Node: NewCompliancePortalReference(tcc),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -85,13 +85,13 @@ func NewDocument(document *coredata.Document) *Document {
|
|||||||
Organization: &Organization{
|
Organization: &Organization{
|
||||||
ID: document.OrganizationID,
|
ID: document.OrganizationID,
|
||||||
},
|
},
|
||||||
CurrentPublishedMajor: document.CurrentPublishedMajor,
|
CurrentPublishedMajor: document.CurrentPublishedMajor,
|
||||||
CurrentPublishedMinor: document.CurrentPublishedMinor,
|
CurrentPublishedMinor: document.CurrentPublishedMinor,
|
||||||
WriteMode: document.WriteMode,
|
WriteMode: document.WriteMode,
|
||||||
TrustCenterVisibility: document.TrustCenterVisibility,
|
CompliancePortalVisibility: document.CompliancePortalVisibility,
|
||||||
Status: document.Status,
|
Status: document.Status,
|
||||||
ArchivedAt: document.ArchivedAt,
|
ArchivedAt: document.ArchivedAt,
|
||||||
CreatedAt: document.CreatedAt,
|
CreatedAt: document.CreatedAt,
|
||||||
UpdatedAt: document.UpdatedAt,
|
UpdatedAt: document.UpdatedAt,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ func NewThirdParty(v *coredata.ThirdParty) *ThirdParty {
|
|||||||
LegalName: v.LegalName,
|
LegalName: v.LegalName,
|
||||||
WebsiteURL: v.WebsiteURL,
|
WebsiteURL: v.WebsiteURL,
|
||||||
Category: v.Category,
|
Category: v.Category,
|
||||||
ShowOnTrustCenter: v.ShowOnTrustCenter,
|
ShowOnCompliancePortal: v.ShowOnCompliancePortal,
|
||||||
Level: v.Level,
|
Level: v.Level,
|
||||||
Countries: v.Countries,
|
Countries: v.Countries,
|
||||||
UpdatedAt: v.UpdatedAt,
|
UpdatedAt: v.UpdatedAt,
|
||||||
|
|||||||
@@ -1,96 +0,0 @@
|
|||||||
// Copyright (c) 2025-2026 Probo Inc <hello@probo.com>.
|
|
||||||
//
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
// of this software and associated documentation files (the "Software"), to deal
|
|
||||||
// in the Software without restriction, including without limitation the rights
|
|
||||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
// copies of the Software, and to permit persons to whom the Software is
|
|
||||||
// furnished to do so, subject to the following conditions:
|
|
||||||
//
|
|
||||||
// The above copyright notice and this permission notice shall be included in
|
|
||||||
// all copies or substantial portions of the Software.
|
|
||||||
//
|
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
// SOFTWARE.
|
|
||||||
|
|
||||||
package types
|
|
||||||
|
|
||||||
import (
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"go.probo.inc/probo/pkg/coredata"
|
|
||||||
"go.probo.inc/probo/pkg/gid"
|
|
||||||
)
|
|
||||||
|
|
||||||
type TrustCenter struct {
|
|
||||||
ID gid.GID `json:"id"`
|
|
||||||
Active bool `json:"active"`
|
|
||||||
SearchEngineIndexing coredata.SearchEngineIndexing `json:"searchEngineIndexing"`
|
|
||||||
Logo *File `json:"logo,omitempty"`
|
|
||||||
DarkLogo *File `json:"darkLogo,omitempty"`
|
|
||||||
Nda *File `json:"nda,omitempty"`
|
|
||||||
Description *string `json:"description,omitempty"`
|
|
||||||
WebsiteURL *string `json:"websiteUrl,omitempty"`
|
|
||||||
Email *string `json:"email,omitempty"`
|
|
||||||
HeadquarterAddress *string `json:"headquarterAddress,omitempty"`
|
|
||||||
Title string `json:"title"`
|
|
||||||
CreatedAt time.Time `json:"createdAt"`
|
|
||||||
UpdatedAt time.Time `json:"updatedAt"`
|
|
||||||
Organization *Organization `json:"organization"`
|
|
||||||
Accesses *TrustCenterAccessConnection `json:"accesses"`
|
|
||||||
References *TrustCenterReferenceConnection `json:"references"`
|
|
||||||
ComplianceFrameworks *ComplianceFrameworkConnection `json:"complianceFrameworks"`
|
|
||||||
CustomLinks *ComplianceCustomLinkConnection `json:"customLinks"`
|
|
||||||
MailingList *MailingList `json:"mailingList,omitempty"`
|
|
||||||
DefaultDomain *CustomDomain `json:"defaultDomain,omitempty"`
|
|
||||||
CustomDomain *CustomDomain `json:"customDomain,omitempty"`
|
|
||||||
Permission bool `json:"permission"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (TrustCenter) IsNode() {}
|
|
||||||
func (t TrustCenter) GetID() gid.GID { return t.ID }
|
|
||||||
|
|
||||||
func NewTrustCenter(tc *coredata.TrustCenter) *TrustCenter {
|
|
||||||
trustCenter := &TrustCenter{
|
|
||||||
ID: tc.ID,
|
|
||||||
Organization: &Organization{
|
|
||||||
ID: tc.OrganizationID,
|
|
||||||
},
|
|
||||||
Active: tc.Active,
|
|
||||||
SearchEngineIndexing: tc.SearchEngineIndexing,
|
|
||||||
Description: tc.Description,
|
|
||||||
WebsiteURL: tc.WebsiteURL,
|
|
||||||
Email: tc.Email,
|
|
||||||
HeadquarterAddress: tc.HeadquarterAddress,
|
|
||||||
Title: tc.Title,
|
|
||||||
CreatedAt: tc.CreatedAt,
|
|
||||||
UpdatedAt: tc.UpdatedAt,
|
|
||||||
}
|
|
||||||
|
|
||||||
if tc.LogoFileID != nil {
|
|
||||||
trustCenter.Logo = &File{ID: *tc.LogoFileID}
|
|
||||||
}
|
|
||||||
|
|
||||||
if tc.DarkLogoFileID != nil {
|
|
||||||
trustCenter.DarkLogo = &File{ID: *tc.DarkLogoFileID}
|
|
||||||
}
|
|
||||||
|
|
||||||
if tc.NonDisclosureAgreementFileID != nil {
|
|
||||||
trustCenter.Nda = &File{ID: *tc.NonDisclosureAgreementFileID}
|
|
||||||
}
|
|
||||||
|
|
||||||
if tc.DefaultDomainID != nil {
|
|
||||||
trustCenter.DefaultDomain = &CustomDomain{ID: *tc.DefaultDomainID}
|
|
||||||
}
|
|
||||||
|
|
||||||
if tc.CustomDomainID != nil {
|
|
||||||
trustCenter.CustomDomain = &CustomDomain{ID: *tc.CustomDomainID}
|
|
||||||
}
|
|
||||||
|
|
||||||
return trustCenter
|
|
||||||
}
|
|
||||||
@@ -1,121 +0,0 @@
|
|||||||
// Copyright (c) 2025-2026 Probo Inc <hello@probo.com>.
|
|
||||||
//
|
|
||||||
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
// of this software and associated documentation files (the "Software"), to deal
|
|
||||||
// in the Software without restriction, including without limitation the rights
|
|
||||||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
// copies of the Software, and to permit persons to whom the Software is
|
|
||||||
// furnished to do so, subject to the following conditions:
|
|
||||||
//
|
|
||||||
// The above copyright notice and this permission notice shall be included in
|
|
||||||
// all copies or substantial portions of the Software.
|
|
||||||
//
|
|
||||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
// SOFTWARE.
|
|
||||||
|
|
||||||
package types
|
|
||||||
|
|
||||||
import (
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"go.probo.inc/probo/pkg/coredata"
|
|
||||||
"go.probo.inc/probo/pkg/gid"
|
|
||||||
"go.probo.inc/probo/pkg/page"
|
|
||||||
)
|
|
||||||
|
|
||||||
type (
|
|
||||||
TrustCenterDocumentAccessOrderBy = OrderBy[coredata.TrustCenterDocumentAccessOrderField]
|
|
||||||
|
|
||||||
TrustCenterDocumentAccessConnection struct {
|
|
||||||
TotalCount int
|
|
||||||
Edges []*TrustCenterDocumentAccessEdge
|
|
||||||
PageInfo PageInfo
|
|
||||||
|
|
||||||
Resolver any
|
|
||||||
ParentID gid.GID
|
|
||||||
}
|
|
||||||
|
|
||||||
TrustCenterDocumentAccess struct {
|
|
||||||
ID gid.GID `json:"id"`
|
|
||||||
OrganizationID gid.GID `json:"-"`
|
|
||||||
Status coredata.TrustCenterDocumentAccessStatus `json:"status"`
|
|
||||||
CreatedAt time.Time `json:"createdAt"`
|
|
||||||
UpdatedAt time.Time `json:"updatedAt"`
|
|
||||||
TrustCenterAccess *TrustCenterAccess `json:"trustCenterAccess"`
|
|
||||||
Document *Document `json:"document,omitempty"`
|
|
||||||
ReportFile *File `json:"reportFile,omitempty"`
|
|
||||||
TrustCenterFile *TrustCenterFile `json:"trustCenterFile,omitempty"`
|
|
||||||
|
|
||||||
// Internal fields used by resolvers
|
|
||||||
TrustCenterAccessID gid.GID `json:"-"`
|
|
||||||
DocumentID *gid.GID `json:"-"`
|
|
||||||
ReportFileID *gid.GID `json:"-"`
|
|
||||||
TrustCenterFileID *gid.GID `json:"-"`
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
func NewTrustCenterDocumentAccess(tcda *coredata.TrustCenterDocumentAccess) *TrustCenterDocumentAccess {
|
|
||||||
object := &TrustCenterDocumentAccess{
|
|
||||||
ID: tcda.ID,
|
|
||||||
OrganizationID: tcda.OrganizationID,
|
|
||||||
Status: tcda.Status,
|
|
||||||
CreatedAt: tcda.CreatedAt,
|
|
||||||
UpdatedAt: tcda.UpdatedAt,
|
|
||||||
TrustCenterAccessID: tcda.TrustCenterAccessID,
|
|
||||||
DocumentID: tcda.DocumentID,
|
|
||||||
ReportFileID: tcda.ReportFileID,
|
|
||||||
TrustCenterFileID: tcda.TrustCenterFileID,
|
|
||||||
}
|
|
||||||
|
|
||||||
if tcda.DocumentID != nil {
|
|
||||||
object.Document = &Document{
|
|
||||||
ID: *tcda.DocumentID,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if tcda.ReportFileID != nil {
|
|
||||||
object.ReportFile = &File{
|
|
||||||
ID: *tcda.ReportFileID,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if tcda.TrustCenterFileID != nil {
|
|
||||||
object.TrustCenterFile = &TrustCenterFile{
|
|
||||||
ID: *tcda.TrustCenterFileID,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return object
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewTrustCenterDocumentAccessConnection(
|
|
||||||
p *page.Page[*coredata.TrustCenterDocumentAccess, coredata.TrustCenterDocumentAccessOrderField],
|
|
||||||
parentType any,
|
|
||||||
parentID gid.GID,
|
|
||||||
) *TrustCenterDocumentAccessConnection {
|
|
||||||
var edges = make([]*TrustCenterDocumentAccessEdge, len(p.Data))
|
|
||||||
|
|
||||||
for i := range edges {
|
|
||||||
edges[i] = NewTrustCenterDocumentAccessEdge(p.Data[i], p.Cursor.OrderBy.Field)
|
|
||||||
}
|
|
||||||
|
|
||||||
return &TrustCenterDocumentAccessConnection{
|
|
||||||
Edges: edges,
|
|
||||||
PageInfo: *NewPageInfo(p),
|
|
||||||
|
|
||||||
Resolver: parentType,
|
|
||||||
ParentID: parentID,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewTrustCenterDocumentAccessEdge(access *coredata.TrustCenterDocumentAccess, orderBy coredata.TrustCenterDocumentAccessOrderField) *TrustCenterDocumentAccessEdge {
|
|
||||||
return &TrustCenterDocumentAccessEdge{
|
|
||||||
Cursor: access.CursorKey(orderBy),
|
|
||||||
Node: NewTrustCenterDocumentAccess(access),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1523,12 +1523,12 @@ func (r *Resolver) UpdateAuditTool(ctx context.Context, req *mcp.CallToolRequest
|
|||||||
audit, err := svc.Audits.Update(
|
audit, err := svc.Audits.Update(
|
||||||
ctx, scope,
|
ctx, scope,
|
||||||
&probo.UpdateAuditRequest{
|
&probo.UpdateAuditRequest{
|
||||||
ID: input.ID,
|
ID: input.ID,
|
||||||
Name: UnwrapOmittable(input.Name),
|
Name: UnwrapOmittable(input.Name),
|
||||||
ValidFrom: input.ValidFrom,
|
ValidFrom: input.ValidFrom,
|
||||||
ValidUntil: input.ValidUntil,
|
ValidUntil: input.ValidUntil,
|
||||||
State: input.State,
|
State: input.State,
|
||||||
TrustCenterVisibility: input.TrustCenterVisibility,
|
CompliancePortalVisibility: input.CompliancePortalVisibility,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -2240,9 +2240,9 @@ func (r *Resolver) AddDocumentTool(ctx context.Context, req *mcp.CallToolRequest
|
|||||||
|
|
||||||
svc := r.proboSvc
|
svc := r.proboSvc
|
||||||
|
|
||||||
var trustCenterVisibility *coredata.TrustCenterVisibility
|
var compliancePortalVisibility *coredata.CompliancePortalVisibility
|
||||||
if input.TrustCenterVisibility != nil {
|
if input.CompliancePortalVisibility != nil {
|
||||||
trustCenterVisibility = input.TrustCenterVisibility
|
compliancePortalVisibility = input.CompliancePortalVisibility
|
||||||
}
|
}
|
||||||
|
|
||||||
contentJSON, err := markdownToProseMirrorJSON(input.Content)
|
contentJSON, err := markdownToProseMirrorJSON(input.Content)
|
||||||
@@ -2253,13 +2253,13 @@ func (r *Resolver) AddDocumentTool(ctx context.Context, req *mcp.CallToolRequest
|
|||||||
document, documentVersion, err := svc.Documents.Create(
|
document, documentVersion, err := svc.Documents.Create(
|
||||||
ctx, scope,
|
ctx, scope,
|
||||||
probo.CreateDocumentRequest{
|
probo.CreateDocumentRequest{
|
||||||
OrganizationID: input.OrganizationID,
|
OrganizationID: input.OrganizationID,
|
||||||
Title: input.Title,
|
Title: input.Title,
|
||||||
Content: contentJSON,
|
Content: contentJSON,
|
||||||
Classification: input.Classification,
|
Classification: input.Classification,
|
||||||
DocumentType: input.DocumentType,
|
DocumentType: input.DocumentType,
|
||||||
TrustCenterVisibility: trustCenterVisibility,
|
CompliancePortalVisibility: compliancePortalVisibility,
|
||||||
DefaultApproverIDs: input.DefaultApproverIds,
|
DefaultApproverIDs: input.DefaultApproverIds,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -2296,13 +2296,13 @@ func (r *Resolver) UpdateDocumentTool(ctx context.Context, req *mcp.CallToolRequ
|
|||||||
document, documentVersion, _, err := svc.Documents.Update(
|
document, documentVersion, _, err := svc.Documents.Update(
|
||||||
ctx, scope,
|
ctx, scope,
|
||||||
probo.UpdateDocumentRequest{
|
probo.UpdateDocumentRequest{
|
||||||
DocumentID: input.ID,
|
DocumentID: input.ID,
|
||||||
Title: input.Title,
|
Title: input.Title,
|
||||||
Content: content,
|
Content: content,
|
||||||
Classification: input.Classification,
|
Classification: input.Classification,
|
||||||
DocumentType: input.DocumentType,
|
DocumentType: input.DocumentType,
|
||||||
TrustCenterVisibility: input.TrustCenterVisibility,
|
CompliancePortalVisibility: input.CompliancePortalVisibility,
|
||||||
DefaultApproverIDs: defaultApproverIDs,
|
DefaultApproverIDs: defaultApproverIDs,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -4880,65 +4880,65 @@ func (r *Resolver) DeleteRightsRequestTool(ctx context.Context, req *mcp.CallToo
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetTrustCenterTool handles the getTrustCenter tool
|
// GetCompliancePortalTool handles the getCompliancePortal tool
|
||||||
// Get the trust center for an organization
|
// Get the compliance portal for an organization
|
||||||
func (r *Resolver) GetTrustCenterTool(ctx context.Context, req *mcp.CallToolRequest, input *types.GetTrustCenterInput) (*mcp.CallToolResult, types.GetTrustCenterOutput, error) {
|
func (r *Resolver) GetCompliancePortalTool(ctx context.Context, req *mcp.CallToolRequest, input *types.GetCompliancePortalInput) (*mcp.CallToolResult, types.GetCompliancePortalOutput, error) {
|
||||||
scope, err := r.Authorize(ctx, input.OrganizationID, management.ActionCompliancePortalGet)
|
scope, err := r.Authorize(ctx, input.OrganizationID, management.ActionCompliancePortalGet)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, types.GetTrustCenterOutput{}, err
|
return nil, types.GetCompliancePortalOutput{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
prb := r.management
|
prb := r.management
|
||||||
|
|
||||||
trustCenter, err := prb.GetByOrganizationID(ctx, scope, input.OrganizationID)
|
compliancePortal, err := prb.GetByOrganizationID(ctx, scope, input.OrganizationID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, types.GetTrustCenterOutput{}, fmt.Errorf("cannot get trust center: %w", err)
|
return nil, types.GetCompliancePortalOutput{}, fmt.Errorf("cannot get compliance portal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
tc := types.NewTrustCenter(trustCenter)
|
tc := types.NewCompliancePortal(compliancePortal)
|
||||||
|
|
||||||
if trustCenter.LogoFileID != nil {
|
if compliancePortal.LogoFileID != nil {
|
||||||
logo, err := r.loadFile(ctx, scope, *trustCenter.LogoFileID)
|
logo, err := r.loadFile(ctx, scope, *compliancePortal.LogoFileID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, types.GetTrustCenterOutput{}, err
|
return nil, types.GetCompliancePortalOutput{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
tc.Logo = logo
|
tc.Logo = logo
|
||||||
}
|
}
|
||||||
|
|
||||||
if trustCenter.DarkLogoFileID != nil {
|
if compliancePortal.DarkLogoFileID != nil {
|
||||||
darkLogo, err := r.loadFile(ctx, scope, *trustCenter.DarkLogoFileID)
|
darkLogo, err := r.loadFile(ctx, scope, *compliancePortal.DarkLogoFileID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, types.GetTrustCenterOutput{}, err
|
return nil, types.GetCompliancePortalOutput{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
tc.DarkLogo = darkLogo
|
tc.DarkLogo = darkLogo
|
||||||
}
|
}
|
||||||
|
|
||||||
if trustCenter.NonDisclosureAgreementFileID != nil {
|
if compliancePortal.NonDisclosureAgreementFileID != nil {
|
||||||
nda, err := r.loadFile(ctx, scope, *trustCenter.NonDisclosureAgreementFileID)
|
nda, err := r.loadFile(ctx, scope, *compliancePortal.NonDisclosureAgreementFileID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, types.GetTrustCenterOutput{}, err
|
return nil, types.GetCompliancePortalOutput{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
tc.Nda = nda
|
tc.Nda = nda
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, types.GetTrustCenterOutput{TrustCenter: tc}, nil
|
return nil, types.GetCompliancePortalOutput{CompliancePortal: tc}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateTrustCenterTool handles the updateTrustCenter tool
|
// UpdateCompliancePortalTool handles the updateCompliancePortal tool
|
||||||
// Update the trust center settings
|
// Update the compliance portal settings
|
||||||
func (r *Resolver) UpdateTrustCenterTool(ctx context.Context, req *mcp.CallToolRequest, input *types.UpdateTrustCenterInput) (*mcp.CallToolResult, types.UpdateTrustCenterOutput, error) {
|
func (r *Resolver) UpdateCompliancePortalTool(ctx context.Context, req *mcp.CallToolRequest, input *types.UpdateCompliancePortalInput) (*mcp.CallToolResult, types.UpdateCompliancePortalOutput, error) {
|
||||||
scope, err := r.Authorize(ctx, input.TrustCenterID, management.ActionCompliancePortalUpdate)
|
scope, err := r.Authorize(ctx, input.CompliancePortalID, management.ActionCompliancePortalUpdate)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, types.UpdateTrustCenterOutput{}, err
|
return nil, types.UpdateCompliancePortalOutput{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
prb := r.management
|
prb := r.management
|
||||||
|
|
||||||
updateReq := &management.UpdateRequest{
|
updateReq := &management.UpdateRequest{
|
||||||
ID: input.TrustCenterID,
|
ID: input.CompliancePortalID,
|
||||||
}
|
}
|
||||||
|
|
||||||
if active := UnwrapOmittable(input.Active); active != nil {
|
if active := UnwrapOmittable(input.Active); active != nil {
|
||||||
@@ -4958,31 +4958,31 @@ func (r *Resolver) UpdateTrustCenterTool(ctx context.Context, req *mcp.CallToolR
|
|||||||
updateReq.Title = *title
|
updateReq.Title = *title
|
||||||
}
|
}
|
||||||
|
|
||||||
trustCenter, _, err := prb.Update(ctx, scope, updateReq)
|
compliancePortal, _, err := prb.Update(ctx, scope, updateReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, types.UpdateTrustCenterOutput{}, fmt.Errorf("cannot update trust center: %w", err)
|
return nil, types.UpdateCompliancePortalOutput{}, fmt.Errorf("cannot update compliance portal: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, types.UpdateTrustCenterOutput{TrustCenter: types.NewTrustCenter(trustCenter)}, nil
|
return nil, types.UpdateCompliancePortalOutput{CompliancePortal: types.NewCompliancePortal(compliancePortal)}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ListTrustCenterReferencesTool handles the listTrustCenterReferences tool
|
// ListCompliancePortalReferencesTool handles the listCompliancePortalReferences tool
|
||||||
// List all references for a trust center
|
// List all references for a compliance portal
|
||||||
func (r *Resolver) ListTrustCenterReferencesTool(ctx context.Context, req *mcp.CallToolRequest, input *types.ListTrustCenterReferencesInput) (*mcp.CallToolResult, types.ListTrustCenterReferencesOutput, error) {
|
func (r *Resolver) ListCompliancePortalReferencesTool(ctx context.Context, req *mcp.CallToolRequest, input *types.ListCompliancePortalReferencesInput) (*mcp.CallToolResult, types.ListCompliancePortalReferencesOutput, error) {
|
||||||
scope, err := r.Authorize(ctx, input.TrustCenterID, management.ActionCompliancePortalReferenceList)
|
scope, err := r.Authorize(ctx, input.CompliancePortalID, management.ActionCompliancePortalReferenceList)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, types.ListTrustCenterReferencesOutput{}, err
|
return nil, types.ListCompliancePortalReferencesOutput{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
prb := r.management
|
prb := r.management
|
||||||
|
|
||||||
pageOrderBy := page.OrderBy[coredata.TrustCenterReferenceOrderField]{
|
pageOrderBy := page.OrderBy[coredata.CompliancePortalReferenceOrderField]{
|
||||||
Field: coredata.TrustCenterReferenceOrderFieldRank,
|
Field: coredata.CompliancePortalReferenceOrderFieldRank,
|
||||||
Direction: page.OrderDirectionAsc,
|
Direction: page.OrderDirectionAsc,
|
||||||
}
|
}
|
||||||
|
|
||||||
if input.OrderBy != nil {
|
if input.OrderBy != nil {
|
||||||
pageOrderBy = page.OrderBy[coredata.TrustCenterReferenceOrderField]{
|
pageOrderBy = page.OrderBy[coredata.CompliancePortalReferenceOrderField]{
|
||||||
Field: input.OrderBy.Field,
|
Field: input.OrderBy.Field,
|
||||||
Direction: input.OrderBy.Direction,
|
Direction: input.OrderBy.Direction,
|
||||||
}
|
}
|
||||||
@@ -4990,18 +4990,18 @@ func (r *Resolver) ListTrustCenterReferencesTool(ctx context.Context, req *mcp.C
|
|||||||
|
|
||||||
cursor := types.NewCursor(input.Size, input.Cursor, pageOrderBy)
|
cursor := types.NewCursor(input.Size, input.Cursor, pageOrderBy)
|
||||||
|
|
||||||
p, err := prb.ListReferences(ctx, scope, input.TrustCenterID, cursor)
|
p, err := prb.ListReferences(ctx, scope, input.CompliancePortalID, cursor)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, types.ListTrustCenterReferencesOutput{}, fmt.Errorf("cannot list trust center references: %w", err)
|
return nil, types.ListCompliancePortalReferencesOutput{}, fmt.Errorf("cannot list compliance portal references: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
refs := make([]*types.TrustCenterReference, 0, len(p.Data))
|
refs := make([]*types.CompliancePortalReference, 0, len(p.Data))
|
||||||
for _, reference := range p.Data {
|
for _, reference := range p.Data {
|
||||||
ref := types.NewTrustCenterReference(reference)
|
ref := types.NewCompliancePortalReference(reference)
|
||||||
|
|
||||||
logo, err := r.loadFile(ctx, scope, reference.LogoFileID)
|
logo, err := r.loadFile(ctx, scope, reference.LogoFileID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, types.ListTrustCenterReferencesOutput{}, err
|
return nil, types.ListCompliancePortalReferencesOutput{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
ref.Logo = logo
|
ref.Logo = logo
|
||||||
@@ -5009,15 +5009,15 @@ func (r *Resolver) ListTrustCenterReferencesTool(ctx context.Context, req *mcp.C
|
|||||||
refs = append(refs, ref)
|
refs = append(refs, ref)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, types.NewListTrustCenterReferencesOutput(refs, p), nil
|
return nil, types.NewListCompliancePortalReferencesOutput(refs, p), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// AddTrustCenterReferenceTool handles the addTrustCenterReference tool
|
// AddCompliancePortalReferenceTool handles the addCompliancePortalReference tool
|
||||||
// Add a new reference to the trust center
|
// Add a new reference to the compliance portal
|
||||||
func (r *Resolver) AddTrustCenterReferenceTool(ctx context.Context, req *mcp.CallToolRequest, input *types.AddTrustCenterReferenceInput) (*mcp.CallToolResult, types.AddTrustCenterReferenceOutput, error) {
|
func (r *Resolver) AddCompliancePortalReferenceTool(ctx context.Context, req *mcp.CallToolRequest, input *types.AddCompliancePortalReferenceInput) (*mcp.CallToolResult, types.AddCompliancePortalReferenceOutput, error) {
|
||||||
scope, err := r.Authorize(ctx, input.TrustCenterID, management.ActionCompliancePortalReferenceCreate)
|
scope, err := r.Authorize(ctx, input.CompliancePortalID, management.ActionCompliancePortalReferenceCreate)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, types.AddTrustCenterReferenceOutput{}, err
|
return nil, types.AddCompliancePortalReferenceOutput{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
prb := r.management
|
prb := r.management
|
||||||
@@ -5030,25 +5030,25 @@ func (r *Resolver) AddTrustCenterReferenceTool(ctx context.Context, req *mcp.Cal
|
|||||||
reference, err := prb.CreateReference(
|
reference, err := prb.CreateReference(
|
||||||
ctx, scope,
|
ctx, scope,
|
||||||
&management.CreateReferenceRequest{
|
&management.CreateReferenceRequest{
|
||||||
TrustCenterID: input.TrustCenterID,
|
CompliancePortalID: input.CompliancePortalID,
|
||||||
Name: input.Name,
|
Name: input.Name,
|
||||||
Description: input.Description,
|
Description: input.Description,
|
||||||
WebsiteURL: websiteURL,
|
WebsiteURL: websiteURL,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, types.AddTrustCenterReferenceOutput{}, fmt.Errorf("cannot add trust center reference: %w", err)
|
return nil, types.AddCompliancePortalReferenceOutput{}, fmt.Errorf("cannot add compliance portal reference: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, types.AddTrustCenterReferenceOutput{TrustCenterReference: types.NewTrustCenterReference(reference)}, nil
|
return nil, types.AddCompliancePortalReferenceOutput{CompliancePortalReference: types.NewCompliancePortalReference(reference)}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// UpdateTrustCenterReferenceTool handles the updateTrustCenterReference tool
|
// UpdateCompliancePortalReferenceTool handles the updateCompliancePortalReference tool
|
||||||
// Update a trust center reference
|
// Update a compliance portal reference
|
||||||
func (r *Resolver) UpdateTrustCenterReferenceTool(ctx context.Context, req *mcp.CallToolRequest, input *types.UpdateTrustCenterReferenceInput) (*mcp.CallToolResult, types.UpdateTrustCenterReferenceOutput, error) {
|
func (r *Resolver) UpdateCompliancePortalReferenceTool(ctx context.Context, req *mcp.CallToolRequest, input *types.UpdateCompliancePortalReferenceInput) (*mcp.CallToolResult, types.UpdateCompliancePortalReferenceOutput, error) {
|
||||||
scope, err := r.Authorize(ctx, input.ID, management.ActionCompliancePortalReferenceUpdate)
|
scope, err := r.Authorize(ctx, input.ID, management.ActionCompliancePortalReferenceUpdate)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, types.UpdateTrustCenterReferenceOutput{}, err
|
return nil, types.UpdateCompliancePortalReferenceOutput{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
prb := r.management
|
prb := r.management
|
||||||
@@ -5072,95 +5072,95 @@ func (r *Resolver) UpdateTrustCenterReferenceTool(ctx context.Context, req *mcp.
|
|||||||
|
|
||||||
reference, err := prb.UpdateReference(ctx, scope, updateRefReq)
|
reference, err := prb.UpdateReference(ctx, scope, updateRefReq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, types.UpdateTrustCenterReferenceOutput{}, fmt.Errorf("cannot update trust center reference: %w", err)
|
return nil, types.UpdateCompliancePortalReferenceOutput{}, fmt.Errorf("cannot update compliance portal reference: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, types.UpdateTrustCenterReferenceOutput{TrustCenterReference: types.NewTrustCenterReference(reference)}, nil
|
return nil, types.UpdateCompliancePortalReferenceOutput{CompliancePortalReference: types.NewCompliancePortalReference(reference)}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteTrustCenterReferenceTool handles the deleteTrustCenterReference tool
|
// DeleteCompliancePortalReferenceTool handles the deleteCompliancePortalReference tool
|
||||||
// Delete a trust center reference
|
// Delete a compliance portal reference
|
||||||
func (r *Resolver) DeleteTrustCenterReferenceTool(ctx context.Context, req *mcp.CallToolRequest, input *types.DeleteTrustCenterReferenceInput) (*mcp.CallToolResult, types.DeleteTrustCenterReferenceOutput, error) {
|
func (r *Resolver) DeleteCompliancePortalReferenceTool(ctx context.Context, req *mcp.CallToolRequest, input *types.DeleteCompliancePortalReferenceInput) (*mcp.CallToolResult, types.DeleteCompliancePortalReferenceOutput, error) {
|
||||||
scope, err := r.Authorize(ctx, input.ID, management.ActionCompliancePortalReferenceDelete)
|
scope, err := r.Authorize(ctx, input.ID, management.ActionCompliancePortalReferenceDelete)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, types.DeleteTrustCenterReferenceOutput{}, err
|
return nil, types.DeleteCompliancePortalReferenceOutput{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
prb := r.management
|
prb := r.management
|
||||||
|
|
||||||
err = prb.DeleteReference(ctx, scope, input.ID)
|
err = prb.DeleteReference(ctx, scope, input.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, types.DeleteTrustCenterReferenceOutput{}, fmt.Errorf("cannot delete trust center reference: %w", err)
|
return nil, types.DeleteCompliancePortalReferenceOutput{}, fmt.Errorf("cannot delete compliance portal reference: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, types.DeleteTrustCenterReferenceOutput{DeletedTrustCenterReferenceID: input.ID}, nil
|
return nil, types.DeleteCompliancePortalReferenceOutput{DeletedCompliancePortalReferenceID: input.ID}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ListTrustCenterFilesTool handles the listTrustCenterFiles tool
|
// ListCompliancePortalFilesTool handles the listCompliancePortalFiles tool
|
||||||
// List all files for the trust center
|
// List all files for the compliance portal
|
||||||
func (r *Resolver) ListTrustCenterFilesTool(ctx context.Context, req *mcp.CallToolRequest, input *types.ListTrustCenterFilesInput) (*mcp.CallToolResult, types.ListTrustCenterFilesOutput, error) {
|
func (r *Resolver) ListCompliancePortalFilesTool(ctx context.Context, req *mcp.CallToolRequest, input *types.ListCompliancePortalFilesInput) (*mcp.CallToolResult, types.ListCompliancePortalFilesOutput, error) {
|
||||||
scope, err := r.Authorize(ctx, input.OrganizationID, management.ActionCompliancePortalFileList)
|
scope, err := r.Authorize(ctx, input.OrganizationID, management.ActionCompliancePortalFileList)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, types.ListTrustCenterFilesOutput{}, err
|
return nil, types.ListCompliancePortalFilesOutput{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
prb := r.management
|
prb := r.management
|
||||||
|
|
||||||
pageOrderBy := page.OrderBy[coredata.TrustCenterFileOrderField]{
|
pageOrderBy := page.OrderBy[coredata.CompliancePortalFileOrderField]{
|
||||||
Field: coredata.TrustCenterFileOrderFieldCreatedAt,
|
Field: coredata.CompliancePortalFileOrderFieldCreatedAt,
|
||||||
Direction: page.OrderDirectionDesc,
|
Direction: page.OrderDirectionDesc,
|
||||||
}
|
}
|
||||||
|
|
||||||
if input.OrderBy != nil {
|
if input.OrderBy != nil {
|
||||||
pageOrderBy = page.OrderBy[coredata.TrustCenterFileOrderField]{
|
pageOrderBy = page.OrderBy[coredata.CompliancePortalFileOrderField]{
|
||||||
Field: input.OrderBy.Field,
|
Field: input.OrderBy.Field,
|
||||||
Direction: input.OrderBy.Direction,
|
Direction: input.OrderBy.Direction,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cursor := types.NewCursor(input.Size, input.Cursor, pageOrderBy)
|
cursor := types.NewCursor(input.Size, input.Cursor, pageOrderBy)
|
||||||
filter := coredata.NewTrustCenterFileFilter()
|
filter := coredata.NewCompliancePortalFileFilter()
|
||||||
|
|
||||||
p, err := prb.ListFilesForOrganizationID(ctx, scope, input.OrganizationID, cursor, filter)
|
p, err := prb.ListFilesForOrganizationID(ctx, scope, input.OrganizationID, cursor, filter)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, types.ListTrustCenterFilesOutput{}, fmt.Errorf("cannot list trust center files: %w", err)
|
return nil, types.ListCompliancePortalFilesOutput{}, fmt.Errorf("cannot list compliance portal files: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
files := make([]*types.TrustCenterFile, 0, len(p.Data))
|
files := make([]*types.CompliancePortalFile, 0, len(p.Data))
|
||||||
for _, f := range p.Data {
|
for _, f := range p.Data {
|
||||||
file, err := r.loadFile(ctx, scope, f.FileID)
|
file, err := r.loadFile(ctx, scope, f.FileID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, types.ListTrustCenterFilesOutput{}, err
|
return nil, types.ListCompliancePortalFilesOutput{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
files = append(files, types.NewTrustCenterFile(f, file))
|
files = append(files, types.NewCompliancePortalFile(f, file))
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, types.NewListTrustCenterFilesOutput(files, p), nil
|
return nil, types.NewListCompliancePortalFilesOutput(files, p), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// DeleteTrustCenterFileTool handles the deleteTrustCenterFile tool
|
// DeleteCompliancePortalFileTool handles the deleteCompliancePortalFile tool
|
||||||
// Delete a trust center file
|
// Delete a compliance portal file
|
||||||
func (r *Resolver) DeleteTrustCenterFileTool(ctx context.Context, req *mcp.CallToolRequest, input *types.DeleteTrustCenterFileInput) (*mcp.CallToolResult, types.DeleteTrustCenterFileOutput, error) {
|
func (r *Resolver) DeleteCompliancePortalFileTool(ctx context.Context, req *mcp.CallToolRequest, input *types.DeleteCompliancePortalFileInput) (*mcp.CallToolResult, types.DeleteCompliancePortalFileOutput, error) {
|
||||||
scope, err := r.Authorize(ctx, input.ID, management.ActionCompliancePortalFileDelete)
|
scope, err := r.Authorize(ctx, input.ID, management.ActionCompliancePortalFileDelete)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, types.DeleteTrustCenterFileOutput{}, err
|
return nil, types.DeleteCompliancePortalFileOutput{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
prb := r.management
|
prb := r.management
|
||||||
|
|
||||||
err = prb.DeleteFile(ctx, scope, input.ID)
|
err = prb.DeleteFile(ctx, scope, input.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, types.DeleteTrustCenterFileOutput{}, fmt.Errorf("cannot delete trust center file: %w", err)
|
return nil, types.DeleteCompliancePortalFileOutput{}, fmt.Errorf("cannot delete compliance portal file: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil, types.DeleteTrustCenterFileOutput{DeletedTrustCenterFileID: input.ID}, nil
|
return nil, types.DeleteCompliancePortalFileOutput{DeletedCompliancePortalFileID: input.ID}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// ListComplianceCustomLinksTool handles the listComplianceCustomLinks tool
|
// ListComplianceCustomLinksTool handles the listComplianceCustomLinks tool
|
||||||
// List all custom links for a trust center
|
// List all custom links for a compliance portal
|
||||||
func (r *Resolver) ListComplianceCustomLinksTool(ctx context.Context, req *mcp.CallToolRequest, input *types.ListComplianceCustomLinksInput) (*mcp.CallToolResult, types.ListComplianceCustomLinksOutput, error) {
|
func (r *Resolver) ListComplianceCustomLinksTool(ctx context.Context, req *mcp.CallToolRequest, input *types.ListComplianceCustomLinksInput) (*mcp.CallToolResult, types.ListComplianceCustomLinksOutput, error) {
|
||||||
scope, err := r.Authorize(ctx, input.TrustCenterID, management.ActionComplianceCustomLinkList)
|
scope, err := r.Authorize(ctx, input.CompliancePortalID, management.ActionComplianceCustomLinkList)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, types.ListComplianceCustomLinksOutput{}, err
|
return nil, types.ListComplianceCustomLinksOutput{}, err
|
||||||
}
|
}
|
||||||
@@ -5181,7 +5181,7 @@ func (r *Resolver) ListComplianceCustomLinksTool(ctx context.Context, req *mcp.C
|
|||||||
|
|
||||||
cursor := types.NewCursor(input.Size, input.Cursor, pageOrderBy)
|
cursor := types.NewCursor(input.Size, input.Cursor, pageOrderBy)
|
||||||
|
|
||||||
p, err := prb.ListCustomLinks(ctx, scope, input.TrustCenterID, cursor)
|
p, err := prb.ListCustomLinks(ctx, scope, input.CompliancePortalID, cursor)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, types.ListComplianceCustomLinksOutput{}, fmt.Errorf("cannot list compliance custom links: %w", err)
|
return nil, types.ListComplianceCustomLinksOutput{}, fmt.Errorf("cannot list compliance custom links: %w", err)
|
||||||
}
|
}
|
||||||
@@ -5190,9 +5190,9 @@ func (r *Resolver) ListComplianceCustomLinksTool(ctx context.Context, req *mcp.C
|
|||||||
}
|
}
|
||||||
|
|
||||||
// AddComplianceCustomLinkTool handles the addComplianceCustomLink tool
|
// AddComplianceCustomLinkTool handles the addComplianceCustomLink tool
|
||||||
// Add a new custom link to the trust center
|
// Add a new custom link to the compliance portal
|
||||||
func (r *Resolver) AddComplianceCustomLinkTool(ctx context.Context, req *mcp.CallToolRequest, input *types.AddComplianceCustomLinkInput) (*mcp.CallToolResult, types.AddComplianceCustomLinkOutput, error) {
|
func (r *Resolver) AddComplianceCustomLinkTool(ctx context.Context, req *mcp.CallToolRequest, input *types.AddComplianceCustomLinkInput) (*mcp.CallToolResult, types.AddComplianceCustomLinkOutput, error) {
|
||||||
scope, err := r.Authorize(ctx, input.TrustCenterID, management.ActionComplianceCustomLinkCreate)
|
scope, err := r.Authorize(ctx, input.CompliancePortalID, management.ActionComplianceCustomLinkCreate)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, types.AddComplianceCustomLinkOutput{}, err
|
return nil, types.AddComplianceCustomLinkOutput{}, err
|
||||||
}
|
}
|
||||||
@@ -5202,9 +5202,9 @@ func (r *Resolver) AddComplianceCustomLinkTool(ctx context.Context, req *mcp.Cal
|
|||||||
item, err := prb.CreateCustomLink(
|
item, err := prb.CreateCustomLink(
|
||||||
ctx, scope,
|
ctx, scope,
|
||||||
&management.CreateCustomLinkRequest{
|
&management.CreateCustomLinkRequest{
|
||||||
TrustCenterID: input.TrustCenterID,
|
CompliancePortalID: input.CompliancePortalID,
|
||||||
Name: input.Name,
|
Name: input.Name,
|
||||||
URL: input.URL,
|
URL: input.URL,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -5274,14 +5274,14 @@ func (r *Resolver) DeleteComplianceCustomLinkTool(ctx context.Context, req *mcp.
|
|||||||
// CreateCustomDomainTool handles the createCustomDomain tool
|
// CreateCustomDomainTool handles the createCustomDomain tool
|
||||||
// Create a custom domain for a compliance page
|
// Create a custom domain for a compliance page
|
||||||
func (r *Resolver) CreateCustomDomainTool(ctx context.Context, req *mcp.CallToolRequest, input *types.CreateCustomDomainInput) (*mcp.CallToolResult, types.CreateCustomDomainOutput, error) {
|
func (r *Resolver) CreateCustomDomainTool(ctx context.Context, req *mcp.CallToolRequest, input *types.CreateCustomDomainInput) (*mcp.CallToolResult, types.CreateCustomDomainOutput, error) {
|
||||||
scope, err := r.Authorize(ctx, input.TrustCenterID, management.ActionCustomDomainCreate)
|
scope, err := r.Authorize(ctx, input.CompliancePortalID, management.ActionCustomDomainCreate)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, types.CreateCustomDomainOutput{}, err
|
return nil, types.CreateCustomDomainOutput{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
domain, err := r.management.AddCustomDomain(
|
domain, err := r.management.AddCustomDomain(
|
||||||
ctx, scope,
|
ctx, scope,
|
||||||
input.TrustCenterID,
|
input.CompliancePortalID,
|
||||||
input.Domain,
|
input.Domain,
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -5302,12 +5302,12 @@ func (r *Resolver) CreateCustomDomainTool(ctx context.Context, req *mcp.CallTool
|
|||||||
// DeleteCustomDomainTool handles the deleteCustomDomain tool
|
// DeleteCustomDomainTool handles the deleteCustomDomain tool
|
||||||
// Delete the custom domain of a compliance page
|
// Delete the custom domain of a compliance page
|
||||||
func (r *Resolver) DeleteCustomDomainTool(ctx context.Context, req *mcp.CallToolRequest, input *types.DeleteCustomDomainInput) (*mcp.CallToolResult, types.DeleteCustomDomainOutput, error) {
|
func (r *Resolver) DeleteCustomDomainTool(ctx context.Context, req *mcp.CallToolRequest, input *types.DeleteCustomDomainInput) (*mcp.CallToolResult, types.DeleteCustomDomainOutput, error) {
|
||||||
scope, err := r.Authorize(ctx, input.TrustCenterID, management.ActionCustomDomainDelete)
|
scope, err := r.Authorize(ctx, input.CompliancePortalID, management.ActionCustomDomainDelete)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, types.DeleteCustomDomainOutput{}, err
|
return nil, types.DeleteCustomDomainOutput{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
compliancePage, err := r.management.Get(ctx, scope, input.TrustCenterID)
|
compliancePage, err := r.management.Get(ctx, scope, input.CompliancePortalID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, types.DeleteCustomDomainOutput{}, fmt.Errorf("cannot load compliance page: %w", err)
|
return nil, types.DeleteCustomDomainOutput{}, fmt.Errorf("cannot load compliance page: %w", err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4590,13 +4590,13 @@ components:
|
|||||||
- OUTDATED
|
- OUTDATED
|
||||||
go.probo.inc/mcpgen/type: go.probo.inc/probo/pkg/coredata.AuditState
|
go.probo.inc/mcpgen/type: go.probo.inc/probo/pkg/coredata.AuditState
|
||||||
|
|
||||||
TrustCenterVisibility:
|
CompliancePortalVisibility:
|
||||||
type: string
|
type: string
|
||||||
enum:
|
enum:
|
||||||
- NONE
|
- NONE
|
||||||
- PRIVATE
|
- PRIVATE
|
||||||
- PUBLIC
|
- PUBLIC
|
||||||
go.probo.inc/mcpgen/type: go.probo.inc/probo/pkg/coredata.TrustCenterVisibility
|
go.probo.inc/mcpgen/type: go.probo.inc/probo/pkg/coredata.CompliancePortalVisibility
|
||||||
|
|
||||||
AuditOrderField:
|
AuditOrderField:
|
||||||
type: string
|
type: string
|
||||||
@@ -4627,7 +4627,7 @@ components:
|
|||||||
- organization_id
|
- organization_id
|
||||||
- framework_id
|
- framework_id
|
||||||
- state
|
- state
|
||||||
- trust_center_visibility
|
- compliance_portal_visibility
|
||||||
- has_report
|
- has_report
|
||||||
- created_at
|
- created_at
|
||||||
- updated_at
|
- updated_at
|
||||||
@@ -4661,9 +4661,9 @@ components:
|
|||||||
state:
|
state:
|
||||||
$ref: "#/components/schemas/AuditState"
|
$ref: "#/components/schemas/AuditState"
|
||||||
description: Audit state
|
description: Audit state
|
||||||
trust_center_visibility:
|
compliance_portal_visibility:
|
||||||
$ref: "#/components/schemas/TrustCenterVisibility"
|
$ref: "#/components/schemas/CompliancePortalVisibility"
|
||||||
description: Trust center visibility
|
description: Compliance portal visibility
|
||||||
has_report:
|
has_report:
|
||||||
type: boolean
|
type: boolean
|
||||||
description: Whether the audit has an attached report
|
description: Whether the audit has an attached report
|
||||||
@@ -4818,13 +4818,13 @@ components:
|
|||||||
- type: "null"
|
- type: "null"
|
||||||
description: No state
|
description: No state
|
||||||
description: Audit state
|
description: Audit state
|
||||||
trust_center_visibility:
|
compliance_portal_visibility:
|
||||||
anyOf:
|
anyOf:
|
||||||
- $ref: "#/components/schemas/TrustCenterVisibility"
|
- $ref: "#/components/schemas/CompliancePortalVisibility"
|
||||||
description: Trust center visibility
|
description: Compliance portal visibility
|
||||||
- type: "null"
|
- type: "null"
|
||||||
description: No trust center visibility
|
description: No compliance portal visibility
|
||||||
description: Trust center visibility
|
description: Compliance portal visibility
|
||||||
|
|
||||||
UpdateAuditOutput:
|
UpdateAuditOutput:
|
||||||
type: object
|
type: object
|
||||||
@@ -5781,7 +5781,7 @@ components:
|
|||||||
required:
|
required:
|
||||||
- id
|
- id
|
||||||
- organization_id
|
- organization_id
|
||||||
- trust_center_visibility
|
- compliance_portal_visibility
|
||||||
- write_mode
|
- write_mode
|
||||||
- status
|
- status
|
||||||
- created_at
|
- created_at
|
||||||
@@ -5803,9 +5803,9 @@ components:
|
|||||||
- integer
|
- integer
|
||||||
- "null"
|
- "null"
|
||||||
description: Current published minor version number
|
description: Current published minor version number
|
||||||
trust_center_visibility:
|
compliance_portal_visibility:
|
||||||
$ref: "#/components/schemas/TrustCenterVisibility"
|
$ref: "#/components/schemas/CompliancePortalVisibility"
|
||||||
description: Trust center visibility
|
description: Compliance portal visibility
|
||||||
write_mode:
|
write_mode:
|
||||||
$ref: "#/components/schemas/DocumentWriteMode"
|
$ref: "#/components/schemas/DocumentWriteMode"
|
||||||
description: Write mode (authored or generated)
|
description: Write mode (authored or generated)
|
||||||
@@ -6043,11 +6043,11 @@ components:
|
|||||||
items:
|
items:
|
||||||
$ref: "#/components/schemas/DocumentWriteMode"
|
$ref: "#/components/schemas/DocumentWriteMode"
|
||||||
description: Filter by write mode (AUTHORED or GENERATED)
|
description: Filter by write mode (AUTHORED or GENERATED)
|
||||||
trust_center_visibilities:
|
compliance_portal_visibilities:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: "#/components/schemas/TrustCenterVisibility"
|
$ref: "#/components/schemas/CompliancePortalVisibility"
|
||||||
description: Trust center visibilities
|
description: Compliance portal visibilities
|
||||||
document_types:
|
document_types:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
@@ -6118,9 +6118,9 @@ components:
|
|||||||
document_type:
|
document_type:
|
||||||
$ref: "#/components/schemas/DocumentType"
|
$ref: "#/components/schemas/DocumentType"
|
||||||
description: Document type
|
description: Document type
|
||||||
trust_center_visibility:
|
compliance_portal_visibility:
|
||||||
$ref: "#/components/schemas/TrustCenterVisibility"
|
$ref: "#/components/schemas/CompliancePortalVisibility"
|
||||||
description: Trust center visibility
|
description: Compliance portal visibility
|
||||||
default_approver_ids:
|
default_approver_ids:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
@@ -6159,9 +6159,9 @@ components:
|
|||||||
document_type:
|
document_type:
|
||||||
$ref: "#/components/schemas/DocumentType"
|
$ref: "#/components/schemas/DocumentType"
|
||||||
description: Document type
|
description: Document type
|
||||||
trust_center_visibility:
|
compliance_portal_visibility:
|
||||||
$ref: "#/components/schemas/TrustCenterVisibility"
|
$ref: "#/components/schemas/CompliancePortalVisibility"
|
||||||
description: Trust center visibility
|
description: Compliance portal visibility
|
||||||
default_approver_ids:
|
default_approver_ids:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
@@ -8739,42 +8739,42 @@ components:
|
|||||||
- FAILED
|
- FAILED
|
||||||
go.probo.inc/mcpgen/type: go.probo.inc/probo/pkg/coredata.CertificateStatus
|
go.probo.inc/mcpgen/type: go.probo.inc/probo/pkg/coredata.CertificateStatus
|
||||||
|
|
||||||
TrustCenterReferenceOrderField:
|
CompliancePortalReferenceOrderField:
|
||||||
type: string
|
type: string
|
||||||
enum:
|
enum:
|
||||||
- RANK
|
- RANK
|
||||||
- NAME
|
- NAME
|
||||||
- CREATED_AT
|
- CREATED_AT
|
||||||
- UPDATED_AT
|
- UPDATED_AT
|
||||||
go.probo.inc/mcpgen/type: go.probo.inc/probo/pkg/coredata.TrustCenterReferenceOrderField
|
go.probo.inc/mcpgen/type: go.probo.inc/probo/pkg/coredata.CompliancePortalReferenceOrderField
|
||||||
|
|
||||||
TrustCenterReferenceOrderBy:
|
CompliancePortalReferenceOrderBy:
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
- field
|
- field
|
||||||
- direction
|
- direction
|
||||||
properties:
|
properties:
|
||||||
field:
|
field:
|
||||||
$ref: "#/components/schemas/TrustCenterReferenceOrderField"
|
$ref: "#/components/schemas/CompliancePortalReferenceOrderField"
|
||||||
direction:
|
direction:
|
||||||
$ref: "#/components/schemas/OrderDirection"
|
$ref: "#/components/schemas/OrderDirection"
|
||||||
|
|
||||||
TrustCenterFileOrderField:
|
CompliancePortalFileOrderField:
|
||||||
type: string
|
type: string
|
||||||
enum:
|
enum:
|
||||||
- NAME
|
- NAME
|
||||||
- CREATED_AT
|
- CREATED_AT
|
||||||
- UPDATED_AT
|
- UPDATED_AT
|
||||||
go.probo.inc/mcpgen/type: go.probo.inc/probo/pkg/coredata.TrustCenterFileOrderField
|
go.probo.inc/mcpgen/type: go.probo.inc/probo/pkg/coredata.CompliancePortalFileOrderField
|
||||||
|
|
||||||
TrustCenterFileOrderBy:
|
CompliancePortalFileOrderBy:
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
- field
|
- field
|
||||||
- direction
|
- direction
|
||||||
properties:
|
properties:
|
||||||
field:
|
field:
|
||||||
$ref: "#/components/schemas/TrustCenterFileOrderField"
|
$ref: "#/components/schemas/CompliancePortalFileOrderField"
|
||||||
direction:
|
direction:
|
||||||
$ref: "#/components/schemas/OrderDirection"
|
$ref: "#/components/schemas/OrderDirection"
|
||||||
|
|
||||||
@@ -8825,7 +8825,7 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
format: date-time
|
format: date-time
|
||||||
|
|
||||||
TrustCenter:
|
CompliancePortal:
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
- id
|
- id
|
||||||
@@ -8880,7 +8880,7 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
format: date-time
|
format: date-time
|
||||||
|
|
||||||
TrustCenterReference:
|
CompliancePortalReference:
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
- id
|
- id
|
||||||
@@ -8912,14 +8912,14 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
format: date-time
|
format: date-time
|
||||||
|
|
||||||
TrustCenterFile:
|
CompliancePortalFile:
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
- id
|
- id
|
||||||
- name
|
- name
|
||||||
- category
|
- category
|
||||||
- file
|
- file
|
||||||
- trust_center_visibility
|
- compliance_portal_visibility
|
||||||
- organization_id
|
- organization_id
|
||||||
- created_at
|
- created_at
|
||||||
- updated_at
|
- updated_at
|
||||||
@@ -8932,8 +8932,8 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
file:
|
file:
|
||||||
$ref: "#/components/schemas/File"
|
$ref: "#/components/schemas/File"
|
||||||
trust_center_visibility:
|
compliance_portal_visibility:
|
||||||
$ref: "#/components/schemas/TrustCenterVisibility"
|
$ref: "#/components/schemas/CompliancePortalVisibility"
|
||||||
organization_id:
|
organization_id:
|
||||||
$ref: "#/components/schemas/GID"
|
$ref: "#/components/schemas/GID"
|
||||||
created_at:
|
created_at:
|
||||||
@@ -9018,7 +9018,7 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
format: date-time
|
format: date-time
|
||||||
|
|
||||||
GetTrustCenterInput:
|
GetCompliancePortalInput:
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
- organization_id
|
- organization_id
|
||||||
@@ -9027,27 +9027,27 @@ components:
|
|||||||
$ref: "#/components/schemas/GID"
|
$ref: "#/components/schemas/GID"
|
||||||
description: Organization ID
|
description: Organization ID
|
||||||
|
|
||||||
GetTrustCenterOutput:
|
GetCompliancePortalOutput:
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
- trust_center
|
- compliance_portal
|
||||||
properties:
|
properties:
|
||||||
trust_center:
|
compliance_portal:
|
||||||
$ref: "#/components/schemas/TrustCenter"
|
$ref: "#/components/schemas/CompliancePortal"
|
||||||
|
|
||||||
UpdateTrustCenterInput:
|
UpdateCompliancePortalInput:
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
- trust_center_id
|
- compliance_portal_id
|
||||||
properties:
|
properties:
|
||||||
trust_center_id:
|
compliance_portal_id:
|
||||||
$ref: "#/components/schemas/GID"
|
$ref: "#/components/schemas/GID"
|
||||||
description: Trust center ID
|
description: Compliance portal ID
|
||||||
active:
|
active:
|
||||||
type:
|
type:
|
||||||
- boolean
|
- boolean
|
||||||
- "null"
|
- "null"
|
||||||
description: Whether the trust center is active
|
description: Whether the compliance portal is active
|
||||||
go.probo.inc/mcpgen/omittable: true
|
go.probo.inc/mcpgen/omittable: true
|
||||||
search_engine_indexing:
|
search_engine_indexing:
|
||||||
anyOf:
|
anyOf:
|
||||||
@@ -9086,25 +9086,25 @@ components:
|
|||||||
description: Public compliance page title
|
description: Public compliance page title
|
||||||
go.probo.inc/mcpgen/omittable: true
|
go.probo.inc/mcpgen/omittable: true
|
||||||
|
|
||||||
UpdateTrustCenterOutput:
|
UpdateCompliancePortalOutput:
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
- trust_center
|
- compliance_portal
|
||||||
properties:
|
properties:
|
||||||
trust_center:
|
compliance_portal:
|
||||||
$ref: "#/components/schemas/TrustCenter"
|
$ref: "#/components/schemas/CompliancePortal"
|
||||||
|
|
||||||
ListTrustCenterReferencesInput:
|
ListCompliancePortalReferencesInput:
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
- trust_center_id
|
- compliance_portal_id
|
||||||
properties:
|
properties:
|
||||||
trust_center_id:
|
compliance_portal_id:
|
||||||
$ref: "#/components/schemas/GID"
|
$ref: "#/components/schemas/GID"
|
||||||
description: Trust center ID
|
description: Compliance portal ID
|
||||||
order_by:
|
order_by:
|
||||||
$ref: "#/components/schemas/TrustCenterReferenceOrderBy"
|
$ref: "#/components/schemas/CompliancePortalReferenceOrderBy"
|
||||||
description: Trust center reference order by
|
description: Compliance portal reference order by
|
||||||
size:
|
size:
|
||||||
type: integer
|
type: integer
|
||||||
description: Page size
|
description: Page size
|
||||||
@@ -9112,28 +9112,28 @@ components:
|
|||||||
$ref: "#/components/schemas/CursorKey"
|
$ref: "#/components/schemas/CursorKey"
|
||||||
description: Page cursor
|
description: Page cursor
|
||||||
|
|
||||||
ListTrustCenterReferencesOutput:
|
ListCompliancePortalReferencesOutput:
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
- trust_center_references
|
- compliance_portal_references
|
||||||
properties:
|
properties:
|
||||||
next_cursor:
|
next_cursor:
|
||||||
$ref: "#/components/schemas/CursorKey"
|
$ref: "#/components/schemas/CursorKey"
|
||||||
description: Next cursor
|
description: Next cursor
|
||||||
trust_center_references:
|
compliance_portal_references:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: "#/components/schemas/TrustCenterReference"
|
$ref: "#/components/schemas/CompliancePortalReference"
|
||||||
|
|
||||||
AddTrustCenterReferenceInput:
|
AddCompliancePortalReferenceInput:
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
- trust_center_id
|
- compliance_portal_id
|
||||||
- name
|
- name
|
||||||
properties:
|
properties:
|
||||||
trust_center_id:
|
compliance_portal_id:
|
||||||
$ref: "#/components/schemas/GID"
|
$ref: "#/components/schemas/GID"
|
||||||
description: Trust center ID
|
description: Compliance portal ID
|
||||||
name:
|
name:
|
||||||
type: string
|
type: string
|
||||||
description: Reference name
|
description: Reference name
|
||||||
@@ -9144,22 +9144,22 @@ components:
|
|||||||
type: string
|
type: string
|
||||||
description: Reference website URL
|
description: Reference website URL
|
||||||
|
|
||||||
AddTrustCenterReferenceOutput:
|
AddCompliancePortalReferenceOutput:
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
- trust_center_reference
|
- compliance_portal_reference
|
||||||
properties:
|
properties:
|
||||||
trust_center_reference:
|
compliance_portal_reference:
|
||||||
$ref: "#/components/schemas/TrustCenterReference"
|
$ref: "#/components/schemas/CompliancePortalReference"
|
||||||
|
|
||||||
UpdateTrustCenterReferenceInput:
|
UpdateCompliancePortalReferenceInput:
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
- id
|
- id
|
||||||
properties:
|
properties:
|
||||||
id:
|
id:
|
||||||
$ref: "#/components/schemas/GID"
|
$ref: "#/components/schemas/GID"
|
||||||
description: Trust center reference ID
|
description: Compliance portal reference ID
|
||||||
name:
|
name:
|
||||||
type:
|
type:
|
||||||
- string
|
- string
|
||||||
@@ -9185,31 +9185,31 @@ components:
|
|||||||
description: Reference rank
|
description: Reference rank
|
||||||
go.probo.inc/mcpgen/omittable: true
|
go.probo.inc/mcpgen/omittable: true
|
||||||
|
|
||||||
UpdateTrustCenterReferenceOutput:
|
UpdateCompliancePortalReferenceOutput:
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
- trust_center_reference
|
- compliance_portal_reference
|
||||||
properties:
|
properties:
|
||||||
trust_center_reference:
|
compliance_portal_reference:
|
||||||
$ref: "#/components/schemas/TrustCenterReference"
|
$ref: "#/components/schemas/CompliancePortalReference"
|
||||||
|
|
||||||
DeleteTrustCenterReferenceInput:
|
DeleteCompliancePortalReferenceInput:
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
- id
|
- id
|
||||||
properties:
|
properties:
|
||||||
id:
|
id:
|
||||||
$ref: "#/components/schemas/GID"
|
$ref: "#/components/schemas/GID"
|
||||||
description: Trust center reference ID
|
description: Compliance portal reference ID
|
||||||
|
|
||||||
DeleteTrustCenterReferenceOutput:
|
DeleteCompliancePortalReferenceOutput:
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
- deleted_trust_center_reference_id
|
- deleted_compliance_portal_reference_id
|
||||||
properties:
|
properties:
|
||||||
deleted_trust_center_reference_id:
|
deleted_compliance_portal_reference_id:
|
||||||
$ref: "#/components/schemas/GID"
|
$ref: "#/components/schemas/GID"
|
||||||
description: Deleted trust center reference ID
|
description: Deleted compliance portal reference ID
|
||||||
|
|
||||||
CompliancePortalCommitmentIcon:
|
CompliancePortalCommitmentIcon:
|
||||||
type: string
|
type: string
|
||||||
@@ -9579,7 +9579,7 @@ components:
|
|||||||
properties:
|
properties:
|
||||||
resource_id:
|
resource_id:
|
||||||
$ref: "#/components/schemas/GID"
|
$ref: "#/components/schemas/GID"
|
||||||
description: Document, trust center file, or audit ID
|
description: Document, compliance portal file, or audit ID
|
||||||
alias:
|
alias:
|
||||||
type: string
|
type: string
|
||||||
description: Human-readable alias slug
|
description: Human-readable alias slug
|
||||||
@@ -9623,7 +9623,7 @@ components:
|
|||||||
$ref: "#/components/schemas/GID"
|
$ref: "#/components/schemas/GID"
|
||||||
description: Resource ID whose alias was removed
|
description: Resource ID whose alias was removed
|
||||||
|
|
||||||
ListTrustCenterFilesInput:
|
ListCompliancePortalFilesInput:
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
- organization_id
|
- organization_id
|
||||||
@@ -9632,8 +9632,8 @@ components:
|
|||||||
$ref: "#/components/schemas/GID"
|
$ref: "#/components/schemas/GID"
|
||||||
description: Organization ID
|
description: Organization ID
|
||||||
order_by:
|
order_by:
|
||||||
$ref: "#/components/schemas/TrustCenterFileOrderBy"
|
$ref: "#/components/schemas/CompliancePortalFileOrderBy"
|
||||||
description: Trust center file order by
|
description: Compliance portal file order by
|
||||||
size:
|
size:
|
||||||
type: integer
|
type: integer
|
||||||
description: Page size
|
description: Page size
|
||||||
@@ -9641,45 +9641,45 @@ components:
|
|||||||
$ref: "#/components/schemas/CursorKey"
|
$ref: "#/components/schemas/CursorKey"
|
||||||
description: Page cursor
|
description: Page cursor
|
||||||
|
|
||||||
ListTrustCenterFilesOutput:
|
ListCompliancePortalFilesOutput:
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
- trust_center_files
|
- compliance_portal_files
|
||||||
properties:
|
properties:
|
||||||
next_cursor:
|
next_cursor:
|
||||||
$ref: "#/components/schemas/CursorKey"
|
$ref: "#/components/schemas/CursorKey"
|
||||||
description: Next cursor
|
description: Next cursor
|
||||||
trust_center_files:
|
compliance_portal_files:
|
||||||
type: array
|
type: array
|
||||||
items:
|
items:
|
||||||
$ref: "#/components/schemas/TrustCenterFile"
|
$ref: "#/components/schemas/CompliancePortalFile"
|
||||||
|
|
||||||
DeleteTrustCenterFileInput:
|
DeleteCompliancePortalFileInput:
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
- id
|
- id
|
||||||
properties:
|
properties:
|
||||||
id:
|
id:
|
||||||
$ref: "#/components/schemas/GID"
|
$ref: "#/components/schemas/GID"
|
||||||
description: Trust center file ID
|
description: Compliance portal file ID
|
||||||
|
|
||||||
DeleteTrustCenterFileOutput:
|
DeleteCompliancePortalFileOutput:
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
- deleted_trust_center_file_id
|
- deleted_compliance_portal_file_id
|
||||||
properties:
|
properties:
|
||||||
deleted_trust_center_file_id:
|
deleted_compliance_portal_file_id:
|
||||||
$ref: "#/components/schemas/GID"
|
$ref: "#/components/schemas/GID"
|
||||||
description: Deleted trust center file ID
|
description: Deleted compliance portal file ID
|
||||||
|
|
||||||
ListComplianceCustomLinksInput:
|
ListComplianceCustomLinksInput:
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
- trust_center_id
|
- compliance_portal_id
|
||||||
properties:
|
properties:
|
||||||
trust_center_id:
|
compliance_portal_id:
|
||||||
$ref: "#/components/schemas/GID"
|
$ref: "#/components/schemas/GID"
|
||||||
description: Trust center ID
|
description: Compliance portal ID
|
||||||
order_by:
|
order_by:
|
||||||
$ref: "#/components/schemas/ComplianceCustomLinkOrderBy"
|
$ref: "#/components/schemas/ComplianceCustomLinkOrderBy"
|
||||||
description: Compliance custom link order by
|
description: Compliance custom link order by
|
||||||
@@ -9706,13 +9706,13 @@ components:
|
|||||||
AddComplianceCustomLinkInput:
|
AddComplianceCustomLinkInput:
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
- trust_center_id
|
- compliance_portal_id
|
||||||
- name
|
- name
|
||||||
- url
|
- url
|
||||||
properties:
|
properties:
|
||||||
trust_center_id:
|
compliance_portal_id:
|
||||||
$ref: "#/components/schemas/GID"
|
$ref: "#/components/schemas/GID"
|
||||||
description: Trust center ID
|
description: Compliance portal ID
|
||||||
name:
|
name:
|
||||||
type: string
|
type: string
|
||||||
description: Custom Link name
|
description: Custom Link name
|
||||||
@@ -9784,12 +9784,12 @@ components:
|
|||||||
CreateCustomDomainInput:
|
CreateCustomDomainInput:
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
- trust_center_id
|
- compliance_portal_id
|
||||||
- domain
|
- domain
|
||||||
properties:
|
properties:
|
||||||
trust_center_id:
|
compliance_portal_id:
|
||||||
$ref: "#/components/schemas/GID"
|
$ref: "#/components/schemas/GID"
|
||||||
description: Compliance page (trust center) ID
|
description: Compliance portal ID
|
||||||
domain:
|
domain:
|
||||||
type: string
|
type: string
|
||||||
description: Custom domain name
|
description: Custom domain name
|
||||||
@@ -9805,11 +9805,11 @@ components:
|
|||||||
DeleteCustomDomainInput:
|
DeleteCustomDomainInput:
|
||||||
type: object
|
type: object
|
||||||
required:
|
required:
|
||||||
- trust_center_id
|
- compliance_portal_id
|
||||||
properties:
|
properties:
|
||||||
trust_center_id:
|
compliance_portal_id:
|
||||||
$ref: "#/components/schemas/GID"
|
$ref: "#/components/schemas/GID"
|
||||||
description: Compliance page (trust center) ID
|
description: Compliance portal ID
|
||||||
|
|
||||||
DeleteCustomDomainOutput:
|
DeleteCustomDomainOutput:
|
||||||
type: object
|
type: object
|
||||||
@@ -14036,57 +14036,57 @@ tools:
|
|||||||
$ref: "#/components/schemas/DeleteRightsRequestInput"
|
$ref: "#/components/schemas/DeleteRightsRequestInput"
|
||||||
outputSchema:
|
outputSchema:
|
||||||
$ref: "#/components/schemas/DeleteRightsRequestOutput"
|
$ref: "#/components/schemas/DeleteRightsRequestOutput"
|
||||||
- name: getTrustCenter
|
- name: getCompliancePortal
|
||||||
description: Get the trust center for an organization
|
description: Get the compliance portal for an organization
|
||||||
hints:
|
hints:
|
||||||
readonly: true
|
readonly: true
|
||||||
idempotent: true
|
idempotent: true
|
||||||
inputSchema:
|
inputSchema:
|
||||||
$ref: "#/components/schemas/GetTrustCenterInput"
|
$ref: "#/components/schemas/GetCompliancePortalInput"
|
||||||
outputSchema:
|
outputSchema:
|
||||||
$ref: "#/components/schemas/GetTrustCenterOutput"
|
$ref: "#/components/schemas/GetCompliancePortalOutput"
|
||||||
- name: updateTrustCenter
|
- name: updateCompliancePortal
|
||||||
description: Update a trust center's settings
|
description: Update a compliance portal's settings
|
||||||
hints:
|
hints:
|
||||||
readonly: false
|
readonly: false
|
||||||
inputSchema:
|
inputSchema:
|
||||||
$ref: "#/components/schemas/UpdateTrustCenterInput"
|
$ref: "#/components/schemas/UpdateCompliancePortalInput"
|
||||||
outputSchema:
|
outputSchema:
|
||||||
$ref: "#/components/schemas/UpdateTrustCenterOutput"
|
$ref: "#/components/schemas/UpdateCompliancePortalOutput"
|
||||||
- name: listTrustCenterReferences
|
- name: listCompliancePortalReferences
|
||||||
description: List all references for a trust center
|
description: List all references for a compliance portal
|
||||||
hints:
|
hints:
|
||||||
readonly: true
|
readonly: true
|
||||||
idempotent: true
|
idempotent: true
|
||||||
inputSchema:
|
inputSchema:
|
||||||
$ref: "#/components/schemas/ListTrustCenterReferencesInput"
|
$ref: "#/components/schemas/ListCompliancePortalReferencesInput"
|
||||||
outputSchema:
|
outputSchema:
|
||||||
$ref: "#/components/schemas/ListTrustCenterReferencesOutput"
|
$ref: "#/components/schemas/ListCompliancePortalReferencesOutput"
|
||||||
- name: addTrustCenterReference
|
- name: addCompliancePortalReference
|
||||||
description: Add a new reference to a trust center
|
description: Add a new reference to a compliance portal
|
||||||
hints:
|
hints:
|
||||||
readonly: false
|
readonly: false
|
||||||
inputSchema:
|
inputSchema:
|
||||||
$ref: "#/components/schemas/AddTrustCenterReferenceInput"
|
$ref: "#/components/schemas/AddCompliancePortalReferenceInput"
|
||||||
outputSchema:
|
outputSchema:
|
||||||
$ref: "#/components/schemas/AddTrustCenterReferenceOutput"
|
$ref: "#/components/schemas/AddCompliancePortalReferenceOutput"
|
||||||
- name: updateTrustCenterReference
|
- name: updateCompliancePortalReference
|
||||||
description: Update an existing trust center reference
|
description: Update an existing compliance portal reference
|
||||||
hints:
|
hints:
|
||||||
readonly: false
|
readonly: false
|
||||||
inputSchema:
|
inputSchema:
|
||||||
$ref: "#/components/schemas/UpdateTrustCenterReferenceInput"
|
$ref: "#/components/schemas/UpdateCompliancePortalReferenceInput"
|
||||||
outputSchema:
|
outputSchema:
|
||||||
$ref: "#/components/schemas/UpdateTrustCenterReferenceOutput"
|
$ref: "#/components/schemas/UpdateCompliancePortalReferenceOutput"
|
||||||
- name: deleteTrustCenterReference
|
- name: deleteCompliancePortalReference
|
||||||
description: Delete a trust center reference
|
description: Delete a compliance portal reference
|
||||||
hints:
|
hints:
|
||||||
readonly: false
|
readonly: false
|
||||||
destructive: true
|
destructive: true
|
||||||
inputSchema:
|
inputSchema:
|
||||||
$ref: "#/components/schemas/DeleteTrustCenterReferenceInput"
|
$ref: "#/components/schemas/DeleteCompliancePortalReferenceInput"
|
||||||
outputSchema:
|
outputSchema:
|
||||||
$ref: "#/components/schemas/DeleteTrustCenterReferenceOutput"
|
$ref: "#/components/schemas/DeleteCompliancePortalReferenceOutput"
|
||||||
- name: listCommitmentGroups
|
- name: listCommitmentGroups
|
||||||
description: List all commitment groups for a trust center
|
description: List all commitment groups for a trust center
|
||||||
hints:
|
hints:
|
||||||
@@ -14172,26 +14172,26 @@ tools:
|
|||||||
$ref: "#/components/schemas/RemoveResourceAliasInput"
|
$ref: "#/components/schemas/RemoveResourceAliasInput"
|
||||||
outputSchema:
|
outputSchema:
|
||||||
$ref: "#/components/schemas/RemoveResourceAliasOutput"
|
$ref: "#/components/schemas/RemoveResourceAliasOutput"
|
||||||
- name: listTrustCenterFiles
|
- name: listCompliancePortalFiles
|
||||||
description: List all files for the trust center
|
description: List all files for the compliance portal
|
||||||
hints:
|
hints:
|
||||||
readonly: true
|
readonly: true
|
||||||
idempotent: true
|
idempotent: true
|
||||||
inputSchema:
|
inputSchema:
|
||||||
$ref: "#/components/schemas/ListTrustCenterFilesInput"
|
$ref: "#/components/schemas/ListCompliancePortalFilesInput"
|
||||||
outputSchema:
|
outputSchema:
|
||||||
$ref: "#/components/schemas/ListTrustCenterFilesOutput"
|
$ref: "#/components/schemas/ListCompliancePortalFilesOutput"
|
||||||
- name: deleteTrustCenterFile
|
- name: deleteCompliancePortalFile
|
||||||
description: Delete a trust center file
|
description: Delete a compliance portal file
|
||||||
hints:
|
hints:
|
||||||
readonly: false
|
readonly: false
|
||||||
destructive: true
|
destructive: true
|
||||||
inputSchema:
|
inputSchema:
|
||||||
$ref: "#/components/schemas/DeleteTrustCenterFileInput"
|
$ref: "#/components/schemas/DeleteCompliancePortalFileInput"
|
||||||
outputSchema:
|
outputSchema:
|
||||||
$ref: "#/components/schemas/DeleteTrustCenterFileOutput"
|
$ref: "#/components/schemas/DeleteCompliancePortalFileOutput"
|
||||||
- name: listComplianceCustomLinks
|
- name: listComplianceCustomLinks
|
||||||
description: List all compliance custom links for a trust center
|
description: List all compliance custom links for a compliance portal
|
||||||
hints:
|
hints:
|
||||||
readonly: true
|
readonly: true
|
||||||
idempotent: true
|
idempotent: true
|
||||||
@@ -14200,7 +14200,7 @@ tools:
|
|||||||
outputSchema:
|
outputSchema:
|
||||||
$ref: "#/components/schemas/ListComplianceCustomLinksOutput"
|
$ref: "#/components/schemas/ListComplianceCustomLinksOutput"
|
||||||
- name: addComplianceCustomLink
|
- name: addComplianceCustomLink
|
||||||
description: Add a new compliance custom link to a trust center
|
description: Add a new compliance custom link to a compliance portal
|
||||||
hints:
|
hints:
|
||||||
readonly: false
|
readonly: false
|
||||||
inputSchema:
|
inputSchema:
|
||||||
|
|||||||
@@ -27,17 +27,17 @@ import (
|
|||||||
|
|
||||||
func NewAudit(a *coredata.Audit, file *coredata.File) *Audit {
|
func NewAudit(a *coredata.Audit, file *coredata.File) *Audit {
|
||||||
audit := &Audit{
|
audit := &Audit{
|
||||||
ID: a.ID,
|
ID: a.ID,
|
||||||
Name: a.Name,
|
Name: a.Name,
|
||||||
OrganizationID: a.OrganizationID,
|
OrganizationID: a.OrganizationID,
|
||||||
FrameworkID: a.FrameworkID,
|
FrameworkID: a.FrameworkID,
|
||||||
State: a.State,
|
State: a.State,
|
||||||
TrustCenterVisibility: a.TrustCenterVisibility,
|
CompliancePortalVisibility: a.CompliancePortalVisibility,
|
||||||
HasReport: a.ReportFileID != nil,
|
HasReport: a.ReportFileID != nil,
|
||||||
ValidFrom: a.ValidFrom,
|
ValidFrom: a.ValidFrom,
|
||||||
ValidUntil: a.ValidUntil,
|
ValidUntil: a.ValidUntil,
|
||||||
CreatedAt: a.CreatedAt,
|
CreatedAt: a.CreatedAt,
|
||||||
UpdatedAt: a.UpdatedAt,
|
UpdatedAt: a.UpdatedAt,
|
||||||
}
|
}
|
||||||
|
|
||||||
if file != nil {
|
if file != nil {
|
||||||
|
|||||||
@@ -25,8 +25,8 @@ import (
|
|||||||
"go.probo.inc/probo/pkg/page"
|
"go.probo.inc/probo/pkg/page"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewTrustCenter(tc *coredata.TrustCenter) *TrustCenter {
|
func NewCompliancePortal(tc *coredata.CompliancePortal) *CompliancePortal {
|
||||||
return &TrustCenter{
|
return &CompliancePortal{
|
||||||
ID: tc.ID,
|
ID: tc.ID,
|
||||||
OrganizationID: tc.OrganizationID,
|
OrganizationID: tc.OrganizationID,
|
||||||
Active: tc.Active,
|
Active: tc.Active,
|
||||||
@@ -41,8 +41,8 @@ func NewTrustCenter(tc *coredata.TrustCenter) *TrustCenter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewTrustCenterReference(r *coredata.TrustCenterReference) *TrustCenterReference {
|
func NewCompliancePortalReference(r *coredata.CompliancePortalReference) *CompliancePortalReference {
|
||||||
return &TrustCenterReference{
|
return &CompliancePortalReference{
|
||||||
ID: r.ID,
|
ID: r.ID,
|
||||||
Name: r.Name,
|
Name: r.Name,
|
||||||
Description: r.Description,
|
Description: r.Description,
|
||||||
@@ -53,10 +53,10 @@ func NewTrustCenterReference(r *coredata.TrustCenterReference) *TrustCenterRefer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewListTrustCenterReferencesOutput(
|
func NewListCompliancePortalReferencesOutput(
|
||||||
refs []*TrustCenterReference,
|
refs []*CompliancePortalReference,
|
||||||
p *page.Page[*coredata.TrustCenterReference, coredata.TrustCenterReferenceOrderField],
|
p *page.Page[*coredata.CompliancePortalReference, coredata.CompliancePortalReferenceOrderField],
|
||||||
) ListTrustCenterReferencesOutput {
|
) ListCompliancePortalReferencesOutput {
|
||||||
var nextCursor *page.CursorKey
|
var nextCursor *page.CursorKey
|
||||||
|
|
||||||
if len(p.Data) > 0 {
|
if len(p.Data) > 0 {
|
||||||
@@ -64,35 +64,35 @@ func NewListTrustCenterReferencesOutput(
|
|||||||
nextCursor = &cursorKey
|
nextCursor = &cursorKey
|
||||||
}
|
}
|
||||||
|
|
||||||
return ListTrustCenterReferencesOutput{
|
return ListCompliancePortalReferencesOutput{
|
||||||
|
NextCursor: nextCursor,
|
||||||
|
CompliancePortalReferences: refs,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewCompliancePortalFile(f *coredata.CompliancePortalFile, file *File) *CompliancePortalFile {
|
||||||
|
return &CompliancePortalFile{
|
||||||
|
ID: f.ID,
|
||||||
|
OrganizationID: f.OrganizationID,
|
||||||
|
Name: f.Name,
|
||||||
|
Category: f.Category,
|
||||||
|
File: file,
|
||||||
|
CompliancePortalVisibility: f.CompliancePortalVisibility,
|
||||||
|
CreatedAt: f.CreatedAt,
|
||||||
|
UpdatedAt: f.UpdatedAt,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewListCompliancePortalFilesOutput(files []*CompliancePortalFile, p *page.Page[*coredata.CompliancePortalFile, coredata.CompliancePortalFileOrderField]) ListCompliancePortalFilesOutput {
|
||||||
|
var nextCursor *page.CursorKey
|
||||||
|
|
||||||
|
if len(p.Data) > 0 {
|
||||||
|
cursorKey := p.Data[len(p.Data)-1].CursorKey(p.Cursor.OrderBy.Field)
|
||||||
|
nextCursor = &cursorKey
|
||||||
|
}
|
||||||
|
|
||||||
|
return ListCompliancePortalFilesOutput{
|
||||||
NextCursor: nextCursor,
|
NextCursor: nextCursor,
|
||||||
TrustCenterReferences: refs,
|
CompliancePortalFiles: files,
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewTrustCenterFile(f *coredata.TrustCenterFile, file *File) *TrustCenterFile {
|
|
||||||
return &TrustCenterFile{
|
|
||||||
ID: f.ID,
|
|
||||||
OrganizationID: f.OrganizationID,
|
|
||||||
Name: f.Name,
|
|
||||||
Category: f.Category,
|
|
||||||
File: file,
|
|
||||||
TrustCenterVisibility: f.TrustCenterVisibility,
|
|
||||||
CreatedAt: f.CreatedAt,
|
|
||||||
UpdatedAt: f.UpdatedAt,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewListTrustCenterFilesOutput(files []*TrustCenterFile, p *page.Page[*coredata.TrustCenterFile, coredata.TrustCenterFileOrderField]) ListTrustCenterFilesOutput {
|
|
||||||
var nextCursor *page.CursorKey
|
|
||||||
|
|
||||||
if len(p.Data) > 0 {
|
|
||||||
cursorKey := p.Data[len(p.Data)-1].CursorKey(p.Cursor.OrderBy.Field)
|
|
||||||
nextCursor = &cursorKey
|
|
||||||
}
|
|
||||||
|
|
||||||
return ListTrustCenterFilesOutput{
|
|
||||||
NextCursor: nextCursor,
|
|
||||||
TrustCenterFiles: files,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -49,16 +49,16 @@ func proseMirrorJSONToMarkdown(pmJSON string) (string, error) {
|
|||||||
|
|
||||||
func NewDocument(d *coredata.Document) *Document {
|
func NewDocument(d *coredata.Document) *Document {
|
||||||
return &Document{
|
return &Document{
|
||||||
ID: d.ID,
|
ID: d.ID,
|
||||||
OrganizationID: d.OrganizationID,
|
OrganizationID: d.OrganizationID,
|
||||||
CurrentPublishedMajor: d.CurrentPublishedMajor,
|
CurrentPublishedMajor: d.CurrentPublishedMajor,
|
||||||
CurrentPublishedMinor: d.CurrentPublishedMinor,
|
CurrentPublishedMinor: d.CurrentPublishedMinor,
|
||||||
WriteMode: d.WriteMode,
|
WriteMode: d.WriteMode,
|
||||||
TrustCenterVisibility: d.TrustCenterVisibility,
|
CompliancePortalVisibility: d.CompliancePortalVisibility,
|
||||||
Status: d.Status,
|
Status: d.Status,
|
||||||
ArchivedAt: d.ArchivedAt,
|
ArchivedAt: d.ArchivedAt,
|
||||||
CreatedAt: d.CreatedAt,
|
CreatedAt: d.CreatedAt,
|
||||||
UpdatedAt: d.UpdatedAt,
|
UpdatedAt: d.UpdatedAt,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import (
|
|||||||
func NewMux(
|
func NewMux(
|
||||||
logger *log.Logger,
|
logger *log.Logger,
|
||||||
slackSvc *slack.Service,
|
slackSvc *slack.Service,
|
||||||
trustSvc *visitor.Service,
|
visitorSvc *visitor.Service,
|
||||||
) *chi.Mux {
|
) *chi.Mux {
|
||||||
r := chi.NewMux()
|
r := chi.NewMux()
|
||||||
|
|
||||||
@@ -40,7 +40,7 @@ func NewMux(
|
|||||||
slackSvc,
|
slackSvc,
|
||||||
slackSvc.GetSlackSigningSecret(),
|
slackSvc.GetSlackSigningSecret(),
|
||||||
logger,
|
logger,
|
||||||
trustSvc,
|
visitorSvc,
|
||||||
))
|
))
|
||||||
|
|
||||||
return r
|
return r
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ const (
|
|||||||
StatusReject = "reject"
|
StatusReject = "reject"
|
||||||
)
|
)
|
||||||
|
|
||||||
func SlackHandler(slackSvc *slack.Service, slackSigningSecret string, logger *log.Logger, trustSvc *visitor.Service) http.HandlerFunc {
|
func SlackHandler(slackSvc *slack.Service, slackSigningSecret string, logger *log.Logger, visitorSvc *visitor.Service) http.HandlerFunc {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
ctx := r.Context()
|
ctx := r.Context()
|
||||||
|
|
||||||
@@ -235,7 +235,7 @@ func SlackHandler(slackSvc *slack.Service, slackSigningSecret string, logger *lo
|
|||||||
documentIDs = []gid.GID{gID}
|
documentIDs = []gid.GID{gID}
|
||||||
case coredata.FileEntityType:
|
case coredata.FileEntityType:
|
||||||
reportIDs = []gid.GID{gID}
|
reportIDs = []gid.GID{gID}
|
||||||
case coredata.TrustCenterFileEntityType:
|
case coredata.CompliancePortalFileEntityType:
|
||||||
fileIDs = []gid.GID{gID}
|
fileIDs = []gid.GID{gID}
|
||||||
default:
|
default:
|
||||||
logger.ErrorCtx(ctx, "unknown entity type", log.Error(err))
|
logger.ErrorCtx(ctx, "unknown entity type", log.Error(err))
|
||||||
@@ -247,7 +247,7 @@ func SlackHandler(slackSvc *slack.Service, slackSigningSecret string, logger *lo
|
|||||||
|
|
||||||
switch statusAction {
|
switch statusAction {
|
||||||
case StatusAccept:
|
case StatusAccept:
|
||||||
if err := trustSvc.GrantPortalAccessByIDs(
|
if err := visitorSvc.GrantPortalAccessByIDs(
|
||||||
ctx,
|
ctx,
|
||||||
scope,
|
scope,
|
||||||
initialSlackMessage.OrganizationID,
|
initialSlackMessage.OrganizationID,
|
||||||
@@ -262,7 +262,7 @@ func SlackHandler(slackSvc *slack.Service, slackSigningSecret string, logger *lo
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
case StatusReject:
|
case StatusReject:
|
||||||
if err := trustSvc.RejectOrRevokePortalAccessByIDs(
|
if err := visitorSvc.RejectOrRevokePortalAccessByIDs(
|
||||||
ctx,
|
ctx,
|
||||||
scope,
|
scope,
|
||||||
initialSlackMessage.OrganizationID,
|
initialSlackMessage.OrganizationID,
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ type Config struct {
|
|||||||
ResourceAlias *resourcealias.Service
|
ResourceAlias *resourcealias.Service
|
||||||
File *filemanager.Service
|
File *filemanager.Service
|
||||||
IAM *iam.Service
|
IAM *iam.Service
|
||||||
Trust *visitor.Service
|
Visitor *visitor.Service
|
||||||
ESign *esign.Service
|
ESign *esign.Service
|
||||||
Management *management.Service
|
Management *management.Service
|
||||||
CertManager *certmanager.Service
|
CertManager *certmanager.Service
|
||||||
@@ -104,7 +104,7 @@ func NewServer(cfg Config) (*Server, error) {
|
|||||||
ResourceAlias: cfg.ResourceAlias,
|
ResourceAlias: cfg.ResourceAlias,
|
||||||
File: cfg.File,
|
File: cfg.File,
|
||||||
IAM: cfg.IAM,
|
IAM: cfg.IAM,
|
||||||
Trust: cfg.Trust,
|
Visitor: cfg.Visitor,
|
||||||
ESign: cfg.ESign,
|
ESign: cfg.ESign,
|
||||||
Management: cfg.Management,
|
Management: cfg.Management,
|
||||||
CertManager: cfg.CertManager,
|
CertManager: cfg.CertManager,
|
||||||
|
|||||||
Reference in New Issue
Block a user