Skip to content

Commit 8b7f3e8

Browse files
committed
style: standardize formatting and alignment across multiple files
1 parent 0ad9206 commit 8b7f3e8

File tree

15 files changed

+75
-75
lines changed

15 files changed

+75
-75
lines changed

audit_hook/extension.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ import (
1111
"log/slog"
1212
"time"
1313

14-
"github.com/xraph/shield/plugin"
1514
"github.com/xraph/shield/id"
15+
"github.com/xraph/shield/plugin"
1616
)
1717

1818
// Compile-time interface checks.
1919
var (
20-
_ plugin.Plugin = (*Extension)(nil)
20+
_ plugin.Plugin = (*Extension)(nil)
2121
_ plugin.ScanStarted = (*Extension)(nil)
2222
_ plugin.ScanCompleted = (*Extension)(nil)
2323
_ plugin.ScanBlocked = (*Extension)(nil)

boundary/boundary.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ const (
3232
// Limit defines a specific boundary constraint.
3333
type Limit struct {
3434
Scope Scope `json:"scope"`
35-
Deny []string `json:"deny,omitempty"` // explicitly denied items
36-
Allow []string `json:"allow,omitempty"` // explicitly allowed items (allowlist mode)
35+
Deny []string `json:"deny,omitempty"` // explicitly denied items
36+
Allow []string `json:"allow,omitempty"` // explicitly allowed items (allowlist mode)
3737
UseAllow bool `json:"use_allow,omitempty"` // true = allowlist mode, false = denylist mode
3838
}
3939

compliance/compliance.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ type Report struct {
3434

3535
// ListFilter defines filtering for compliance report list queries.
3636
type ListFilter struct {
37-
ScopeKey string
38-
Framework Framework
39-
Limit int
40-
Offset int
37+
ScopeKey string
38+
Framework Framework
39+
Limit int
40+
Offset int
4141
}
4242

4343
// Store defines persistence operations for compliance reports.

engine/engine.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@ import (
2020
"time"
2121

2222
"github.com/xraph/shield"
23-
"github.com/xraph/shield/plugin"
2423
"github.com/xraph/shield/id"
24+
"github.com/xraph/shield/plugin"
2525
"github.com/xraph/shield/scan"
2626
"github.com/xraph/shield/store"
2727
)
2828

2929
// Engine is the core safety execution engine.
3030
type Engine struct {
31-
store store.Store
32-
registry *plugin.Registry
33-
config shield.Config
34-
logger *slog.Logger
31+
store store.Store
32+
registry *plugin.Registry
33+
config shield.Config
34+
logger *slog.Logger
3535
}
3636

3737
// Option configures the Engine.

instinct/instinct.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const (
6666
// Strategy defines how an instinct detects threats.
6767
type Strategy struct {
6868
Name string `json:"name"` // e.g., "classifier", "canary", "perplexity", "hierarchy"
69-
Weight float64 `json:"weight,omitempty"` // contribution to combined score (0.0-1.0)
69+
Weight float64 `json:"weight,omitempty"` // contribution to combined score (0.0-1.0)
7070
Config map[string]any `json:"config,omitempty"`
7171
}
7272

judgment/judgment.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const (
4949
type Assessor struct {
5050
Name string `json:"name"`
5151
Domain Domain `json:"domain"`
52-
Weight float64 `json:"weight,omitempty"` // contribution to combined score
52+
Weight float64 `json:"weight,omitempty"` // contribution to combined score
5353
Config map[string]any `json:"config,omitempty"`
5454
RequiresContext bool `json:"requires_context,omitempty"` // needs source material
5555
}
@@ -66,7 +66,7 @@ type Judgment struct {
6666
TenantID string `json:"tenant_id,omitempty"`
6767
Domain Domain `json:"domain" bun:",notnull"`
6868
Assessors []Assessor `json:"assessors,omitempty" bun:"type:jsonb"`
69-
Threshold float64 `json:"threshold,omitempty"` // risk threshold for action (0.0-1.0)
69+
Threshold float64 `json:"threshold,omitempty"` // risk threshold for action (0.0-1.0)
7070
Action string `json:"action" bun:",notnull"` // "flag", "block", "warn"
7171
Enabled bool `json:"enabled" bun:",notnull,default:true"`
7272
Metadata map[string]any `json:"metadata,omitempty" bun:"type:jsonb"`

observability/extension.go

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,26 @@ import (
88

99
gu "github.com/xraph/go-utils/metrics"
1010

11-
"github.com/xraph/shield/plugin"
1211
"github.com/xraph/shield/id"
12+
"github.com/xraph/shield/plugin"
1313
)
1414

1515
// Compile-time interface checks.
1616
var (
17-
_ plugin.Plugin = (*MetricsExtension)(nil)
18-
_ plugin.ScanStarted = (*MetricsExtension)(nil)
19-
_ plugin.ScanCompleted = (*MetricsExtension)(nil)
20-
_ plugin.ScanBlocked = (*MetricsExtension)(nil)
21-
_ plugin.ScanFailed = (*MetricsExtension)(nil)
22-
_ plugin.InstinctTriggered = (*MetricsExtension)(nil)
23-
_ plugin.AwarenessDetected = (*MetricsExtension)(nil)
24-
_ plugin.JudgmentAssessed = (*MetricsExtension)(nil)
25-
_ plugin.ValueViolated = (*MetricsExtension)(nil)
26-
_ plugin.ReflexFired = (*MetricsExtension)(nil)
27-
_ plugin.BoundaryEnforced = (*MetricsExtension)(nil)
28-
_ plugin.PIIDetected = (*MetricsExtension)(nil)
29-
_ plugin.PIIRedacted = (*MetricsExtension)(nil)
30-
_ plugin.PolicyEvaluated = (*MetricsExtension)(nil)
17+
_ plugin.Plugin = (*MetricsExtension)(nil)
18+
_ plugin.ScanStarted = (*MetricsExtension)(nil)
19+
_ plugin.ScanCompleted = (*MetricsExtension)(nil)
20+
_ plugin.ScanBlocked = (*MetricsExtension)(nil)
21+
_ plugin.ScanFailed = (*MetricsExtension)(nil)
22+
_ plugin.InstinctTriggered = (*MetricsExtension)(nil)
23+
_ plugin.AwarenessDetected = (*MetricsExtension)(nil)
24+
_ plugin.JudgmentAssessed = (*MetricsExtension)(nil)
25+
_ plugin.ValueViolated = (*MetricsExtension)(nil)
26+
_ plugin.ReflexFired = (*MetricsExtension)(nil)
27+
_ plugin.BoundaryEnforced = (*MetricsExtension)(nil)
28+
_ plugin.PIIDetected = (*MetricsExtension)(nil)
29+
_ plugin.PIIRedacted = (*MetricsExtension)(nil)
30+
_ plugin.PolicyEvaluated = (*MetricsExtension)(nil)
3131
_ plugin.SafetyProfileResolved = (*MetricsExtension)(nil)
3232
)
3333

options.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ type Option func(*Options)
66

77
// Options holds resolved top-level Shield configuration.
88
type Options struct {
9-
Config Config
10-
Profile string // default safety profile name
11-
Instincts []string // inline instinct names
12-
Awareness []string // inline awareness names
13-
Values []string // inline value names
9+
Config Config
10+
Profile string // default safety profile name
11+
Instincts []string // inline instinct names
12+
Awareness []string // inline awareness names
13+
Values []string // inline value names
1414
Boundaries []string // inline boundary names
1515
Judgments []string // inline judgment names
1616
Reflexes []string // inline reflex names

pii/store.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ type Token struct {
1616
ID id.PIITokenID `json:"id" bun:",pk"`
1717
ScanID id.ScanID `json:"scan_id" bun:",notnull"`
1818
TenantID string `json:"tenant_id" bun:",notnull"`
19-
PIIType string `json:"pii_type" bun:",notnull"` // "email", "ssn", "phone", "cc", etc.
20-
Placeholder string `json:"placeholder" bun:",notnull"` // "[EMAIL_1]", "[SSN_1]"
19+
PIIType string `json:"pii_type" bun:",notnull"` // "email", "ssn", "phone", "cc", etc.
20+
Placeholder string `json:"placeholder" bun:",notnull"` // "[EMAIL_1]", "[SSN_1]"
2121
EncryptedValue []byte `json:"encrypted_value" bun:",notnull"` // AES-256-GCM encrypted
22-
ExpiresAt *time.Time `json:"expires_at,omitempty"` // GDPR retention
22+
ExpiresAt *time.Time `json:"expires_at,omitempty"` // GDPR retention
2323
}
2424

2525
// Stats holds PII vault statistics.
@@ -35,7 +35,7 @@ type Store interface {
3535
LoadPIITokens(ctx context.Context, tokenIDs []id.PIITokenID) ([]*Token, error)
3636
LoadPIITokensByScan(ctx context.Context, scanID id.ScanID) ([]*Token, error)
3737
DeletePIITokens(ctx context.Context, tokenIDs []id.PIITokenID) error
38-
DeletePIITokensByTenant(ctx context.Context, tenantID string) error // GDPR
38+
DeletePIITokensByTenant(ctx context.Context, tenantID string) error // GDPR
3939
PurgePIITokens(ctx context.Context, olderThan time.Time) (int64, error) // retention
4040
PIIStats(ctx context.Context, tenantID string) (*Stats, error)
4141
}

plugin/registry.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ type Registry struct {
9898
scanFailed []scanFailedEntry
9999
instinctTriggered []instinctTriggeredEntry
100100
awarenessDetected []awarenessDetectedEntry
101-
judgmentAssessed []judgmentAssessedEntry
101+
judgmentAssessed []judgmentAssessedEntry
102102
valueViolated []valueViolatedEntry
103103
reflexFired []reflexFiredEntry
104104
boundaryEnforced []boundaryEnforcedEntry

0 commit comments

Comments
 (0)