(auth: AuthFile, scopeId: string, secretId: string)
| 636 | }; |
| 637 | |
| 638 | const readScopedFileSecret = (auth: AuthFile, scopeId: string, secretId: string): string | null => { |
| 639 | const scoped = auth[scopeId]; |
| 640 | if (scoped && typeof scoped === "object" && !Array.isArray(scoped)) { |
| 641 | return scoped[secretId] ?? null; |
| 642 | } |
| 643 | const flat = auth[secretId]; |
| 644 | return typeof flat === "string" ? flat : null; |
| 645 | }; |
| 646 | |
| 647 | const flatAuthEntries = (auth: AuthFile): Record<string, string> => { |
| 648 | const out: Record<string, string> = {}; |