All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.antmedia.security.MockTokenService Maven / Gradle / Ivy

Go to download

Ant Media Server supports RTMP, RTSP, MP4, HLS, WebRTC, Adaptive Streaming, etc.

There is a newer version: 2.11.3
Show newest version
package io.antmedia.security;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

import org.red5.server.api.scope.IScope;
import org.red5.server.api.stream.IStreamPublishSecurity;

import io.antmedia.datastore.db.types.Token;


public class MockTokenService implements  IStreamPublishSecurity, ITokenService{

	Map authenticatedMap = new ConcurrentHashMap<>();
	Map subscriberAuthenticatedMap = new ConcurrentHashMap<>();

	public boolean checkToken(String tokenId, String streamId, String sessionId, String type) {
		return true;
	}

	@Override
	public boolean isPublishAllowed(IScope scope, String name, String mode, Map queryParams) {
		return true;
	}

	@Override
	public Token createToken(String streamId, long exprireDate, String type, String roomId) {
		return null;
	}
	
	@Override
	public Token createJwtToken(String streamId, long exprireDate, String type, String roomId) {
		return null;
	}

	@Override
	public Map getAuthenticatedMap() {
		return authenticatedMap;
	}
	
	@Override
	public Map getSubscriberAuthenticatedMap() {
		return subscriberAuthenticatedMap;
	}

	@Override
	public boolean checkJwtToken(String jwtTokenId, String streamId, String type) {
		return true;
	}
	
	@Override
	public boolean checkHash(String hash, String streamId, String sessionId, String type) {
		return true;
	}


	@Override
	public boolean checkTimeBasedSubscriber(String subscriberId, String streamId, String sessionId,
			String subscriberCode, boolean forPublish) {
		return true;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy