Skip to content

Commit c84d848

Browse files
committed
Merge branch 'main' of https://github.com/ideal-world/bios
2 parents e78a8e7 + fa61d49 commit c84d848

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

backend/basic/src/rbum/helper/rbum_scope_helper.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,15 +245,15 @@ where
245245
/// Check ``owner`` field of the context and fill the context.
246246
///
247247
/// When using ``ak/sk`` authentication from an internal calling interface (mostly ``ci`` type interfaces),
248-
/// there is no ``owner`` field,
248+
/// there is ``ak`` field,
249249
/// so this method can be used to determine whether it comes from an internal calling interface.
250250
///
251251
/// This method will fetch the context from the request header (default: 'Bios-Ctx') and fill the current context.
252252
///
253253
/// Warning: This operation is unsafe, and it should only be used in scenarios where there is no security risk.
254254
#[cfg(feature = "default")]
255255
pub fn check_without_owner_and_unsafe_fill_ctx(request: &tardis::web::poem::Request, funs: &TardisFunsInst, ctx: &mut TardisContext) -> TardisResult<()> {
256-
if !ctx.owner.is_empty() {
256+
if ctx.ak.is_empty() {
257257
return Err(TardisError::forbidden("[Basic] Request context owner is not empty", "403-rbum-req-ctx-owner-is-not-empty"));
258258
}
259259
unsafe_fill_ctx(request, funs, ctx)

backend/basic/src/spi.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
//! 1. The binding relationship between each SPI backend implementation and the corresponding tenant or application must be bound before use,
5353
//! and the binding relationship is stored in ``rbum_rel``, with the tag as ``spi_ident``
5454
//! 1. No request authentication is done.
55-
//! The SPI service trusts the authentication information carried by the request (``owner`` in ``TardisContext``, corresponding to the Id of the tenant or application).
55+
//! The SPI service trusts the authentication information carried by the request (``ak`` in ``TardisContext``, corresponding to the Id of the tenant or application).
5656
//! The authentication logic will be implemented uniformly by the gateway
5757
//! 1. Delayed initialization.
5858
//! The backend implementation of each SPI service is initialized (client generated) only when called for the first time to reduce resource consumption at startup.
@@ -65,7 +65,7 @@
6565
//! 1. 每个SPI的后端实现可以有多个,对应于``rbum_item及扩展的spi_bs``。如可以为spi-search的``spi-bs-pg``指定多个连接
6666
//! 1. 每个SPI后端实现的连接信息存储于``rbum_cert``
6767
//! 1. 每个SPI后端实现的要绑定给对应的租户或应用后才能使用,绑定关系存储于``rbum_rel``,tag为``spi_ident``
68-
//! 1. 不做请求认证。SPI服务信任请求带来的认证信息(``TardisContext``中的``owner``,对应于租户或应用的Id)。认证的逻辑将由网关统一实现
68+
//! 1. 不做请求认证。SPI服务信任请求带来的认证信息(``TardisContext``中的``ak``,对应于租户或应用的Id)。认证的逻辑将由网关统一实现
6969
//! 1. 延时初始化。SPI服务的每个后端实现只有在第一次调用时才会初始化(生成client),以减少启动时的资源消耗。详见 [`crate::spi::spi_funs::SpiBsInst`]
7070
#[cfg(feature = "default")]
7171
pub mod api;

0 commit comments

Comments
 (0)