feat(credential): support custom credential ID generation (#1984)

introduces support for custom credential ID generation, allowing users to specify their own credential IDs instead of relying solely on auto-generated UUIDs.
This commit is contained in:
KKRainbow
2026-03-12 00:48:24 +08:00
committed by GitHub
parent 330659e449
commit c8f3c5d6aa
4 changed files with 93 additions and 11 deletions
+9 -6
View File
@@ -232,12 +232,15 @@ impl CredentialManageRpc for PeerManagerRpcService {
)));
};
let (id, secret) = global_ctx.get_credential_manager().generate_credential(
request.groups,
request.allow_relay,
request.allowed_proxy_cidrs,
ttl,
);
let (id, secret) = global_ctx
.get_credential_manager()
.generate_credential_with_id(
request.groups,
request.allow_relay,
request.allowed_proxy_cidrs,
ttl,
request.credential_id,
);
global_ctx.issue_event(crate::common::global_ctx::GlobalCtxEvent::CredentialChanged);