(value: string | undefined, name: string)
| 161 | } |
| 162 | |
| 163 | function parseRequiredSecret(value: string | undefined, name: string): string { |
| 164 | const secret = value?.trim(); |
| 165 | if (!secret) { |
| 166 | throw new Error(`${name} is required for DevSpace OAuth. Run: devspace init`); |
| 167 | } |
| 168 | if (secret.length < 16) { |
| 169 | throw new Error(`${name} must be at least 16 characters long.`); |
| 170 | } |
| 171 | return secret; |
| 172 | } |
| 173 | |
| 174 | function parseOAuthConfig(env: NodeJS.ProcessEnv, ownerToken: string | undefined): OAuthConfig { |
| 175 | return { |