Skip to content

Commit 9703625

Browse files
committed
Initial commit. Move certificate managing code to new project.
1 parent 25ba669 commit 9703625

File tree

21 files changed

+378
-171
lines changed

21 files changed

+378
-171
lines changed

common/config/rush/nonbrowser-approved-packages.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
"name": "@microsoft/api-extractor-model",
1515
"allowedCategories": [ "libraries" ]
1616
},
17+
{
18+
"name": "@microsoft/debug-certificate-manager",
19+
"allowedCategories": [ "libraries" ]
20+
},
1721
{
1822
"name": "@microsoft/decorators",
1923
"allowedCategories": [ "libraries" ]

common/config/rush/pnpm-lock.yaml

Lines changed: 93 additions & 74 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
## API Report File for "@microsoft/debug-certificate-manager"
2+
3+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4+
5+
```ts
6+
7+
// @public (undocumented)
8+
export class CertificateStore {
9+
// (undocumented)
10+
certificateData: string | undefined;
11+
// (undocumented)
12+
readonly certificatePath: string;
13+
// (undocumented)
14+
static readonly instance: CertificateStore;
15+
// (undocumented)
16+
keyData: string | undefined;
17+
}
18+
19+
// @public
20+
export function ensureCertificate(canGenerateNewCertificate: boolean, parentTask: ILogging): ICertificate;
21+
22+
// @public (undocumented)
23+
export interface ICertificate {
24+
// (undocumented)
25+
pemCertificate: string | undefined;
26+
// (undocumented)
27+
pemKey: string | undefined;
28+
}
29+
30+
// @public (undocumented)
31+
export interface ILogging {
32+
// (undocumented)
33+
log: (string: any) => void;
34+
// (undocumented)
35+
logError: (string: any) => void;
36+
// (undocumented)
37+
logVerbose: (string: any) => void;
38+
// (undocumented)
39+
logWarning: (string: any) => void;
40+
}
41+
42+
// @public (undocumented)
43+
export function untrustCertificate(parentTask: ILogging): boolean;
44+
45+
46+
// (No @packageDocumentation comment for this package)
47+
48+
```
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
## API Report File for "@microsoft/debug-certificate-manager"
2+
3+
> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4+
5+
```ts
6+
7+
// @public (undocumented)
8+
export class CertificateStore {
9+
// (undocumented)
10+
certificateData: string | undefined;
11+
// (undocumented)
12+
readonly certificatePath: string;
13+
// (undocumented)
14+
static readonly instance: CertificateStore;
15+
// (undocumented)
16+
keyData: string | undefined;
17+
}
18+
19+
// @public
20+
export function ensureCertificate(canGenerateNewCertificate: boolean, parentTask: ILogging): ICertificate;
21+
22+
// @public (undocumented)
23+
export interface ICertificate {
24+
// (undocumented)
25+
pemCertificate: string | undefined;
26+
// (undocumented)
27+
pemKey: string | undefined;
28+
}
29+
30+
// @public (undocumented)
31+
export interface ILogging {
32+
// (undocumented)
33+
log: (string: any) => void;
34+
// (undocumented)
35+
logError: (string: any) => void;
36+
// (undocumented)
37+
logVerbose: (string: any) => void;
38+
// (undocumented)
39+
logWarning: (string: any) => void;
40+
}
41+
42+
// @public (undocumented)
43+
export function untrustCertificate(parentTask: ILogging): boolean;
44+
45+
46+
// (No @packageDocumentation comment for this package)
47+
48+
```

core-build/gulp-core-build-serve/package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,25 @@
1313
"build": "gulp --clean"
1414
},
1515
"dependencies": {
16+
"@microsoft/debug-certificate-manager": "~0.1.0",
1617
"@microsoft/gulp-core-build": "3.13.3",
1718
"@microsoft/node-core-library": "3.18.2",
1819
"@types/node": "8.10.54",
1920
"colors": "~1.2.1",
20-
"deasync": "~0.1.7",
2121
"express": "~4.16.2",
2222
"gulp": "~4.0.2",
2323
"gulp-connect": "~5.5.0",
2424
"gulp-open": "~3.0.1",
25-
"node-forge": "~0.7.1",
2625
"sudo": "~1.0.3"
2726
},
2827
"devDependencies": {
29-
"@microsoft/rush-stack-compiler-3.5": "0.3.13",
3028
"@microsoft/node-library-build": "6.3.14",
29+
"@microsoft/rush-stack-compiler-3.5": "0.3.13",
3130
"@rushstack/eslint-config": "0.5.1",
3231
"@types/express": "4.11.0",
3332
"@types/express-serve-static-core": "4.11.0",
3433
"@types/gulp": "4.0.6",
3534
"@types/mime": "0.0.29",
36-
"@types/node-forge": "0.6.8",
3735
"@types/orchestrator": "0.0.30",
3836
"@types/serve-static": "1.13.1",
3937
"@types/through2": "2.0.32",

core-build/gulp-core-build-serve/src/NodeForgeExtensions.d.ts

Lines changed: 0 additions & 45 deletions
This file was deleted.

core-build/gulp-core-build-serve/src/ServeTask.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import * as ExpressType from 'express';
1515

1616
import {
1717
ICertificate
18-
} from './certificates';
18+
} from '@microsoft/debug-certificate-manager';
1919

2020
/**
2121
* @remarks

core-build/gulp-core-build-serve/src/TrustCertTask.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as Gulp from 'gulp';
66
import {
77
ICertificate,
88
ensureCertificate
9-
} from './certificates';
9+
} from '@microsoft/debug-certificate-manager';
1010

1111
/**
1212
* This task generates and trusts a development certificate. The certificate is self-signed

core-build/gulp-core-build-serve/src/UntrustCertTask.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
import { GulpTask } from '@microsoft/gulp-core-build';
55
import * as Gulp from 'gulp';
6-
import { CertificateStore } from './CertificateStore';
7-
import { untrustCertificate } from './certificates';
6+
import { CertificateStore } from '@microsoft/debug-certificate-manager';
7+
import { untrustCertificate } from '@microsoft/debug-certificate-manager';
88

99
/**
1010
* On Windows, this task removes the certificate with the expected serial number from the user's
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
@microsoft/debug-certificate-manager
2+
3+
Copyright (c) Microsoft Corporation. All rights reserved.
4+
5+
MIT License
6+
7+
Permission is hereby granted, free of charge, to any person obtaining
8+
a copy of this software and associated documentation files (the
9+
"Software"), to deal in the Software without restriction, including
10+
without limitation the rights to use, copy, modify, merge, publish,
11+
distribute, sublicense, and/or sell copies of the Software, and to
12+
permit persons to whom the Software is furnished to do so, subject to
13+
the following conditions:
14+
15+
The above copyright notice and this permission notice shall be
16+
included in all copies or substantial portions of the Software.
17+
18+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
19+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)