Extract WWW certificate provider
Summary: Extract WWW certificate provider from the iOS certificate provider. Hide its implementation from OSS since it is not relevant for OSS folks. Reviewed By: mweststrate Differential Revision: D33895378 fbshipit-source-id: 376afda3b5fa3857c0eb280b92555314eb1a0d1f
This commit is contained in:
committed by
Facebook GitHub Bot
parent
29f6d0e711
commit
fd13399cb9
@@ -8,21 +8,20 @@
|
||||
*/
|
||||
|
||||
import {IdbConfig} from './idbConfig';
|
||||
import {KeytarManager} from '../../utils/keytar';
|
||||
import CertificateProvider from '../../utils/CertificateProvider';
|
||||
import iosUtil from './iOSContainerUtility';
|
||||
import fs from 'fs-extra';
|
||||
import {promisify} from 'util';
|
||||
import tmp, {DirOptions} from 'tmp';
|
||||
import {csrFileName} from '../../utils/certificateUtils';
|
||||
import {csrFileName, extractAppNameFromCSR} from '../../utils/certificateUtils';
|
||||
import path from 'path';
|
||||
|
||||
const tmpDir = promisify(tmp.dir) as (options?: DirOptions) => Promise<string>;
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
export default class iOSCertificateProvider extends CertificateProvider {
|
||||
constructor(keytarManager: KeytarManager, private idbConfig: IdbConfig) {
|
||||
super(keytarManager);
|
||||
constructor(private idbConfig: IdbConfig) {
|
||||
super();
|
||||
}
|
||||
|
||||
async getTargetDeviceId(
|
||||
@@ -62,13 +61,13 @@ export default class iOSCertificateProvider extends CertificateProvider {
|
||||
return matchingIds[0];
|
||||
}
|
||||
|
||||
protected async handleFSBasedDeploy(
|
||||
protected async deployOrStageFileForDevice(
|
||||
destination: string,
|
||||
filename: string,
|
||||
contents: string,
|
||||
csr: string,
|
||||
appName: string,
|
||||
) {
|
||||
const appName = await extractAppNameFromCSR(csr);
|
||||
try {
|
||||
await fs.writeFile(destination + filename, contents);
|
||||
} catch (err) {
|
||||
|
||||
@@ -46,10 +46,7 @@ export class IOSDeviceManager {
|
||||
this.idbConfig,
|
||||
'IOSDeviceManager.certificateProvider -> missing idbConfig',
|
||||
);
|
||||
return new iOSCertificateProvider(
|
||||
this.flipperServer.keytarManager,
|
||||
this.idbConfig,
|
||||
);
|
||||
return new iOSCertificateProvider(this.idbConfig);
|
||||
}
|
||||
|
||||
private forwardPort(port: number, multiplexChannelPort: number) {
|
||||
|
||||
Reference in New Issue
Block a user