Compare commits
2 Commits
381560eef8
...
479d2623e6
| Author | SHA1 | Date | |
|---|---|---|---|
| 479d2623e6 | |||
| a3caa0ebfa |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
/target
|
/target
|
||||||
|
/.direnv/
|
||||||
|
|||||||
10
shell.nix
Normal file
10
shell.nix
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{ pkgs ? import <nixpkgs> {} }:
|
||||||
|
|
||||||
|
with pkgs;
|
||||||
|
|
||||||
|
mkShell {
|
||||||
|
buildInputs = [
|
||||||
|
protobuf
|
||||||
|
rustup
|
||||||
|
];
|
||||||
|
}
|
||||||
@@ -17,12 +17,13 @@ fn get_live_id(channel: String) -> String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn auth_header(mut req: Request<()>) -> Result<Request<()>, Status> {
|
pub fn auth_header(mut req: Request<()>) -> Result<Request<()>, Status> {
|
||||||
let token: MetadataValue<_> = "Bearer my-secret-token"
|
let oauth_token = "Yeah!".to_string();
|
||||||
|
let token: MetadataValue<_> = format!("Bearer {}", oauth_token)
|
||||||
.parse()
|
.parse()
|
||||||
.expect("failed to parse token");
|
.expect("failed to parse token");
|
||||||
|
|
||||||
req.metadata_mut()
|
req.metadata_mut()
|
||||||
.insert("x-goog-api-key", token)
|
.insert("authorization", token)
|
||||||
.expect("WHAT");
|
.expect("WHAT");
|
||||||
Ok(req)
|
Ok(req)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user