Skip to content

Commit 76b6c09

Browse files
refactor: update auth inventory types and enhance dashboard UI
- Renamed auth inventory types for better clarity (NetworkAuth -> NetworkAuthMethods, FormLoginDetails -> FormLoginEndpoint) - Added SaveScanEvent method to mockResultStore for testing - Completely redesigned dashboard UI with Anthropic-inspired dark theme - Added visual improvements including hover effects, shadows, and smoother transitions - Updated status badge styling with semi-transparent backgrounds - Improved typography and spacing
1 parent e04a464 commit 76b6c09

9 files changed

Lines changed: 2451 additions & 114 deletions

File tree

cmd/orchestrator/orchestrator_test.go

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ func (m *mockResultStore) GetSummary(ctx context.Context, scanID string) (*types
8585
return &types.Summary{}, m.err
8686
}
8787

88+
func (m *mockResultStore) SaveScanEvent(ctx context.Context, scanID string, eventType string, component string, message string, metadata map[string]interface{}) error {
89+
return m.err
90+
}
91+
8892
func (m *mockResultStore) Close() error {
8993
return m.err
9094
}
@@ -444,7 +448,7 @@ func TestConvertAuthInventoryToFindings_Empty(t *testing.T) {
444448

445449
func TestConvertAuthInventoryToFindings_NetworkAuth(t *testing.T) {
446450
inventory := &authdiscovery.AuthInventory{
447-
NetworkAuth: &authdiscovery.NetworkAuth{
451+
NetworkAuth: &authdiscovery.NetworkAuthMethods{
448452
LDAP: []authdiscovery.LDAPEndpoint{
449453
{
450454
Host: "ldap.example.com",
@@ -467,8 +471,8 @@ func TestConvertAuthInventoryToFindings_NetworkAuth(t *testing.T) {
467471

468472
func TestConvertAuthInventoryToFindings_WebAuth(t *testing.T) {
469473
inventory := &authdiscovery.AuthInventory{
470-
WebAuth: &authdiscovery.WebAuth{
471-
FormLogin: []authdiscovery.FormLoginDetails{
474+
WebAuth: &authdiscovery.WebAuthMethods{
475+
FormLogin: []authdiscovery.FormLoginEndpoint{
472476
{
473477
URL: "https://example.com/login",
474478
Method: "POST",
@@ -491,8 +495,8 @@ func TestConvertAuthInventoryToFindings_WebAuth(t *testing.T) {
491495

492496
func TestConvertAuthInventoryToFindings_APIAuth(t *testing.T) {
493497
inventory := &authdiscovery.AuthInventory{
494-
APIAuth: &authdiscovery.APIAuth{
495-
REST: []authdiscovery.RESTAuthDetails{
498+
APIAuth: &authdiscovery.APIAuthMethods{
499+
REST: []authdiscovery.RESTEndpoint{
496500
{
497501
URL: "https://api.example.com/v1",
498502
},
@@ -533,18 +537,18 @@ func TestConvertAuthInventoryToFindings_CustomAuth(t *testing.T) {
533537

534538
func TestConvertAuthInventoryToFindings_Multiple(t *testing.T) {
535539
inventory := &authdiscovery.AuthInventory{
536-
NetworkAuth: &authdiscovery.NetworkAuth{
540+
NetworkAuth: &authdiscovery.NetworkAuthMethods{
537541
LDAP: []authdiscovery.LDAPEndpoint{
538542
{Host: "ldap.example.com", Port: 389, SSL: false},
539543
},
540544
},
541-
WebAuth: &authdiscovery.WebAuth{
542-
FormLogin: []authdiscovery.FormLoginDetails{
545+
WebAuth: &authdiscovery.WebAuthMethods{
546+
FormLogin: []authdiscovery.FormLoginEndpoint{
543547
{URL: "https://example.com/login", Method: "POST"},
544548
},
545549
},
546-
APIAuth: &authdiscovery.APIAuth{
547-
REST: []authdiscovery.RESTAuthDetails{
550+
APIAuth: &authdiscovery.APIAuthMethods{
551+
REST: []authdiscovery.RESTEndpoint{
548552
{URL: "https://api.example.com/v1"},
549553
},
550554
},
@@ -749,13 +753,13 @@ func BenchmarkRunComprehensiveBusinessLogicTests(b *testing.B) {
749753

750754
func BenchmarkConvertAuthInventoryToFindings(b *testing.B) {
751755
inventory := &authdiscovery.AuthInventory{
752-
NetworkAuth: &authdiscovery.NetworkAuth{
756+
NetworkAuth: &authdiscovery.NetworkAuthMethods{
753757
LDAP: []authdiscovery.LDAPEndpoint{
754758
{Host: "ldap.example.com", Port: 389, SSL: false},
755759
},
756760
},
757-
WebAuth: &authdiscovery.WebAuth{
758-
FormLogin: []authdiscovery.FormLoginDetails{
761+
WebAuth: &authdiscovery.WebAuthMethods{
762+
FormLogin: []authdiscovery.FormLoginEndpoint{
759763
{URL: "https://example.com/login", Method: "POST"},
760764
},
761765
},

0 commit comments

Comments
 (0)