/**
 * Copyright © 2025 by Data Virtuality GmbH
 */
package org.teiid.query.processor;

import java.util.Map;
import java.util.stream.Collectors;
import org.teiid.adminapi.impl.SessionMetadata;
import org.teiid.dqp.internal.process.UserLimits;
import org.teiid.query.util.DVUsersHandlerIntf;

import java.util.Collection;
import java.util.List;
import java.util.Set;

/**
 * @author Mate Simovic
 * @date 2025.01.09
 *
 */
public class FakeUsersHandler implements DVUsersHandlerIntf {
	@Override
	public boolean isAdminOrSystemOrHasRoles(SessionMetadata session) {
		return true;
	}

	@Override
	public boolean hasUser(String username) {
		return true;
	}

	@Override
	public Map<String, Exception> addMappedRoles(Set<String> roleSet) {
		return roleSet.stream().collect(Collectors.toMap(e -> e, e -> null));
	}

	@Override
	public String normalizeUserName(String username) {
		return username;
	}

	@Override
	public List<String> getDomainOrUserRoleNames(String username) {
		return List.of();
	}

	@Override
	public UserLimits getUserLimits(String username) {
		return new UserLimits();
	}

	@Override
	public String getUserTimezone(String username) {
		return null;
	}

	@Override
	public List<String> getUserTypeDomains() {
		return List.of();
	}

	@Override
	public Boolean isLoginAllowed(String username) {
		return true;
	}

	@Override
	public Void resurrectInvalidatedPermissions(boolean validateCurrentUser, boolean distribute) {
		return null;
	}

	@Override
	public Void invalidatePermissions() {
		return null;
	}
}