MCPcopy Create free account
hub / github.com/astercloud/aster / TestNewAccessController

Function TestNewAccessController

pkg/security/access_control_test.go:133–150  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

131}
132
133func TestNewAccessController(t *testing.T) {
134 config := &AccessControlConfig{
135 SessionTimeout: 30 * time.Minute,
136 MaxSessionsPerUser: 5,
137 EnableAudit: true,
138 }
139
140 auditLog := &mockAuditLog{}
141 ac := NewAccessController(config, auditLog)
142
143 if ac == nil {
144 t.Fatal("expected AccessController, got nil")
145 }
146
147 if ac.config.SessionTimeout != 30*time.Minute {
148 t.Errorf("expected SessionTimeout 30m, got %v", ac.config.SessionTimeout)
149 }
150}
151
152func TestAccessController_CreateUser(t *testing.T) {
153 ac := NewAccessController(&AccessControlConfig{}, &mockAuditLog{})

Callers

nothing calls this directly

Calls 1

NewAccessControllerFunction · 0.85

Tested by

no test coverage detected