(deps)
| 950 | } |
| 951 | |
| 952 | function knownLocalSecrets(deps) { |
| 953 | const secrets = new Set(); |
| 954 | const add = value => { |
| 955 | if (typeof value === 'string' && value.length >= 8) secrets.add(value); |
| 956 | }; |
| 957 | if (deps) add(deps.nodeSecret); |
| 958 | try { add(getHubNodeSecret(deps || {})); } catch (_) {} |
| 959 | for (const [key, value] of Object.entries(process.env)) { |
| 960 | if (/SECRET|TOKEN|API[_-]?KEY|PASSWORD|AUTH|CREDENTIAL/i.test(key)) add(value); |
| 961 | } |
| 962 | return Array.from(secrets).sort((a, b) => b.length - a.length); |
| 963 | } |
| 964 | |
| 965 | function hasHubAuthorization(deps) { |
| 966 | if (getHubNodeSecret(deps)) return true; |
no test coverage detected