Skip to content
Snippets Groups Projects

Add basic application framework and example application to show interaction between events an NBI

Merged Ghost User requested to merge istaester/init-application-framework into develop
3 files
+ 105
49
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -18,6 +18,7 @@ import (
@@ -18,6 +18,7 @@ import (
)
)
func getTestAuthInterceptorServer(t *testing.T) (*AuthInterceptor, *User, *Role, *SbiServer) {
func getTestAuthInterceptorServer(t *testing.T) (*AuthInterceptor, *User, *Role, *SbiServer) {
 
initUUIDs(t)
jwtManager := rbac.NewJWTManager("test", time.Minute)
jwtManager := rbac.NewJWTManager("test", time.Minute)
userStore := rbac.NewMemoryUserStore()
userStore := rbac.NewMemoryUserStore()
userService := rbac.NewUserService(userStore)
userService := rbac.NewUserService(userStore)
@@ -25,16 +26,21 @@ func getTestAuthInterceptorServer(t *testing.T) (*AuthInterceptor, *User, *Role,
@@ -25,16 +26,21 @@ func getTestAuthInterceptorServer(t *testing.T) (*AuthInterceptor, *User, *Role,
roleStore := rbac.NewMemoryRoleStore()
roleStore := rbac.NewMemoryRoleStore()
roleService := rbac.NewRoleService(roleStore)
roleService := rbac.NewRoleService(roleStore)
 
mockPnd := getMockPnd(t)
 
pndStore := nucleus.NewMemoryPndStore()
pndStore := nucleus.NewMemoryPndStore()
 
if err := pndStore.Add(mockPnd); err != nil {
 
t.Fatal(err)
 
}
s := NewAuthInterceptor(jwtManager, userService, roleService)
s := NewAuthInterceptor(jwtManager, userService, roleService)
u := NewUserServer(jwtManager, userService)
u := NewUserServer(jwtManager, userService)
r := NewRoleServer(jwtManager, roleService)
r := NewRoleServer(jwtManager, roleService)
sbi := NewSbiServer(pndStore)
sbiServer := NewSbiServer(pndStore)
clearAndCreateAuthTestSetup(userService, roleService)
clearAndCreateAuthTestSetup(userService, roleService)
return s, u, r, sbi
return s, u, r, sbiServer
}
}
func dialer(interceptorServer *AuthInterceptor, userServer *User, roleServer *Role, sbiServer *SbiServer) func(context.Context, string) (net.Conn, error) {
func dialer(interceptorServer *AuthInterceptor, userServer *User, roleServer *Role, sbiServer *SbiServer) func(context.Context, string) (net.Conn, error) {
Loading