UserRecord
@JsonIgnoreProperties(ignoreUnknown = true) record UserRecord(String userId, String username, String passwordHash, List<String> roles)
源码Source
io/agentscope/builder/web/auth/UserStore.java:79–84可 JSON 序列化的用户。位于 io.agentscope.builder.web.auth 包。核心成员包括 userId、username、passwordHash、roles、hasRole。
JSON-serializable user record.
记录组件摘要Record Component Summary
| 组件Component | 类型Type | 说明Description |
|---|---|---|
userId | String | 执行用户标识相关操作。 stable unique identifier (used as HarnessAgent namespace key) |
username | String | 执行 `username` 方法。 display name |
passwordHash | String | 执行 `passwordHash` 方法。 BCrypt hash |
roles | List<String> | 执行 `roles` 方法。 list of role strings (e.g. `["user"]`, `["user","admin"]`) |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public boolean hasRole(String role) | 判断是否具有角色。 Returns whether this has the role. |
记录组件详情Record Component Detail
userId
String userId执行用户标识相关操作。
stable unique identifier (used as HarnessAgent namespace key)
源码Source
io/agentscope/builder/web/auth/UserStore.java:79–84username
String username执行 username 方法。
display name
源码Source
io/agentscope/builder/web/auth/UserStore.java:79–84passwordHash
String passwordHash执行 passwordHash 方法。
BCrypt hash
源码Source
io/agentscope/builder/web/auth/UserStore.java:79–84roles
List<String> roles执行 roles 方法。
list of role strings (e.g. ["user"], ["user","admin"])
源码Source
io/agentscope/builder/web/auth/UserStore.java:79–84方法详情Method Detail
hasRole
public boolean hasRole(String role)
判断是否具有角色。
Returns whether this has the role.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
role | String | 角色(类型 `String`)。The role. |
boolean返回布尔值,表示判断结果。Returns a boolean result.
源码Source
io/agentscope/builder/web/auth/UserStore.java:81–83