Skip to content
Snippets Groups Projects
Verified Commit f6312975 authored by Timm Fitschen's avatar Timm Fitschen
Browse files

WIP: GRPC-web proxy

parent 28cc6ac8
Branches
Tags
2 merge requests!58REL: prepare release 0.7.2,!45F grpc f acm
...@@ -30,6 +30,8 @@ class AuthInterceptor implements ServerInterceptor { ...@@ -30,6 +30,8 @@ class AuthInterceptor implements ServerInterceptor {
private static final Key<String> AUTHENTICATION_HEADER = private static final Key<String> AUTHENTICATION_HEADER =
Key.of("authentication", Metadata.ASCII_STRING_MARSHALLER); Key.of("authentication", Metadata.ASCII_STRING_MARSHALLER);
private static final Key<String> AUTHORIZATION_HEADER =
Key.of("Authorization", Metadata.ASCII_STRING_MARSHALLER);
private static final Context.Key<Subject> SUBJECT_KEY = Context.key("subject"); private static final Context.Key<Subject> SUBJECT_KEY = Context.key("subject");
private static final String BASIC_SCHEME_PREFIX = "Basic "; private static final String BASIC_SCHEME_PREFIX = "Basic ";
/** /**
...@@ -67,7 +69,10 @@ class AuthInterceptor implements ServerInterceptor { ...@@ -67,7 +69,10 @@ class AuthInterceptor implements ServerInterceptor {
final ServerCall<ReqT, RespT> call, final ServerCall<ReqT, RespT> call,
final Metadata headers, final Metadata headers,
final ServerCallHandler<ReqT, RespT> next) { final ServerCallHandler<ReqT, RespT> next) {
final String authentication = headers.get(AUTHENTICATION_HEADER); String authentication = headers.get(AUTHENTICATION_HEADER);
if (authentication == null) {
authentication = headers.get(AUTHORIZATION_HEADER);
}
Status status = Status status =
Status.UNKNOWN.withDescription( Status.UNKNOWN.withDescription(
"An unknown error occured during authentication. Please report a bug."); "An unknown error occured during authentication. Please report a bug.");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment