Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
async userProvidedOverride(choice) {
switch (choice) {
case 'distCert': {
log('Please provide your distribution certificate P12:');
const distCertValues = await prompt(sharedQuestions);
const certP12Buffer = await fs.readFile(distCertValues.pathToP12);
const certPassword = distCertValues.p12Password;
const distCertSerialNumber = IosCodeSigning.findP12CertSerialNumber(
certP12Buffer,
certPassword
);
return {
metadata: { distCertSerialNumber },
credentials: this._ensureObjectsHasOnlyStrings({
certP12: certP12Buffer.toString('base64'),
certPassword,
}),
};
}
case 'pushCert': {
log('Please provide the path to your push notification cert P12');
const pushCertValues = await prompt(sharedQuestions);
return {
metadata: {},
async expoManagedResource(choice, appleCreds, teamId, credsMetadata, isEnterprise) {
switch (choice) {
case 'distCert': {
const produceCertAttempt = await authFuncs.produceCerts(appleCreds, teamId, isEnterprise);
this._throwIfFailureWithReasonDump(produceCertAttempt);
const distCertSerialNumber = IosCodeSigning.findP12CertSerialNumber(
produceCertAttempt.certP12,
produceCertAttempt.certPassword
);
return {
metadata: { distCertSerialNumber },
credentials: this._ensureObjectsHasOnlyStrings(produceCertAttempt),
};
}
case 'pushCert': {
const producePushCertsAttempt = await authFuncs.producePushCerts(
appleCreds,
credsMetadata,
teamId,
isEnterprise
);
this._throwIfFailureWithReasonDump(producePushCertsAttempt);