Skip to main content

StepUpResourceResolver

Trait StepUpResourceResolver 

Source
pub trait StepUpResourceResolver:
    Send
    + Sync
    + 'static {
    // Required method
    fn resolve<'life0, 'life1, 'async_trait>(
        &'life0 self,
        context: &'life1 ActionContext,
    ) -> Pin<Box<dyn Future<Output = Result<String, BaseError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

从当前可信请求状态解析 proof 必须绑定的稳定资源标识。

实现者可以读取路径参数等客户端候选,但必须结合服务端事实完成规范化与授权相关 校验,返回例如 org_user:42 的稳定标识。不得把客户端自报的“已验证资源”直接 原样返回。解析失败必须 fail-closed。

§收窄 proof 重放窗口

proof 在 TTL 内对同一资源标识可重放。资源标识越粗,重放面越大:仅绑定 transfer:account:42 意味着重认证一次即可在该账户上重复发起任意金额的转账。 资源标识应把操作参数指纹纳入标识,例如金额、目标账户等关键参数的 hash (transfer:account:42:sha256(amount=100,to=account:7)),使 proof 只覆盖一次 确定的操作语义,任何参数变化都会使 proof 失效并触发新的 challenge。

Required Methods§

Source

fn resolve<'life0, 'life1, 'async_trait>( &'life0 self, context: &'life1 ActionContext, ) -> Pin<Box<dyn Future<Output = Result<String, BaseError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

解析当前请求实际操作的稳定资源标识。

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§