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
|
||||
File *filemanager.Service
|
||||
IAM *iam.Service
|
||||
Trust *visitor.Service
|
||||
Visitor *visitor.Service
|
||||
ESign *esign.Service
|
||||
Management *management.Service
|
||||
CertManager *certmanager.Service
|
||||
@@ -242,12 +242,12 @@ func NewServer(cfg Config) (*Server, error) {
|
||||
slackHandler: slack_v1.NewMux(
|
||||
cfg.Logger.Named("slack.v1"),
|
||||
cfg.Slack,
|
||||
cfg.Trust,
|
||||
cfg.Visitor,
|
||||
),
|
||||
connectHandler: connect_v1.NewMux(
|
||||
cfg.Logger.Named("connect.v1"),
|
||||
cfg.IAM,
|
||||
cfg.Trust,
|
||||
cfg.Visitor,
|
||||
cfg.Cookie,
|
||||
cfg.TokenSecret,
|
||||
cfg.File,
|
||||
@@ -257,7 +257,7 @@ func NewServer(cfg Config) (*Server, error) {
|
||||
return true
|
||||
}
|
||||
|
||||
_, err := cfg.Trust.GetPortalByDomainName(ctx, host)
|
||||
_, err := cfg.Visitor.GetPortalByDomainName(ctx, host)
|
||||
|
||||
return err == nil
|
||||
},
|
||||
|
||||
@@ -31,10 +31,10 @@ type (
|
||||
)
|
||||
|
||||
var (
|
||||
identityContextKey = &ctxKey{name: "identity"}
|
||||
sessionContextKey = &ctxKey{name: "session"}
|
||||
apiKeyContextKey = &ctxKey{name: "api_key"}
|
||||
trustCenterKey = &ctxKey{name: "trust_center"}
|
||||
identityContextKey = &ctxKey{name: "identity"}
|
||||
sessionContextKey = &ctxKey{name: "session"}
|
||||
apiKeyContextKey = &ctxKey{name: "api_key"}
|
||||
compliancePortalKey = &ctxKey{name: "compliance_portal"}
|
||||
)
|
||||
|
||||
func SessionFromContext(ctx context.Context) *coredata.Session {
|
||||
|
||||
@@ -29,11 +29,11 @@ import (
|
||||
"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 http.HandlerFunc(
|
||||
func(w http.ResponseWriter, r *http.Request) {
|
||||
compliancePage := CompliancePageFromContext(r.Context())
|
||||
compliancePage := CompliancePortalFromContext(r.Context())
|
||||
|
||||
if compliancePage == nil {
|
||||
httpserver.RenderJSON(
|
||||
@@ -29,16 +29,16 @@ import (
|
||||
type ctxKey struct{ name string }
|
||||
|
||||
var (
|
||||
compliancePageKey = &ctxKey{name: "compliance_page"}
|
||||
compliancePageBaseURLKey = &ctxKey{name: "compliance_page_base_url"}
|
||||
compliancePortalKey = &ctxKey{name: "compliance_portal"}
|
||||
compliancePortalBaseURLKey = &ctxKey{name: "compliance_portal_base_url"}
|
||||
)
|
||||
|
||||
func CompliancePageFromContext(ctx context.Context) *coredata.TrustCenter {
|
||||
page, _ := ctx.Value(compliancePageKey).(*coredata.TrustCenter)
|
||||
func CompliancePortalFromContext(ctx context.Context) *coredata.CompliancePortal {
|
||||
page, _ := ctx.Value(compliancePortalKey).(*coredata.CompliancePortal)
|
||||
return page
|
||||
}
|
||||
|
||||
func CompliancePageBaseURLFromContext(ctx context.Context) *string {
|
||||
page, _ := ctx.Value(compliancePageBaseURLKey).(*string)
|
||||
func CompliancePortalBaseURLFromContext(ctx context.Context) *string {
|
||||
page, _ := ctx.Value(compliancePortalBaseURLKey).(*string)
|
||||
return page
|
||||
}
|
||||
|
||||
@@ -28,15 +28,15 @@ import (
|
||||
)
|
||||
|
||||
type Handler struct {
|
||||
trustService *visitor.Service
|
||||
visitor *visitor.Service
|
||||
}
|
||||
|
||||
func NewHandler(trustService *visitor.Service) *Handler {
|
||||
return &Handler{trustService: trustService}
|
||||
func NewHandler(visitorSvc *visitor.Service) *Handler {
|
||||
return &Handler{visitor: visitorSvc}
|
||||
}
|
||||
|
||||
func (h *Handler) HandleLLMsTxt(w http.ResponseWriter, r *http.Request) {
|
||||
tc := CompliancePageFromContext(r.Context())
|
||||
tc := CompliancePortalFromContext(r.Context())
|
||||
if tc == nil {
|
||||
http.Error(w, "not found", http.StatusNotFound)
|
||||
return
|
||||
@@ -46,19 +46,19 @@ func (h *Handler) HandleLLMsTxt(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
func (h *Handler) HandleRobotsTxt(w http.ResponseWriter, r *http.Request) {
|
||||
tc := CompliancePageFromContext(r.Context())
|
||||
tc := CompliancePortalFromContext(r.Context())
|
||||
if tc == nil {
|
||||
http.Error(w, "not found", http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
|
||||
baseURL := CompliancePageBaseURLFromContext(r.Context())
|
||||
baseURL := CompliancePortalBaseURLFromContext(r.Context())
|
||||
if baseURL == nil {
|
||||
http.Error(w, "not found", http.StatusNotFound)
|
||||
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")
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
func (h *Handler) HandleSitemap(w http.ResponseWriter, r *http.Request) {
|
||||
tc := CompliancePageFromContext(r.Context())
|
||||
tc := CompliancePortalFromContext(r.Context())
|
||||
if tc == nil {
|
||||
http.Error(w, "not found", http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
|
||||
baseURL := CompliancePageBaseURLFromContext(r.Context())
|
||||
baseURL := CompliancePortalBaseURLFromContext(r.Context())
|
||||
if baseURL == nil {
|
||||
http.Error(w, "not found", http.StatusNotFound)
|
||||
return
|
||||
@@ -88,7 +88,7 @@ func (h *Handler) HandleSitemap(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ import (
|
||||
"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 http.HandlerFunc(
|
||||
func(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -44,9 +44,9 @@ func NewMemberProvisioningMiddleware(trustSvc *visitor.Service, logger *log.Logg
|
||||
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))
|
||||
httpserver.RenderJSON(
|
||||
w,
|
||||
|
||||
@@ -34,7 +34,7 @@ import (
|
||||
"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 http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
@@ -44,7 +44,7 @@ func NewSNIMiddleware(trustSvc *visitor.Service) func(next http.Handler) http.Ha
|
||||
return
|
||||
}
|
||||
|
||||
compliancePage, err := trustSvc.GetPortalByDomainName(ctx, r.TLS.ServerName)
|
||||
compliancePage, err := visitorSvc.GetPortalByDomainName(ctx, r.TLS.ServerName)
|
||||
if err != nil {
|
||||
if errors.Is(err, visitor.ErrPageNotFound) {
|
||||
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
|
||||
// challenges are handled upstream and never reach this middleware.
|
||||
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 {
|
||||
httpserver.RenderJSON(
|
||||
w,
|
||||
@@ -106,13 +106,13 @@ func NewSNIMiddleware(trustSvc *visitor.Service) func(next http.Handler) http.Ha
|
||||
|
||||
ctx = context.WithValue(
|
||||
ctx,
|
||||
compliancePageBaseURLKey,
|
||||
compliancePortalBaseURLKey,
|
||||
&baseURLString,
|
||||
)
|
||||
r = r.WithContext(ctx)
|
||||
|
||||
if compliancePage.Active {
|
||||
ctx = context.WithValue(ctx, compliancePageKey, compliancePage)
|
||||
ctx = context.WithValue(ctx, compliancePortalKey, compliancePage)
|
||||
next.ServeHTTP(w, r.WithContext(ctx))
|
||||
|
||||
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")
|
||||
}
|
||||
|
||||
compliancePage := complianceportal.CompliancePageFromContext(ctx)
|
||||
compliancePage := complianceportal.CompliancePortalFromContext(ctx)
|
||||
|
||||
profile, err := r.iam.OrganizationService.GetProfileForIdentityAndOrganization(ctx, identity.ID, compliancePage.OrganizationID)
|
||||
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.
|
||||
func (r *queryResolver) Node(ctx context.Context, id gid.GID) (types.Node, error) {
|
||||
scope := coredata.NewScopeFromObjectID(id)
|
||||
trustService := r.trust
|
||||
visitorService := r.visitor
|
||||
|
||||
switch id.EntityType() {
|
||||
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 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)
|
||||
@@ -67,7 +67,7 @@ func (r *queryResolver) Node(ctx context.Context, id gid.GID) (types.Node, error
|
||||
return types.NewDocument(document), nil
|
||||
|
||||
case coredata.FrameworkEntityType:
|
||||
framework, err := trustService.GetFramework(ctx, scope, id)
|
||||
framework, err := visitorService.GetFramework(ctx, scope, id)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot get framework", log.Error(err))
|
||||
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
|
||||
|
||||
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 errors.Is(err, visitor.ErrReportNotFound) || errors.Is(err, coredata.ErrResourceNotFound) {
|
||||
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
|
||||
|
||||
case coredata.AuditEntityType:
|
||||
audit, err := trustService.GetAudit(ctx, scope, id)
|
||||
audit, err := visitorService.GetAudit(ctx, scope, id)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot get audit", log.Error(err))
|
||||
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
|
||||
|
||||
case coredata.ThirdPartyEntityType:
|
||||
thirdParty, err := trustService.GetThirdParty(ctx, scope, id)
|
||||
thirdParty, err := visitorService.GetThirdParty(ctx, scope, id)
|
||||
if err != nil {
|
||||
r.logger.ErrorCtx(ctx, "cannot get thirdParty", log.Error(err))
|
||||
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
|
||||
|
||||
case coredata.TrustCenterEntityType:
|
||||
trustCenter, err := trustService.GetPortal(ctx, scope, id)
|
||||
case coredata.CompliancePortalEntityType:
|
||||
compliancePortal, err := visitorService.GetPortal(ctx, scope, id)
|
||||
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 types.NewTrustCenter(trustCenter), nil
|
||||
return types.NewCompliancePortal(compliancePortal), nil
|
||||
|
||||
case coredata.TrustCenterReferenceEntityType:
|
||||
reference, err := trustService.GetPortalReference(ctx, scope, id)
|
||||
case coredata.CompliancePortalReferenceEntityType:
|
||||
reference, err := visitorService.GetPortalReference(ctx, scope, id)
|
||||
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 types.NewTrustCenterReference(reference), nil
|
||||
return types.NewCompliancePortalReference(reference), nil
|
||||
|
||||
case coredata.TrustCenterFileEntityType:
|
||||
trustCenter := complianceportal.CompliancePageFromContext(ctx)
|
||||
case coredata.CompliancePortalFileEntityType:
|
||||
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 errors.Is(err, visitor.ErrPortalFileNotFound) || errors.Is(err, visitor.ErrPortalFileNotVisible) {
|
||||
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 types.NewTrustCenterFile(trustCenterFile), nil
|
||||
return types.NewCompliancePortalFile(portalFile), nil
|
||||
|
||||
default:
|
||||
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) {
|
||||
resourceID, err := gid.ParseGID(alias)
|
||||
if err != nil {
|
||||
trustCenter := complianceportal.CompliancePageFromContext(ctx)
|
||||
scope := coredata.NewScopeFromObjectID(trustCenter.ID)
|
||||
compliancePortal := complianceportal.CompliancePortalFromContext(ctx)
|
||||
scope := coredata.NewScopeFromObjectID(compliancePortal.ID)
|
||||
|
||||
resourceID, err = r.resourceAlias.ResolveAlias(
|
||||
ctx,
|
||||
@@ -174,22 +174,20 @@ func (r *queryResolver) AliasedNode(ctx context.Context, alias string) (types.No
|
||||
return r.Node(ctx, resourceID)
|
||||
}
|
||||
|
||||
// CurrentTrustCenter is the resolver for the currentTrustCenter field.
|
||||
func (r *queryResolver) CurrentTrustCenter(ctx context.Context) (*types.TrustCenter, error) {
|
||||
trustCenter := complianceportal.CompliancePageFromContext(ctx)
|
||||
// CurrentCompliancePortal is the resolver for the currentCompliancePortal field.
|
||||
func (r *queryResolver) CurrentCompliancePortal(ctx context.Context) (*types.CompliancePortal, error) {
|
||||
compliancePortal := complianceportal.CompliancePortalFromContext(ctx)
|
||||
|
||||
scope := coredata.NewScopeFromObjectID(trustCenter.ID)
|
||||
trustService := r.trust
|
||||
scope := coredata.NewScopeFromObjectID(compliancePortal.ID)
|
||||
visitorService := r.visitor
|
||||
|
||||
var err error
|
||||
|
||||
trustCenter, err = trustService.GetPortal(ctx, scope, trustCenter.ID)
|
||||
compliancePortal, err := visitorService.GetPortal(ctx, scope, compliancePortal.ID)
|
||||
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 types.NewTrustCenter(trustCenter), nil
|
||||
return types.NewCompliancePortal(compliancePortal), nil
|
||||
}
|
||||
|
||||
// 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
|
||||
}
|
||||
|
||||
compliancePage := complianceportal.CompliancePageFromContext(ctx)
|
||||
compliancePage := complianceportal.CompliancePortalFromContext(ctx)
|
||||
scope := coredata.NewScopeFromObjectID(compliancePage.OrganizationID)
|
||||
|
||||
result, err := r.trust.ListRightsRequestsForOrganizationIDAndContact(
|
||||
result, err := r.visitor.ListRightsRequestsForOrganizationIDAndContact(
|
||||
ctx,
|
||||
scope,
|
||||
compliancePage.OrganizationID,
|
||||
|
||||
@@ -56,7 +56,7 @@ func NewBrandDarkLogoHandler(logger *log.Logger, fileManager *filemanager.Servic
|
||||
}
|
||||
|
||||
func (h *brandLogoHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
compliancePage := complianceportal.CompliancePageFromContext(r.Context())
|
||||
compliancePage := complianceportal.CompliancePortalFromContext(r.Context())
|
||||
if compliancePage == nil {
|
||||
httpserver.RenderError(w, http.StatusNotFound, errNotFound)
|
||||
return
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -26,12 +26,12 @@ type Query {
|
||||
viewer: Identity
|
||||
node(id: ID!): Node
|
||||
aliasedNode(alias: String!): Node
|
||||
currentTrustCenter: TrustCenter
|
||||
currentCompliancePortal: CompliancePortal
|
||||
oidcProviders: [OIDCProviderInfo!]!
|
||||
@goField(forceResolver: true)
|
||||
@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
|
||||
# the portal can still render its empty state.
|
||||
myRightsRequests(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
type TrustCenter implements Node {
|
||||
type CompliancePortal implements Node {
|
||||
id: ID!
|
||||
active: Boolean!
|
||||
slug: String!
|
||||
@@ -20,7 +20,7 @@ type TrustCenter implements Node {
|
||||
after: CursorKey
|
||||
last: Int
|
||||
before: CursorKey
|
||||
filter: TrustCenterVisibilityFilter
|
||||
filter: CompliancePortalVisibilityFilter
|
||||
): DocumentConnection! @goField(forceResolver: true)
|
||||
|
||||
audits(
|
||||
@@ -28,7 +28,7 @@ type TrustCenter implements Node {
|
||||
after: CursorKey
|
||||
last: Int
|
||||
before: CursorKey
|
||||
filter: TrustCenterVisibilityFilter
|
||||
filter: CompliancePortalVisibilityFilter
|
||||
): AuditConnection! @goField(forceResolver: true)
|
||||
|
||||
subprocessors(
|
||||
@@ -49,7 +49,7 @@ type TrustCenter implements Node {
|
||||
after: CursorKey
|
||||
last: Int
|
||||
before: CursorKey
|
||||
): TrustCenterReferenceConnection! @goField(forceResolver: true)
|
||||
): CompliancePortalReferenceConnection! @goField(forceResolver: true)
|
||||
|
||||
commitmentGroups(
|
||||
first: Int
|
||||
@@ -58,13 +58,13 @@ type TrustCenter implements Node {
|
||||
before: CursorKey
|
||||
): CompliancePortalCommitmentGroupConnection! @goField(forceResolver: true)
|
||||
|
||||
trustCenterFiles(
|
||||
compliancePortalFiles(
|
||||
first: Int
|
||||
after: CursorKey
|
||||
last: Int
|
||||
before: CursorKey
|
||||
filter: TrustCenterVisibilityFilter
|
||||
): TrustCenterFileConnection! @goField(forceResolver: true)
|
||||
filter: CompliancePortalVisibilityFilter
|
||||
): CompliancePortalFileConnection! @goField(forceResolver: true)
|
||||
|
||||
complianceFrameworks(
|
||||
first: Int
|
||||
@@ -109,16 +109,16 @@ enum DocumentType
|
||||
)
|
||||
}
|
||||
|
||||
enum TrustCenterVisibility
|
||||
@goModel(model: "go.probo.inc/probo/pkg/coredata.TrustCenterVisibility") {
|
||||
enum CompliancePortalVisibility
|
||||
@goModel(model: "go.probo.inc/probo/pkg/coredata.CompliancePortalVisibility") {
|
||||
PRIVATE
|
||||
@goEnum(value: "go.probo.inc/probo/pkg/coredata.TrustCenterVisibilityPrivate")
|
||||
@goEnum(value: "go.probo.inc/probo/pkg/coredata.CompliancePortalVisibilityPrivate")
|
||||
PUBLIC
|
||||
@goEnum(value: "go.probo.inc/probo/pkg/coredata.TrustCenterVisibilityPublic")
|
||||
@goEnum(value: "go.probo.inc/probo/pkg/coredata.CompliancePortalVisibilityPublic")
|
||||
}
|
||||
|
||||
input TrustCenterVisibilityFilter {
|
||||
visibility: TrustCenterVisibility
|
||||
input CompliancePortalVisibilityFilter {
|
||||
visibility: CompliancePortalVisibility
|
||||
}
|
||||
|
||||
type Document implements Node @nda {
|
||||
@@ -291,7 +291,7 @@ type SubprocessorEdge @nda {
|
||||
node: Subprocessor!
|
||||
}
|
||||
|
||||
type TrustCenterReference implements Node @nda {
|
||||
type CompliancePortalReference implements Node @nda {
|
||||
id: ID!
|
||||
name: String!
|
||||
description: String
|
||||
@@ -299,14 +299,14 @@ type TrustCenterReference implements Node @nda {
|
||||
logo: File! @goField(forceResolver: true)
|
||||
}
|
||||
|
||||
type TrustCenterReferenceConnection @nda {
|
||||
edges: [TrustCenterReferenceEdge!]!
|
||||
type CompliancePortalReferenceConnection @nda {
|
||||
edges: [CompliancePortalReferenceEdge!]!
|
||||
pageInfo: PageInfo!
|
||||
}
|
||||
|
||||
type TrustCenterReferenceEdge @nda {
|
||||
type CompliancePortalReferenceEdge @nda {
|
||||
cursor: CursorKey!
|
||||
node: TrustCenterReference!
|
||||
node: CompliancePortalReference!
|
||||
}
|
||||
|
||||
enum CompliancePortalCommitmentIcon
|
||||
@@ -394,7 +394,7 @@ type CompliancePortalCommitmentEdge {
|
||||
node: CompliancePortalCommitment!
|
||||
}
|
||||
|
||||
type TrustCenterFile implements Node @nda {
|
||||
type CompliancePortalFile implements Node @nda {
|
||||
id: ID!
|
||||
name: String!
|
||||
category: String!
|
||||
@@ -403,14 +403,14 @@ type TrustCenterFile implements Node @nda {
|
||||
access: DocumentAccess @goField(forceResolver: true)
|
||||
}
|
||||
|
||||
type TrustCenterFileConnection @nda {
|
||||
edges: [TrustCenterFileEdge!]!
|
||||
type CompliancePortalFileConnection @nda {
|
||||
edges: [CompliancePortalFileEdge!]!
|
||||
pageInfo: PageInfo!
|
||||
}
|
||||
|
||||
type TrustCenterFileEdge @nda {
|
||||
type CompliancePortalFileEdge @nda {
|
||||
cursor: CursorKey!
|
||||
node: TrustCenterFile!
|
||||
node: CompliancePortalFile!
|
||||
}
|
||||
|
||||
type ComplianceCustomLink implements Node {
|
||||
@@ -430,7 +430,7 @@ type ComplianceCustomLinkEdge {
|
||||
node: ComplianceCustomLink!
|
||||
}
|
||||
|
||||
type TrustCenterAccess implements Node {
|
||||
type CompliancePortalAccess implements Node {
|
||||
id: ID!
|
||||
email: EmailAddr!
|
||||
name: String!
|
||||
@@ -440,23 +440,23 @@ type TrustCenterAccess implements Node {
|
||||
|
||||
enum DocumentAccessStatus
|
||||
@goModel(
|
||||
model: "go.probo.inc/probo/pkg/coredata.TrustCenterDocumentAccessStatus"
|
||||
model: "go.probo.inc/probo/pkg/coredata.CompliancePortalDocumentAccessStatus"
|
||||
) {
|
||||
REQUESTED
|
||||
@goEnum(
|
||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterDocumentAccessStatusRequested"
|
||||
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalDocumentAccessStatusRequested"
|
||||
)
|
||||
GRANTED
|
||||
@goEnum(
|
||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterDocumentAccessStatusGranted"
|
||||
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalDocumentAccessStatusGranted"
|
||||
)
|
||||
REJECTED
|
||||
@goEnum(
|
||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterDocumentAccessStatusRejected"
|
||||
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalDocumentAccessStatusRejected"
|
||||
)
|
||||
REVOKED
|
||||
@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!
|
||||
@authentication(required: OPTIONAL) @nda
|
||||
|
||||
exportTrustCenterFile(
|
||||
input: ExportTrustCenterFileInput!
|
||||
): ExportTrustCenterFilePayload! @authentication(required: OPTIONAL) @nda
|
||||
exportCompliancePortalFile(
|
||||
input: ExportCompliancePortalFileInput!
|
||||
): ExportCompliancePortalFilePayload! @authentication(required: OPTIONAL) @nda
|
||||
|
||||
requestDocumentAccess(
|
||||
input: RequestDocumentAccessInput!
|
||||
@@ -486,8 +486,8 @@ extend type Mutation {
|
||||
input: RequestReportAccessInput!
|
||||
): RequestReportAccessPayload! @authentication(required: PRESENT) @nda
|
||||
|
||||
requestTrustCenterFileAccess(
|
||||
input: RequestTrustCenterFileAccessInput!
|
||||
requestCompliancePortalFileAccess(
|
||||
input: RequestCompliancePortalFileAccessInput!
|
||||
): RequestFileAccessPayload! @authentication(required: PRESENT) @nda
|
||||
}
|
||||
|
||||
@@ -500,11 +500,11 @@ type RequestReportAccessPayload {
|
||||
}
|
||||
|
||||
type RequestFileAccessPayload {
|
||||
file: TrustCenterFile
|
||||
file: CompliancePortalFile
|
||||
}
|
||||
|
||||
type RequestAccessesPayload {
|
||||
trustCenterAccess: TrustCenterAccess!
|
||||
compliancePortalAccess: CompliancePortalAccess!
|
||||
}
|
||||
|
||||
input ExportDocumentPDFInput {
|
||||
@@ -523,12 +523,12 @@ input RequestReportAccessInput {
|
||||
reportId: ID!
|
||||
}
|
||||
|
||||
input RequestTrustCenterFileAccessInput {
|
||||
trustCenterFileId: ID!
|
||||
input RequestCompliancePortalFileAccessInput {
|
||||
compliancePortalFileId: ID!
|
||||
}
|
||||
|
||||
input ExportTrustCenterFileInput {
|
||||
trustCenterFileId: ID!
|
||||
input ExportCompliancePortalFileInput {
|
||||
compliancePortalFileId: ID!
|
||||
}
|
||||
|
||||
type ExportDocumentPDFPayload {
|
||||
@@ -539,6 +539,6 @@ type ExportReportPDFPayload {
|
||||
data: String!
|
||||
}
|
||||
|
||||
type ExportTrustCenterFilePayload {
|
||||
type ExportCompliancePortalFilePayload {
|
||||
data: String!
|
||||
}
|
||||
@@ -41,7 +41,7 @@ import (
|
||||
|
||||
func NewGraphQLHandler(
|
||||
iamSvc *iam.Service,
|
||||
trustSvc *visitor.Service,
|
||||
visitorSvc *visitor.Service,
|
||||
resourceAliasSvc *resourcealias.Service,
|
||||
fileManagerSvc *filemanager.Service,
|
||||
esignSvc *esign.Service,
|
||||
@@ -55,7 +55,7 @@ func NewGraphQLHandler(
|
||||
config := schema.Config{
|
||||
Resolvers: &Resolver{
|
||||
iam: iamSvc,
|
||||
trust: trustSvc,
|
||||
visitor: visitorSvc,
|
||||
resourceAlias: resourceAliasSvc,
|
||||
fileManager: fileManagerSvc,
|
||||
esign: esignSvc,
|
||||
@@ -65,7 +65,7 @@ func NewGraphQLHandler(
|
||||
sessionCookie: authn.NewCookie(&cookieConfig),
|
||||
},
|
||||
Directives: schema.DirectiveRoot{
|
||||
Nda: newNDADirective(logger, trustSvc, esignSvc),
|
||||
Nda: newNDADirective(logger, visitorSvc, esignSvc),
|
||||
Authentication: authentication.Directive,
|
||||
SessionOnly: session.Directive,
|
||||
},
|
||||
|
||||
@@ -20,8 +20,8 @@ import (
|
||||
|
||||
// SubscribeToMailingList is the resolver for the subscribeToMailingList field.
|
||||
func (r *mutationResolver) SubscribeToMailingList(ctx context.Context) (*types.SubscribeToMailingListPayload, error) {
|
||||
trustCenter := complianceportal.CompliancePageFromContext(ctx)
|
||||
if trustCenter.MailingListID == nil {
|
||||
compliancePortal := complianceportal.CompliancePortalFromContext(ctx)
|
||||
if compliancePortal.MailingListID == nil {
|
||||
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(
|
||||
ctx,
|
||||
&mailman.CreateSubscriberRequest{
|
||||
MailingListID: *trustCenter.MailingListID,
|
||||
MailingListID: *compliancePortal.MailingListID,
|
||||
Email: identity.EmailAddress,
|
||||
FullName: identity.FullName,
|
||||
},
|
||||
@@ -56,14 +56,14 @@ func (r *mutationResolver) SubscribeToMailingList(ctx context.Context) (*types.S
|
||||
|
||||
// UnsubscribeFromMailingList is the resolver for the unsubscribeFromMailingList field.
|
||||
func (r *mutationResolver) UnsubscribeFromMailingList(ctx context.Context) (*types.UnsubscribeFromMailingListPayload, error) {
|
||||
trustCenter := complianceportal.CompliancePageFromContext(ctx)
|
||||
if trustCenter.MailingListID == nil {
|
||||
compliancePortal := complianceportal.CompliancePortalFromContext(ctx)
|
||||
if compliancePortal.MailingListID == nil {
|
||||
return nil, gqlutils.NotFoundf(ctx, "mailing list not found")
|
||||
}
|
||||
|
||||
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 {
|
||||
r.logger.ErrorCtx(ctx, "cannot get mailing list subscription", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
|
||||
@@ -102,7 +102,7 @@ func NewMux(cfg MuxConfig) (http.Handler, error) {
|
||||
|
||||
r.Group(
|
||||
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.BrandLogoPath, NewBrandLogoHandler(cfg.Logger, cfg.File))
|
||||
@@ -128,12 +128,12 @@ func NewMux(cfg MuxConfig) (http.Handler, error) {
|
||||
|
||||
func compliancePageHeadData() HeadDataFunc {
|
||||
return func(r *http.Request) HeadData {
|
||||
tc := complianceportal.CompliancePageFromContext(r.Context())
|
||||
tc := complianceportal.CompliancePortalFromContext(r.Context())
|
||||
if tc == nil {
|
||||
return HeadData{Title: "Compliance Page"}
|
||||
}
|
||||
|
||||
compliancePageBaseURL := complianceportal.CompliancePageBaseURLFromContext(r.Context())
|
||||
compliancePageBaseURL := complianceportal.CompliancePortalBaseURLFromContext(r.Context())
|
||||
|
||||
description := tc.Title + " Compliance Page"
|
||||
if tc.Description != nil && *tc.Description != "" {
|
||||
|
||||
@@ -35,7 +35,7 @@ import (
|
||||
|
||||
func newNDADirective(
|
||||
logger *log.Logger,
|
||||
trustSvc *visitor.Service,
|
||||
visitorSvc *visitor.Service,
|
||||
esignSvc *esign.Service,
|
||||
) 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)
|
||||
}
|
||||
|
||||
compliancePage := complianceportal.CompliancePageFromContext(ctx)
|
||||
compliancePage := complianceportal.CompliancePortalFromContext(ctx)
|
||||
if compliancePage == nil {
|
||||
logger.ErrorCtx(ctx, "cannot get compliance page from context")
|
||||
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 {
|
||||
logger.ErrorCtx(ctx, "cannot get compliance page membership", log.Error(err))
|
||||
return nil, gqlutils.Internal(ctx)
|
||||
|
||||
@@ -23,9 +23,9 @@ import (
|
||||
// AcceptElectronicSignature is the resolver for the acceptElectronicSignature field.
|
||||
func (r *mutationResolver) AcceptElectronicSignature(ctx context.Context, input types.AcceptElectronicSignatureInput) (*types.AcceptElectronicSignaturePayload, error) {
|
||||
var (
|
||||
identity = authn.IdentityFromContext(ctx)
|
||||
httpReq = gqlutils.HTTPRequestFromContext(ctx)
|
||||
trustCenter = complianceportal.CompliancePageFromContext(ctx)
|
||||
identity = authn.IdentityFromContext(ctx)
|
||||
httpReq = gqlutils.HTTPRequestFromContext(ctx)
|
||||
compliancePortal = complianceportal.CompliancePortalFromContext(ctx)
|
||||
)
|
||||
|
||||
signerIP, _, _ := net.SplitHostPort(httpReq.RemoteAddr)
|
||||
@@ -33,7 +33,7 @@ func (r *mutationResolver) AcceptElectronicSignature(ctx context.Context, input
|
||||
signerIP = httpReq.RemoteAddr
|
||||
}
|
||||
|
||||
scope := coredata.NewScopeFromObjectID(trustCenter.ID)
|
||||
scope := coredata.NewScopeFromObjectID(compliancePortal.ID)
|
||||
|
||||
signature, err := r.esign.AcceptSignature(
|
||||
ctx,
|
||||
@@ -59,9 +59,9 @@ func (r *mutationResolver) AcceptElectronicSignature(ctx context.Context, input
|
||||
// RecordSigningEvent is the resolver for the recordSigningEvent field.
|
||||
func (r *mutationResolver) RecordSigningEvent(ctx context.Context, input types.RecordSigningEventInput) (*types.RecordSigningEventPayload, error) {
|
||||
var (
|
||||
identity = authn.IdentityFromContext(ctx)
|
||||
httpReq = gqlutils.HTTPRequestFromContext(ctx)
|
||||
trustCenter = complianceportal.CompliancePageFromContext(ctx)
|
||||
identity = authn.IdentityFromContext(ctx)
|
||||
httpReq = gqlutils.HTTPRequestFromContext(ctx)
|
||||
compliancePortal = complianceportal.CompliancePortalFromContext(ctx)
|
||||
)
|
||||
|
||||
actorIP, _, _ := net.SplitHostPort(httpReq.RemoteAddr)
|
||||
@@ -69,7 +69,7 @@ func (r *mutationResolver) RecordSigningEvent(ctx context.Context, input types.R
|
||||
actorIP = httpReq.RemoteAddr
|
||||
}
|
||||
|
||||
scope := coredata.NewScopeFromObjectID(trustCenter.ID)
|
||||
scope := coredata.NewScopeFromObjectID(compliancePortal.ID)
|
||||
|
||||
if err := r.esign.RecordEvent(
|
||||
ctx,
|
||||
@@ -92,13 +92,13 @@ func (r *mutationResolver) RecordSigningEvent(ctx context.Context, input types.R
|
||||
|
||||
// FileURL is the resolver for the fileUrl field.
|
||||
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 {
|
||||
scope := coredata.NewScopeFromObjectID(trustCenter.ID)
|
||||
trustService := r.trust
|
||||
scope := coredata.NewScopeFromObjectID(compliancePortal.ID)
|
||||
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 {
|
||||
fileURL, err := r.esign.GenerateSignatureFileURL(ctx, *access.ElectronicSignatureID, 15*time.Minute)
|
||||
if err == nil {
|
||||
@@ -109,10 +109,10 @@ func (r *nonDisclosureAgreementResolver) FileURL(ctx context.Context, obj *types
|
||||
}
|
||||
}
|
||||
|
||||
scope := coredata.NewScopeFromObjectID(trustCenter.ID)
|
||||
trustService := r.trust
|
||||
scope := coredata.NewScopeFromObjectID(compliancePortal.ID)
|
||||
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 {
|
||||
return "", gqlutils.Internal(ctx)
|
||||
}
|
||||
@@ -127,11 +127,11 @@ func (r *nonDisclosureAgreementResolver) ViewerSignature(ctx context.Context, ob
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
trustCenter := complianceportal.CompliancePageFromContext(ctx)
|
||||
scope := coredata.NewScopeFromObjectID(trustCenter.ID)
|
||||
trustService := r.trust
|
||||
compliancePortal := complianceportal.CompliancePortalFromContext(ctx)
|
||||
scope := coredata.NewScopeFromObjectID(compliancePortal.ID)
|
||||
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 {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
@@ -92,9 +92,9 @@ func (h *OAuthCallbackHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
|
||||
return
|
||||
}
|
||||
|
||||
portal := complianceportal.CompliancePageFromContext(ctx)
|
||||
portal := complianceportal.CompliancePortalFromContext(ctx)
|
||||
|
||||
portalBaseURL := complianceportal.CompliancePageBaseURLFromContext(ctx)
|
||||
portalBaseURL := complianceportal.CompliancePortalBaseURLFromContext(ctx)
|
||||
if portal == nil || portalBaseURL == nil {
|
||||
httpserver.RenderError(w, http.StatusNotFound, errNotFound)
|
||||
return
|
||||
|
||||
@@ -34,8 +34,8 @@ func NewOAuthClientMetadataHandler(visitorSvc *visitor.Service) http.Handler {
|
||||
func (h *oauthClientMetadataHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
|
||||
compliancePage := complianceportal.CompliancePageFromContext(ctx)
|
||||
baseURL := complianceportal.CompliancePageBaseURLFromContext(ctx)
|
||||
compliancePage := complianceportal.CompliancePortalFromContext(ctx)
|
||||
baseURL := complianceportal.CompliancePortalBaseURLFromContext(ctx)
|
||||
|
||||
if compliancePage == nil || baseURL == nil {
|
||||
httpserver.RenderError(w, http.StatusNotFound, errNotFound)
|
||||
|
||||
@@ -58,8 +58,8 @@ func NewOAuthInitiateHandler(
|
||||
func (h *OAuthInitiateHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
ctx := r.Context()
|
||||
|
||||
compliancePage := complianceportal.CompliancePageFromContext(ctx)
|
||||
portalBaseURL := complianceportal.CompliancePageBaseURLFromContext(ctx)
|
||||
compliancePage := complianceportal.CompliancePortalFromContext(ctx)
|
||||
portalBaseURL := complianceportal.CompliancePortalBaseURLFromContext(ctx)
|
||||
|
||||
if compliancePage == nil || portalBaseURL == nil {
|
||||
httpserver.RenderError(w, http.StatusNotFound, errNotFound)
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
package complianceportal_v1
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"go.gearno.de/kit/log"
|
||||
"go.probo.inc/probo/pkg/baseurl"
|
||||
"go.probo.inc/probo/pkg/complianceportal/visitor"
|
||||
@@ -31,19 +29,8 @@ import (
|
||||
)
|
||||
|
||||
type (
|
||||
TrustAuthConfig struct {
|
||||
CookieName string
|
||||
CookieDomain string
|
||||
CookieDuration time.Duration
|
||||
TokenDuration time.Duration
|
||||
ReportURLDuration time.Duration
|
||||
Scope string
|
||||
TokenType string
|
||||
CookieSecure bool
|
||||
}
|
||||
|
||||
Resolver struct {
|
||||
trust *visitor.Service
|
||||
visitor *visitor.Service
|
||||
resourceAlias *resourcealias.Service
|
||||
fileManager *filemanager.Service
|
||||
esign *esign.Service
|
||||
|
||||
@@ -34,8 +34,8 @@ func (r *Resolver) ResourceAliasResolver(
|
||||
ctx context.Context,
|
||||
storageResourceID gid.GID,
|
||||
) (*string, error) {
|
||||
trustCenter := complianceportal.CompliancePageFromContext(ctx)
|
||||
scope := coredata.NewScopeFromObjectID(trustCenter.ID)
|
||||
compliancePortal := complianceportal.CompliancePortalFromContext(ctx)
|
||||
scope := coredata.NewScopeFromObjectID(compliancePortal.ID)
|
||||
|
||||
alias, err := r.resourceAlias.GetByResourceID(ctx, scope, storageResourceID)
|
||||
if err != nil {
|
||||
|
||||
@@ -9,7 +9,7 @@ import (
|
||||
"context"
|
||||
|
||||
"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/server/api/authn"
|
||||
"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")
|
||||
}
|
||||
|
||||
compliancePage := complianceportal.CompliancePageFromContext(ctx)
|
||||
compliancePage := complianceportal.CompliancePortalFromContext(ctx)
|
||||
scope := coredata.NewScopeFromObjectID(compliancePage.OrganizationID)
|
||||
|
||||
rightsRequest, err := r.trust.CreateRightsRequest(
|
||||
rightsRequest, err := r.visitor.CreateRightsRequest(
|
||||
ctx,
|
||||
scope,
|
||||
&trust.CreateRightsRequest{
|
||||
&visitor.CreateRightsRequest{
|
||||
OrganizationID: compliancePage.OrganizationID,
|
||||
RequestType: input.RequestType,
|
||||
DataSubject: input.DataSubject,
|
||||
|
||||
@@ -24,16 +24,16 @@ import (
|
||||
"go.probo.inc/probo/pkg/coredata"
|
||||
)
|
||||
|
||||
func NewTrustCenter(tc *coredata.TrustCenter) *TrustCenter {
|
||||
return &TrustCenter{
|
||||
ID: tc.ID,
|
||||
Active: tc.Active,
|
||||
Slug: tc.Slug,
|
||||
Title: tc.Title,
|
||||
Description: tc.Description,
|
||||
WebsiteURL: tc.WebsiteURL,
|
||||
Email: tc.Email,
|
||||
HeadquarterAddress: tc.HeadquarterAddress,
|
||||
func NewCompliancePortal(cp *coredata.CompliancePortal) *CompliancePortal {
|
||||
return &CompliancePortal{
|
||||
ID: cp.ID,
|
||||
Active: cp.Active,
|
||||
Slug: cp.Slug,
|
||||
Title: cp.Title,
|
||||
Description: cp.Description,
|
||||
WebsiteURL: cp.WebsiteURL,
|
||||
Email: cp.Email,
|
||||
HeadquarterAddress: cp.HeadquarterAddress,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,31 +25,34 @@ import (
|
||||
"go.probo.inc/probo/pkg/page"
|
||||
)
|
||||
|
||||
func NewTrustCenterFileConnection(
|
||||
p *page.Page[*coredata.TrustCenterFile, coredata.TrustCenterFileOrderField],
|
||||
) *TrustCenterFileConnection {
|
||||
edges := make([]*TrustCenterFileEdge, len(p.Data))
|
||||
for i, trustCenterFile := range p.Data {
|
||||
edges[i] = NewTrustCenterFileEdge(trustCenterFile, p.Cursor.OrderBy.Field)
|
||||
func NewCompliancePortalFileConnection(
|
||||
p *page.Page[*coredata.CompliancePortalFile, coredata.CompliancePortalFileOrderField],
|
||||
) *CompliancePortalFileConnection {
|
||||
edges := make([]*CompliancePortalFileEdge, len(p.Data))
|
||||
for i, portalFile := range p.Data {
|
||||
edges[i] = NewCompliancePortalFileEdge(portalFile, p.Cursor.OrderBy.Field)
|
||||
}
|
||||
|
||||
return &TrustCenterFileConnection{
|
||||
return &CompliancePortalFileConnection{
|
||||
Edges: edges,
|
||||
PageInfo: NewPageInfo(p),
|
||||
}
|
||||
}
|
||||
|
||||
func NewTrustCenterFile(f *coredata.TrustCenterFile) *TrustCenterFile {
|
||||
return &TrustCenterFile{
|
||||
func NewCompliancePortalFile(f *coredata.CompliancePortalFile) *CompliancePortalFile {
|
||||
return &CompliancePortalFile{
|
||||
ID: f.ID,
|
||||
Name: f.Name,
|
||||
Category: f.Category,
|
||||
}
|
||||
}
|
||||
|
||||
func NewTrustCenterFileEdge(f *coredata.TrustCenterFile, orderField coredata.TrustCenterFileOrderField) *TrustCenterFileEdge {
|
||||
return &TrustCenterFileEdge{
|
||||
Node: NewTrustCenterFile(f),
|
||||
func NewCompliancePortalFileEdge(
|
||||
f *coredata.CompliancePortalFile,
|
||||
orderField coredata.CompliancePortalFileOrderField,
|
||||
) *CompliancePortalFileEdge {
|
||||
return &CompliancePortalFileEdge{
|
||||
Node: NewCompliancePortalFile(f),
|
||||
Cursor: f.CursorKey(orderField),
|
||||
}
|
||||
}
|
||||
@@ -25,31 +25,36 @@ import (
|
||||
"go.probo.inc/probo/pkg/page"
|
||||
)
|
||||
|
||||
func NewTrustCenterReference(tcc *coredata.TrustCenterReference) *TrustCenterReference {
|
||||
return &TrustCenterReference{
|
||||
ID: tcc.ID,
|
||||
Name: tcc.Name,
|
||||
Description: tcc.Description,
|
||||
WebsiteURL: tcc.WebsiteURL,
|
||||
func NewCompliancePortalReference(ref *coredata.CompliancePortalReference) *CompliancePortalReference {
|
||||
return &CompliancePortalReference{
|
||||
ID: ref.ID,
|
||||
Name: ref.Name,
|
||||
Description: ref.Description,
|
||||
WebsiteURL: ref.WebsiteURL,
|
||||
}
|
||||
}
|
||||
|
||||
func NewTrustCenterReferenceConnection(p *page.Page[*coredata.TrustCenterReference, coredata.TrustCenterReferenceOrderField]) *TrustCenterReferenceConnection {
|
||||
edges := make([]*TrustCenterReferenceEdge, len(p.Data))
|
||||
func NewCompliancePortalReferenceConnection(
|
||||
p *page.Page[*coredata.CompliancePortalReference, coredata.CompliancePortalReferenceOrderField],
|
||||
) *CompliancePortalReferenceConnection {
|
||||
edges := make([]*CompliancePortalReferenceEdge, len(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,
|
||||
PageInfo: NewPageInfo(p),
|
||||
}
|
||||
}
|
||||
|
||||
func NewTrustCenterReferenceEdge(tcc *coredata.TrustCenterReference, orderBy coredata.TrustCenterReferenceOrderField) *TrustCenterReferenceEdge {
|
||||
return &TrustCenterReferenceEdge{
|
||||
Cursor: tcc.CursorKey(orderBy),
|
||||
Node: NewTrustCenterReference(tcc),
|
||||
func NewCompliancePortalReferenceEdge(
|
||||
ref *coredata.CompliancePortalReference,
|
||||
orderBy coredata.CompliancePortalReferenceOrderField,
|
||||
) *CompliancePortalReferenceEdge {
|
||||
return &CompliancePortalReferenceEdge{
|
||||
Cursor: ref.CursorKey(orderBy),
|
||||
Node: NewCompliancePortalReference(ref),
|
||||
}
|
||||
}
|
||||
@@ -78,7 +78,7 @@ type (
|
||||
func NewMux(
|
||||
logger *log.Logger,
|
||||
svc *iam.Service,
|
||||
trustSvc *visitor.Service,
|
||||
visitorSvc *visitor.Service,
|
||||
cookieConfig securecookie.Config,
|
||||
tokenSecret string,
|
||||
fileManagerSvc *filemanager.Service,
|
||||
|
||||
@@ -379,13 +379,13 @@ func (r *mutationResolver) CreateAudit(ctx context.Context, input types.CreateAu
|
||||
}
|
||||
|
||||
req := probo.CreateAuditRequest{
|
||||
OrganizationID: input.OrganizationID,
|
||||
FrameworkID: input.FrameworkID,
|
||||
Name: input.Name,
|
||||
ValidFrom: input.ValidFrom,
|
||||
ValidUntil: input.ValidUntil,
|
||||
State: input.State,
|
||||
TrustCenterVisibility: input.TrustCenterVisibility,
|
||||
OrganizationID: input.OrganizationID,
|
||||
FrameworkID: input.FrameworkID,
|
||||
Name: input.Name,
|
||||
ValidFrom: input.ValidFrom,
|
||||
ValidUntil: input.ValidUntil,
|
||||
State: input.State,
|
||||
CompliancePortalVisibility: input.CompliancePortalVisibility,
|
||||
}
|
||||
|
||||
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{
|
||||
ID: input.ID,
|
||||
Name: gqlutils.UnwrapOmittable(input.Name),
|
||||
ValidFrom: input.ValidFrom,
|
||||
ValidUntil: input.ValidUntil,
|
||||
State: input.State,
|
||||
TrustCenterVisibility: input.TrustCenterVisibility,
|
||||
ID: input.ID,
|
||||
Name: gqlutils.UnwrapOmittable(input.Name),
|
||||
ValidFrom: input.ValidFrom,
|
||||
ValidUntil: input.ValidUntil,
|
||||
State: input.State,
|
||||
CompliancePortalVisibility: input.CompliancePortalVisibility,
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
case coredata.TrustCenterEntityType:
|
||||
case coredata.CompliancePortalEntityType:
|
||||
action = management.ActionCompliancePortalGet
|
||||
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 {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return types.NewTrustCenter(trustCenter), nil
|
||||
return types.NewCompliancePortal(compliancePortal), nil
|
||||
}
|
||||
case coredata.TrustCenterAccessEntityType:
|
||||
case coredata.CompliancePortalAccessEntityType:
|
||||
action = management.ActionCompliancePortalAccessGet
|
||||
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 {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return types.NewTrustCenterAccess(trustCenterAccess), nil
|
||||
return types.NewCompliancePortalAccess(compliancePortalAccess), nil
|
||||
}
|
||||
case coredata.RightsRequestEntityType:
|
||||
action = probo.ActionRightsRequestGet
|
||||
|
||||
@@ -154,17 +154,17 @@ func (r *customDomainResolver) Permission(ctx context.Context, obj *types.Custom
|
||||
return r.Resolver.Permission(ctx, obj, action)
|
||||
}
|
||||
|
||||
// UpdateTrustCenter is the resolver for the updateTrustCenter field.
|
||||
func (r *mutationResolver) UpdateTrustCenter(ctx context.Context, input types.UpdateTrustCenterInput) (*types.UpdateTrustCenterPayload, error) {
|
||||
scope, err := r.authorize(ctx, input.TrustCenterID, management.ActionCompliancePortalUpdate)
|
||||
// UpdateCompliancePortal is the resolver for the updateCompliancePortal field.
|
||||
func (r *mutationResolver) UpdateCompliancePortal(ctx context.Context, input types.UpdateCompliancePortalInput) (*types.UpdateCompliancePortalPayload, error) {
|
||||
scope, err := r.authorize(ctx, input.CompliancePortalID, management.ActionCompliancePortalUpdate)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
trustCenter, _, err := r.management.Update(
|
||||
compliancePortal, _, err := r.management.Update(
|
||||
ctx, scope,
|
||||
&management.UpdateRequest{
|
||||
ID: input.TrustCenterID,
|
||||
ID: input.CompliancePortalID,
|
||||
Active: input.Active,
|
||||
SearchEngineIndexing: input.SearchEngineIndexing,
|
||||
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)
|
||||
}
|
||||
|
||||
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 &types.UpdateTrustCenterPayload{
|
||||
TrustCenter: types.NewTrustCenter(trustCenter),
|
||||
return &types.UpdateCompliancePortalPayload{
|
||||
CompliancePortal: types.NewCompliancePortal(compliancePortal),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// UploadTrustCenterNda is the resolver for the uploadTrustCenterNDA field.
|
||||
func (r *mutationResolver) UploadTrustCenterNda(ctx context.Context, input types.UploadTrustCenterNDAInput) (*types.UploadTrustCenterNDAPayload, error) {
|
||||
scope, err := r.authorize(ctx, input.TrustCenterID, management.ActionCompliancePortalNonDisclosureAgreementUpload)
|
||||
// UploadCompliancePortalNda is the resolver for the uploadCompliancePortalNDA field.
|
||||
func (r *mutationResolver) UploadCompliancePortalNda(ctx context.Context, input types.UploadCompliancePortalNDAInput) (*types.UploadCompliancePortalNDAPayload, error) {
|
||||
scope, err := r.authorize(ctx, input.CompliancePortalID, management.ActionCompliancePortalNonDisclosureAgreementUpload)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
trustCenter, _, err := r.management.UploadNDA(
|
||||
compliancePortal, _, err := r.management.UploadNDA(
|
||||
ctx, scope,
|
||||
&management.UploadNDARequest{
|
||||
TrustCenterID: input.TrustCenterID,
|
||||
File: input.File.File,
|
||||
FileName: input.FileName,
|
||||
CompliancePortalID: input.CompliancePortalID,
|
||||
File: input.File.File,
|
||||
FileName: input.FileName,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
@@ -209,43 +209,43 @@ func (r *mutationResolver) UploadTrustCenterNda(ctx context.Context, input types
|
||||
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 &types.UploadTrustCenterNDAPayload{
|
||||
TrustCenter: types.NewTrustCenter(trustCenter),
|
||||
return &types.UploadCompliancePortalNDAPayload{
|
||||
CompliancePortal: types.NewCompliancePortal(compliancePortal),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// DeleteTrustCenterNda is the resolver for the deleteTrustCenterNDA field.
|
||||
func (r *mutationResolver) DeleteTrustCenterNda(ctx context.Context, input types.DeleteTrustCenterNDAInput) (*types.DeleteTrustCenterNDAPayload, error) {
|
||||
scope, err := r.authorize(ctx, input.TrustCenterID, management.ActionCompliancePortalNonDisclosureAgreementDelete)
|
||||
// DeleteCompliancePortalNda is the resolver for the deleteCompliancePortalNDA field.
|
||||
func (r *mutationResolver) DeleteCompliancePortalNda(ctx context.Context, input types.DeleteCompliancePortalNDAInput) (*types.DeleteCompliancePortalNDAPayload, error) {
|
||||
scope, err := r.authorize(ctx, input.CompliancePortalID, management.ActionCompliancePortalNonDisclosureAgreementDelete)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
trustCenter, _, err := r.management.DeleteNDA(ctx, scope, input.TrustCenterID)
|
||||
compliancePortal, _, err := r.management.DeleteNDA(ctx, scope, input.CompliancePortalID)
|
||||
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 &types.DeleteTrustCenterNDAPayload{
|
||||
TrustCenter: types.NewTrustCenter(trustCenter),
|
||||
return &types.DeleteCompliancePortalNDAPayload{
|
||||
CompliancePortal: types.NewCompliancePortal(compliancePortal),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// UpdateTrustCenterBrand is the resolver for the updateTrustCenterBrand field.
|
||||
func (r *mutationResolver) UpdateTrustCenterBrand(ctx context.Context, input types.UpdateTrustCenterBrandInput) (*types.UpdateTrustCenterBrandPayload, error) {
|
||||
scope, err := r.authorize(ctx, input.TrustCenterID, management.ActionCompliancePortalUpdate)
|
||||
// UpdateCompliancePortalBrand is the resolver for the updateCompliancePortalBrand field.
|
||||
func (r *mutationResolver) UpdateCompliancePortalBrand(ctx context.Context, input types.UpdateCompliancePortalBrandInput) (*types.UpdateCompliancePortalBrandPayload, error) {
|
||||
scope, err := r.authorize(ctx, input.CompliancePortalID, management.ActionCompliancePortalUpdate)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
req := &management.UpdateBrandRequest{
|
||||
TrustCenterID: input.TrustCenterID,
|
||||
CompliancePortalID: input.CompliancePortalID,
|
||||
}
|
||||
|
||||
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 validationErrors, ok := errors.AsType[validator.ValidationErrors](err); ok {
|
||||
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 &types.UpdateTrustCenterBrandPayload{
|
||||
TrustCenter: types.NewTrustCenter(trustCenter),
|
||||
return &types.UpdateCompliancePortalBrandPayload{
|
||||
CompliancePortal: types.NewCompliancePortal(compliancePortal),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// UpdateTrustCenterAccess is the resolver for the updateTrustCenterAccess field.
|
||||
func (r *mutationResolver) UpdateTrustCenterAccess(ctx context.Context, input types.UpdateTrustCenterAccessInput) (*types.UpdateTrustCenterAccessPayload, error) {
|
||||
// UpdateCompliancePortalAccess is the resolver for the updateCompliancePortalAccess field.
|
||||
func (r *mutationResolver) UpdateCompliancePortalAccess(ctx context.Context, input types.UpdateCompliancePortalAccessInput) (*types.UpdateCompliancePortalAccessPayload, error) {
|
||||
scope, err := r.authorize(ctx, input.ID, management.ActionCompliancePortalAccessUpdate)
|
||||
if err != nil {
|
||||
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{
|
||||
ID: fileAccess.ID,
|
||||
Status: fileAccess.Status,
|
||||
@@ -335,10 +335,10 @@ func (r *mutationResolver) UpdateTrustCenterAccess(ctx context.Context, input ty
|
||||
access, err := r.management.UpdateAccess(
|
||||
ctx, scope,
|
||||
&management.UpdateAccessRequest{
|
||||
ID: input.ID,
|
||||
DocumentAccesses: documentAccesses,
|
||||
ReportAccesses: reportAccesses,
|
||||
TrustCenterFileAccesses: fileAccesses,
|
||||
ID: input.ID,
|
||||
DocumentAccesses: documentAccesses,
|
||||
ReportAccesses: reportAccesses,
|
||||
CompliancePortalFileAccesses: fileAccesses,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
@@ -346,36 +346,36 @@ func (r *mutationResolver) UpdateTrustCenterAccess(ctx context.Context, input ty
|
||||
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 &types.UpdateTrustCenterAccessPayload{
|
||||
TrustCenterAccess: types.NewTrustCenterAccess(access),
|
||||
return &types.UpdateCompliancePortalAccessPayload{
|
||||
CompliancePortalAccess: types.NewCompliancePortalAccess(access),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// DeleteTrustCenterAccess is the resolver for the deleteTrustCenterAccess field.
|
||||
func (r *mutationResolver) DeleteTrustCenterAccess(ctx context.Context, input types.DeleteTrustCenterAccessInput) (*types.DeleteTrustCenterAccessPayload, error) {
|
||||
// DeleteCompliancePortalAccess is the resolver for the deleteCompliancePortalAccess field.
|
||||
func (r *mutationResolver) DeleteCompliancePortalAccess(ctx context.Context, input types.DeleteCompliancePortalAccessInput) (*types.DeleteCompliancePortalAccessPayload, error) {
|
||||
scope, err := r.authorize(ctx, input.ID, management.ActionCompliancePortalAccessDelete)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
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 &types.DeleteTrustCenterAccessPayload{
|
||||
DeletedTrustCenterAccessID: input.ID,
|
||||
return &types.DeleteCompliancePortalAccessPayload{
|
||||
DeletedCompliancePortalAccessID: input.ID,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// CreateTrustCenterReference is the resolver for the createTrustCenterReference field.
|
||||
func (r *mutationResolver) CreateTrustCenterReference(ctx context.Context, input types.CreateTrustCenterReferenceInput) (*types.CreateTrustCenterReferencePayload, error) {
|
||||
scope, err := r.authorize(ctx, input.TrustCenterID, management.ActionCompliancePortalReferenceCreate)
|
||||
// CreateCompliancePortalReference is the resolver for the createCompliancePortalReference field.
|
||||
func (r *mutationResolver) CreateCompliancePortalReference(ctx context.Context, input types.CreateCompliancePortalReferenceInput) (*types.CreateCompliancePortalReferencePayload, error) {
|
||||
scope, err := r.authorize(ctx, input.CompliancePortalID, management.ActionCompliancePortalReferenceCreate)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -383,10 +383,10 @@ func (r *mutationResolver) CreateTrustCenterReference(ctx context.Context, input
|
||||
reference, err := r.management.CreateReference(
|
||||
ctx, scope,
|
||||
&management.CreateReferenceRequest{
|
||||
TrustCenterID: input.TrustCenterID,
|
||||
Name: input.Name,
|
||||
Description: input.Description,
|
||||
WebsiteURL: input.WebsiteURL,
|
||||
CompliancePortalID: input.CompliancePortalID,
|
||||
Name: input.Name,
|
||||
Description: input.Description,
|
||||
WebsiteURL: input.WebsiteURL,
|
||||
LogoFile: management.File{
|
||||
Content: input.LogoFile.File,
|
||||
Filename: input.LogoFile.Filename,
|
||||
@@ -400,18 +400,18 @@ func (r *mutationResolver) CreateTrustCenterReference(ctx context.Context, input
|
||||
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 &types.CreateTrustCenterReferencePayload{
|
||||
TrustCenterReferenceEdge: types.NewTrustCenterReferenceEdge(reference, coredata.TrustCenterReferenceOrderFieldRank),
|
||||
return &types.CreateCompliancePortalReferencePayload{
|
||||
CompliancePortalReferenceEdge: types.NewCompliancePortalReferenceEdge(reference, coredata.CompliancePortalReferenceOrderFieldRank),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// UpdateTrustCenterReference is the resolver for the updateTrustCenterReference field.
|
||||
func (r *mutationResolver) UpdateTrustCenterReference(ctx context.Context, input types.UpdateTrustCenterReferenceInput) (*types.UpdateTrustCenterReferencePayload, error) {
|
||||
// UpdateCompliancePortalReference is the resolver for the updateCompliancePortalReference field.
|
||||
func (r *mutationResolver) UpdateCompliancePortalReference(ctx context.Context, input types.UpdateCompliancePortalReferenceInput) (*types.UpdateCompliancePortalReferencePayload, error) {
|
||||
scope, err := r.authorize(ctx, input.ID, management.ActionCompliancePortalReferenceUpdate)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -440,36 +440,36 @@ func (r *mutationResolver) UpdateTrustCenterReference(ctx context.Context, input
|
||||
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 &types.UpdateTrustCenterReferencePayload{
|
||||
TrustCenterReference: types.NewTrustCenterReference(reference),
|
||||
return &types.UpdateCompliancePortalReferencePayload{
|
||||
CompliancePortalReference: types.NewCompliancePortalReference(reference),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// DeleteTrustCenterReference is the resolver for the deleteTrustCenterReference field.
|
||||
func (r *mutationResolver) DeleteTrustCenterReference(ctx context.Context, input types.DeleteTrustCenterReferenceInput) (*types.DeleteTrustCenterReferencePayload, error) {
|
||||
// DeleteCompliancePortalReference is the resolver for the deleteCompliancePortalReference field.
|
||||
func (r *mutationResolver) DeleteCompliancePortalReference(ctx context.Context, input types.DeleteCompliancePortalReferenceInput) (*types.DeleteCompliancePortalReferencePayload, error) {
|
||||
scope, err := r.authorize(ctx, input.ID, management.ActionCompliancePortalReferenceDelete)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
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 &types.DeleteTrustCenterReferencePayload{
|
||||
DeletedTrustCenterReferenceID: input.ID,
|
||||
return &types.DeleteCompliancePortalReferencePayload{
|
||||
DeletedCompliancePortalReferenceID: input.ID,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// CreateCompliancePortalCommitmentGroup is the resolver for the createCompliancePortalCommitmentGroup field.
|
||||
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 {
|
||||
return nil, err
|
||||
}
|
||||
@@ -477,9 +477,9 @@ func (r *mutationResolver) CreateCompliancePortalCommitmentGroup(ctx context.Con
|
||||
group, err := r.management.CreateCommitmentGroup(
|
||||
ctx, scope,
|
||||
&management.CreateCompliancePortalCommitmentGroupRequest{
|
||||
TrustCenterID: input.TrustCenterID,
|
||||
Title: input.Title,
|
||||
Description: input.Description,
|
||||
CompliancePortalID: input.CompliancePortalID,
|
||||
Title: input.Title,
|
||||
Description: input.Description,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
@@ -629,7 +629,7 @@ func (r *mutationResolver) DeleteCompliancePortalCommitment(ctx context.Context,
|
||||
|
||||
// CreateComplianceFramework is the resolver for the createComplianceFramework field.
|
||||
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 {
|
||||
return nil, err
|
||||
}
|
||||
@@ -637,8 +637,8 @@ func (r *mutationResolver) CreateComplianceFramework(ctx context.Context, input
|
||||
cf, err := r.management.CreateFramework(
|
||||
ctx, scope,
|
||||
&management.CreateFrameworkRequest{
|
||||
TrustCenterID: input.TrustCenterID,
|
||||
FrameworkID: input.FrameworkID,
|
||||
CompliancePortalID: input.CompliancePortalID,
|
||||
FrameworkID: input.FrameworkID,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
@@ -711,7 +711,7 @@ func (r *mutationResolver) DeleteComplianceFramework(ctx context.Context, input
|
||||
|
||||
// CreateComplianceCustomLink is the resolver for the createComplianceCustomLink field.
|
||||
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 {
|
||||
return nil, err
|
||||
}
|
||||
@@ -719,9 +719,9 @@ func (r *mutationResolver) CreateComplianceCustomLink(ctx context.Context, input
|
||||
item, err := r.management.CreateCustomLink(
|
||||
ctx, scope,
|
||||
&management.CreateCustomLinkRequest{
|
||||
TrustCenterID: input.TrustCenterID,
|
||||
Name: input.Name,
|
||||
URL: input.URL,
|
||||
CompliancePortalID: input.CompliancePortalID,
|
||||
Name: input.Name,
|
||||
URL: input.URL,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
@@ -789,8 +789,8 @@ func (r *mutationResolver) DeleteComplianceCustomLink(ctx context.Context, input
|
||||
}, nil
|
||||
}
|
||||
|
||||
// CreateTrustCenterFile is the resolver for the createTrustCenterFile field.
|
||||
func (r *mutationResolver) CreateTrustCenterFile(ctx context.Context, input types.CreateTrustCenterFileInput) (*types.CreateTrustCenterFilePayload, error) {
|
||||
// CreateCompliancePortalFile is the resolver for the createCompliancePortalFile field.
|
||||
func (r *mutationResolver) CreateCompliancePortalFile(ctx context.Context, input types.CreateCompliancePortalFileInput) (*types.CreateCompliancePortalFilePayload, error) {
|
||||
scope, err := r.authorize(ctx, input.OrganizationID, management.ActionCompliancePortalFileCreate)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -808,7 +808,7 @@ func (r *mutationResolver) CreateTrustCenterFile(ctx context.Context, input type
|
||||
Size: input.File.Size,
|
||||
ContentType: input.File.ContentType,
|
||||
},
|
||||
TrustCenterVisibility: input.TrustCenterVisibility,
|
||||
CompliancePortalVisibility: input.CompliancePortalVisibility,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
@@ -816,18 +816,18 @@ func (r *mutationResolver) CreateTrustCenterFile(ctx context.Context, input type
|
||||
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 &types.CreateTrustCenterFilePayload{
|
||||
TrustCenterFileEdge: types.NewTrustCenterFileEdge(file, coredata.TrustCenterFileOrderFieldCreatedAt),
|
||||
return &types.CreateCompliancePortalFilePayload{
|
||||
CompliancePortalFileEdge: types.NewCompliancePortalFileEdge(file, coredata.CompliancePortalFileOrderFieldCreatedAt),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// UpdateTrustCenterFile is the resolver for the updateTrustCenterFile field.
|
||||
func (r *mutationResolver) UpdateTrustCenterFile(ctx context.Context, input types.UpdateTrustCenterFileInput) (*types.UpdateTrustCenterFilePayload, error) {
|
||||
// UpdateCompliancePortalFile is the resolver for the updateCompliancePortalFile field.
|
||||
func (r *mutationResolver) UpdateCompliancePortalFile(ctx context.Context, input types.UpdateCompliancePortalFileInput) (*types.UpdateCompliancePortalFilePayload, error) {
|
||||
scope, err := r.authorize(ctx, input.ID, management.ActionCompliancePortalFileUpdate)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -836,10 +836,10 @@ func (r *mutationResolver) UpdateTrustCenterFile(ctx context.Context, input type
|
||||
file, err := r.management.UpdateFile(
|
||||
ctx, scope,
|
||||
&management.UpdateFileRequest{
|
||||
ID: input.ID,
|
||||
Name: input.Name,
|
||||
Category: input.Category,
|
||||
TrustCenterVisibility: input.TrustCenterVisibility,
|
||||
ID: input.ID,
|
||||
Name: input.Name,
|
||||
Category: input.Category,
|
||||
CompliancePortalVisibility: input.CompliancePortalVisibility,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
@@ -847,18 +847,18 @@ func (r *mutationResolver) UpdateTrustCenterFile(ctx context.Context, input type
|
||||
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 &types.UpdateTrustCenterFilePayload{
|
||||
TrustCenterFile: types.NewTrustCenterFile(file),
|
||||
return &types.UpdateCompliancePortalFilePayload{
|
||||
CompliancePortalFile: types.NewCompliancePortalFile(file),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// GetTrustCenterFile is the resolver for the getTrustCenterFile field.
|
||||
func (r *mutationResolver) GetTrustCenterFile(ctx context.Context, input types.GetTrustCenterFileInput) (*types.GetTrustCenterFilePayload, error) {
|
||||
// GetCompliancePortalFile is the resolver for the getCompliancePortalFile field.
|
||||
func (r *mutationResolver) GetCompliancePortalFile(ctx context.Context, input types.GetCompliancePortalFileInput) (*types.GetCompliancePortalFilePayload, error) {
|
||||
scope, err := r.authorize(ctx, input.ID, management.ActionCompliancePortalFileGet)
|
||||
if err != nil {
|
||||
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)
|
||||
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 &types.GetTrustCenterFilePayload{
|
||||
TrustCenterFile: types.NewTrustCenterFile(file),
|
||||
return &types.GetCompliancePortalFilePayload{
|
||||
CompliancePortalFile: types.NewCompliancePortalFile(file),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// DeleteTrustCenterFile is the resolver for the deleteTrustCenterFile field.
|
||||
func (r *mutationResolver) DeleteTrustCenterFile(ctx context.Context, input types.DeleteTrustCenterFileInput) (*types.DeleteTrustCenterFilePayload, error) {
|
||||
// DeleteCompliancePortalFile is the resolver for the deleteCompliancePortalFile field.
|
||||
func (r *mutationResolver) DeleteCompliancePortalFile(ctx context.Context, input types.DeleteCompliancePortalFileInput) (*types.DeleteCompliancePortalFilePayload, error) {
|
||||
scope, err := r.authorize(ctx, input.ID, management.ActionCompliancePortalFileDelete)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
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 &types.DeleteTrustCenterFilePayload{
|
||||
DeletedTrustCenterFileID: input.ID,
|
||||
return &types.DeleteCompliancePortalFilePayload{
|
||||
DeletedCompliancePortalFileID: input.ID,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// CreateCustomDomain is the resolver for the createCustomDomain field.
|
||||
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 {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
domain, err := r.management.AddCustomDomain(
|
||||
ctx, scope,
|
||||
input.TrustCenterID,
|
||||
input.CompliancePortalID,
|
||||
input.Domain,
|
||||
)
|
||||
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.
|
||||
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 {
|
||||
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.
|
||||
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 {
|
||||
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.
|
||||
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)
|
||||
if err != nil {
|
||||
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.
|
||||
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)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
trustCenter, err := r.management.Get(ctx, scope, obj.ID)
|
||||
compliancePortal, err := r.management.Get(ctx, scope, obj.ID)
|
||||
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)
|
||||
}
|
||||
|
||||
organization, err := r.probo.Organizations.Get(ctx, scope, trustCenter.OrganizationID)
|
||||
organization, err := r.probo.Organizations.Get(ctx, scope, compliancePortal.OrganizationID)
|
||||
if err != nil {
|
||||
if errors.Is(err, coredata.ErrResourceNotFound) {
|
||||
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.
|
||||
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)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.TrustCenterAccessOrderField]{
|
||||
Field: coredata.TrustCenterAccessOrderFieldCreatedAt,
|
||||
pageOrderBy := page.OrderBy[coredata.CompliancePortalAccessOrderField]{
|
||||
Field: coredata.CompliancePortalAccessOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.TrustCenterAccessOrderField]{
|
||||
pageOrderBy = page.OrderBy[coredata.CompliancePortalAccessOrderField]{
|
||||
Field: orderBy.Field,
|
||||
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)
|
||||
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 types.NewTrustCenterAccessConnection(result), nil
|
||||
return types.NewCompliancePortalAccessConnection(result), nil
|
||||
}
|
||||
|
||||
// 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)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.TrustCenterReferenceOrderField]{
|
||||
Field: coredata.TrustCenterReferenceOrderFieldRank,
|
||||
pageOrderBy := page.OrderBy[coredata.CompliancePortalReferenceOrderField]{
|
||||
Field: coredata.CompliancePortalReferenceOrderFieldRank,
|
||||
Direction: page.OrderDirectionAsc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.TrustCenterReferenceOrderField]{
|
||||
pageOrderBy = page.OrderBy[coredata.CompliancePortalReferenceOrderField]{
|
||||
Field: orderBy.Field,
|
||||
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)
|
||||
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 types.NewTrustCenterReferenceConnection(result, obj.ID), nil
|
||||
return types.NewCompliancePortalReferenceConnection(result, obj.ID), nil
|
||||
}
|
||||
|
||||
// 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)
|
||||
if err != nil {
|
||||
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.
|
||||
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)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -1134,7 +1134,7 @@ func (r *trustCenterResolver) ComplianceFrameworks(ctx context.Context, obj *typ
|
||||
}
|
||||
|
||||
// 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)
|
||||
if err != nil {
|
||||
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.
|
||||
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)
|
||||
if err != nil {
|
||||
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)
|
||||
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)
|
||||
}
|
||||
|
||||
@@ -1188,7 +1188,7 @@ func (r *trustCenterResolver) MailingList(ctx context.Context, obj *types.TrustC
|
||||
}
|
||||
|
||||
// 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 {
|
||||
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.
|
||||
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 {
|
||||
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.
|
||||
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)
|
||||
if err != nil {
|
||||
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)
|
||||
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)
|
||||
}
|
||||
|
||||
@@ -1254,12 +1254,12 @@ func (r *trustCenterResolver) PublicURL(ctx context.Context, obj *types.TrustCen
|
||||
}
|
||||
|
||||
// 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)
|
||||
}
|
||||
|
||||
// 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)
|
||||
if err != nil {
|
||||
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)
|
||||
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 {
|
||||
@@ -1283,7 +1283,7 @@ func (r *trustCenterAccessResolver) NdaSignature(ctx context.Context, obj *types
|
||||
}
|
||||
|
||||
// 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)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
@@ -1299,7 +1299,7 @@ func (r *trustCenterAccessResolver) PendingRequestCount(ctx context.Context, obj
|
||||
}
|
||||
|
||||
// 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)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
@@ -1315,7 +1315,7 @@ func (r *trustCenterAccessResolver) ActiveCount(ctx context.Context, obj *types.
|
||||
}
|
||||
|
||||
// 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 {
|
||||
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.
|
||||
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)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.TrustCenterDocumentAccessOrderField]{
|
||||
Field: coredata.TrustCenterDocumentAccessOrderFieldCreatedAt,
|
||||
pageOrderBy := page.OrderBy[coredata.CompliancePortalDocumentAccessOrderField]{
|
||||
Field: coredata.CompliancePortalDocumentAccessOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.TrustCenterDocumentAccessOrderField]{
|
||||
pageOrderBy = page.OrderBy[coredata.CompliancePortalDocumentAccessOrderField]{
|
||||
Field: orderBy.Field,
|
||||
Direction: orderBy.Direction,
|
||||
}
|
||||
@@ -1357,20 +1357,20 @@ func (r *trustCenterAccessResolver) AvailableDocumentAccesses(ctx context.Contex
|
||||
|
||||
result, err := r.management.ListAvailableDocumentAccesses(ctx, scope, obj.ID, cursor)
|
||||
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 types.NewTrustCenterDocumentAccessConnection(result, obj, obj.ID), nil
|
||||
return types.NewCompliancePortalDocumentAccessConnection(result, obj, obj.ID), nil
|
||||
}
|
||||
|
||||
// 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)
|
||||
}
|
||||
|
||||
// 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)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -1395,7 +1395,7 @@ func (r *trustCenterDocumentAccessResolver) Document(ctx context.Context, obj *t
|
||||
}
|
||||
|
||||
// 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 {
|
||||
return nil, nil
|
||||
}
|
||||
@@ -1421,7 +1421,7 @@ func (r *trustCenterDocumentAccessResolver) ReportFile(ctx context.Context, obj
|
||||
}
|
||||
|
||||
// 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)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -1445,28 +1445,28 @@ func (r *trustCenterDocumentAccessResolver) Audit(ctx context.Context, obj *type
|
||||
return types.NewAudit(audit), nil
|
||||
}
|
||||
|
||||
// TrustCenterFile is the resolver for the trustCenterFile field.
|
||||
func (r *trustCenterDocumentAccessResolver) TrustCenterFile(ctx context.Context, obj *types.TrustCenterDocumentAccess) (*types.TrustCenterFile, error) {
|
||||
scope, err := r.authorize(ctx, obj.TrustCenterAccessID, management.ActionCompliancePortalFileGet)
|
||||
// CompliancePortalFile is the resolver for the compliancePortalFile field.
|
||||
func (r *compliancePortalDocumentAccessResolver) CompliancePortalFile(ctx context.Context, obj *types.CompliancePortalDocumentAccess) (*types.CompliancePortalFile, error) {
|
||||
scope, err := r.authorize(ctx, obj.CompliancePortalAccessID, management.ActionCompliancePortalFileGet)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if obj.TrustCenterFileID == nil {
|
||||
if obj.CompliancePortalFileID == 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 {
|
||||
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 types.NewTrustCenterFile(trustCenterFile), nil
|
||||
return types.NewCompliancePortalFile(compliancePortalFile), nil
|
||||
}
|
||||
|
||||
// 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)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
@@ -1474,7 +1474,7 @@ func (r *trustCenterDocumentAccessConnectionResolver) TotalCount(ctx context.Con
|
||||
|
||||
count, err := r.management.CountDocumentAccesses(ctx, scope, obj.ParentID)
|
||||
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)
|
||||
}
|
||||
|
||||
@@ -1482,7 +1482,7 @@ func (r *trustCenterDocumentAccessConnectionResolver) TotalCount(ctx context.Con
|
||||
}
|
||||
|
||||
// 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 {
|
||||
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.
|
||||
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)
|
||||
if err != nil {
|
||||
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.
|
||||
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)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
trustCenterFile, err := r.management.GetFile(ctx, scope, obj.ID)
|
||||
compliancePortalFile, err := r.management.GetFile(ctx, scope, obj.ID)
|
||||
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)
|
||||
}
|
||||
|
||||
organization, err := r.probo.Organizations.Get(ctx, scope, trustCenterFile.OrganizationID)
|
||||
organization, err := r.probo.Organizations.Get(ctx, scope, compliancePortalFile.OrganizationID)
|
||||
if err != nil {
|
||||
if errors.Is(err, coredata.ErrResourceNotFound) {
|
||||
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.
|
||||
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)
|
||||
}
|
||||
|
||||
// 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)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
@@ -1541,7 +1541,7 @@ func (r *trustCenterFileConnectionResolver) TotalCount(ctx context.Context, obj
|
||||
|
||||
count, err := r.management.CountFilesForOrganizationID(ctx, scope, obj.ParentID)
|
||||
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)
|
||||
}
|
||||
|
||||
@@ -1549,7 +1549,7 @@ func (r *trustCenterFileConnectionResolver) TotalCount(ctx context.Context, obj
|
||||
}
|
||||
|
||||
// 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 {
|
||||
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.
|
||||
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)
|
||||
}
|
||||
|
||||
// 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)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
@@ -1571,7 +1571,7 @@ func (r *trustCenterReferenceConnectionResolver) TotalCount(ctx context.Context,
|
||||
|
||||
count, err := r.management.CountReferences(ctx, scope, obj.ParentID)
|
||||
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)
|
||||
}
|
||||
|
||||
@@ -1611,42 +1611,44 @@ func (r *Resolver) CompliancePortalCommitmentGroupConnection() schema.Compliance
|
||||
// CustomDomain returns schema.CustomDomainResolver implementation.
|
||||
func (r *Resolver) CustomDomain() schema.CustomDomainResolver { return &customDomainResolver{r} }
|
||||
|
||||
// TrustCenter returns schema.TrustCenterResolver implementation.
|
||||
func (r *Resolver) TrustCenter() schema.TrustCenterResolver { return &trustCenterResolver{r} }
|
||||
|
||||
// TrustCenterAccess returns schema.TrustCenterAccessResolver implementation.
|
||||
func (r *Resolver) TrustCenterAccess() schema.TrustCenterAccessResolver {
|
||||
return &trustCenterAccessResolver{r}
|
||||
// CompliancePortal returns schema.CompliancePortalResolver implementation.
|
||||
func (r *Resolver) CompliancePortal() schema.CompliancePortalResolver {
|
||||
return &compliancePortalResolver{r}
|
||||
}
|
||||
|
||||
// TrustCenterDocumentAccess returns schema.TrustCenterDocumentAccessResolver implementation.
|
||||
func (r *Resolver) TrustCenterDocumentAccess() schema.TrustCenterDocumentAccessResolver {
|
||||
return &trustCenterDocumentAccessResolver{r}
|
||||
// CompliancePortalAccess returns schema.CompliancePortalAccessResolver implementation.
|
||||
func (r *Resolver) CompliancePortalAccess() schema.CompliancePortalAccessResolver {
|
||||
return &compliancePortalAccessResolver{r}
|
||||
}
|
||||
|
||||
// TrustCenterDocumentAccessConnection returns schema.TrustCenterDocumentAccessConnectionResolver implementation.
|
||||
func (r *Resolver) TrustCenterDocumentAccessConnection() schema.TrustCenterDocumentAccessConnectionResolver {
|
||||
return &trustCenterDocumentAccessConnectionResolver{r}
|
||||
// CompliancePortalDocumentAccess returns schema.CompliancePortalDocumentAccessResolver implementation.
|
||||
func (r *Resolver) CompliancePortalDocumentAccess() schema.CompliancePortalDocumentAccessResolver {
|
||||
return &compliancePortalDocumentAccessResolver{r}
|
||||
}
|
||||
|
||||
// TrustCenterFile returns schema.TrustCenterFileResolver implementation.
|
||||
func (r *Resolver) TrustCenterFile() schema.TrustCenterFileResolver {
|
||||
return &trustCenterFileResolver{r}
|
||||
// CompliancePortalDocumentAccessConnection returns schema.CompliancePortalDocumentAccessConnectionResolver implementation.
|
||||
func (r *Resolver) CompliancePortalDocumentAccessConnection() schema.CompliancePortalDocumentAccessConnectionResolver {
|
||||
return &compliancePortalDocumentAccessConnectionResolver{r}
|
||||
}
|
||||
|
||||
// TrustCenterFileConnection returns schema.TrustCenterFileConnectionResolver implementation.
|
||||
func (r *Resolver) TrustCenterFileConnection() schema.TrustCenterFileConnectionResolver {
|
||||
return &trustCenterFileConnectionResolver{r}
|
||||
// CompliancePortalFile returns schema.CompliancePortalFileResolver implementation.
|
||||
func (r *Resolver) CompliancePortalFile() schema.CompliancePortalFileResolver {
|
||||
return &compliancePortalFileResolver{r}
|
||||
}
|
||||
|
||||
// TrustCenterReference returns schema.TrustCenterReferenceResolver implementation.
|
||||
func (r *Resolver) TrustCenterReference() schema.TrustCenterReferenceResolver {
|
||||
return &trustCenterReferenceResolver{r}
|
||||
// CompliancePortalFileConnection returns schema.CompliancePortalFileConnectionResolver implementation.
|
||||
func (r *Resolver) CompliancePortalFileConnection() schema.CompliancePortalFileConnectionResolver {
|
||||
return &compliancePortalFileConnectionResolver{r}
|
||||
}
|
||||
|
||||
// TrustCenterReferenceConnection returns schema.TrustCenterReferenceConnectionResolver implementation.
|
||||
func (r *Resolver) TrustCenterReferenceConnection() schema.TrustCenterReferenceConnectionResolver {
|
||||
return &trustCenterReferenceConnectionResolver{r}
|
||||
// CompliancePortalReference returns schema.CompliancePortalReferenceResolver implementation.
|
||||
func (r *Resolver) CompliancePortalReference() schema.CompliancePortalReferenceResolver {
|
||||
return &compliancePortalReferenceResolver{r}
|
||||
}
|
||||
|
||||
// CompliancePortalReferenceConnection returns schema.CompliancePortalReferenceConnectionResolver implementation.
|
||||
func (r *Resolver) CompliancePortalReferenceConnection() schema.CompliancePortalReferenceConnectionResolver {
|
||||
return &compliancePortalReferenceConnectionResolver{r}
|
||||
}
|
||||
|
||||
type (
|
||||
@@ -1657,12 +1659,12 @@ type (
|
||||
compliancePortalCommitmentGroupResolver struct{ *Resolver }
|
||||
compliancePortalCommitmentGroupConnectionResolver struct{ *Resolver }
|
||||
customDomainResolver struct{ *Resolver }
|
||||
trustCenterResolver struct{ *Resolver }
|
||||
trustCenterAccessResolver struct{ *Resolver }
|
||||
trustCenterDocumentAccessResolver struct{ *Resolver }
|
||||
trustCenterDocumentAccessConnectionResolver struct{ *Resolver }
|
||||
trustCenterFileResolver struct{ *Resolver }
|
||||
trustCenterFileConnectionResolver struct{ *Resolver }
|
||||
trustCenterReferenceResolver struct{ *Resolver }
|
||||
trustCenterReferenceConnectionResolver struct{ *Resolver }
|
||||
compliancePortalResolver struct{ *Resolver }
|
||||
compliancePortalAccessResolver struct{ *Resolver }
|
||||
compliancePortalDocumentAccessResolver struct{ *Resolver }
|
||||
compliancePortalDocumentAccessConnectionResolver struct{ *Resolver }
|
||||
compliancePortalFileResolver struct{ *Resolver }
|
||||
compliancePortalFileConnectionResolver struct{ *Resolver }
|
||||
compliancePortalReferenceResolver 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(
|
||||
ctx, scope,
|
||||
probo.CreateDocumentRequest{
|
||||
OrganizationID: input.OrganizationID,
|
||||
Title: input.Title,
|
||||
Content: content,
|
||||
Classification: input.Classification,
|
||||
DocumentType: input.DocumentType,
|
||||
TrustCenterVisibility: input.TrustCenterVisibility,
|
||||
DefaultApproverIDs: input.DefaultApproverIds,
|
||||
OrganizationID: input.OrganizationID,
|
||||
Title: input.Title,
|
||||
Content: content,
|
||||
Classification: input.Classification,
|
||||
DocumentType: input.DocumentType,
|
||||
CompliancePortalVisibility: input.CompliancePortalVisibility,
|
||||
DefaultApproverIDs: input.DefaultApproverIds,
|
||||
},
|
||||
)
|
||||
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(
|
||||
ctx, scope,
|
||||
probo.UpdateDocumentRequest{
|
||||
DocumentID: input.ID,
|
||||
Title: input.Title,
|
||||
Content: input.Content,
|
||||
Classification: input.Classification,
|
||||
DocumentType: input.DocumentType,
|
||||
TrustCenterVisibility: input.TrustCenterVisibility,
|
||||
DefaultApproverIDs: defaultApproverIDs,
|
||||
DocumentID: input.ID,
|
||||
Title: input.Title,
|
||||
Content: input.Content,
|
||||
Classification: input.Classification,
|
||||
DocumentType: input.DocumentType,
|
||||
CompliancePortalVisibility: input.CompliancePortalVisibility,
|
||||
DefaultApproverIDs: defaultApproverIDs,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
|
||||
@@ -172,7 +172,7 @@ type Audit implements Node {
|
||||
filter: FindingFilter
|
||||
): FindingConnection @goField(forceResolver: true)
|
||||
|
||||
trustCenterVisibility: TrustCenterVisibility!
|
||||
compliancePortalVisibility: CompliancePortalVisibility!
|
||||
createdAt: Datetime!
|
||||
updatedAt: Datetime!
|
||||
|
||||
@@ -276,7 +276,7 @@ input CreateAuditInput {
|
||||
validFrom: Datetime
|
||||
validUntil: Datetime
|
||||
state: AuditState
|
||||
trustCenterVisibility: TrustCenterVisibility
|
||||
compliancePortalVisibility: CompliancePortalVisibility
|
||||
file: Upload
|
||||
}
|
||||
|
||||
@@ -286,7 +286,7 @@ input UpdateAuditInput {
|
||||
validFrom: Datetime
|
||||
validUntil: Datetime
|
||||
state: AuditState
|
||||
trustCenterVisibility: TrustCenterVisibility
|
||||
compliancePortalVisibility: CompliancePortalVisibility
|
||||
}
|
||||
|
||||
input DeleteAuditInput {
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
enum TrustCenterVisibility
|
||||
@goModel(model: "go.probo.inc/probo/pkg/coredata.TrustCenterVisibility") {
|
||||
enum CompliancePortalVisibility
|
||||
@goModel(model: "go.probo.inc/probo/pkg/coredata.CompliancePortalVisibility") {
|
||||
NONE
|
||||
@goEnum(
|
||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterVisibilityNone"
|
||||
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalVisibilityNone"
|
||||
)
|
||||
PRIVATE
|
||||
@goEnum(
|
||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterVisibilityPrivate"
|
||||
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalVisibilityPrivate"
|
||||
)
|
||||
PUBLIC
|
||||
@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(
|
||||
model: "go.probo.inc/probo/pkg/coredata.TrustCenterDocumentAccessStatus"
|
||||
model: "go.probo.inc/probo/pkg/coredata.CompliancePortalDocumentAccessStatus"
|
||||
) {
|
||||
REQUESTED
|
||||
@goEnum(
|
||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterDocumentAccessStatusRequested"
|
||||
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalDocumentAccessStatusRequested"
|
||||
)
|
||||
GRANTED
|
||||
@goEnum(
|
||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterDocumentAccessStatusGranted"
|
||||
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalDocumentAccessStatusGranted"
|
||||
)
|
||||
REJECTED
|
||||
@goEnum(
|
||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterDocumentAccessStatusRejected"
|
||||
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalDocumentAccessStatusRejected"
|
||||
)
|
||||
REVOKED
|
||||
@goEnum(
|
||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterDocumentAccessStatusRevoked"
|
||||
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalDocumentAccessStatusRevoked"
|
||||
)
|
||||
}
|
||||
|
||||
enum TrustCenterAccessOrderField
|
||||
enum CompliancePortalAccessOrderField
|
||||
@goModel(
|
||||
model: "go.probo.inc/probo/pkg/coredata.TrustCenterAccessOrderField"
|
||||
model: "go.probo.inc/probo/pkg/coredata.CompliancePortalAccessOrderField"
|
||||
) {
|
||||
CREATED_AT
|
||||
@goEnum(
|
||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterAccessOrderFieldCreatedAt"
|
||||
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalAccessOrderFieldCreatedAt"
|
||||
)
|
||||
}
|
||||
|
||||
enum TrustCenterAccessState
|
||||
enum CompliancePortalAccessState
|
||||
@goModel(
|
||||
model: "go.probo.inc/probo/pkg/coredata.TrustCenterAccessState"
|
||||
model: "go.probo.inc/probo/pkg/coredata.CompliancePortalAccessState"
|
||||
) {
|
||||
ACTIVE
|
||||
@goEnum(
|
||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterAccessStateActive"
|
||||
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalAccessStateActive"
|
||||
)
|
||||
INACTIVE
|
||||
@goEnum(
|
||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterAccessStateInactive"
|
||||
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalAccessStateInactive"
|
||||
)
|
||||
}
|
||||
|
||||
enum TrustCenterDocumentAccessOrderField
|
||||
enum CompliancePortalDocumentAccessOrderField
|
||||
@goModel(
|
||||
model: "go.probo.inc/probo/pkg/coredata.TrustCenterDocumentAccessOrderField"
|
||||
model: "go.probo.inc/probo/pkg/coredata.CompliancePortalDocumentAccessOrderField"
|
||||
) {
|
||||
CREATED_AT
|
||||
@goEnum(
|
||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterDocumentAccessOrderFieldCreatedAt"
|
||||
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalDocumentAccessOrderFieldCreatedAt"
|
||||
)
|
||||
}
|
||||
|
||||
enum TrustCenterReferenceOrderField
|
||||
enum CompliancePortalReferenceOrderField
|
||||
@goModel(
|
||||
model: "go.probo.inc/probo/pkg/coredata.TrustCenterReferenceOrderField"
|
||||
model: "go.probo.inc/probo/pkg/coredata.CompliancePortalReferenceOrderField"
|
||||
) {
|
||||
RANK
|
||||
@goEnum(
|
||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterReferenceOrderFieldRank"
|
||||
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalReferenceOrderFieldRank"
|
||||
)
|
||||
NAME
|
||||
@goEnum(
|
||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterReferenceOrderFieldName"
|
||||
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalReferenceOrderFieldName"
|
||||
)
|
||||
CREATED_AT
|
||||
@goEnum(
|
||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterReferenceOrderFieldCreatedAt"
|
||||
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalReferenceOrderFieldCreatedAt"
|
||||
)
|
||||
UPDATED_AT
|
||||
@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(
|
||||
model: "go.probo.inc/probo/pkg/coredata.TrustCenterFileOrderField"
|
||||
model: "go.probo.inc/probo/pkg/coredata.CompliancePortalFileOrderField"
|
||||
) {
|
||||
NAME
|
||||
@goEnum(
|
||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterFileOrderFieldName"
|
||||
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalFileOrderFieldName"
|
||||
)
|
||||
CREATED_AT
|
||||
@goEnum(
|
||||
value: "go.probo.inc/probo/pkg/coredata.TrustCenterFileOrderFieldCreatedAt"
|
||||
value: "go.probo.inc/probo/pkg/coredata.CompliancePortalFileOrderFieldCreatedAt"
|
||||
)
|
||||
UPDATED_AT
|
||||
@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")
|
||||
}
|
||||
|
||||
input TrustCenterAccessOrder
|
||||
input CompliancePortalAccessOrder
|
||||
@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!
|
||||
field: TrustCenterAccessOrderField!
|
||||
field: CompliancePortalAccessOrderField!
|
||||
}
|
||||
|
||||
input TrustCenterDocumentAccessOrder
|
||||
input CompliancePortalDocumentAccessOrder
|
||||
@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!
|
||||
field: TrustCenterDocumentAccessOrderField!
|
||||
field: CompliancePortalDocumentAccessOrderField!
|
||||
}
|
||||
|
||||
input TrustCenterReferenceOrder
|
||||
input CompliancePortalReferenceOrder
|
||||
@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!
|
||||
field: TrustCenterReferenceOrderField!
|
||||
field: CompliancePortalReferenceOrderField!
|
||||
}
|
||||
|
||||
input CompliancePortalCommitmentGroupOrder
|
||||
@@ -306,12 +306,12 @@ input CompliancePortalCommitmentOrder
|
||||
field: CompliancePortalCommitmentOrderField!
|
||||
}
|
||||
|
||||
input TrustCenterFileOrder
|
||||
input CompliancePortalFileOrder
|
||||
@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!
|
||||
field: TrustCenterFileOrderField!
|
||||
field: CompliancePortalFileOrderField!
|
||||
}
|
||||
|
||||
input ComplianceCustomLinkOrder
|
||||
@@ -330,9 +330,9 @@ input ComplianceFrameworkOrder
|
||||
field: ComplianceFrameworkOrderField!
|
||||
}
|
||||
|
||||
type TrustCenter implements Node
|
||||
type CompliancePortal implements Node
|
||||
@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!
|
||||
active: Boolean!
|
||||
@@ -354,16 +354,16 @@ type TrustCenter implements Node
|
||||
after: CursorKey
|
||||
last: Int
|
||||
before: CursorKey
|
||||
orderBy: TrustCenterAccessOrder
|
||||
): TrustCenterAccessConnection! @goField(forceResolver: true)
|
||||
orderBy: CompliancePortalAccessOrder
|
||||
): CompliancePortalAccessConnection! @goField(forceResolver: true)
|
||||
|
||||
references(
|
||||
first: Int
|
||||
after: CursorKey
|
||||
last: Int
|
||||
before: CursorKey
|
||||
orderBy: TrustCenterReferenceOrder
|
||||
): TrustCenterReferenceConnection! @goField(forceResolver: true)
|
||||
orderBy: CompliancePortalReferenceOrder
|
||||
): CompliancePortalReferenceConnection! @goField(forceResolver: true)
|
||||
|
||||
commitmentGroups(
|
||||
first: Int
|
||||
@@ -400,17 +400,17 @@ type TrustCenter implements Node
|
||||
permission(action: String!): Boolean! @goField(forceResolver: true)
|
||||
}
|
||||
|
||||
type TrustCenterConnection {
|
||||
edges: [TrustCenterEdge!]!
|
||||
type CompliancePortalConnection {
|
||||
edges: [CompliancePortalEdge!]!
|
||||
pageInfo: PageInfo!
|
||||
}
|
||||
|
||||
type TrustCenterEdge {
|
||||
type CompliancePortalEdge {
|
||||
cursor: CursorKey!
|
||||
node: TrustCenter!
|
||||
node: CompliancePortal!
|
||||
}
|
||||
|
||||
type TrustCenterAccess implements Node {
|
||||
type CompliancePortalAccess implements Node {
|
||||
id: ID!
|
||||
ndaSignature: ElectronicSignature @goField(forceResolver: true)
|
||||
createdAt: Datetime!
|
||||
@@ -427,49 +427,49 @@ type TrustCenterAccess implements Node {
|
||||
after: CursorKey
|
||||
last: Int
|
||||
before: CursorKey
|
||||
orderBy: TrustCenterDocumentAccessOrder
|
||||
): TrustCenterDocumentAccessConnection! @goField(forceResolver: true)
|
||||
orderBy: CompliancePortalDocumentAccessOrder
|
||||
): CompliancePortalDocumentAccessConnection! @goField(forceResolver: true)
|
||||
|
||||
permission(action: String!): Boolean! @goField(forceResolver: true)
|
||||
}
|
||||
|
||||
type TrustCenterDocumentAccess
|
||||
type CompliancePortalDocumentAccess
|
||||
@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!
|
||||
status: TrustCenterDocumentAccessStatus!
|
||||
status: CompliancePortalDocumentAccessStatus!
|
||||
document: Document @goField(forceResolver: true)
|
||||
reportFile: File @goField(forceResolver: true)
|
||||
audit: Audit @goField(forceResolver: true)
|
||||
trustCenterFile: TrustCenterFile @goField(forceResolver: true)
|
||||
compliancePortalFile: CompliancePortalFile @goField(forceResolver: true)
|
||||
}
|
||||
|
||||
type TrustCenterDocumentAccessConnection
|
||||
type CompliancePortalDocumentAccessConnection
|
||||
@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)
|
||||
edges: [TrustCenterDocumentAccessEdge!]!
|
||||
edges: [CompliancePortalDocumentAccessEdge!]!
|
||||
pageInfo: PageInfo!
|
||||
}
|
||||
|
||||
type TrustCenterDocumentAccessEdge {
|
||||
type CompliancePortalDocumentAccessEdge {
|
||||
cursor: CursorKey!
|
||||
node: TrustCenterDocumentAccess!
|
||||
node: CompliancePortalDocumentAccess!
|
||||
}
|
||||
|
||||
type TrustCenterAccessConnection {
|
||||
edges: [TrustCenterAccessEdge!]!
|
||||
type CompliancePortalAccessConnection {
|
||||
edges: [CompliancePortalAccessEdge!]!
|
||||
pageInfo: PageInfo!
|
||||
}
|
||||
|
||||
type TrustCenterAccessEdge {
|
||||
type CompliancePortalAccessEdge {
|
||||
cursor: CursorKey!
|
||||
node: TrustCenterAccess!
|
||||
node: CompliancePortalAccess!
|
||||
}
|
||||
|
||||
type TrustCenterReference implements Node {
|
||||
type CompliancePortalReference implements Node {
|
||||
id: ID!
|
||||
name: String!
|
||||
description: String
|
||||
@@ -482,18 +482,18 @@ type TrustCenterReference implements Node {
|
||||
permission(action: String!): Boolean! @goField(forceResolver: true)
|
||||
}
|
||||
|
||||
type TrustCenterReferenceConnection
|
||||
type CompliancePortalReferenceConnection
|
||||
@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)
|
||||
edges: [TrustCenterReferenceEdge!]!
|
||||
edges: [CompliancePortalReferenceEdge!]!
|
||||
pageInfo: PageInfo!
|
||||
}
|
||||
|
||||
type TrustCenterReferenceEdge {
|
||||
type CompliancePortalReferenceEdge {
|
||||
cursor: CursorKey!
|
||||
node: TrustCenterReference!
|
||||
node: CompliancePortalReference!
|
||||
}
|
||||
|
||||
type CompliancePortalCommitmentGroup implements Node {
|
||||
@@ -605,12 +605,12 @@ type ComplianceCustomLinkEdge {
|
||||
node: ComplianceCustomLink!
|
||||
}
|
||||
|
||||
type TrustCenterFile implements Node {
|
||||
type CompliancePortalFile implements Node {
|
||||
id: ID!
|
||||
name: String!
|
||||
category: String!
|
||||
file: File! @goField(forceResolver: true)
|
||||
trustCenterVisibility: TrustCenterVisibility!
|
||||
compliancePortalVisibility: CompliancePortalVisibility!
|
||||
alias: String @goField(forceResolver: true)
|
||||
createdAt: Datetime!
|
||||
updatedAt: Datetime!
|
||||
@@ -619,18 +619,18 @@ type TrustCenterFile implements Node {
|
||||
permission(action: String!): Boolean! @goField(forceResolver: true)
|
||||
}
|
||||
|
||||
type TrustCenterFileConnection
|
||||
type CompliancePortalFileConnection
|
||||
@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)
|
||||
edges: [TrustCenterFileEdge!]!
|
||||
edges: [CompliancePortalFileEdge!]!
|
||||
pageInfo: PageInfo!
|
||||
}
|
||||
|
||||
type TrustCenterFileEdge {
|
||||
type CompliancePortalFileEdge {
|
||||
cursor: CursorKey!
|
||||
node: TrustCenterFile!
|
||||
node: CompliancePortalFile!
|
||||
}
|
||||
|
||||
type CustomDomain implements Node {
|
||||
@@ -662,31 +662,31 @@ type DNSRecordInstruction {
|
||||
}
|
||||
|
||||
extend type Mutation {
|
||||
updateTrustCenter(input: UpdateTrustCenterInput!): UpdateTrustCenterPayload!
|
||||
uploadTrustCenterNDA(
|
||||
input: UploadTrustCenterNDAInput!
|
||||
): UploadTrustCenterNDAPayload!
|
||||
deleteTrustCenterNDA(
|
||||
input: DeleteTrustCenterNDAInput!
|
||||
): DeleteTrustCenterNDAPayload!
|
||||
updateTrustCenterBrand(
|
||||
input: UpdateTrustCenterBrandInput!
|
||||
): UpdateTrustCenterBrandPayload!
|
||||
updateTrustCenterAccess(
|
||||
input: UpdateTrustCenterAccessInput!
|
||||
): UpdateTrustCenterAccessPayload!
|
||||
deleteTrustCenterAccess(
|
||||
input: DeleteTrustCenterAccessInput!
|
||||
): DeleteTrustCenterAccessPayload!
|
||||
createTrustCenterReference(
|
||||
input: CreateTrustCenterReferenceInput!
|
||||
): CreateTrustCenterReferencePayload!
|
||||
updateTrustCenterReference(
|
||||
input: UpdateTrustCenterReferenceInput!
|
||||
): UpdateTrustCenterReferencePayload!
|
||||
deleteTrustCenterReference(
|
||||
input: DeleteTrustCenterReferenceInput!
|
||||
): DeleteTrustCenterReferencePayload!
|
||||
updateCompliancePortal(input: UpdateCompliancePortalInput!): UpdateCompliancePortalPayload!
|
||||
uploadCompliancePortalNDA(
|
||||
input: UploadCompliancePortalNDAInput!
|
||||
): UploadCompliancePortalNDAPayload!
|
||||
deleteCompliancePortalNDA(
|
||||
input: DeleteCompliancePortalNDAInput!
|
||||
): DeleteCompliancePortalNDAPayload!
|
||||
updateCompliancePortalBrand(
|
||||
input: UpdateCompliancePortalBrandInput!
|
||||
): UpdateCompliancePortalBrandPayload!
|
||||
updateCompliancePortalAccess(
|
||||
input: UpdateCompliancePortalAccessInput!
|
||||
): UpdateCompliancePortalAccessPayload!
|
||||
deleteCompliancePortalAccess(
|
||||
input: DeleteCompliancePortalAccessInput!
|
||||
): DeleteCompliancePortalAccessPayload!
|
||||
createCompliancePortalReference(
|
||||
input: CreateCompliancePortalReferenceInput!
|
||||
): CreateCompliancePortalReferencePayload!
|
||||
updateCompliancePortalReference(
|
||||
input: UpdateCompliancePortalReferenceInput!
|
||||
): UpdateCompliancePortalReferencePayload!
|
||||
deleteCompliancePortalReference(
|
||||
input: DeleteCompliancePortalReferenceInput!
|
||||
): DeleteCompliancePortalReferencePayload!
|
||||
createCompliancePortalCommitmentGroup(
|
||||
input: CreateCompliancePortalCommitmentGroupInput!
|
||||
): CreateCompliancePortalCommitmentGroupPayload!
|
||||
@@ -723,18 +723,18 @@ extend type Mutation {
|
||||
deleteComplianceCustomLink(
|
||||
input: DeleteComplianceCustomLinkInput!
|
||||
): DeleteComplianceCustomLinkPayload!
|
||||
createTrustCenterFile(
|
||||
input: CreateTrustCenterFileInput!
|
||||
): CreateTrustCenterFilePayload!
|
||||
updateTrustCenterFile(
|
||||
input: UpdateTrustCenterFileInput!
|
||||
): UpdateTrustCenterFilePayload!
|
||||
getTrustCenterFile(
|
||||
input: GetTrustCenterFileInput!
|
||||
): GetTrustCenterFilePayload!
|
||||
deleteTrustCenterFile(
|
||||
input: DeleteTrustCenterFileInput!
|
||||
): DeleteTrustCenterFilePayload!
|
||||
createCompliancePortalFile(
|
||||
input: CreateCompliancePortalFileInput!
|
||||
): CreateCompliancePortalFilePayload!
|
||||
updateCompliancePortalFile(
|
||||
input: UpdateCompliancePortalFileInput!
|
||||
): UpdateCompliancePortalFilePayload!
|
||||
getCompliancePortalFile(
|
||||
input: GetCompliancePortalFileInput!
|
||||
): GetCompliancePortalFilePayload!
|
||||
deleteCompliancePortalFile(
|
||||
input: DeleteCompliancePortalFileInput!
|
||||
): DeleteCompliancePortalFilePayload!
|
||||
createCustomDomain(
|
||||
input: CreateCustomDomainInput!
|
||||
): CreateCustomDomainPayload!
|
||||
@@ -743,8 +743,8 @@ extend type Mutation {
|
||||
): DeleteCustomDomainPayload!
|
||||
}
|
||||
|
||||
input UpdateTrustCenterInput {
|
||||
trustCenterId: ID!
|
||||
input UpdateCompliancePortalInput {
|
||||
compliancePortalId: ID!
|
||||
active: Boolean
|
||||
searchEngineIndexing: SearchEngineIndexing
|
||||
title: String
|
||||
@@ -754,49 +754,49 @@ input UpdateTrustCenterInput {
|
||||
headquarterAddress: String @goField(omittable: true)
|
||||
}
|
||||
|
||||
input UploadTrustCenterNDAInput {
|
||||
trustCenterId: ID!
|
||||
input UploadCompliancePortalNDAInput {
|
||||
compliancePortalId: ID!
|
||||
fileName: String!
|
||||
file: Upload!
|
||||
}
|
||||
|
||||
input DeleteTrustCenterNDAInput {
|
||||
trustCenterId: ID!
|
||||
input DeleteCompliancePortalNDAInput {
|
||||
compliancePortalId: ID!
|
||||
}
|
||||
|
||||
input UpdateTrustCenterBrandInput {
|
||||
trustCenterId: ID!
|
||||
input UpdateCompliancePortalBrandInput {
|
||||
compliancePortalId: ID!
|
||||
logoFile: Upload @goField(omittable: true)
|
||||
darkLogoFile: Upload @goField(omittable: true)
|
||||
}
|
||||
|
||||
input TrustCenterDocumentAccessInput {
|
||||
input CompliancePortalDocumentAccessInput {
|
||||
id: ID!
|
||||
status: TrustCenterDocumentAccessStatus!
|
||||
status: CompliancePortalDocumentAccessStatus!
|
||||
}
|
||||
|
||||
input UpdateTrustCenterAccessInput {
|
||||
input UpdateCompliancePortalAccessInput {
|
||||
id: ID!
|
||||
name: String
|
||||
state: TrustCenterAccessState
|
||||
documents: [TrustCenterDocumentAccessInput!]
|
||||
reports: [TrustCenterDocumentAccessInput!]
|
||||
trustCenterFiles: [TrustCenterDocumentAccessInput!]
|
||||
state: CompliancePortalAccessState
|
||||
documents: [CompliancePortalDocumentAccessInput!]
|
||||
reports: [CompliancePortalDocumentAccessInput!]
|
||||
compliancePortalFiles: [CompliancePortalDocumentAccessInput!]
|
||||
}
|
||||
|
||||
input DeleteTrustCenterAccessInput {
|
||||
input DeleteCompliancePortalAccessInput {
|
||||
id: ID!
|
||||
}
|
||||
|
||||
input CreateTrustCenterReferenceInput {
|
||||
trustCenterId: ID!
|
||||
input CreateCompliancePortalReferenceInput {
|
||||
compliancePortalId: ID!
|
||||
name: String!
|
||||
description: String
|
||||
websiteUrl: String!
|
||||
logoFile: Upload!
|
||||
}
|
||||
|
||||
input UpdateTrustCenterReferenceInput {
|
||||
input UpdateCompliancePortalReferenceInput {
|
||||
id: ID!
|
||||
name: String
|
||||
description: String @goField(omittable: true)
|
||||
@@ -805,12 +805,12 @@ input UpdateTrustCenterReferenceInput {
|
||||
rank: Int
|
||||
}
|
||||
|
||||
input DeleteTrustCenterReferenceInput {
|
||||
input DeleteCompliancePortalReferenceInput {
|
||||
id: ID!
|
||||
}
|
||||
|
||||
input CreateCompliancePortalCommitmentGroupInput {
|
||||
trustCenterId: ID!
|
||||
compliancePortalId: ID!
|
||||
title: String!
|
||||
description: String!
|
||||
}
|
||||
@@ -848,7 +848,7 @@ input DeleteCompliancePortalCommitmentInput {
|
||||
}
|
||||
|
||||
input CreateComplianceFrameworkInput {
|
||||
trustCenterId: ID!
|
||||
compliancePortalId: ID!
|
||||
frameworkId: ID!
|
||||
}
|
||||
|
||||
@@ -862,7 +862,7 @@ input DeleteComplianceFrameworkInput {
|
||||
}
|
||||
|
||||
input CreateComplianceCustomLinkInput {
|
||||
trustCenterId: ID!
|
||||
compliancePortalId: ID!
|
||||
name: String!
|
||||
url: String!
|
||||
}
|
||||
@@ -878,31 +878,31 @@ input DeleteComplianceCustomLinkInput {
|
||||
id: ID!
|
||||
}
|
||||
|
||||
input CreateTrustCenterFileInput {
|
||||
input CreateCompliancePortalFileInput {
|
||||
organizationId: ID!
|
||||
name: String!
|
||||
category: String!
|
||||
file: Upload!
|
||||
trustCenterVisibility: TrustCenterVisibility!
|
||||
compliancePortalVisibility: CompliancePortalVisibility!
|
||||
}
|
||||
|
||||
input UpdateTrustCenterFileInput {
|
||||
input UpdateCompliancePortalFileInput {
|
||||
id: ID!
|
||||
name: String
|
||||
category: String
|
||||
trustCenterVisibility: TrustCenterVisibility
|
||||
compliancePortalVisibility: CompliancePortalVisibility
|
||||
}
|
||||
|
||||
input GetTrustCenterFileInput {
|
||||
input GetCompliancePortalFileInput {
|
||||
id: ID!
|
||||
}
|
||||
|
||||
input DeleteTrustCenterFileInput {
|
||||
input DeleteCompliancePortalFileInput {
|
||||
id: ID!
|
||||
}
|
||||
|
||||
input CreateCustomDomainInput {
|
||||
trustCenterId: ID!
|
||||
compliancePortalId: ID!
|
||||
domain: String!
|
||||
}
|
||||
|
||||
@@ -910,40 +910,40 @@ input DeleteCustomDomainInput {
|
||||
customDomainId: ID!
|
||||
}
|
||||
|
||||
type UpdateTrustCenterPayload {
|
||||
trustCenter: TrustCenter!
|
||||
type UpdateCompliancePortalPayload {
|
||||
compliancePortal: CompliancePortal!
|
||||
}
|
||||
|
||||
type UploadTrustCenterNDAPayload {
|
||||
trustCenter: TrustCenter!
|
||||
type UploadCompliancePortalNDAPayload {
|
||||
compliancePortal: CompliancePortal!
|
||||
}
|
||||
|
||||
type DeleteTrustCenterNDAPayload {
|
||||
trustCenter: TrustCenter!
|
||||
type DeleteCompliancePortalNDAPayload {
|
||||
compliancePortal: CompliancePortal!
|
||||
}
|
||||
|
||||
type UpdateTrustCenterBrandPayload {
|
||||
trustCenter: TrustCenter!
|
||||
type UpdateCompliancePortalBrandPayload {
|
||||
compliancePortal: CompliancePortal!
|
||||
}
|
||||
|
||||
type UpdateTrustCenterAccessPayload {
|
||||
trustCenterAccess: TrustCenterAccess!
|
||||
type UpdateCompliancePortalAccessPayload {
|
||||
compliancePortalAccess: CompliancePortalAccess!
|
||||
}
|
||||
|
||||
type DeleteTrustCenterAccessPayload {
|
||||
deletedTrustCenterAccessId: ID!
|
||||
type DeleteCompliancePortalAccessPayload {
|
||||
deletedCompliancePortalAccessId: ID!
|
||||
}
|
||||
|
||||
type CreateTrustCenterReferencePayload {
|
||||
trustCenterReferenceEdge: TrustCenterReferenceEdge!
|
||||
type CreateCompliancePortalReferencePayload {
|
||||
compliancePortalReferenceEdge: CompliancePortalReferenceEdge!
|
||||
}
|
||||
|
||||
type UpdateTrustCenterReferencePayload {
|
||||
trustCenterReference: TrustCenterReference!
|
||||
type UpdateCompliancePortalReferencePayload {
|
||||
compliancePortalReference: CompliancePortalReference!
|
||||
}
|
||||
|
||||
type DeleteTrustCenterReferencePayload {
|
||||
deletedTrustCenterReferenceId: ID!
|
||||
type DeleteCompliancePortalReferencePayload {
|
||||
deletedCompliancePortalReferenceId: ID!
|
||||
}
|
||||
|
||||
type CreateCompliancePortalCommitmentGroupPayload {
|
||||
@@ -994,20 +994,20 @@ type DeleteComplianceCustomLinkPayload {
|
||||
deletedComplianceCustomLinkId: ID!
|
||||
}
|
||||
|
||||
type CreateTrustCenterFilePayload {
|
||||
trustCenterFileEdge: TrustCenterFileEdge!
|
||||
type CreateCompliancePortalFilePayload {
|
||||
compliancePortalFileEdge: CompliancePortalFileEdge!
|
||||
}
|
||||
|
||||
type UpdateTrustCenterFilePayload {
|
||||
trustCenterFile: TrustCenterFile!
|
||||
type UpdateCompliancePortalFilePayload {
|
||||
compliancePortalFile: CompliancePortalFile!
|
||||
}
|
||||
|
||||
type GetTrustCenterFilePayload {
|
||||
trustCenterFile: TrustCenterFile!
|
||||
type GetCompliancePortalFilePayload {
|
||||
compliancePortalFile: CompliancePortalFile!
|
||||
}
|
||||
|
||||
type DeleteTrustCenterFilePayload {
|
||||
deletedTrustCenterFileId: ID!
|
||||
type DeleteCompliancePortalFilePayload {
|
||||
deletedCompliancePortalFileId: ID!
|
||||
}
|
||||
|
||||
type CreateCustomDomainPayload {
|
||||
@@ -268,7 +268,7 @@ type Document implements Node {
|
||||
id: ID!
|
||||
currentPublishedMajor: Int
|
||||
currentPublishedMinor: Int
|
||||
trustCenterVisibility: TrustCenterVisibility!
|
||||
compliancePortalVisibility: CompliancePortalVisibility!
|
||||
alias: String @goField(forceResolver: true)
|
||||
organization: Organization! @goField(forceResolver: true)
|
||||
|
||||
@@ -592,7 +592,7 @@ input CreateDocumentInput {
|
||||
content: String
|
||||
documentType: DocumentType!
|
||||
classification: DocumentClassification!
|
||||
trustCenterVisibility: TrustCenterVisibility
|
||||
compliancePortalVisibility: CompliancePortalVisibility
|
||||
defaultApproverIds: [ID!]
|
||||
}
|
||||
|
||||
@@ -602,7 +602,7 @@ input UpdateDocumentInput {
|
||||
content: String
|
||||
classification: DocumentClassification
|
||||
documentType: DocumentType
|
||||
trustCenterVisibility: TrustCenterVisibility
|
||||
compliancePortalVisibility: CompliancePortalVisibility
|
||||
defaultApproverIds: [ID!]
|
||||
}
|
||||
|
||||
|
||||
@@ -314,14 +314,14 @@ type Organization implements Node {
|
||||
orderBy: AgentRunOrder
|
||||
): AgentRunConnection! @goField(forceResolver: true)
|
||||
|
||||
trustCenter: TrustCenter @goField(forceResolver: true)
|
||||
trustCenterFiles(
|
||||
compliancePortal: CompliancePortal @goField(forceResolver: true)
|
||||
compliancePortalFiles(
|
||||
first: Int
|
||||
after: CursorKey
|
||||
last: Int
|
||||
before: CursorKey
|
||||
orderBy: TrustCenterFileOrder
|
||||
): TrustCenterFileConnection! @goField(forceResolver: true)
|
||||
orderBy: CompliancePortalFileOrder
|
||||
): CompliancePortalFileConnection! @goField(forceResolver: true)
|
||||
|
||||
cookieBanners(
|
||||
first: Int
|
||||
|
||||
@@ -302,7 +302,7 @@ type ThirdParty implements Node {
|
||||
headquarterAddress: String
|
||||
legalName: String
|
||||
websiteUrl: String
|
||||
showOnTrustCenter: Boolean!
|
||||
showOnCompliancePortal: Boolean!
|
||||
level: Int!
|
||||
|
||||
parentThirdParty: ThirdParty @goField(forceResolver: true)
|
||||
@@ -566,7 +566,7 @@ input UpdateThirdPartyInput {
|
||||
trustPageUrl: String @goField(omittable: true)
|
||||
businessOwnerId: ID @goField(omittable: true)
|
||||
securityOwnerId: ID @goField(omittable: true)
|
||||
showOnTrustCenter: Boolean
|
||||
showOnCompliancePortal: Boolean
|
||||
}
|
||||
|
||||
input DeleteThirdPartyInput {
|
||||
|
||||
@@ -1157,36 +1157,36 @@ func (r *organizationResolver) AgentRuns(ctx context.Context, obj *types.Organiz
|
||||
return types.NewAgentRunConnection(page, r, obj.ID), nil
|
||||
}
|
||||
|
||||
// TrustCenter is the resolver for the trustCenter field.
|
||||
func (r *organizationResolver) TrustCenter(ctx context.Context, obj *types.Organization) (*types.TrustCenter, error) {
|
||||
// CompliancePortal is the resolver for the compliancePortal field.
|
||||
func (r *organizationResolver) CompliancePortal(ctx context.Context, obj *types.Organization) (*types.CompliancePortal, error) {
|
||||
scope, err := r.authorize(ctx, obj.ID, management.ActionCompliancePortalGet)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
trustCenter, err := r.management.GetByOrganizationID(ctx, scope, obj.ID)
|
||||
compliancePortal, err := r.management.GetByOrganizationID(ctx, scope, obj.ID)
|
||||
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 types.NewTrustCenter(trustCenter), nil
|
||||
return types.NewCompliancePortal(compliancePortal), nil
|
||||
}
|
||||
|
||||
// TrustCenterFiles is the resolver for the trustCenterFiles 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) {
|
||||
// CompliancePortalFiles is the resolver for the compliancePortalFiles field.
|
||||
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)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.TrustCenterFileOrderField]{
|
||||
Field: coredata.TrustCenterFileOrderFieldCreatedAt,
|
||||
pageOrderBy := page.OrderBy[coredata.CompliancePortalFileOrderField]{
|
||||
Field: coredata.CompliancePortalFileOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.TrustCenterFileOrderField]{
|
||||
pageOrderBy = page.OrderBy[coredata.CompliancePortalFileOrderField]{
|
||||
Field: orderBy.Field,
|
||||
Direction: orderBy.Direction,
|
||||
}
|
||||
@@ -1194,13 +1194,13 @@ func (r *organizationResolver) TrustCenterFiles(ctx context.Context, obj *types.
|
||||
|
||||
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 {
|
||||
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 types.NewTrustCenterFileConnection(pageResult, obj.ID), nil
|
||||
return types.NewCompliancePortalFileConnection(pageResult, obj.ID), nil
|
||||
}
|
||||
|
||||
// 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,
|
||||
BusinessOwnerID: gqlutils.UnwrapOmittable(input.BusinessOwnerID),
|
||||
SecurityOwnerID: gqlutils.UnwrapOmittable(input.SecurityOwnerID),
|
||||
ShowOnTrustCenter: input.ShowOnTrustCenter,
|
||||
ShowOnCompliancePortal: input.ShowOnCompliancePortal,
|
||||
Countries: input.Countries,
|
||||
},
|
||||
)
|
||||
|
||||
@@ -74,13 +74,13 @@ func NewAudit(a *coredata.Audit) *Audit {
|
||||
Framework: &Framework{
|
||||
ID: a.FrameworkID,
|
||||
},
|
||||
ValidFrom: a.ValidFrom,
|
||||
ValidUntil: a.ValidUntil,
|
||||
State: a.State,
|
||||
Name: a.Name,
|
||||
TrustCenterVisibility: a.TrustCenterVisibility,
|
||||
CreatedAt: a.CreatedAt,
|
||||
UpdatedAt: a.UpdatedAt,
|
||||
ValidFrom: a.ValidFrom,
|
||||
ValidUntil: a.ValidUntil,
|
||||
State: a.State,
|
||||
Name: a.Name,
|
||||
CompliancePortalVisibility: a.CompliancePortalVisibility,
|
||||
CreatedAt: a.CreatedAt,
|
||||
UpdatedAt: a.UpdatedAt,
|
||||
}
|
||||
|
||||
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"
|
||||
)
|
||||
|
||||
type TrustCenterAccessOrderBy = OrderBy[coredata.TrustCenterAccessOrderField]
|
||||
type CompliancePortalAccessOrderBy = OrderBy[coredata.CompliancePortalAccessOrderField]
|
||||
|
||||
func NewTrustCenterAccessConnection(
|
||||
page *page.Page[*coredata.TrustCenterAccess, coredata.TrustCenterAccessOrderField],
|
||||
) *TrustCenterAccessConnection {
|
||||
var edges = make([]*TrustCenterAccessEdge, len(page.Data))
|
||||
func NewCompliancePortalAccessConnection(
|
||||
page *page.Page[*coredata.CompliancePortalAccess, coredata.CompliancePortalAccessOrderField],
|
||||
) *CompliancePortalAccessConnection {
|
||||
var edges = make([]*CompliancePortalAccessEdge, len(page.Data))
|
||||
|
||||
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,
|
||||
PageInfo: NewPageInfo(page),
|
||||
}
|
||||
}
|
||||
|
||||
func NewTrustCenterAccessEdge(tca *coredata.TrustCenterAccess, orderBy coredata.TrustCenterAccessOrderField) *TrustCenterAccessEdge {
|
||||
return &TrustCenterAccessEdge{
|
||||
func NewCompliancePortalAccessEdge(tca *coredata.CompliancePortalAccess, orderBy coredata.CompliancePortalAccessOrderField) *CompliancePortalAccessEdge {
|
||||
return &CompliancePortalAccessEdge{
|
||||
Cursor: tca.CursorKey(orderBy),
|
||||
Node: NewTrustCenterAccess(tca),
|
||||
Node: NewCompliancePortalAccess(tca),
|
||||
}
|
||||
}
|
||||
|
||||
func NewTrustCenterAccess(tca *coredata.TrustCenterAccess) *TrustCenterAccess {
|
||||
return &TrustCenterAccess{
|
||||
func NewCompliancePortalAccess(tca *coredata.CompliancePortalAccess) *CompliancePortalAccess {
|
||||
return &CompliancePortalAccess{
|
||||
ID: tca.ID,
|
||||
OrganizationID: tca.OrganizationID,
|
||||
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"
|
||||
)
|
||||
|
||||
type TrustCenterFileOrderBy = OrderBy[coredata.TrustCenterFileOrderField]
|
||||
type CompliancePortalFileOrderBy = OrderBy[coredata.CompliancePortalFileOrderField]
|
||||
|
||||
type TrustCenterFileConnection struct {
|
||||
TotalCount int `json:"totalCount"`
|
||||
Edges []*TrustCenterFileEdge `json:"edges"`
|
||||
PageInfo *PageInfo `json:"pageInfo"`
|
||||
ParentID gid.GID `json:"-"`
|
||||
type CompliancePortalFileConnection struct {
|
||||
TotalCount int `json:"totalCount"`
|
||||
Edges []*CompliancePortalFileEdge `json:"edges"`
|
||||
PageInfo *PageInfo `json:"pageInfo"`
|
||||
ParentID gid.GID `json:"-"`
|
||||
}
|
||||
|
||||
func NewTrustCenterFile(tcf *coredata.TrustCenterFile) *TrustCenterFile {
|
||||
return &TrustCenterFile{
|
||||
ID: tcf.ID,
|
||||
Name: tcf.Name,
|
||||
Category: tcf.Category,
|
||||
File: &File{ID: tcf.FileID},
|
||||
TrustCenterVisibility: tcf.TrustCenterVisibility,
|
||||
CreatedAt: tcf.CreatedAt,
|
||||
UpdatedAt: tcf.UpdatedAt,
|
||||
func NewCompliancePortalFile(tcf *coredata.CompliancePortalFile) *CompliancePortalFile {
|
||||
return &CompliancePortalFile{
|
||||
ID: tcf.ID,
|
||||
Name: tcf.Name,
|
||||
Category: tcf.Category,
|
||||
File: &File{ID: tcf.FileID},
|
||||
CompliancePortalVisibility: tcf.CompliancePortalVisibility,
|
||||
CreatedAt: tcf.CreatedAt,
|
||||
UpdatedAt: tcf.UpdatedAt,
|
||||
Organization: &Organization{
|
||||
ID: tcf.OrganizationID,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func NewTrustCenterFileConnection(
|
||||
p *page.Page[*coredata.TrustCenterFile, coredata.TrustCenterFileOrderField],
|
||||
func NewCompliancePortalFileConnection(
|
||||
p *page.Page[*coredata.CompliancePortalFile, coredata.CompliancePortalFileOrderField],
|
||||
parentID gid.GID,
|
||||
) *TrustCenterFileConnection {
|
||||
var edges = make([]*TrustCenterFileEdge, len(p.Data))
|
||||
) *CompliancePortalFileConnection {
|
||||
var edges = make([]*CompliancePortalFileEdge, len(p.Data))
|
||||
|
||||
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,
|
||||
PageInfo: NewPageInfo(p),
|
||||
ParentID: parentID,
|
||||
}
|
||||
}
|
||||
|
||||
func NewTrustCenterFileEdge(tcf *coredata.TrustCenterFile, orderBy coredata.TrustCenterFileOrderField) *TrustCenterFileEdge {
|
||||
return &TrustCenterFileEdge{
|
||||
func NewCompliancePortalFileEdge(tcf *coredata.CompliancePortalFile, orderBy coredata.CompliancePortalFileOrderField) *CompliancePortalFileEdge {
|
||||
return &CompliancePortalFileEdge{
|
||||
Cursor: tcf.CursorKey(orderBy),
|
||||
Node: NewTrustCenterFile(tcf),
|
||||
Node: NewCompliancePortalFile(tcf),
|
||||
}
|
||||
}
|
||||
@@ -26,17 +26,17 @@ import (
|
||||
"go.probo.inc/probo/pkg/page"
|
||||
)
|
||||
|
||||
type TrustCenterReferenceOrderBy = OrderBy[coredata.TrustCenterReferenceOrderField]
|
||||
type CompliancePortalReferenceOrderBy = OrderBy[coredata.CompliancePortalReferenceOrderField]
|
||||
|
||||
type TrustCenterReferenceConnection struct {
|
||||
TotalCount int `json:"totalCount"`
|
||||
Edges []*TrustCenterReferenceEdge `json:"edges"`
|
||||
PageInfo *PageInfo `json:"pageInfo"`
|
||||
ParentID gid.GID `json:"-"`
|
||||
type CompliancePortalReferenceConnection struct {
|
||||
TotalCount int `json:"totalCount"`
|
||||
Edges []*CompliancePortalReferenceEdge `json:"edges"`
|
||||
PageInfo *PageInfo `json:"pageInfo"`
|
||||
ParentID gid.GID `json:"-"`
|
||||
}
|
||||
|
||||
func NewTrustCenterReference(tcc *coredata.TrustCenterReference) *TrustCenterReference {
|
||||
return &TrustCenterReference{
|
||||
func NewCompliancePortalReference(tcc *coredata.CompliancePortalReference) *CompliancePortalReference {
|
||||
return &CompliancePortalReference{
|
||||
ID: tcc.ID,
|
||||
Name: tcc.Name,
|
||||
Description: tcc.Description,
|
||||
@@ -48,26 +48,26 @@ func NewTrustCenterReference(tcc *coredata.TrustCenterReference) *TrustCenterRef
|
||||
}
|
||||
}
|
||||
|
||||
func NewTrustCenterReferenceConnection(
|
||||
p *page.Page[*coredata.TrustCenterReference, coredata.TrustCenterReferenceOrderField],
|
||||
func NewCompliancePortalReferenceConnection(
|
||||
p *page.Page[*coredata.CompliancePortalReference, coredata.CompliancePortalReferenceOrderField],
|
||||
parentID gid.GID,
|
||||
) *TrustCenterReferenceConnection {
|
||||
var edges = make([]*TrustCenterReferenceEdge, len(p.Data))
|
||||
) *CompliancePortalReferenceConnection {
|
||||
var edges = make([]*CompliancePortalReferenceEdge, len(p.Data))
|
||||
|
||||
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,
|
||||
PageInfo: NewPageInfo(p),
|
||||
ParentID: parentID,
|
||||
}
|
||||
}
|
||||
|
||||
func NewTrustCenterReferenceEdge(tcc *coredata.TrustCenterReference, orderBy coredata.TrustCenterReferenceOrderField) *TrustCenterReferenceEdge {
|
||||
return &TrustCenterReferenceEdge{
|
||||
func NewCompliancePortalReferenceEdge(tcc *coredata.CompliancePortalReference, orderBy coredata.CompliancePortalReferenceOrderField) *CompliancePortalReferenceEdge {
|
||||
return &CompliancePortalReferenceEdge{
|
||||
Cursor: tcc.CursorKey(orderBy),
|
||||
Node: NewTrustCenterReference(tcc),
|
||||
Node: NewCompliancePortalReference(tcc),
|
||||
}
|
||||
}
|
||||
@@ -85,13 +85,13 @@ func NewDocument(document *coredata.Document) *Document {
|
||||
Organization: &Organization{
|
||||
ID: document.OrganizationID,
|
||||
},
|
||||
CurrentPublishedMajor: document.CurrentPublishedMajor,
|
||||
CurrentPublishedMinor: document.CurrentPublishedMinor,
|
||||
WriteMode: document.WriteMode,
|
||||
TrustCenterVisibility: document.TrustCenterVisibility,
|
||||
Status: document.Status,
|
||||
ArchivedAt: document.ArchivedAt,
|
||||
CreatedAt: document.CreatedAt,
|
||||
UpdatedAt: document.UpdatedAt,
|
||||
CurrentPublishedMajor: document.CurrentPublishedMajor,
|
||||
CurrentPublishedMinor: document.CurrentPublishedMinor,
|
||||
WriteMode: document.WriteMode,
|
||||
CompliancePortalVisibility: document.CompliancePortalVisibility,
|
||||
Status: document.Status,
|
||||
ArchivedAt: document.ArchivedAt,
|
||||
CreatedAt: document.CreatedAt,
|
||||
UpdatedAt: document.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ func NewThirdParty(v *coredata.ThirdParty) *ThirdParty {
|
||||
LegalName: v.LegalName,
|
||||
WebsiteURL: v.WebsiteURL,
|
||||
Category: v.Category,
|
||||
ShowOnTrustCenter: v.ShowOnTrustCenter,
|
||||
ShowOnCompliancePortal: v.ShowOnCompliancePortal,
|
||||
Level: v.Level,
|
||||
Countries: v.Countries,
|
||||
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(
|
||||
ctx, scope,
|
||||
&probo.UpdateAuditRequest{
|
||||
ID: input.ID,
|
||||
Name: UnwrapOmittable(input.Name),
|
||||
ValidFrom: input.ValidFrom,
|
||||
ValidUntil: input.ValidUntil,
|
||||
State: input.State,
|
||||
TrustCenterVisibility: input.TrustCenterVisibility,
|
||||
ID: input.ID,
|
||||
Name: UnwrapOmittable(input.Name),
|
||||
ValidFrom: input.ValidFrom,
|
||||
ValidUntil: input.ValidUntil,
|
||||
State: input.State,
|
||||
CompliancePortalVisibility: input.CompliancePortalVisibility,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
@@ -2240,9 +2240,9 @@ func (r *Resolver) AddDocumentTool(ctx context.Context, req *mcp.CallToolRequest
|
||||
|
||||
svc := r.proboSvc
|
||||
|
||||
var trustCenterVisibility *coredata.TrustCenterVisibility
|
||||
if input.TrustCenterVisibility != nil {
|
||||
trustCenterVisibility = input.TrustCenterVisibility
|
||||
var compliancePortalVisibility *coredata.CompliancePortalVisibility
|
||||
if input.CompliancePortalVisibility != nil {
|
||||
compliancePortalVisibility = input.CompliancePortalVisibility
|
||||
}
|
||||
|
||||
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(
|
||||
ctx, scope,
|
||||
probo.CreateDocumentRequest{
|
||||
OrganizationID: input.OrganizationID,
|
||||
Title: input.Title,
|
||||
Content: contentJSON,
|
||||
Classification: input.Classification,
|
||||
DocumentType: input.DocumentType,
|
||||
TrustCenterVisibility: trustCenterVisibility,
|
||||
DefaultApproverIDs: input.DefaultApproverIds,
|
||||
OrganizationID: input.OrganizationID,
|
||||
Title: input.Title,
|
||||
Content: contentJSON,
|
||||
Classification: input.Classification,
|
||||
DocumentType: input.DocumentType,
|
||||
CompliancePortalVisibility: compliancePortalVisibility,
|
||||
DefaultApproverIDs: input.DefaultApproverIds,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
@@ -2296,13 +2296,13 @@ func (r *Resolver) UpdateDocumentTool(ctx context.Context, req *mcp.CallToolRequ
|
||||
document, documentVersion, _, err := svc.Documents.Update(
|
||||
ctx, scope,
|
||||
probo.UpdateDocumentRequest{
|
||||
DocumentID: input.ID,
|
||||
Title: input.Title,
|
||||
Content: content,
|
||||
Classification: input.Classification,
|
||||
DocumentType: input.DocumentType,
|
||||
TrustCenterVisibility: input.TrustCenterVisibility,
|
||||
DefaultApproverIDs: defaultApproverIDs,
|
||||
DocumentID: input.ID,
|
||||
Title: input.Title,
|
||||
Content: content,
|
||||
Classification: input.Classification,
|
||||
DocumentType: input.DocumentType,
|
||||
CompliancePortalVisibility: input.CompliancePortalVisibility,
|
||||
DefaultApproverIDs: defaultApproverIDs,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
@@ -4880,65 +4880,65 @@ func (r *Resolver) DeleteRightsRequestTool(ctx context.Context, req *mcp.CallToo
|
||||
}, nil
|
||||
}
|
||||
|
||||
// GetTrustCenterTool handles the getTrustCenter tool
|
||||
// Get the trust center for an organization
|
||||
func (r *Resolver) GetTrustCenterTool(ctx context.Context, req *mcp.CallToolRequest, input *types.GetTrustCenterInput) (*mcp.CallToolResult, types.GetTrustCenterOutput, error) {
|
||||
// GetCompliancePortalTool handles the getCompliancePortal tool
|
||||
// Get the compliance portal for an organization
|
||||
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)
|
||||
if err != nil {
|
||||
return nil, types.GetTrustCenterOutput{}, err
|
||||
return nil, types.GetCompliancePortalOutput{}, err
|
||||
}
|
||||
|
||||
prb := r.management
|
||||
|
||||
trustCenter, err := prb.GetByOrganizationID(ctx, scope, input.OrganizationID)
|
||||
compliancePortal, err := prb.GetByOrganizationID(ctx, scope, input.OrganizationID)
|
||||
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 {
|
||||
logo, err := r.loadFile(ctx, scope, *trustCenter.LogoFileID)
|
||||
if compliancePortal.LogoFileID != nil {
|
||||
logo, err := r.loadFile(ctx, scope, *compliancePortal.LogoFileID)
|
||||
if err != nil {
|
||||
return nil, types.GetTrustCenterOutput{}, err
|
||||
return nil, types.GetCompliancePortalOutput{}, err
|
||||
}
|
||||
|
||||
tc.Logo = logo
|
||||
}
|
||||
|
||||
if trustCenter.DarkLogoFileID != nil {
|
||||
darkLogo, err := r.loadFile(ctx, scope, *trustCenter.DarkLogoFileID)
|
||||
if compliancePortal.DarkLogoFileID != nil {
|
||||
darkLogo, err := r.loadFile(ctx, scope, *compliancePortal.DarkLogoFileID)
|
||||
if err != nil {
|
||||
return nil, types.GetTrustCenterOutput{}, err
|
||||
return nil, types.GetCompliancePortalOutput{}, err
|
||||
}
|
||||
|
||||
tc.DarkLogo = darkLogo
|
||||
}
|
||||
|
||||
if trustCenter.NonDisclosureAgreementFileID != nil {
|
||||
nda, err := r.loadFile(ctx, scope, *trustCenter.NonDisclosureAgreementFileID)
|
||||
if compliancePortal.NonDisclosureAgreementFileID != nil {
|
||||
nda, err := r.loadFile(ctx, scope, *compliancePortal.NonDisclosureAgreementFileID)
|
||||
if err != nil {
|
||||
return nil, types.GetTrustCenterOutput{}, err
|
||||
return nil, types.GetCompliancePortalOutput{}, err
|
||||
}
|
||||
|
||||
tc.Nda = nda
|
||||
}
|
||||
|
||||
return nil, types.GetTrustCenterOutput{TrustCenter: tc}, nil
|
||||
return nil, types.GetCompliancePortalOutput{CompliancePortal: tc}, nil
|
||||
}
|
||||
|
||||
// UpdateTrustCenterTool handles the updateTrustCenter tool
|
||||
// Update the trust center settings
|
||||
func (r *Resolver) UpdateTrustCenterTool(ctx context.Context, req *mcp.CallToolRequest, input *types.UpdateTrustCenterInput) (*mcp.CallToolResult, types.UpdateTrustCenterOutput, error) {
|
||||
scope, err := r.Authorize(ctx, input.TrustCenterID, management.ActionCompliancePortalUpdate)
|
||||
// UpdateCompliancePortalTool handles the updateCompliancePortal tool
|
||||
// Update the compliance portal settings
|
||||
func (r *Resolver) UpdateCompliancePortalTool(ctx context.Context, req *mcp.CallToolRequest, input *types.UpdateCompliancePortalInput) (*mcp.CallToolResult, types.UpdateCompliancePortalOutput, error) {
|
||||
scope, err := r.Authorize(ctx, input.CompliancePortalID, management.ActionCompliancePortalUpdate)
|
||||
if err != nil {
|
||||
return nil, types.UpdateTrustCenterOutput{}, err
|
||||
return nil, types.UpdateCompliancePortalOutput{}, err
|
||||
}
|
||||
|
||||
prb := r.management
|
||||
|
||||
updateReq := &management.UpdateRequest{
|
||||
ID: input.TrustCenterID,
|
||||
ID: input.CompliancePortalID,
|
||||
}
|
||||
|
||||
if active := UnwrapOmittable(input.Active); active != nil {
|
||||
@@ -4958,31 +4958,31 @@ func (r *Resolver) UpdateTrustCenterTool(ctx context.Context, req *mcp.CallToolR
|
||||
updateReq.Title = *title
|
||||
}
|
||||
|
||||
trustCenter, _, err := prb.Update(ctx, scope, updateReq)
|
||||
compliancePortal, _, err := prb.Update(ctx, scope, updateReq)
|
||||
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
|
||||
// List all references for a trust center
|
||||
func (r *Resolver) ListTrustCenterReferencesTool(ctx context.Context, req *mcp.CallToolRequest, input *types.ListTrustCenterReferencesInput) (*mcp.CallToolResult, types.ListTrustCenterReferencesOutput, error) {
|
||||
scope, err := r.Authorize(ctx, input.TrustCenterID, management.ActionCompliancePortalReferenceList)
|
||||
// ListCompliancePortalReferencesTool handles the listCompliancePortalReferences tool
|
||||
// List all references for a compliance portal
|
||||
func (r *Resolver) ListCompliancePortalReferencesTool(ctx context.Context, req *mcp.CallToolRequest, input *types.ListCompliancePortalReferencesInput) (*mcp.CallToolResult, types.ListCompliancePortalReferencesOutput, error) {
|
||||
scope, err := r.Authorize(ctx, input.CompliancePortalID, management.ActionCompliancePortalReferenceList)
|
||||
if err != nil {
|
||||
return nil, types.ListTrustCenterReferencesOutput{}, err
|
||||
return nil, types.ListCompliancePortalReferencesOutput{}, err
|
||||
}
|
||||
|
||||
prb := r.management
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.TrustCenterReferenceOrderField]{
|
||||
Field: coredata.TrustCenterReferenceOrderFieldRank,
|
||||
pageOrderBy := page.OrderBy[coredata.CompliancePortalReferenceOrderField]{
|
||||
Field: coredata.CompliancePortalReferenceOrderFieldRank,
|
||||
Direction: page.OrderDirectionAsc,
|
||||
}
|
||||
|
||||
if input.OrderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.TrustCenterReferenceOrderField]{
|
||||
pageOrderBy = page.OrderBy[coredata.CompliancePortalReferenceOrderField]{
|
||||
Field: input.OrderBy.Field,
|
||||
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)
|
||||
|
||||
p, err := prb.ListReferences(ctx, scope, input.TrustCenterID, cursor)
|
||||
p, err := prb.ListReferences(ctx, scope, input.CompliancePortalID, cursor)
|
||||
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 {
|
||||
ref := types.NewTrustCenterReference(reference)
|
||||
ref := types.NewCompliancePortalReference(reference)
|
||||
|
||||
logo, err := r.loadFile(ctx, scope, reference.LogoFileID)
|
||||
if err != nil {
|
||||
return nil, types.ListTrustCenterReferencesOutput{}, err
|
||||
return nil, types.ListCompliancePortalReferencesOutput{}, err
|
||||
}
|
||||
|
||||
ref.Logo = logo
|
||||
@@ -5009,15 +5009,15 @@ func (r *Resolver) ListTrustCenterReferencesTool(ctx context.Context, req *mcp.C
|
||||
refs = append(refs, ref)
|
||||
}
|
||||
|
||||
return nil, types.NewListTrustCenterReferencesOutput(refs, p), nil
|
||||
return nil, types.NewListCompliancePortalReferencesOutput(refs, p), nil
|
||||
}
|
||||
|
||||
// AddTrustCenterReferenceTool handles the addTrustCenterReference tool
|
||||
// Add a new reference to the trust center
|
||||
func (r *Resolver) AddTrustCenterReferenceTool(ctx context.Context, req *mcp.CallToolRequest, input *types.AddTrustCenterReferenceInput) (*mcp.CallToolResult, types.AddTrustCenterReferenceOutput, error) {
|
||||
scope, err := r.Authorize(ctx, input.TrustCenterID, management.ActionCompliancePortalReferenceCreate)
|
||||
// AddCompliancePortalReferenceTool handles the addCompliancePortalReference tool
|
||||
// Add a new reference to the compliance portal
|
||||
func (r *Resolver) AddCompliancePortalReferenceTool(ctx context.Context, req *mcp.CallToolRequest, input *types.AddCompliancePortalReferenceInput) (*mcp.CallToolResult, types.AddCompliancePortalReferenceOutput, error) {
|
||||
scope, err := r.Authorize(ctx, input.CompliancePortalID, management.ActionCompliancePortalReferenceCreate)
|
||||
if err != nil {
|
||||
return nil, types.AddTrustCenterReferenceOutput{}, err
|
||||
return nil, types.AddCompliancePortalReferenceOutput{}, err
|
||||
}
|
||||
|
||||
prb := r.management
|
||||
@@ -5030,25 +5030,25 @@ func (r *Resolver) AddTrustCenterReferenceTool(ctx context.Context, req *mcp.Cal
|
||||
reference, err := prb.CreateReference(
|
||||
ctx, scope,
|
||||
&management.CreateReferenceRequest{
|
||||
TrustCenterID: input.TrustCenterID,
|
||||
Name: input.Name,
|
||||
Description: input.Description,
|
||||
WebsiteURL: websiteURL,
|
||||
CompliancePortalID: input.CompliancePortalID,
|
||||
Name: input.Name,
|
||||
Description: input.Description,
|
||||
WebsiteURL: websiteURL,
|
||||
},
|
||||
)
|
||||
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
|
||||
// Update a trust center reference
|
||||
func (r *Resolver) UpdateTrustCenterReferenceTool(ctx context.Context, req *mcp.CallToolRequest, input *types.UpdateTrustCenterReferenceInput) (*mcp.CallToolResult, types.UpdateTrustCenterReferenceOutput, error) {
|
||||
// UpdateCompliancePortalReferenceTool handles the updateCompliancePortalReference tool
|
||||
// Update a compliance portal reference
|
||||
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)
|
||||
if err != nil {
|
||||
return nil, types.UpdateTrustCenterReferenceOutput{}, err
|
||||
return nil, types.UpdateCompliancePortalReferenceOutput{}, err
|
||||
}
|
||||
|
||||
prb := r.management
|
||||
@@ -5072,95 +5072,95 @@ func (r *Resolver) UpdateTrustCenterReferenceTool(ctx context.Context, req *mcp.
|
||||
|
||||
reference, err := prb.UpdateReference(ctx, scope, updateRefReq)
|
||||
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
|
||||
// Delete a trust center reference
|
||||
func (r *Resolver) DeleteTrustCenterReferenceTool(ctx context.Context, req *mcp.CallToolRequest, input *types.DeleteTrustCenterReferenceInput) (*mcp.CallToolResult, types.DeleteTrustCenterReferenceOutput, error) {
|
||||
// DeleteCompliancePortalReferenceTool handles the deleteCompliancePortalReference tool
|
||||
// Delete a compliance portal reference
|
||||
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)
|
||||
if err != nil {
|
||||
return nil, types.DeleteTrustCenterReferenceOutput{}, err
|
||||
return nil, types.DeleteCompliancePortalReferenceOutput{}, err
|
||||
}
|
||||
|
||||
prb := r.management
|
||||
|
||||
err = prb.DeleteReference(ctx, scope, input.ID)
|
||||
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
|
||||
// List all files for the trust center
|
||||
func (r *Resolver) ListTrustCenterFilesTool(ctx context.Context, req *mcp.CallToolRequest, input *types.ListTrustCenterFilesInput) (*mcp.CallToolResult, types.ListTrustCenterFilesOutput, error) {
|
||||
// ListCompliancePortalFilesTool handles the listCompliancePortalFiles tool
|
||||
// List all files for the compliance portal
|
||||
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)
|
||||
if err != nil {
|
||||
return nil, types.ListTrustCenterFilesOutput{}, err
|
||||
return nil, types.ListCompliancePortalFilesOutput{}, err
|
||||
}
|
||||
|
||||
prb := r.management
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.TrustCenterFileOrderField]{
|
||||
Field: coredata.TrustCenterFileOrderFieldCreatedAt,
|
||||
pageOrderBy := page.OrderBy[coredata.CompliancePortalFileOrderField]{
|
||||
Field: coredata.CompliancePortalFileOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
|
||||
if input.OrderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.TrustCenterFileOrderField]{
|
||||
pageOrderBy = page.OrderBy[coredata.CompliancePortalFileOrderField]{
|
||||
Field: input.OrderBy.Field,
|
||||
Direction: input.OrderBy.Direction,
|
||||
}
|
||||
}
|
||||
|
||||
cursor := types.NewCursor(input.Size, input.Cursor, pageOrderBy)
|
||||
filter := coredata.NewTrustCenterFileFilter()
|
||||
filter := coredata.NewCompliancePortalFileFilter()
|
||||
|
||||
p, err := prb.ListFilesForOrganizationID(ctx, scope, input.OrganizationID, cursor, filter)
|
||||
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 {
|
||||
file, err := r.loadFile(ctx, scope, f.FileID)
|
||||
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
|
||||
// Delete a trust center file
|
||||
func (r *Resolver) DeleteTrustCenterFileTool(ctx context.Context, req *mcp.CallToolRequest, input *types.DeleteTrustCenterFileInput) (*mcp.CallToolResult, types.DeleteTrustCenterFileOutput, error) {
|
||||
// DeleteCompliancePortalFileTool handles the deleteCompliancePortalFile tool
|
||||
// Delete a compliance portal file
|
||||
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)
|
||||
if err != nil {
|
||||
return nil, types.DeleteTrustCenterFileOutput{}, err
|
||||
return nil, types.DeleteCompliancePortalFileOutput{}, err
|
||||
}
|
||||
|
||||
prb := r.management
|
||||
|
||||
err = prb.DeleteFile(ctx, scope, input.ID)
|
||||
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
|
||||
// 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) {
|
||||
scope, err := r.Authorize(ctx, input.TrustCenterID, management.ActionComplianceCustomLinkList)
|
||||
scope, err := r.Authorize(ctx, input.CompliancePortalID, management.ActionComplianceCustomLinkList)
|
||||
if err != nil {
|
||||
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)
|
||||
|
||||
p, err := prb.ListCustomLinks(ctx, scope, input.TrustCenterID, cursor)
|
||||
p, err := prb.ListCustomLinks(ctx, scope, input.CompliancePortalID, cursor)
|
||||
if err != nil {
|
||||
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
|
||||
// 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) {
|
||||
scope, err := r.Authorize(ctx, input.TrustCenterID, management.ActionComplianceCustomLinkCreate)
|
||||
scope, err := r.Authorize(ctx, input.CompliancePortalID, management.ActionComplianceCustomLinkCreate)
|
||||
if err != nil {
|
||||
return nil, types.AddComplianceCustomLinkOutput{}, err
|
||||
}
|
||||
@@ -5202,9 +5202,9 @@ func (r *Resolver) AddComplianceCustomLinkTool(ctx context.Context, req *mcp.Cal
|
||||
item, err := prb.CreateCustomLink(
|
||||
ctx, scope,
|
||||
&management.CreateCustomLinkRequest{
|
||||
TrustCenterID: input.TrustCenterID,
|
||||
Name: input.Name,
|
||||
URL: input.URL,
|
||||
CompliancePortalID: input.CompliancePortalID,
|
||||
Name: input.Name,
|
||||
URL: input.URL,
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
@@ -5274,14 +5274,14 @@ func (r *Resolver) DeleteComplianceCustomLinkTool(ctx context.Context, req *mcp.
|
||||
// CreateCustomDomainTool handles the createCustomDomain tool
|
||||
// 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) {
|
||||
scope, err := r.Authorize(ctx, input.TrustCenterID, management.ActionCustomDomainCreate)
|
||||
scope, err := r.Authorize(ctx, input.CompliancePortalID, management.ActionCustomDomainCreate)
|
||||
if err != nil {
|
||||
return nil, types.CreateCustomDomainOutput{}, err
|
||||
}
|
||||
|
||||
domain, err := r.management.AddCustomDomain(
|
||||
ctx, scope,
|
||||
input.TrustCenterID,
|
||||
input.CompliancePortalID,
|
||||
input.Domain,
|
||||
)
|
||||
if err != nil {
|
||||
@@ -5302,12 +5302,12 @@ func (r *Resolver) CreateCustomDomainTool(ctx context.Context, req *mcp.CallTool
|
||||
// DeleteCustomDomainTool handles the deleteCustomDomain tool
|
||||
// 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) {
|
||||
scope, err := r.Authorize(ctx, input.TrustCenterID, management.ActionCustomDomainDelete)
|
||||
scope, err := r.Authorize(ctx, input.CompliancePortalID, management.ActionCustomDomainDelete)
|
||||
if err != nil {
|
||||
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 {
|
||||
return nil, types.DeleteCustomDomainOutput{}, fmt.Errorf("cannot load compliance page: %w", err)
|
||||
}
|
||||
|
||||
@@ -4590,13 +4590,13 @@ components:
|
||||
- OUTDATED
|
||||
go.probo.inc/mcpgen/type: go.probo.inc/probo/pkg/coredata.AuditState
|
||||
|
||||
TrustCenterVisibility:
|
||||
CompliancePortalVisibility:
|
||||
type: string
|
||||
enum:
|
||||
- NONE
|
||||
- PRIVATE
|
||||
- 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:
|
||||
type: string
|
||||
@@ -4627,7 +4627,7 @@ components:
|
||||
- organization_id
|
||||
- framework_id
|
||||
- state
|
||||
- trust_center_visibility
|
||||
- compliance_portal_visibility
|
||||
- has_report
|
||||
- created_at
|
||||
- updated_at
|
||||
@@ -4661,9 +4661,9 @@ components:
|
||||
state:
|
||||
$ref: "#/components/schemas/AuditState"
|
||||
description: Audit state
|
||||
trust_center_visibility:
|
||||
$ref: "#/components/schemas/TrustCenterVisibility"
|
||||
description: Trust center visibility
|
||||
compliance_portal_visibility:
|
||||
$ref: "#/components/schemas/CompliancePortalVisibility"
|
||||
description: Compliance portal visibility
|
||||
has_report:
|
||||
type: boolean
|
||||
description: Whether the audit has an attached report
|
||||
@@ -4818,13 +4818,13 @@ components:
|
||||
- type: "null"
|
||||
description: No state
|
||||
description: Audit state
|
||||
trust_center_visibility:
|
||||
compliance_portal_visibility:
|
||||
anyOf:
|
||||
- $ref: "#/components/schemas/TrustCenterVisibility"
|
||||
description: Trust center visibility
|
||||
- $ref: "#/components/schemas/CompliancePortalVisibility"
|
||||
description: Compliance portal visibility
|
||||
- type: "null"
|
||||
description: No trust center visibility
|
||||
description: Trust center visibility
|
||||
description: No compliance portal visibility
|
||||
description: Compliance portal visibility
|
||||
|
||||
UpdateAuditOutput:
|
||||
type: object
|
||||
@@ -5781,7 +5781,7 @@ components:
|
||||
required:
|
||||
- id
|
||||
- organization_id
|
||||
- trust_center_visibility
|
||||
- compliance_portal_visibility
|
||||
- write_mode
|
||||
- status
|
||||
- created_at
|
||||
@@ -5803,9 +5803,9 @@ components:
|
||||
- integer
|
||||
- "null"
|
||||
description: Current published minor version number
|
||||
trust_center_visibility:
|
||||
$ref: "#/components/schemas/TrustCenterVisibility"
|
||||
description: Trust center visibility
|
||||
compliance_portal_visibility:
|
||||
$ref: "#/components/schemas/CompliancePortalVisibility"
|
||||
description: Compliance portal visibility
|
||||
write_mode:
|
||||
$ref: "#/components/schemas/DocumentWriteMode"
|
||||
description: Write mode (authored or generated)
|
||||
@@ -6043,11 +6043,11 @@ components:
|
||||
items:
|
||||
$ref: "#/components/schemas/DocumentWriteMode"
|
||||
description: Filter by write mode (AUTHORED or GENERATED)
|
||||
trust_center_visibilities:
|
||||
compliance_portal_visibilities:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/TrustCenterVisibility"
|
||||
description: Trust center visibilities
|
||||
$ref: "#/components/schemas/CompliancePortalVisibility"
|
||||
description: Compliance portal visibilities
|
||||
document_types:
|
||||
type: array
|
||||
items:
|
||||
@@ -6118,9 +6118,9 @@ components:
|
||||
document_type:
|
||||
$ref: "#/components/schemas/DocumentType"
|
||||
description: Document type
|
||||
trust_center_visibility:
|
||||
$ref: "#/components/schemas/TrustCenterVisibility"
|
||||
description: Trust center visibility
|
||||
compliance_portal_visibility:
|
||||
$ref: "#/components/schemas/CompliancePortalVisibility"
|
||||
description: Compliance portal visibility
|
||||
default_approver_ids:
|
||||
type: array
|
||||
items:
|
||||
@@ -6159,9 +6159,9 @@ components:
|
||||
document_type:
|
||||
$ref: "#/components/schemas/DocumentType"
|
||||
description: Document type
|
||||
trust_center_visibility:
|
||||
$ref: "#/components/schemas/TrustCenterVisibility"
|
||||
description: Trust center visibility
|
||||
compliance_portal_visibility:
|
||||
$ref: "#/components/schemas/CompliancePortalVisibility"
|
||||
description: Compliance portal visibility
|
||||
default_approver_ids:
|
||||
type: array
|
||||
items:
|
||||
@@ -8739,42 +8739,42 @@ components:
|
||||
- FAILED
|
||||
go.probo.inc/mcpgen/type: go.probo.inc/probo/pkg/coredata.CertificateStatus
|
||||
|
||||
TrustCenterReferenceOrderField:
|
||||
CompliancePortalReferenceOrderField:
|
||||
type: string
|
||||
enum:
|
||||
- RANK
|
||||
- NAME
|
||||
- CREATED_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
|
||||
required:
|
||||
- field
|
||||
- direction
|
||||
properties:
|
||||
field:
|
||||
$ref: "#/components/schemas/TrustCenterReferenceOrderField"
|
||||
$ref: "#/components/schemas/CompliancePortalReferenceOrderField"
|
||||
direction:
|
||||
$ref: "#/components/schemas/OrderDirection"
|
||||
|
||||
TrustCenterFileOrderField:
|
||||
CompliancePortalFileOrderField:
|
||||
type: string
|
||||
enum:
|
||||
- NAME
|
||||
- CREATED_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
|
||||
required:
|
||||
- field
|
||||
- direction
|
||||
properties:
|
||||
field:
|
||||
$ref: "#/components/schemas/TrustCenterFileOrderField"
|
||||
$ref: "#/components/schemas/CompliancePortalFileOrderField"
|
||||
direction:
|
||||
$ref: "#/components/schemas/OrderDirection"
|
||||
|
||||
@@ -8825,7 +8825,7 @@ components:
|
||||
type: string
|
||||
format: date-time
|
||||
|
||||
TrustCenter:
|
||||
CompliancePortal:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
@@ -8880,7 +8880,7 @@ components:
|
||||
type: string
|
||||
format: date-time
|
||||
|
||||
TrustCenterReference:
|
||||
CompliancePortalReference:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
@@ -8912,14 +8912,14 @@ components:
|
||||
type: string
|
||||
format: date-time
|
||||
|
||||
TrustCenterFile:
|
||||
CompliancePortalFile:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
- name
|
||||
- category
|
||||
- file
|
||||
- trust_center_visibility
|
||||
- compliance_portal_visibility
|
||||
- organization_id
|
||||
- created_at
|
||||
- updated_at
|
||||
@@ -8932,8 +8932,8 @@ components:
|
||||
type: string
|
||||
file:
|
||||
$ref: "#/components/schemas/File"
|
||||
trust_center_visibility:
|
||||
$ref: "#/components/schemas/TrustCenterVisibility"
|
||||
compliance_portal_visibility:
|
||||
$ref: "#/components/schemas/CompliancePortalVisibility"
|
||||
organization_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
created_at:
|
||||
@@ -9018,7 +9018,7 @@ components:
|
||||
type: string
|
||||
format: date-time
|
||||
|
||||
GetTrustCenterInput:
|
||||
GetCompliancePortalInput:
|
||||
type: object
|
||||
required:
|
||||
- organization_id
|
||||
@@ -9027,27 +9027,27 @@ components:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Organization ID
|
||||
|
||||
GetTrustCenterOutput:
|
||||
GetCompliancePortalOutput:
|
||||
type: object
|
||||
required:
|
||||
- trust_center
|
||||
- compliance_portal
|
||||
properties:
|
||||
trust_center:
|
||||
$ref: "#/components/schemas/TrustCenter"
|
||||
compliance_portal:
|
||||
$ref: "#/components/schemas/CompliancePortal"
|
||||
|
||||
UpdateTrustCenterInput:
|
||||
UpdateCompliancePortalInput:
|
||||
type: object
|
||||
required:
|
||||
- trust_center_id
|
||||
- compliance_portal_id
|
||||
properties:
|
||||
trust_center_id:
|
||||
compliance_portal_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Trust center ID
|
||||
description: Compliance portal ID
|
||||
active:
|
||||
type:
|
||||
- boolean
|
||||
- "null"
|
||||
description: Whether the trust center is active
|
||||
description: Whether the compliance portal is active
|
||||
go.probo.inc/mcpgen/omittable: true
|
||||
search_engine_indexing:
|
||||
anyOf:
|
||||
@@ -9086,25 +9086,25 @@ components:
|
||||
description: Public compliance page title
|
||||
go.probo.inc/mcpgen/omittable: true
|
||||
|
||||
UpdateTrustCenterOutput:
|
||||
UpdateCompliancePortalOutput:
|
||||
type: object
|
||||
required:
|
||||
- trust_center
|
||||
- compliance_portal
|
||||
properties:
|
||||
trust_center:
|
||||
$ref: "#/components/schemas/TrustCenter"
|
||||
compliance_portal:
|
||||
$ref: "#/components/schemas/CompliancePortal"
|
||||
|
||||
ListTrustCenterReferencesInput:
|
||||
ListCompliancePortalReferencesInput:
|
||||
type: object
|
||||
required:
|
||||
- trust_center_id
|
||||
- compliance_portal_id
|
||||
properties:
|
||||
trust_center_id:
|
||||
compliance_portal_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Trust center ID
|
||||
description: Compliance portal ID
|
||||
order_by:
|
||||
$ref: "#/components/schemas/TrustCenterReferenceOrderBy"
|
||||
description: Trust center reference order by
|
||||
$ref: "#/components/schemas/CompliancePortalReferenceOrderBy"
|
||||
description: Compliance portal reference order by
|
||||
size:
|
||||
type: integer
|
||||
description: Page size
|
||||
@@ -9112,28 +9112,28 @@ components:
|
||||
$ref: "#/components/schemas/CursorKey"
|
||||
description: Page cursor
|
||||
|
||||
ListTrustCenterReferencesOutput:
|
||||
ListCompliancePortalReferencesOutput:
|
||||
type: object
|
||||
required:
|
||||
- trust_center_references
|
||||
- compliance_portal_references
|
||||
properties:
|
||||
next_cursor:
|
||||
$ref: "#/components/schemas/CursorKey"
|
||||
description: Next cursor
|
||||
trust_center_references:
|
||||
compliance_portal_references:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/TrustCenterReference"
|
||||
$ref: "#/components/schemas/CompliancePortalReference"
|
||||
|
||||
AddTrustCenterReferenceInput:
|
||||
AddCompliancePortalReferenceInput:
|
||||
type: object
|
||||
required:
|
||||
- trust_center_id
|
||||
- compliance_portal_id
|
||||
- name
|
||||
properties:
|
||||
trust_center_id:
|
||||
compliance_portal_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Trust center ID
|
||||
description: Compliance portal ID
|
||||
name:
|
||||
type: string
|
||||
description: Reference name
|
||||
@@ -9144,22 +9144,22 @@ components:
|
||||
type: string
|
||||
description: Reference website URL
|
||||
|
||||
AddTrustCenterReferenceOutput:
|
||||
AddCompliancePortalReferenceOutput:
|
||||
type: object
|
||||
required:
|
||||
- trust_center_reference
|
||||
- compliance_portal_reference
|
||||
properties:
|
||||
trust_center_reference:
|
||||
$ref: "#/components/schemas/TrustCenterReference"
|
||||
compliance_portal_reference:
|
||||
$ref: "#/components/schemas/CompliancePortalReference"
|
||||
|
||||
UpdateTrustCenterReferenceInput:
|
||||
UpdateCompliancePortalReferenceInput:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
properties:
|
||||
id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Trust center reference ID
|
||||
description: Compliance portal reference ID
|
||||
name:
|
||||
type:
|
||||
- string
|
||||
@@ -9185,31 +9185,31 @@ components:
|
||||
description: Reference rank
|
||||
go.probo.inc/mcpgen/omittable: true
|
||||
|
||||
UpdateTrustCenterReferenceOutput:
|
||||
UpdateCompliancePortalReferenceOutput:
|
||||
type: object
|
||||
required:
|
||||
- trust_center_reference
|
||||
- compliance_portal_reference
|
||||
properties:
|
||||
trust_center_reference:
|
||||
$ref: "#/components/schemas/TrustCenterReference"
|
||||
compliance_portal_reference:
|
||||
$ref: "#/components/schemas/CompliancePortalReference"
|
||||
|
||||
DeleteTrustCenterReferenceInput:
|
||||
DeleteCompliancePortalReferenceInput:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
properties:
|
||||
id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Trust center reference ID
|
||||
description: Compliance portal reference ID
|
||||
|
||||
DeleteTrustCenterReferenceOutput:
|
||||
DeleteCompliancePortalReferenceOutput:
|
||||
type: object
|
||||
required:
|
||||
- deleted_trust_center_reference_id
|
||||
- deleted_compliance_portal_reference_id
|
||||
properties:
|
||||
deleted_trust_center_reference_id:
|
||||
deleted_compliance_portal_reference_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Deleted trust center reference ID
|
||||
description: Deleted compliance portal reference ID
|
||||
|
||||
CompliancePortalCommitmentIcon:
|
||||
type: string
|
||||
@@ -9579,7 +9579,7 @@ components:
|
||||
properties:
|
||||
resource_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Document, trust center file, or audit ID
|
||||
description: Document, compliance portal file, or audit ID
|
||||
alias:
|
||||
type: string
|
||||
description: Human-readable alias slug
|
||||
@@ -9623,7 +9623,7 @@ components:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Resource ID whose alias was removed
|
||||
|
||||
ListTrustCenterFilesInput:
|
||||
ListCompliancePortalFilesInput:
|
||||
type: object
|
||||
required:
|
||||
- organization_id
|
||||
@@ -9632,8 +9632,8 @@ components:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Organization ID
|
||||
order_by:
|
||||
$ref: "#/components/schemas/TrustCenterFileOrderBy"
|
||||
description: Trust center file order by
|
||||
$ref: "#/components/schemas/CompliancePortalFileOrderBy"
|
||||
description: Compliance portal file order by
|
||||
size:
|
||||
type: integer
|
||||
description: Page size
|
||||
@@ -9641,45 +9641,45 @@ components:
|
||||
$ref: "#/components/schemas/CursorKey"
|
||||
description: Page cursor
|
||||
|
||||
ListTrustCenterFilesOutput:
|
||||
ListCompliancePortalFilesOutput:
|
||||
type: object
|
||||
required:
|
||||
- trust_center_files
|
||||
- compliance_portal_files
|
||||
properties:
|
||||
next_cursor:
|
||||
$ref: "#/components/schemas/CursorKey"
|
||||
description: Next cursor
|
||||
trust_center_files:
|
||||
compliance_portal_files:
|
||||
type: array
|
||||
items:
|
||||
$ref: "#/components/schemas/TrustCenterFile"
|
||||
$ref: "#/components/schemas/CompliancePortalFile"
|
||||
|
||||
DeleteTrustCenterFileInput:
|
||||
DeleteCompliancePortalFileInput:
|
||||
type: object
|
||||
required:
|
||||
- id
|
||||
properties:
|
||||
id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Trust center file ID
|
||||
description: Compliance portal file ID
|
||||
|
||||
DeleteTrustCenterFileOutput:
|
||||
DeleteCompliancePortalFileOutput:
|
||||
type: object
|
||||
required:
|
||||
- deleted_trust_center_file_id
|
||||
- deleted_compliance_portal_file_id
|
||||
properties:
|
||||
deleted_trust_center_file_id:
|
||||
deleted_compliance_portal_file_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Deleted trust center file ID
|
||||
description: Deleted compliance portal file ID
|
||||
|
||||
ListComplianceCustomLinksInput:
|
||||
type: object
|
||||
required:
|
||||
- trust_center_id
|
||||
- compliance_portal_id
|
||||
properties:
|
||||
trust_center_id:
|
||||
compliance_portal_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Trust center ID
|
||||
description: Compliance portal ID
|
||||
order_by:
|
||||
$ref: "#/components/schemas/ComplianceCustomLinkOrderBy"
|
||||
description: Compliance custom link order by
|
||||
@@ -9706,13 +9706,13 @@ components:
|
||||
AddComplianceCustomLinkInput:
|
||||
type: object
|
||||
required:
|
||||
- trust_center_id
|
||||
- compliance_portal_id
|
||||
- name
|
||||
- url
|
||||
properties:
|
||||
trust_center_id:
|
||||
compliance_portal_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Trust center ID
|
||||
description: Compliance portal ID
|
||||
name:
|
||||
type: string
|
||||
description: Custom Link name
|
||||
@@ -9784,12 +9784,12 @@ components:
|
||||
CreateCustomDomainInput:
|
||||
type: object
|
||||
required:
|
||||
- trust_center_id
|
||||
- compliance_portal_id
|
||||
- domain
|
||||
properties:
|
||||
trust_center_id:
|
||||
compliance_portal_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Compliance page (trust center) ID
|
||||
description: Compliance portal ID
|
||||
domain:
|
||||
type: string
|
||||
description: Custom domain name
|
||||
@@ -9805,11 +9805,11 @@ components:
|
||||
DeleteCustomDomainInput:
|
||||
type: object
|
||||
required:
|
||||
- trust_center_id
|
||||
- compliance_portal_id
|
||||
properties:
|
||||
trust_center_id:
|
||||
compliance_portal_id:
|
||||
$ref: "#/components/schemas/GID"
|
||||
description: Compliance page (trust center) ID
|
||||
description: Compliance portal ID
|
||||
|
||||
DeleteCustomDomainOutput:
|
||||
type: object
|
||||
@@ -14036,57 +14036,57 @@ tools:
|
||||
$ref: "#/components/schemas/DeleteRightsRequestInput"
|
||||
outputSchema:
|
||||
$ref: "#/components/schemas/DeleteRightsRequestOutput"
|
||||
- name: getTrustCenter
|
||||
description: Get the trust center for an organization
|
||||
- name: getCompliancePortal
|
||||
description: Get the compliance portal for an organization
|
||||
hints:
|
||||
readonly: true
|
||||
idempotent: true
|
||||
inputSchema:
|
||||
$ref: "#/components/schemas/GetTrustCenterInput"
|
||||
$ref: "#/components/schemas/GetCompliancePortalInput"
|
||||
outputSchema:
|
||||
$ref: "#/components/schemas/GetTrustCenterOutput"
|
||||
- name: updateTrustCenter
|
||||
description: Update a trust center's settings
|
||||
$ref: "#/components/schemas/GetCompliancePortalOutput"
|
||||
- name: updateCompliancePortal
|
||||
description: Update a compliance portal's settings
|
||||
hints:
|
||||
readonly: false
|
||||
inputSchema:
|
||||
$ref: "#/components/schemas/UpdateTrustCenterInput"
|
||||
$ref: "#/components/schemas/UpdateCompliancePortalInput"
|
||||
outputSchema:
|
||||
$ref: "#/components/schemas/UpdateTrustCenterOutput"
|
||||
- name: listTrustCenterReferences
|
||||
description: List all references for a trust center
|
||||
$ref: "#/components/schemas/UpdateCompliancePortalOutput"
|
||||
- name: listCompliancePortalReferences
|
||||
description: List all references for a compliance portal
|
||||
hints:
|
||||
readonly: true
|
||||
idempotent: true
|
||||
inputSchema:
|
||||
$ref: "#/components/schemas/ListTrustCenterReferencesInput"
|
||||
$ref: "#/components/schemas/ListCompliancePortalReferencesInput"
|
||||
outputSchema:
|
||||
$ref: "#/components/schemas/ListTrustCenterReferencesOutput"
|
||||
- name: addTrustCenterReference
|
||||
description: Add a new reference to a trust center
|
||||
$ref: "#/components/schemas/ListCompliancePortalReferencesOutput"
|
||||
- name: addCompliancePortalReference
|
||||
description: Add a new reference to a compliance portal
|
||||
hints:
|
||||
readonly: false
|
||||
inputSchema:
|
||||
$ref: "#/components/schemas/AddTrustCenterReferenceInput"
|
||||
$ref: "#/components/schemas/AddCompliancePortalReferenceInput"
|
||||
outputSchema:
|
||||
$ref: "#/components/schemas/AddTrustCenterReferenceOutput"
|
||||
- name: updateTrustCenterReference
|
||||
description: Update an existing trust center reference
|
||||
$ref: "#/components/schemas/AddCompliancePortalReferenceOutput"
|
||||
- name: updateCompliancePortalReference
|
||||
description: Update an existing compliance portal reference
|
||||
hints:
|
||||
readonly: false
|
||||
inputSchema:
|
||||
$ref: "#/components/schemas/UpdateTrustCenterReferenceInput"
|
||||
$ref: "#/components/schemas/UpdateCompliancePortalReferenceInput"
|
||||
outputSchema:
|
||||
$ref: "#/components/schemas/UpdateTrustCenterReferenceOutput"
|
||||
- name: deleteTrustCenterReference
|
||||
description: Delete a trust center reference
|
||||
$ref: "#/components/schemas/UpdateCompliancePortalReferenceOutput"
|
||||
- name: deleteCompliancePortalReference
|
||||
description: Delete a compliance portal reference
|
||||
hints:
|
||||
readonly: false
|
||||
destructive: true
|
||||
inputSchema:
|
||||
$ref: "#/components/schemas/DeleteTrustCenterReferenceInput"
|
||||
$ref: "#/components/schemas/DeleteCompliancePortalReferenceInput"
|
||||
outputSchema:
|
||||
$ref: "#/components/schemas/DeleteTrustCenterReferenceOutput"
|
||||
$ref: "#/components/schemas/DeleteCompliancePortalReferenceOutput"
|
||||
- name: listCommitmentGroups
|
||||
description: List all commitment groups for a trust center
|
||||
hints:
|
||||
@@ -14172,26 +14172,26 @@ tools:
|
||||
$ref: "#/components/schemas/RemoveResourceAliasInput"
|
||||
outputSchema:
|
||||
$ref: "#/components/schemas/RemoveResourceAliasOutput"
|
||||
- name: listTrustCenterFiles
|
||||
description: List all files for the trust center
|
||||
- name: listCompliancePortalFiles
|
||||
description: List all files for the compliance portal
|
||||
hints:
|
||||
readonly: true
|
||||
idempotent: true
|
||||
inputSchema:
|
||||
$ref: "#/components/schemas/ListTrustCenterFilesInput"
|
||||
$ref: "#/components/schemas/ListCompliancePortalFilesInput"
|
||||
outputSchema:
|
||||
$ref: "#/components/schemas/ListTrustCenterFilesOutput"
|
||||
- name: deleteTrustCenterFile
|
||||
description: Delete a trust center file
|
||||
$ref: "#/components/schemas/ListCompliancePortalFilesOutput"
|
||||
- name: deleteCompliancePortalFile
|
||||
description: Delete a compliance portal file
|
||||
hints:
|
||||
readonly: false
|
||||
destructive: true
|
||||
inputSchema:
|
||||
$ref: "#/components/schemas/DeleteTrustCenterFileInput"
|
||||
$ref: "#/components/schemas/DeleteCompliancePortalFileInput"
|
||||
outputSchema:
|
||||
$ref: "#/components/schemas/DeleteTrustCenterFileOutput"
|
||||
$ref: "#/components/schemas/DeleteCompliancePortalFileOutput"
|
||||
- name: listComplianceCustomLinks
|
||||
description: List all compliance custom links for a trust center
|
||||
description: List all compliance custom links for a compliance portal
|
||||
hints:
|
||||
readonly: true
|
||||
idempotent: true
|
||||
@@ -14200,7 +14200,7 @@ tools:
|
||||
outputSchema:
|
||||
$ref: "#/components/schemas/ListComplianceCustomLinksOutput"
|
||||
- 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:
|
||||
readonly: false
|
||||
inputSchema:
|
||||
|
||||
@@ -27,17 +27,17 @@ import (
|
||||
|
||||
func NewAudit(a *coredata.Audit, file *coredata.File) *Audit {
|
||||
audit := &Audit{
|
||||
ID: a.ID,
|
||||
Name: a.Name,
|
||||
OrganizationID: a.OrganizationID,
|
||||
FrameworkID: a.FrameworkID,
|
||||
State: a.State,
|
||||
TrustCenterVisibility: a.TrustCenterVisibility,
|
||||
HasReport: a.ReportFileID != nil,
|
||||
ValidFrom: a.ValidFrom,
|
||||
ValidUntil: a.ValidUntil,
|
||||
CreatedAt: a.CreatedAt,
|
||||
UpdatedAt: a.UpdatedAt,
|
||||
ID: a.ID,
|
||||
Name: a.Name,
|
||||
OrganizationID: a.OrganizationID,
|
||||
FrameworkID: a.FrameworkID,
|
||||
State: a.State,
|
||||
CompliancePortalVisibility: a.CompliancePortalVisibility,
|
||||
HasReport: a.ReportFileID != nil,
|
||||
ValidFrom: a.ValidFrom,
|
||||
ValidUntil: a.ValidUntil,
|
||||
CreatedAt: a.CreatedAt,
|
||||
UpdatedAt: a.UpdatedAt,
|
||||
}
|
||||
|
||||
if file != nil {
|
||||
|
||||
@@ -25,8 +25,8 @@ import (
|
||||
"go.probo.inc/probo/pkg/page"
|
||||
)
|
||||
|
||||
func NewTrustCenter(tc *coredata.TrustCenter) *TrustCenter {
|
||||
return &TrustCenter{
|
||||
func NewCompliancePortal(tc *coredata.CompliancePortal) *CompliancePortal {
|
||||
return &CompliancePortal{
|
||||
ID: tc.ID,
|
||||
OrganizationID: tc.OrganizationID,
|
||||
Active: tc.Active,
|
||||
@@ -41,8 +41,8 @@ func NewTrustCenter(tc *coredata.TrustCenter) *TrustCenter {
|
||||
}
|
||||
}
|
||||
|
||||
func NewTrustCenterReference(r *coredata.TrustCenterReference) *TrustCenterReference {
|
||||
return &TrustCenterReference{
|
||||
func NewCompliancePortalReference(r *coredata.CompliancePortalReference) *CompliancePortalReference {
|
||||
return &CompliancePortalReference{
|
||||
ID: r.ID,
|
||||
Name: r.Name,
|
||||
Description: r.Description,
|
||||
@@ -53,10 +53,10 @@ func NewTrustCenterReference(r *coredata.TrustCenterReference) *TrustCenterRefer
|
||||
}
|
||||
}
|
||||
|
||||
func NewListTrustCenterReferencesOutput(
|
||||
refs []*TrustCenterReference,
|
||||
p *page.Page[*coredata.TrustCenterReference, coredata.TrustCenterReferenceOrderField],
|
||||
) ListTrustCenterReferencesOutput {
|
||||
func NewListCompliancePortalReferencesOutput(
|
||||
refs []*CompliancePortalReference,
|
||||
p *page.Page[*coredata.CompliancePortalReference, coredata.CompliancePortalReferenceOrderField],
|
||||
) ListCompliancePortalReferencesOutput {
|
||||
var nextCursor *page.CursorKey
|
||||
|
||||
if len(p.Data) > 0 {
|
||||
@@ -64,35 +64,35 @@ func NewListTrustCenterReferencesOutput(
|
||||
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,
|
||||
TrustCenterReferences: refs,
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
CompliancePortalFiles: files,
|
||||
}
|
||||
}
|
||||
@@ -49,16 +49,16 @@ func proseMirrorJSONToMarkdown(pmJSON string) (string, error) {
|
||||
|
||||
func NewDocument(d *coredata.Document) *Document {
|
||||
return &Document{
|
||||
ID: d.ID,
|
||||
OrganizationID: d.OrganizationID,
|
||||
CurrentPublishedMajor: d.CurrentPublishedMajor,
|
||||
CurrentPublishedMinor: d.CurrentPublishedMinor,
|
||||
WriteMode: d.WriteMode,
|
||||
TrustCenterVisibility: d.TrustCenterVisibility,
|
||||
Status: d.Status,
|
||||
ArchivedAt: d.ArchivedAt,
|
||||
CreatedAt: d.CreatedAt,
|
||||
UpdatedAt: d.UpdatedAt,
|
||||
ID: d.ID,
|
||||
OrganizationID: d.OrganizationID,
|
||||
CurrentPublishedMajor: d.CurrentPublishedMajor,
|
||||
CurrentPublishedMinor: d.CurrentPublishedMinor,
|
||||
WriteMode: d.WriteMode,
|
||||
CompliancePortalVisibility: d.CompliancePortalVisibility,
|
||||
Status: d.Status,
|
||||
ArchivedAt: d.ArchivedAt,
|
||||
CreatedAt: d.CreatedAt,
|
||||
UpdatedAt: d.UpdatedAt,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ import (
|
||||
func NewMux(
|
||||
logger *log.Logger,
|
||||
slackSvc *slack.Service,
|
||||
trustSvc *visitor.Service,
|
||||
visitorSvc *visitor.Service,
|
||||
) *chi.Mux {
|
||||
r := chi.NewMux()
|
||||
|
||||
@@ -40,7 +40,7 @@ func NewMux(
|
||||
slackSvc,
|
||||
slackSvc.GetSlackSigningSecret(),
|
||||
logger,
|
||||
trustSvc,
|
||||
visitorSvc,
|
||||
))
|
||||
|
||||
return r
|
||||
|
||||
@@ -63,7 +63,7 @@ const (
|
||||
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) {
|
||||
ctx := r.Context()
|
||||
|
||||
@@ -235,7 +235,7 @@ func SlackHandler(slackSvc *slack.Service, slackSigningSecret string, logger *lo
|
||||
documentIDs = []gid.GID{gID}
|
||||
case coredata.FileEntityType:
|
||||
reportIDs = []gid.GID{gID}
|
||||
case coredata.TrustCenterFileEntityType:
|
||||
case coredata.CompliancePortalFileEntityType:
|
||||
fileIDs = []gid.GID{gID}
|
||||
default:
|
||||
logger.ErrorCtx(ctx, "unknown entity type", log.Error(err))
|
||||
@@ -247,7 +247,7 @@ func SlackHandler(slackSvc *slack.Service, slackSigningSecret string, logger *lo
|
||||
|
||||
switch statusAction {
|
||||
case StatusAccept:
|
||||
if err := trustSvc.GrantPortalAccessByIDs(
|
||||
if err := visitorSvc.GrantPortalAccessByIDs(
|
||||
ctx,
|
||||
scope,
|
||||
initialSlackMessage.OrganizationID,
|
||||
@@ -262,7 +262,7 @@ func SlackHandler(slackSvc *slack.Service, slackSigningSecret string, logger *lo
|
||||
return
|
||||
}
|
||||
case StatusReject:
|
||||
if err := trustSvc.RejectOrRevokePortalAccessByIDs(
|
||||
if err := visitorSvc.RejectOrRevokePortalAccessByIDs(
|
||||
ctx,
|
||||
scope,
|
||||
initialSlackMessage.OrganizationID,
|
||||
|
||||
@@ -62,7 +62,7 @@ type Config struct {
|
||||
ResourceAlias *resourcealias.Service
|
||||
File *filemanager.Service
|
||||
IAM *iam.Service
|
||||
Trust *visitor.Service
|
||||
Visitor *visitor.Service
|
||||
ESign *esign.Service
|
||||
Management *management.Service
|
||||
CertManager *certmanager.Service
|
||||
@@ -104,7 +104,7 @@ func NewServer(cfg Config) (*Server, error) {
|
||||
ResourceAlias: cfg.ResourceAlias,
|
||||
File: cfg.File,
|
||||
IAM: cfg.IAM,
|
||||
Trust: cfg.Trust,
|
||||
Visitor: cfg.Visitor,
|
||||
ESign: cfg.ESign,
|
||||
Management: cfg.Management,
|
||||
CertManager: cfg.CertManager,
|
||||
|
||||
Reference in New Issue
Block a user