Skip to content

Commit cca3c15

Browse files
committed
Change API key header
1 parent df0ce90 commit cca3c15

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

backend/main.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func pskUnaryInterceptor(expectedKey string) grpc.UnaryServerInterceptor {
109109
return nil, status.Error(codes.Unauthenticated, "missing metadata")
110110
}
111111

112-
key := md.Get("authorization")
112+
key := md.Get("x-api-key")
113113
if len(key) == 0 || key[0] != expectedKey {
114114
return nil, status.Error(codes.Unauthenticated, "invalid API key")
115115
}
@@ -130,7 +130,7 @@ func pskStreamInterceptor(expectedKey string) grpc.StreamServerInterceptor {
130130
return status.Error(codes.Unauthenticated, "missing metadata")
131131
}
132132

133-
key := md.Get("authorization")
133+
key := md.Get("x-api-key")
134134
if len(key) == 0 || key[0] != expectedKey {
135135
return status.Error(codes.Unauthenticated, "invalid API key")
136136
}

drive-controller/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ fn main() {
194194
let coordinator_client = DriveCoordinatorServiceClient::with_interceptor(
195195
channel,
196196
move |mut req: tonic::Request<()>| {
197-
req.metadata_mut().insert("authorization", psk.clone());
197+
req.metadata_mut().insert("x-api-key", psk.clone());
198198
Ok(req)
199199
},
200200
);

0 commit comments

Comments
 (0)