简体   繁体   English

.Net MAUI Blazor 应用程序 | 服务器端还是客户端?

[英].Net MAUI Blazor App | Server side or client side?

I recently started to learn about .Net MAUI Blazor apps and have some difficulties understanding if the C# code used in the components is "safe".我最近开始了解 .Net MAUI Blazor 应用程序,并且在理解组件中使用的 C# 代码是否“安全”时遇到了一些困难。

Things I know:我知道的事情:

  • If using Blazor server, the C# code in the components stays on the server and it is "safe" to execute database operations right in this code, as well as execute business logic.如果使用 Blazor 服务器,组件中的 C# 代码将保留在服务器上,并且直接在此代码中执行数据库操作以及执行业务逻辑是“安全的”。
  • If using Blazor WASM, the database / Business logic code needs to be accessed using an API since the C# code used in the components is not "safe" (it's downloaded directly on the client's machine)如果使用 Blazor WASM,则需要使用 API 访问数据库/业务逻辑代码,因为组件中使用的 C# 代码不是“安全的”(直接在客户端机器上下载)
  • If using .Net MAUI, the code runs directly on the user's device (it looks like WASM to me).如果使用 .Net MAUI,代码直接在用户的设备上运行(对我来说就像 WASM)。

So my question is: While using .Net MAUI (the Blazor app variant), is the C# code running inside the components "safe" or is it like WASM where the code can be accessed by the client ?所以我的问题是:在使用 .Net MAUI(Blazor 应用程序变体)时,在组件内部运行的 C# 代码是“安全的”还是像 WASM 一样,客户端可以访问代码?

"Not Safe". “不安全”。

Its inside your app.它在您的应用程序中。 Therefore its on the client device.因此它在客户端设备上。 OTOH, its not as exposed as dynamically downloading code to a browser. OTOH,它不像动态下载代码到浏览器那样公开。

The question to ask yourself is whether you consider it safe to directly access database from an app.要问自己的问题是,您是否认为从应用程序直接访问数据库是否安全。

Specifically, jailbroken devices can compromise an app.具体来说,越狱设备可能会危及应用程序。

And the communication might have vulnerabilities (though you will use https to minimize those).并且通信可能存在漏洞(尽管您将使用 https 来最小化这些漏洞)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM