init bootstrap

This commit is contained in:
Fran Jurmanović
2025-07-06 15:02:09 +02:00
commit 016728532c
47 changed files with 8894 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
package middleware
import "context"
// ExportedCachedUserInfo exports CachedUserInfo for testing
type ExportedCachedUserInfo = CachedUserInfo
// GetCachedUserInfo exports the internal getCachedUserInfo method for testing
func (m *AuthMiddleware) GetCachedUserInfo(ctx context.Context, userID string) (*CachedUserInfo, error) {
return m.getCachedUserInfo(ctx, userID)
}
// TestExports provides test-only functionality for AuthMiddleware
type TestExports struct {
AuthMiddleware *AuthMiddleware
}
// NewTestExports creates a new TestExports instance
func NewTestExports(auth *AuthMiddleware) *TestExports {
return &TestExports{
AuthMiddleware: auth,
}
}
// HasPermissionFromCache exports the internal hasPermissionFromCache method for testing
func (t *TestExports) HasPermissionFromCache(userInfo *CachedUserInfo, permission string) bool {
return t.AuthMiddleware.hasPermissionFromCache(userInfo, permission)
}