Link 根据节点 inbound、客户端 host 模板、用户凭据和用户信息生成订阅链接。 effectiveAccess 返回使用全局凭证覆盖后的 UserInbound,保持调用方无感知。
(acc users.UserInbound, user users.User)
| 196 | // Link 根据节点 inbound、客户端 host 模板、用户凭据和用户信息生成订阅链接。 |
| 197 | // effectiveAccess 返回使用全局凭证覆盖后的 UserInbound,保持调用方无感知。 |
| 198 | func effectiveAccess(acc users.UserInbound, user users.User) users.UserInbound { |
| 199 | if user.UUID != "" { |
| 200 | acc.UUID = user.UUID |
| 201 | } |
| 202 | if user.Secret != "" { |
| 203 | acc.Secret = user.Secret |
| 204 | } |
| 205 | return acc |
| 206 | } |
| 207 | |
| 208 | func Link(nodeInbound inbounds.Inbound, host inbounds.Host, access users.UserInbound, user users.User) string { |
| 209 | access = effectiveAccess(access, user) |
no outgoing calls
no test coverage detected