io.antmedia.security.MockTokenService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ant-media-server Show documentation
Show all versions of ant-media-server Show documentation
Ant Media Server supports RTMP, RTSP, MP4, HLS, WebRTC, Adaptive Streaming, etc.
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, String metaData) {
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 checkHash(String hash, String streamId, String sessionId, String type) {
return true;
}
@Override
public boolean checkTimeBasedSubscriber(String subscriberId, String streamId, String sessionId,
String subscriberCode, String tokenType) {
return true;
}
@Override
public boolean isJwtTokenValid(String jwtTokenId, String tokenSecret, String streamId, String type) {
return true;
}
@Override
public boolean checkJwtToken(String jwtTokenId, String streamId, String sessionId, String type) {
return true;
}
}