1
0
mirror of https://github.com/matrix-org/matrix-authentication-service.git synced 2025-07-31 09:24:31 +03:00

Use re-exported wasmtime to avoid dependencies conflicts

This commit is contained in:
Quentin Gliech
2024-07-01 10:11:56 +02:00
parent 69ae7b77bc
commit 4bc425b415
3 changed files with 52 additions and 416 deletions

View File

@ -20,7 +20,6 @@ schemars = { workspace = true, optional = true }
thiserror.workspace = true
tokio.workspace = true
tracing.workspace = true
wasmtime = { version = "20.0.2", default-features = false, features = ["async", "cranelift", "parallel-compilation"] }
mas-data-model.workspace = true
oauth2-types.workspace = true

View File

@ -16,10 +16,12 @@ pub mod model;
use mas_data_model::{AuthorizationGrant, Client, DeviceCodeGrant, User};
use oauth2_types::{registration::VerifiedClientMetadata, scope::Scope};
use opa_wasm::Runtime;
use opa_wasm::{
wasmtime::{Config, Engine, Module, OptLevel, Store},
Runtime,
};
use thiserror::Error;
use tokio::io::{AsyncRead, AsyncReadExt};
use wasmtime::{Config, Engine, Module, Store};
use self::model::{
AuthorizationGrantInput, ClientRegistrationInput, EmailInput, PasswordInput, RegisterInput,
@ -95,7 +97,7 @@ impl PolicyFactory {
) -> Result<Self, LoadError> {
let mut config = Config::default();
config.async_support(true);
config.cranelift_opt_level(wasmtime::OptLevel::SpeedAndSize);
config.cranelift_opt_level(OptLevel::SpeedAndSize);
let engine = Engine::new(&config).map_err(LoadError::Engine)?;