
netflix.karyon.examples.hellonoss.common.auth.AuthenticationServiceImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of karyon-examples Show documentation
Show all versions of karyon-examples Show documentation
karyon-examples developed by Netflix
The newest version!
package netflix.karyon.examples.hellonoss.common.auth;
import io.netty.buffer.ByteBuf;
import io.reactivex.netty.protocol.http.server.HttpServerRequest;
import rx.Observable;
/**
* @author Nitesh Kant
*/
public class AuthenticationServiceImpl implements AuthenticationService {
public static final String AUTH_HEADER_NAME = "MY-USER-ID";
@Override
public Observable authenticate(HttpServerRequest request) {
if (request.getHeaders().contains(AUTH_HEADER_NAME)) {
return Observable.just(Boolean.TRUE);
} else {
return Observable.error(new IllegalArgumentException("Should pass a header: " + AUTH_HEADER_NAME));
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy