Signed-off-by: Bryan Frimin <bryan@probo.com>
This commit is contained in:
Bryan Frimin
2026-05-23 14:07:37 -07:00
parent 23af4caf43
commit bd04f1812a
84 changed files with 227 additions and 139 deletions

View File

@@ -89,10 +89,11 @@ func (e *AccessEntry) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -108,10 +108,11 @@ func (h *AccessEntryDecisionHistory) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -73,10 +73,11 @@ func (c *AccessReviewCampaign) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -72,10 +72,11 @@ func (as *AccessSource) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -141,10 +141,11 @@ func (e *AgentRun) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -77,10 +77,11 @@ func (s *ApplicabilityStatement) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -75,10 +75,11 @@ func (a *Asset) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -81,10 +81,11 @@ func (a *Audit) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -73,10 +73,11 @@ func (e *AuditLogEntry) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -73,10 +73,11 @@ func (c *ComplianceExternalURL) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -76,10 +76,11 @@ func (c *ComplianceFramework) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -105,10 +105,11 @@ func (c *Connector) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -78,10 +78,11 @@ func (c *Control) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -77,10 +77,11 @@ func (b *CookieBanner) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -62,10 +62,11 @@ func (t *CookieBannerTranslation) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -100,10 +100,11 @@ func (v *CookieBannerVersion) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -102,10 +102,11 @@ func (c *CookieCategory) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -78,10 +78,11 @@ func (r *CookieConsentRecord) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -88,10 +88,11 @@ func (cd *CustomDomain) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -183,10 +183,11 @@ func (dpia *DataProtectionImpactAssessment) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -75,10 +75,11 @@ func (d *Datum) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -85,10 +85,11 @@ func (d *Document) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -73,10 +73,11 @@ func (dv *DocumentVersion) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -74,10 +74,11 @@ func (d *DocumentVersionApprovalDecision) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -70,10 +70,11 @@ func (q *DocumentVersionApprovalQuorum) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -84,10 +84,11 @@ func (dvs *DocumentVersionSignature) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -78,6 +78,7 @@ func (es *ElectronicSignature) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
if err := rows.Scan(&id, &organizationID); err != nil {

View File

@@ -91,10 +91,11 @@ WHERE
defer rows.Close()
attrsByID := make(policy.AttributesByID, len(resourceIDs))
for rows.Next() {
var id gid.GID
err = rows.Scan(&id)
if err != nil {
if err := rows.Scan(&id); err != nil {
return nil, fmt.Errorf("cannot scan email authorization attributes: %w", err)
}

View File

@@ -79,10 +79,11 @@ func (e *Evidence) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -83,10 +83,11 @@ func (ej *ExportJob) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -85,10 +85,11 @@ func (f *File) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -92,10 +92,11 @@ func (f *Finding) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -80,6 +80,7 @@ WHERE
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var (
frameworkID gid.GID
@@ -88,10 +89,12 @@ WHERE
if err := rows.Scan(&frameworkID, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan framework authorization attributes batch: %w", err)
}
attrsByID[frameworkID] = policy.Attributes{
"organization_id": organizationID.String(),
}
}
if err := rows.Err(); err != nil {
return nil, fmt.Errorf("cannot iterate framework authorization attributes batch: %w", err)
}

View File

@@ -170,6 +170,7 @@ WHERE
defer rows.Close()
attrsByID := make(policy.AttributesByID, len(resourceIDs))
for rows.Next() {
var (
id gid.GID

View File

@@ -170,6 +170,7 @@ WHERE
defer rows.Close()
attrsByID := make(policy.AttributesByID, len(resourceIDs))
for rows.Next() {
var (
id gid.GID

View File

@@ -55,10 +55,11 @@ func (ml *MailingList) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -64,10 +64,11 @@ func (cns *MailingListSubscriber) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -73,10 +73,11 @@ func (mlu *MailingListUpdate) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -76,10 +76,11 @@ func (m *Measure) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -228,6 +228,7 @@ WHERE
defer rows.Close()
attrsByID := make(policy.AttributesByID, len(resourceIDs))
for rows.Next() {
var (
id gid.GID

View File

@@ -115,6 +115,7 @@ WHERE
defer rows.Close()
attrsByID := make(policy.AttributesByID, len(resourceIDs))
for rows.Next() {
var (
id gid.GID

View File

@@ -99,6 +99,7 @@ WHERE
defer rows.Close()
attrsByID := make(policy.AttributesByID, len(resourceIDs))
for rows.Next() {
var (
id gid.GID
@@ -114,6 +115,7 @@ WHERE
if organizationID != nil {
attrs["organization_id"] = organizationID.String()
}
attrsByID[id] = attrs
}

View File

@@ -86,6 +86,7 @@ WHERE
defer rows.Close()
attrsByID := make(policy.AttributesByID, len(resourceIDs))
for rows.Next() {
var (
id gid.GID

View File

@@ -83,10 +83,11 @@ func (o *Obligation) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -66,6 +66,7 @@ func (o *Organization) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id gid.GID
if err := rows.Scan(&id); err != nil {

View File

@@ -120,6 +120,7 @@ WHERE
defer rows.Close()
attrsByID := make(policy.AttributesByID, len(resourceIDs))
for rows.Next() {
var (
id gid.GID

View File

@@ -196,10 +196,11 @@ func (p *ProcessingActivity) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -62,10 +62,11 @@ func (r *Report) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -81,10 +81,11 @@ func (rr *RightsRequest) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -202,10 +202,11 @@ func (r *Risk) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -71,10 +71,11 @@ func (ra *RiskAssessment) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -73,10 +73,11 @@ func (n *RiskAssessmentNode) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -74,10 +74,11 @@ func (p *RiskAssessmentProcess) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -72,10 +72,11 @@ func (s *RiskAssessmentScenario) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -71,10 +71,11 @@ func (s *RiskAssessmentScope) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -74,10 +74,11 @@ func (t *RiskAssessmentThreat) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -83,10 +83,11 @@ func (s *SAMLConfiguration) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -80,10 +80,11 @@ func (s *SCIMBridge) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -70,10 +70,11 @@ func (s *SCIMConfiguration) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -76,10 +76,11 @@ func (s *SCIMEvent) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -221,6 +221,7 @@ WHERE
defer rows.Close()
attrsByID := make(policy.AttributesByID, len(resourceIDs))
for rows.Next() {
var (
id gid.GID

View File

@@ -77,10 +77,11 @@ func (sm *SlackMessage) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -72,10 +72,11 @@ func (s *StatementOfApplicability) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -83,10 +83,11 @@ func (t *Task) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -201,10 +201,11 @@ func (v *ThirdParty) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -72,10 +72,11 @@ func (vbaa *ThirdPartyBusinessAssociateAgreement) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -73,10 +73,11 @@ func (v *ThirdPartyComplianceReport) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -77,10 +77,11 @@ func (vc *ThirdPartyContact) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -72,10 +72,11 @@ func (vdpa *ThirdPartyDataPrivacyAgreement) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -74,10 +74,11 @@ func (v *ThirdPartyRiskAssessment) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -72,10 +72,11 @@ func (vs *ThirdPartyService) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -99,10 +99,11 @@ func (tp *TrackerPattern) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -87,10 +87,11 @@ func (tr *TrackerResource) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -182,10 +182,11 @@ func (tia *TransferImpactAssessment) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -76,10 +76,11 @@ func (tc *TrustCenter) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -72,10 +72,11 @@ func (tca *TrustCenterAccess) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -73,10 +73,11 @@ func (tcda *TrustCenterDocumentAccess) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -74,10 +74,11 @@ func (t *TrustCenterFile) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -80,10 +80,11 @@ func (t *TrustCenterReference) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -104,10 +104,11 @@ func (w *WebhookSubscription) AuthorizationAttributes(
defer rows.Close()
attrsByID := make(policy.AttributesByID)
for rows.Next() {
var id, organizationID gid.GID
err := rows.Scan(&id, &organizationID)
if err != nil {
if err := rows.Scan(&id, &organizationID); err != nil {
return nil, fmt.Errorf("cannot scan authorization attributes: %w", err)
}

View File

@@ -387,6 +387,7 @@ func (a *Authorizer) evaluateMultiInTx(
// On failure, ErrAssumptionRequired is recorded only against items that
// did not opt out.
var assumptionErr error
if requiresAssumptionCheck {
err := a.checkAssumption(
ctx,
@@ -431,6 +432,7 @@ func (a *Authorizer) evaluateMultiInTx(
decisions := make([]error, len(params.Items))
itemAttrs := make([]policy.Attributes, len(params.Items))
for i, item := range params.Items {
resAttrs := resourceAttrsByResourceID[item.Resource]
if len(item.ResourceAttributes) > 0 {
@@ -438,6 +440,7 @@ func (a *Authorizer) evaluateMultiInTx(
maps.Copy(merged, item.ResourceAttributes)
resAttrs = merged
}
itemAttrs[i] = resAttrs
if assumptionErr != nil && !item.SkipAssumptionCheck {

View File

@@ -986,6 +986,7 @@ func insertBatchTestChildSession(
expiredAt := now.Add(30 * time.Minute)
var expireReason *coredata.ExpireReason
if expired {
reason := coredata.ExpireReasonRevoked
expireReason = &reason
@@ -1039,6 +1040,7 @@ func countAuditLogsForAction(t *testing.T, ctx context.Context, client *pg.Clien
t.Helper()
var count int
require.NoError(t, client.WithTx(ctx, func(ctx context.Context, tx pg.Tx) error {
if err := tx.QueryRow(
ctx,

View File

@@ -83,7 +83,6 @@ func TestAuthorizer_ValidateInputs(t *testing.T) {
_, ok := errors.AsType[*ErrEmptyResourceBatch](err)
require.True(t, ok)
})
}
func TestAuthorizer_InternalErrorPaths(t *testing.T) {

View File

@@ -106,6 +106,7 @@ func TestAuthorizeRelatedErrors_Error(t *testing.T) {
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
if tt.err.Error() != tt.want {
t.Errorf("Error() = %q, want %q", tt.err.Error(), tt.want)
}