implement graphQL and init postgres

This commit is contained in:
Fran Jurmanović
2025-07-06 19:19:36 +02:00
parent 016728532c
commit 26a0d33592
25 changed files with 1713 additions and 314 deletions

View File

@@ -26,13 +26,13 @@ type CachedUserInfo struct {
// AuthMiddleware provides authentication and permission middleware.
type AuthMiddleware struct {
membershipService service.MembershipServiceInterface
membershipService *service.MembershipService
cache *cache.InMemoryCache
securityMW *security.SecurityMiddleware
}
// NewAuthMiddleware creates a new AuthMiddleware.
func NewAuthMiddleware(ms service.MembershipServiceInterface, cache *cache.InMemoryCache) *AuthMiddleware {
func NewAuthMiddleware(ms *service.MembershipService, cache *cache.InMemoryCache) *AuthMiddleware {
auth := &AuthMiddleware{
membershipService: ms,
cache: cache,
@@ -201,7 +201,7 @@ func (m *AuthMiddleware) getCachedUserInfo(ctx context.Context, userID string) (
userInfo := &CachedUserInfo{
UserID: userID,
Username: user.Username,
Username: user.FullName,
Roles: roleNames,
RoleNames: roleNames,
Permissions: permissions,