Fix nightly builds (#4507)
This commit is contained in:
parent
bb1eba4aab
commit
4181367b98
4 changed files with 16 additions and 16 deletions
|
@ -2284,7 +2284,7 @@ dn/RsYEONbwQSjIfMPkvxF+8HQ==
|
||||||
let key = grant.get("key").unwrap().clone().as_string();
|
let key = grant.get("key").unwrap().clone().as_string();
|
||||||
|
|
||||||
// Remove bearer access method
|
// Remove bearer access method
|
||||||
ds.execute(&format!(r#"REMOVE ACCESS api ON DATABASE;"#), &sess, None).await.unwrap();
|
ds.execute("REMOVE ACCESS api ON DATABASE", &sess, None).await.unwrap();
|
||||||
|
|
||||||
// Signin with the bearer key
|
// Signin with the bearer key
|
||||||
let mut sess = Session {
|
let mut sess = Session {
|
||||||
|
@ -2989,7 +2989,7 @@ dn/RsYEONbwQSjIfMPkvxF+8HQ==
|
||||||
let key = grant.get("key").unwrap().clone().as_string();
|
let key = grant.get("key").unwrap().clone().as_string();
|
||||||
|
|
||||||
// Remove bearer access method
|
// Remove bearer access method
|
||||||
ds.execute(&format!(r#"REMOVE ACCESS api ON NAMESPACE;"#), &sess, None).await.unwrap();
|
ds.execute("REMOVE ACCESS api ON NAMESPACE", &sess, None).await.unwrap();
|
||||||
|
|
||||||
// Signin with the bearer key
|
// Signin with the bearer key
|
||||||
let mut sess = Session {
|
let mut sess = Session {
|
||||||
|
@ -3636,7 +3636,7 @@ dn/RsYEONbwQSjIfMPkvxF+8HQ==
|
||||||
let key = grant.get("key").unwrap().clone().as_string();
|
let key = grant.get("key").unwrap().clone().as_string();
|
||||||
|
|
||||||
// Remove bearer access method
|
// Remove bearer access method
|
||||||
ds.execute(&format!(r#"REMOVE ACCESS api ON ROOT;"#), &sess, None).await.unwrap();
|
ds.execute("REMOVE ACCESS api ON ROOT", &sess, None).await.unwrap();
|
||||||
|
|
||||||
// Signin with the bearer key
|
// Signin with the bearer key
|
||||||
let mut sess = Session {
|
let mut sess = Session {
|
||||||
|
|
|
@ -213,12 +213,12 @@ impl Function {
|
||||||
}
|
}
|
||||||
Self::Anonymous(v, x) => {
|
Self::Anonymous(v, x) => {
|
||||||
let val = match v {
|
let val = match v {
|
||||||
c @ Value::Closure(_) => c,
|
c @ Value::Closure(_) => c.clone(),
|
||||||
Value::Param(p) => ctx.value(p).unwrap_or(&Value::None),
|
Value::Param(p) => ctx.value(p).cloned().unwrap_or(Value::None),
|
||||||
Value::Block(_) | Value::Subquery(_) | Value::Idiom(_) | Value::Function(_) => {
|
Value::Block(_) | Value::Subquery(_) | Value::Idiom(_) | Value::Function(_) => {
|
||||||
&stk.run(|stk| v.compute(stk, ctx, opt, doc)).await?
|
stk.run(|stk| v.compute(stk, ctx, opt, doc)).await?
|
||||||
}
|
}
|
||||||
_ => &Value::None,
|
_ => Value::None,
|
||||||
};
|
};
|
||||||
|
|
||||||
match val {
|
match val {
|
||||||
|
|
|
@ -8,7 +8,7 @@ use surrealdb::iam::Role;
|
||||||
use surrealdb::sql::Value;
|
use surrealdb::sql::Value;
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn access_bearer_database() -> () {
|
async fn access_bearer_database() {
|
||||||
// TODO(gguillemas): Remove this once bearer access is no longer experimental.
|
// TODO(gguillemas): Remove this once bearer access is no longer experimental.
|
||||||
std::env::set_var("SURREAL_EXPERIMENTAL_BEARER_ACCESS", "true");
|
std::env::set_var("SURREAL_EXPERIMENTAL_BEARER_ACCESS", "true");
|
||||||
|
|
||||||
|
@ -321,7 +321,7 @@ async fn access_bearer_root() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn access_bearer_revoke_db() -> () {
|
async fn access_bearer_revoke_db() {
|
||||||
// TODO(gguillemas): Remove this once bearer access is no longer experimental.
|
// TODO(gguillemas): Remove this once bearer access is no longer experimental.
|
||||||
std::env::set_var("SURREAL_EXPERIMENTAL_BEARER_ACCESS", "true");
|
std::env::set_var("SURREAL_EXPERIMENTAL_BEARER_ACCESS", "true");
|
||||||
|
|
||||||
|
@ -355,7 +355,7 @@ async fn access_bearer_revoke_db() -> () {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn access_bearer_revoke_ns() -> () {
|
async fn access_bearer_revoke_ns() {
|
||||||
// TODO(gguillemas): Remove this once bearer access is no longer experimental.
|
// TODO(gguillemas): Remove this once bearer access is no longer experimental.
|
||||||
std::env::set_var("SURREAL_EXPERIMENTAL_BEARER_ACCESS", "true");
|
std::env::set_var("SURREAL_EXPERIMENTAL_BEARER_ACCESS", "true");
|
||||||
|
|
||||||
|
@ -389,7 +389,7 @@ async fn access_bearer_revoke_ns() -> () {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn access_bearer_revoke_root() -> () {
|
async fn access_bearer_revoke_root() {
|
||||||
// TODO(gguillemas): Remove this once bearer access is no longer experimental.
|
// TODO(gguillemas): Remove this once bearer access is no longer experimental.
|
||||||
std::env::set_var("SURREAL_EXPERIMENTAL_BEARER_ACCESS", "true");
|
std::env::set_var("SURREAL_EXPERIMENTAL_BEARER_ACCESS", "true");
|
||||||
|
|
||||||
|
@ -469,7 +469,7 @@ async fn permissions_access_grant_db() {
|
||||||
{
|
{
|
||||||
let ds = new_ds().await.unwrap().with_auth_enabled(true);
|
let ds = new_ds().await.unwrap().with_auth_enabled(true);
|
||||||
|
|
||||||
let mut resp = ds.execute(&statement_setup, &sess_setup, None).await.unwrap();
|
let mut resp = ds.execute(statement_setup, &sess_setup, None).await.unwrap();
|
||||||
let res = resp.remove(0).output();
|
let res = resp.remove(0).output();
|
||||||
assert!(res.is_ok(), "Error setting up access method: {:?}", res);
|
assert!(res.is_ok(), "Error setting up access method: {:?}", res);
|
||||||
let res = resp.remove(0).output();
|
let res = resp.remove(0).output();
|
||||||
|
@ -536,7 +536,7 @@ async fn permissions_access_grant_ns() {
|
||||||
{
|
{
|
||||||
let ds = new_ds().await.unwrap().with_auth_enabled(true);
|
let ds = new_ds().await.unwrap().with_auth_enabled(true);
|
||||||
|
|
||||||
let mut resp = ds.execute(&statement_setup, &sess_setup, None).await.unwrap();
|
let mut resp = ds.execute(statement_setup, &sess_setup, None).await.unwrap();
|
||||||
let res = resp.remove(0).output();
|
let res = resp.remove(0).output();
|
||||||
assert!(res.is_ok(), "Error setting up access method: {:?}", res);
|
assert!(res.is_ok(), "Error setting up access method: {:?}", res);
|
||||||
let res = resp.remove(0).output();
|
let res = resp.remove(0).output();
|
||||||
|
@ -603,7 +603,7 @@ async fn permissions_access_grant_root() {
|
||||||
{
|
{
|
||||||
let ds = new_ds().await.unwrap().with_auth_enabled(true);
|
let ds = new_ds().await.unwrap().with_auth_enabled(true);
|
||||||
|
|
||||||
let mut resp = ds.execute(&statement_setup, &sess_setup, None).await.unwrap();
|
let mut resp = ds.execute(statement_setup, &sess_setup, None).await.unwrap();
|
||||||
let res = resp.remove(0).output();
|
let res = resp.remove(0).output();
|
||||||
assert!(res.is_ok(), "Error setting up access method: {:?}", res);
|
assert!(res.is_ok(), "Error setting up access method: {:?}", res);
|
||||||
let res = resp.remove(0).output();
|
let res = resp.remove(0).output();
|
||||||
|
|
|
@ -338,8 +338,8 @@ async fn create_relate_select() -> Result<(), Error> {
|
||||||
res.remove(0);
|
res.remove(0);
|
||||||
match res.remove(0).result {
|
match res.remove(0).result {
|
||||||
Err(Error::InvalidFetch {
|
Err(Error::InvalidFetch {
|
||||||
value: Value::Number(Number::Float(1.0)),
|
value,
|
||||||
}) => {}
|
}) if value == Value::Number(Number::Float(1.0)) => {}
|
||||||
found => panic!("Expected Err(Error::InvalidFetch), found '{found:?}'"),
|
found => panic!("Expected Err(Error::InvalidFetch), found '{found:?}'"),
|
||||||
};
|
};
|
||||||
assert_eq!(tmp, val);
|
assert_eq!(tmp, val);
|
||||||
|
|
Loading…
Reference in a new issue