feat(config): support provider field for seal source and display provider in corps list

- Add optional provider and providerName to NativeSealSourceSchema
- Extract provider from remote user/tenant in addSealCorp
- Output provider field in corps list and corps current commands
This commit is contained in:
gitea committed 2026-07-31 09:57:19 +08:00
1 parent 2ca45d935e
commit 8435ed7fd9
2 files changed
+12 -3

No files matched your search

+9 -2
View File
@@ -88,6 +88,7 @@ async function main() {
id: item.id,
name: item.name,
sourceType: item.source.type,
provider: (item.source as any).provider ?? item.source.type,
current: item.id === currentCorpId
})));
return;
@@ -98,7 +99,8 @@ async function main() {
printJson({
id: corp.id,
name: corp.name,
sourceType: corp.source.type
sourceType: corp.source.type,
provider: (corp.source as any).provider ?? corp.source.type
});
return;
}
@@ -688,6 +690,10 @@ async function addSealCorp(input: Record<string, unknown>) {
stringValue(remoteUser?.id) ??
"seal";
const provider = optionalString(input, "provider") ??
stringValue(remoteUser?.provider) ??
stringValue((remoteTenant as any)?.providerConfig?.provider);
const config: CorpConfig = {
id,
name: tenantName ?? id,
@@ -708,7 +714,8 @@ async function addSealCorp(input: Record<string, unknown>) {
tenantId,
tenantSlug,
tenantName,
providerUserId: stringValue(remoteUser?.providerUserId)
providerUserId: stringValue(remoteUser?.providerUserId),
provider
},
auth: {
refreshTtl: 300