Add compliance portal visitor OAuth service
Handle OAuth initiation, callback exchange, and session creation for anonymous trust center visitors through the portal package. Signed-off-by: Bryan Frimin <bryan@probo.com>
This commit is contained in:
@@ -30,6 +30,31 @@ import (
|
||||
"go.probo.inc/probo/pkg/page"
|
||||
)
|
||||
|
||||
func (s *Service) GetComplianceFramework(
|
||||
ctx context.Context,
|
||||
scope coredata.Scoper,
|
||||
complianceFrameworkID gid.GID,
|
||||
) (*coredata.ComplianceFramework, error) {
|
||||
cf := &coredata.ComplianceFramework{}
|
||||
|
||||
err := s.pg.WithConn(
|
||||
ctx,
|
||||
func(ctx context.Context, conn pg.Querier) error {
|
||||
err := cf.LoadByID(ctx, conn, scope, complianceFrameworkID)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot load compliance framework: %w", err)
|
||||
}
|
||||
|
||||
return nil
|
||||
},
|
||||
)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return cf, nil
|
||||
}
|
||||
|
||||
func (s *Service) ListComplianceFrameworksByPortalID(
|
||||
ctx context.Context,
|
||||
scope coredata.Scoper,
|
||||
|
||||
Reference in New Issue
Block a user