Go format

Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
Sacha Al Himdani
2026-03-03 11:17:05 +01:00
parent 3c70b1e3eb
commit 21ed4113c3
47 changed files with 112 additions and 119 deletions

View File

@@ -21,8 +21,8 @@ import (
type ApplicabilityStatementOrderField string type ApplicabilityStatementOrderField string
const ( const (
ApplicabilityStatementOrderFieldCreatedAt ApplicabilityStatementOrderField = "CREATED_AT" ApplicabilityStatementOrderFieldCreatedAt ApplicabilityStatementOrderField = "CREATED_AT"
ApplicabilityStatementOrderFieldControlSectionTitle ApplicabilityStatementOrderField = "CONTROL_SECTION_TITLE" ApplicabilityStatementOrderFieldControlSectionTitle ApplicabilityStatementOrderField = "CONTROL_SECTION_TITLE"
) )
func (p ApplicabilityStatementOrderField) Column() string { func (p ApplicabilityStatementOrderField) Column() string {

View File

@@ -15,8 +15,8 @@
package coredata package coredata
import ( import (
"go.probo.inc/probo/pkg/gid"
"github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5"
"go.probo.inc/probo/pkg/gid"
) )
type ( type (

View File

@@ -20,9 +20,9 @@ import (
"maps" "maps"
"time" "time"
"go.probo.inc/probo/pkg/gid"
"github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5"
"go.gearno.de/kit/pg" "go.gearno.de/kit/pg"
"go.probo.inc/probo/pkg/gid"
) )
type ( type (

View File

@@ -19,10 +19,10 @@ import (
"fmt" "fmt"
"time" "time"
"go.probo.inc/probo/pkg/crypto/cipher"
"go.probo.inc/probo/pkg/gid"
"github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5"
"go.gearno.de/kit/pg" "go.gearno.de/kit/pg"
"go.probo.inc/probo/pkg/crypto/cipher"
"go.probo.inc/probo/pkg/gid"
) )
type ( type (

View File

@@ -15,8 +15,8 @@
package coredata package coredata
import ( import (
"go.probo.inc/probo/pkg/gid"
"github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5"
"go.probo.inc/probo/pkg/gid"
) )
type ( type (

View File

@@ -20,9 +20,9 @@ import (
"maps" "maps"
"time" "time"
"go.probo.inc/probo/pkg/gid"
"github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5"
"go.gearno.de/kit/pg" "go.gearno.de/kit/pg"
"go.probo.inc/probo/pkg/gid"
) )
type ( type (

View File

@@ -20,9 +20,9 @@ import (
"maps" "maps"
"time" "time"
"go.probo.inc/probo/pkg/gid"
"github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5"
"go.gearno.de/kit/pg" "go.gearno.de/kit/pg"
"go.probo.inc/probo/pkg/gid"
) )
type ( type (

View File

@@ -43,4 +43,3 @@ func (p *DataProtectionImpactAssessmentOrderField) UnmarshalText(text []byte) er
} }
return fmt.Errorf("invalid DataProtectionImpactAssessmentOrderField value: %q", val) return fmt.Errorf("invalid DataProtectionImpactAssessmentOrderField value: %q", val)
} }

View File

@@ -66,4 +66,3 @@ func (p *DataProtectionImpactAssessmentResidualRisk) Scan(value any) error {
func (p DataProtectionImpactAssessmentResidualRisk) Value() (driver.Value, error) { func (p DataProtectionImpactAssessmentResidualRisk) Value() (driver.Value, error) {
return p.String(), nil return p.String(), nil
} }

View File

@@ -15,8 +15,8 @@
package coredata package coredata
import ( import (
"go.probo.inc/probo/pkg/gid"
"github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5"
"go.probo.inc/probo/pkg/gid"
) )
type ( type (

View File

@@ -20,9 +20,9 @@ import (
"maps" "maps"
"time" "time"
"go.probo.inc/probo/pkg/gid"
"github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5"
"go.gearno.de/kit/pg" "go.gearno.de/kit/pg"
"go.probo.inc/probo/pkg/gid"
) )
type ( type (

View File

@@ -62,11 +62,11 @@ ON CONFLICT (document_id, approver_profile_id) DO NOTHING;
` `
args := pgx.StrictNamedArgs{ args := pgx.StrictNamedArgs{
"document_id": da.DocumentID, "document_id": da.DocumentID,
"approver_profile_id": da.ApproverProfileID, "approver_profile_id": da.ApproverProfileID,
"organization_id": da.OrganizationID, "organization_id": da.OrganizationID,
"tenant_id": scope.GetTenantID(), "tenant_id": scope.GetTenantID(),
"created_at": da.CreatedAt, "created_at": da.CreatedAt,
} }
_, err := conn.Exec(ctx, q, args) _, err := conn.Exec(ctx, q, args)

View File

@@ -15,8 +15,8 @@
package coredata package coredata
import ( import (
"go.probo.inc/probo/pkg/gid"
"github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5"
"go.probo.inc/probo/pkg/gid"
) )
type ( type (

View File

@@ -15,8 +15,8 @@
package coredata package coredata
import ( import (
"go.probo.inc/probo/pkg/gid"
"github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5"
"go.probo.inc/probo/pkg/gid"
) )
type ( type (

View File

@@ -15,8 +15,8 @@
package coredata package coredata
import ( import (
"go.probo.inc/probo/pkg/gid"
"github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5"
"go.probo.inc/probo/pkg/gid"
) )
type ( type (

View File

@@ -22,8 +22,8 @@ import (
type RightsRequestType string type RightsRequestType string
const ( const (
RightsRequestTypeAccess RightsRequestType = "ACCESS" RightsRequestTypeAccess RightsRequestType = "ACCESS"
RightsRequestTypeDeletion RightsRequestType = "DELETION" RightsRequestTypeDeletion RightsRequestType = "DELETION"
RightsRequestTypePortability RightsRequestType = "PORTABILITY" RightsRequestTypePortability RightsRequestType = "PORTABILITY"
) )

View File

@@ -20,9 +20,9 @@ import (
"maps" "maps"
"time" "time"
"go.probo.inc/probo/pkg/gid"
"github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5"
"go.gearno.de/kit/pg" "go.gearno.de/kit/pg"
"go.probo.inc/probo/pkg/gid"
) )
type ( type (

View File

@@ -15,8 +15,8 @@
package coredata package coredata
import ( import (
"go.probo.inc/probo/pkg/gid"
"github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5"
"go.probo.inc/probo/pkg/gid"
) )
type ( type (

View File

@@ -20,9 +20,9 @@ import (
"maps" "maps"
"time" "time"
"go.probo.inc/probo/pkg/gid"
"github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5"
"go.gearno.de/kit/pg" "go.gearno.de/kit/pg"
"go.probo.inc/probo/pkg/gid"
) )
type ( type (

View File

@@ -15,8 +15,8 @@
package coredata package coredata
import ( import (
"go.probo.inc/probo/pkg/gid"
"github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5"
"go.probo.inc/probo/pkg/gid"
) )
type ( type (

View File

@@ -43,4 +43,3 @@ func (p *TransferImpactAssessmentOrderField) UnmarshalText(text []byte) error {
} }
return fmt.Errorf("invalid TransferImpactAssessmentOrderField value: %q", val) return fmt.Errorf("invalid TransferImpactAssessmentOrderField value: %q", val)
} }

View File

@@ -15,8 +15,8 @@
package coredata package coredata
import ( import (
"go.probo.inc/probo/pkg/gid"
"github.com/jackc/pgx/v5" "github.com/jackc/pgx/v5"
"go.probo.inc/probo/pkg/gid"
) )
type ( type (

View File

@@ -29,12 +29,12 @@ import (
type ( type (
WebhookData struct { WebhookData struct {
ID gid.GID `db:"id"` ID gid.GID `db:"id"`
OrganizationID gid.GID `db:"organization_id"` OrganizationID gid.GID `db:"organization_id"`
EventType WebhookEventType `db:"event_type"` EventType WebhookEventType `db:"event_type"`
Data json.RawMessage `db:"data"` Data json.RawMessage `db:"data"`
CreatedAt time.Time `db:"created_at"` CreatedAt time.Time `db:"created_at"`
ProcessedAt *time.Time `db:"processed_at"` ProcessedAt *time.Time `db:"processed_at"`
} }
WebhookDataList []*WebhookData WebhookDataList []*WebhookData

View File

@@ -29,12 +29,12 @@ import (
type ( type (
WebhookEvent struct { WebhookEvent struct {
ID gid.GID `db:"id"` ID gid.GID `db:"id"`
WebhookDataID gid.GID `db:"webhook_data_id"` WebhookDataID gid.GID `db:"webhook_data_id"`
WebhookSubscriptionID gid.GID `db:"webhook_subscription_id"` WebhookSubscriptionID gid.GID `db:"webhook_subscription_id"`
Status WebhookEventStatus `db:"status"` Status WebhookEventStatus `db:"status"`
Response json.RawMessage `db:"response"` Response json.RawMessage `db:"response"`
CreatedAt time.Time `db:"created_at"` CreatedAt time.Time `db:"created_at"`
} }
WebhookEvents []*WebhookEvent WebhookEvents []*WebhookEvent
@@ -143,13 +143,13 @@ VALUES (
` `
args := pgx.StrictNamedArgs{ args := pgx.StrictNamedArgs{
"id": w.ID, "id": w.ID,
"tenant_id": scope.GetTenantID(), "tenant_id": scope.GetTenantID(),
"webhook_data_id": w.WebhookDataID, "webhook_data_id": w.WebhookDataID,
"webhook_subscription_id": w.WebhookSubscriptionID, "webhook_subscription_id": w.WebhookSubscriptionID,
"status": w.Status, "status": w.Status,
"response": w.Response, "response": w.Response,
"created_at": w.CreatedAt, "created_at": w.CreatedAt,
} }
_, err := conn.Exec(ctx, q, args) _, err := conn.Exec(ctx, q, args)

View File

@@ -22,9 +22,9 @@ import (
type WebhookEventStatus string type WebhookEventStatus string
const ( const (
WebhookEventStatusPending WebhookEventStatus = "PENDING" WebhookEventStatusPending WebhookEventStatus = "PENDING"
WebhookEventStatusSucceeded WebhookEventStatus = "SUCCEEDED" WebhookEventStatusSucceeded WebhookEventStatus = "SUCCEEDED"
WebhookEventStatusFailed WebhookEventStatus = "FAILED" WebhookEventStatusFailed WebhookEventStatus = "FAILED"
) )
func (s WebhookEventStatus) String() string { func (s WebhookEventStatus) String() string {

View File

@@ -281,14 +281,14 @@ VALUES (
` `
args := pgx.StrictNamedArgs{ args := pgx.StrictNamedArgs{
"tenant_id": scope.GetTenantID(), "tenant_id": scope.GetTenantID(),
"webhook_subscription_id": w.ID, "webhook_subscription_id": w.ID,
"organization_id": w.OrganizationID, "organization_id": w.OrganizationID,
"endpoint_url": w.EndpointURL, "endpoint_url": w.EndpointURL,
"selected_events": w.SelectedEvents, "selected_events": w.SelectedEvents,
"encrypted_signing_secret": w.EncryptedSigningSecret, "encrypted_signing_secret": w.EncryptedSigningSecret,
"created_at": w.CreatedAt, "created_at": w.CreatedAt,
"updated_at": w.UpdatedAt, "updated_at": w.UpdatedAt,
} }
_, err := conn.Exec(ctx, q, args) _, err := conn.Exec(ctx, q, args)

View File

@@ -21,9 +21,9 @@ import (
"errors" "errors"
"testing" "testing"
"go.probo.inc/probo/pkg/crypto/keys"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.probo.inc/probo/pkg/crypto/keys"
) )
func TestGenerate(t *testing.T) { func TestGenerate(t *testing.T) {

View File

@@ -31,9 +31,9 @@ import (
"testing" "testing"
"time" "time"
"go.probo.inc/probo/pkg/crypto/pem"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.probo.inc/probo/pkg/crypto/pem"
) )
func TestEncodeCertificate(t *testing.T) { func TestEncodeCertificate(t *testing.T) {

View File

@@ -19,9 +19,9 @@ import (
"context" "context"
_ "embed" _ "embed"
"fmt" "fmt"
"html/template"
"io" "io"
"strings" "strings"
"html/template"
"time" "time"
"github.com/digitorus/timestamp" "github.com/digitorus/timestamp"

View File

@@ -166,11 +166,11 @@ func TestActionRegistry_ByService(t *testing.T) {
func TestParseAction(t *testing.T) { func TestParseAction(t *testing.T) {
tests := []struct { tests := []struct {
action Action action Action
wantSvc string wantSvc string
wantRes string wantRes string
wantOp string wantOp string
wantErr bool wantErr bool
}{ }{
{ {
action: "iam:identity:get", action: "iam:identity:get",
@@ -217,4 +217,3 @@ func TestParseAction(t *testing.T) {
}) })
} }
} }

View File

@@ -203,9 +203,9 @@ func TestEvaluator_Evaluate_MultipleConditions(t *testing.T) {
) )
tests := []struct { tests := []struct {
name string name string
ctx ConditionContext ctx ConditionContext
want Decision want Decision
}{ }{
{ {
name: "both conditions satisfied", name: "both conditions satisfied",
@@ -260,10 +260,10 @@ func TestEvaluator_Evaluate_WildcardActions(t *testing.T) {
evaluator := NewEvaluator() evaluator := NewEvaluator()
tests := []struct { tests := []struct {
name string name string
policy *Policy policy *Policy
action string action string
want Decision want Decision
}{ }{
{ {
name: "full wildcard allows everything", name: "full wildcard allows everything",
@@ -443,4 +443,3 @@ func TestEvaluationResult_IsAllowed(t *testing.T) {
}) })
} }
} }

View File

@@ -204,4 +204,3 @@ func Example_conditionBasedAccess() {
// User update own profile: allow // User update own profile: allow
// User update other profile: no_match // User update other profile: no_match
} }

View File

@@ -86,4 +86,3 @@ func (m *ActionMatcher) MatchesAny(patterns []string, target string) bool {
} }
return false return false
} }

View File

@@ -100,13 +100,13 @@ const (
ActionVendorRiskAssessmentList = "core:vendor-risk-assessment:list" ActionVendorRiskAssessmentList = "core:vendor-risk-assessment:list"
// Framework actions // Framework actions
ActionFrameworkGet = "core:framework:get" ActionFrameworkGet = "core:framework:get"
ActionFrameworkList = "core:framework:list" ActionFrameworkList = "core:framework:list"
ActionFrameworkCreate = "core:framework:create" ActionFrameworkCreate = "core:framework:create"
ActionFrameworkUpdate = "core:framework:update" ActionFrameworkUpdate = "core:framework:update"
ActionFrameworkDelete = "core:framework:delete" ActionFrameworkDelete = "core:framework:delete"
ActionFrameworkExport = "core:framework:export" ActionFrameworkExport = "core:framework:export"
ActionFrameworkImport = "core:framework:import" ActionFrameworkImport = "core:framework:import"
// Control actions // Control actions
ActionControlGet = "core:control:get" ActionControlGet = "core:control:get"

View File

@@ -386,16 +386,16 @@ func (s MeasureService) Import(
continue continue
} }
controlMeasure := &coredata.ControlMeasure{ controlMeasure := &coredata.ControlMeasure{
ControlID: control.ID, ControlID: control.ID,
MeasureID: measure.ID, MeasureID: measure.ID,
OrganizationID: measure.OrganizationID, OrganizationID: measure.OrganizationID,
CreatedAt: now, CreatedAt: now,
} }
if err := controlMeasure.Upsert(ctx, tx, s.svc.scope); err != nil { if err := controlMeasure.Upsert(ctx, tx, s.svc.scope); err != nil {
return fmt.Errorf("cannot insert control measure: %w", err) return fmt.Errorf("cannot insert control measure: %w", err)
} }
} }
} }

View File

@@ -21,9 +21,9 @@ import (
"github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/s3" "github.com/aws/aws-sdk-go-v2/service/s3"
"go.gearno.de/kit/pg"
"go.probo.inc/probo/pkg/coredata" "go.probo.inc/probo/pkg/coredata"
"go.probo.inc/probo/pkg/gid" "go.probo.inc/probo/pkg/gid"
"go.gearno.de/kit/pg"
) )
type ReportService struct { type ReportService struct {

View File

@@ -30,10 +30,10 @@ func NewSCIMBridge(bridge *coredata.SCIMBridge) *SCIMBridge {
ScimConfiguration: &SCIMConfiguration{ ScimConfiguration: &SCIMConfiguration{
ID: bridge.ScimConfigurationID, ID: bridge.ScimConfigurationID,
}, },
Connector: connector, Connector: connector,
Type: bridge.Type, Type: bridge.Type,
ExcludedUserNames: bridge.ExcludedUserNames, ExcludedUserNames: bridge.ExcludedUserNames,
CreatedAt: bridge.CreatedAt, CreatedAt: bridge.CreatedAt,
UpdatedAt: bridge.UpdatedAt, UpdatedAt: bridge.UpdatedAt,
} }
} }

View File

@@ -68,10 +68,10 @@ func NewWebhookEvent(we *coredata.WebhookEvent) *WebhookEvent {
} }
return &WebhookEvent{ return &WebhookEvent{
ID: we.ID, ID: we.ID,
WebhookSubscriptionID: we.WebhookSubscriptionID, WebhookSubscriptionID: we.WebhookSubscriptionID,
Status: we.Status, Status: we.Status,
Response: response, Response: response,
CreatedAt: we.CreatedAt, CreatedAt: we.CreatedAt,
} }
} }

View File

@@ -47,7 +47,7 @@ func NewListTransferImpactAssessmentsOutput(pg *page.Page[*coredata.TransferImpa
nextCursor = &cursorKey nextCursor = &cursorKey
} }
return ListTransferImpactAssessmentsOutput{ return ListTransferImpactAssessmentsOutput{
NextCursor: nextCursor, NextCursor: nextCursor,
TransferImpactAssessments: items, TransferImpactAssessments: items,
} }
} }

View File

@@ -15,8 +15,8 @@
package pageinfo package pageinfo
import ( import (
"go.probo.inc/probo/pkg/page"
"go.gearno.de/x/ref" "go.gearno.de/x/ref"
"go.probo.inc/probo/pkg/page"
) )
type PageInfo struct { type PageInfo struct {

View File

@@ -20,11 +20,11 @@ import (
"fmt" "fmt"
"time" "time"
"go.gearno.de/kit/log"
"go.gearno.de/kit/pg"
"go.probo.inc/probo/pkg/connector" "go.probo.inc/probo/pkg/connector"
"go.probo.inc/probo/pkg/coredata" "go.probo.inc/probo/pkg/coredata"
"go.probo.inc/probo/pkg/crypto/cipher" "go.probo.inc/probo/pkg/crypto/cipher"
"go.gearno.de/kit/log"
"go.gearno.de/kit/pg"
) )
type ( type (

View File

@@ -18,10 +18,10 @@ import (
"context" "context"
"fmt" "fmt"
"go.gearno.de/kit/pg"
"go.probo.inc/probo/pkg/coredata" "go.probo.inc/probo/pkg/coredata"
"go.probo.inc/probo/pkg/gid" "go.probo.inc/probo/pkg/gid"
"go.probo.inc/probo/pkg/page" "go.probo.inc/probo/pkg/page"
"go.gearno.de/kit/pg"
) )
type AuditService struct { type AuditService struct {

View File

@@ -22,9 +22,9 @@ import (
"github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/s3" "github.com/aws/aws-sdk-go-v2/service/s3"
"go.gearno.de/kit/pg"
"go.probo.inc/probo/pkg/coredata" "go.probo.inc/probo/pkg/coredata"
"go.probo.inc/probo/pkg/gid" "go.probo.inc/probo/pkg/gid"
"go.gearno.de/kit/pg"
) )
type OrganizationService struct { type OrganizationService struct {

View File

@@ -22,10 +22,10 @@ import (
"github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/s3" "github.com/aws/aws-sdk-go-v2/service/s3"
"go.gearno.de/kit/pg"
"go.probo.inc/probo/pkg/coredata" "go.probo.inc/probo/pkg/coredata"
"go.probo.inc/probo/pkg/gid" "go.probo.inc/probo/pkg/gid"
"go.probo.inc/probo/pkg/page" "go.probo.inc/probo/pkg/page"
"go.gearno.de/kit/pg"
) )
type TrustCenterReferenceService struct { type TrustCenterReferenceService struct {

View File

@@ -18,9 +18,9 @@ import (
"strings" "strings"
"testing" "testing"
"go.probo.inc/probo/pkg/version"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"go.probo.inc/probo/pkg/version"
) )
func TestGetBuildInfo(t *testing.T) { func TestGetBuildInfo(t *testing.T) {

View File

@@ -22,20 +22,20 @@ import (
) )
type Obligation struct { type Obligation struct {
ID gid.GID `json:"id"` ID gid.GID `json:"id"`
OrganizationID gid.GID `json:"organizationId"` OrganizationID gid.GID `json:"organizationId"`
Area *string `json:"area"` Area *string `json:"area"`
Source *string `json:"source"` Source *string `json:"source"`
Requirement *string `json:"requirement"` Requirement *string `json:"requirement"`
ActionsToBeImplemented *string `json:"actionsToBeImplemented"` ActionsToBeImplemented *string `json:"actionsToBeImplemented"`
Regulator *string `json:"regulator"` Regulator *string `json:"regulator"`
OwnerID gid.GID `json:"ownerId"` OwnerID gid.GID `json:"ownerId"`
LastReviewDate *time.Time `json:"lastReviewDate"` LastReviewDate *time.Time `json:"lastReviewDate"`
DueDate *time.Time `json:"dueDate"` DueDate *time.Time `json:"dueDate"`
Status coredata.ObligationStatus `json:"status"` Status coredata.ObligationStatus `json:"status"`
Type coredata.ObligationType `json:"type"` Type coredata.ObligationType `json:"type"`
CreatedAt time.Time `json:"createdAt"` CreatedAt time.Time `json:"createdAt"`
UpdatedAt time.Time `json:"updatedAt"` UpdatedAt time.Time `json:"updatedAt"`
} }
func NewObligation(o *coredata.Obligation) *Obligation { func NewObligation(o *coredata.Obligation) *Obligation {