v0.35.0
This commit is contained in:
1 parent
2c03fcf248
commit
d3b492874b
95 files changed
+1628
-743
No files matched your search
+18
-4
@@ -461,6 +461,7 @@ mod tests {
|
||||
let (router, store, _dir, secret, _) = fixture().await;
|
||||
let old = request("/api/status")
|
||||
.header("authorization", format!("Bearer {}", "a".repeat(64)))
|
||||
.extension(PeerAddr("127.0.0.1:45000".parse().unwrap()))
|
||||
.body(Body::empty())
|
||||
.unwrap();
|
||||
assert_eq!(
|
||||
@@ -1645,6 +1646,7 @@ mod tests {
|
||||
.method("POST")
|
||||
.header("authorization", format!("Bearer {token}"))
|
||||
.header("content-type", "application/json")
|
||||
.extension(PeerAddr("127.0.0.1:45000".parse().unwrap()))
|
||||
.body(Body::from("{}"))
|
||||
.unwrap(),
|
||||
)
|
||||
@@ -1663,7 +1665,11 @@ mod tests {
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(forbidden_scope.status(), StatusCode::UNAUTHORIZED);
|
||||
assert_eq!(forbidden_scope.status(), StatusCode::FORBIDDEN);
|
||||
assert_eq!(
|
||||
json_body(forbidden_scope).await,
|
||||
json!({"error":"certificate_api.invalid_route"})
|
||||
);
|
||||
|
||||
let revoked = router
|
||||
.clone()
|
||||
@@ -1804,7 +1810,11 @@ mod tests {
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(denied.status(), StatusCode::UNAUTHORIZED);
|
||||
assert_eq!(denied.status(), StatusCode::FORBIDDEN);
|
||||
assert_eq!(
|
||||
json_body(denied).await,
|
||||
json!({"error":"certificate_api.invalid_route"})
|
||||
);
|
||||
let no_csrf = router
|
||||
.clone()
|
||||
.oneshot(
|
||||
@@ -2774,6 +2784,7 @@ mod tests {
|
||||
request(&path)
|
||||
.header("cookie", cookie)
|
||||
.header("authorization", format!("Bearer {secret}"))
|
||||
.extension(PeerAddr("127.0.0.1:45000".parse().unwrap()))
|
||||
.body(Body::empty())
|
||||
.unwrap(),
|
||||
)
|
||||
@@ -3953,7 +3964,7 @@ mod tests {
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(old_route.status(), StatusCode::METHOD_NOT_ALLOWED);
|
||||
assert_eq!(old_route.status(), StatusCode::NOT_FOUND);
|
||||
store.close().await;
|
||||
}
|
||||
|
||||
@@ -4103,7 +4114,10 @@ mod tests {
|
||||
.await
|
||||
.unwrap();
|
||||
assert_eq!(summary.status(), StatusCode::OK);
|
||||
assert_eq!(summary.headers()["cache-control"], "no-store");
|
||||
assert_eq!(
|
||||
summary.headers()["cache-control"],
|
||||
"private, no-store, no-cache, no-transform"
|
||||
);
|
||||
let summary = json_body(summary).await;
|
||||
assert!(summary.get("prometheus").is_none());
|
||||
assert_eq!(
|
||||
|
||||
Reference in new issue
Block a user