Merge pull request #16230 from backstage/blam/bs/new

Switch out `'plain'` in `HttpServerCertificateOptions`
This commit is contained in:
Ben Lambert
2023-02-07 14:28:42 +01:00
committed by GitHub
7 changed files with 15 additions and 5 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-common': patch
---
Updated to work with the new `type: 'pem'` with `createHttpServer` from `@backstage/backend-app-api`
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/backend-app-api': minor
---
**BREAKING** `HttpServerCertificateOptions` when specified with a `key` and `cert` should also have the `type: 'pem'` instead of `type: 'plain'`
+1 -1
View File
@@ -133,7 +133,7 @@ export const httpRouterServiceFactory: (
// @public
export type HttpServerCertificateOptions =
| {
type: 'plain';
type: 'pem';
key: string;
cert: string;
}
@@ -53,7 +53,7 @@ describe('readHttpServerOptions', () => {
{
listen: { host: '', port: 7007 },
https: {
certificate: { type: 'plain', cert: 'my-cert', key: 'my-key' },
certificate: { type: 'pem', cert: 'my-cert', key: 'my-key' },
},
},
],
+1 -1
View File
@@ -93,7 +93,7 @@ function readHttpsOptions(config?: Config): HttpServerOptions['https'] {
return {
certificate: {
type: 'plain',
type: 'pem',
cert: cc.getString('certificate.cert'),
key: cc.getString('certificate.key'),
},
+1 -1
View File
@@ -51,7 +51,7 @@ export type HttpServerOptions = {
*/
export type HttpServerCertificateOptions =
| {
type: 'plain';
type: 'pem';
key: string;
cert: string;
}
@@ -102,7 +102,7 @@ export class ServiceBuilderImpl implements ServiceBuilder {
this.serverOptions.https = {
certificate: {
...settings.certificate,
type: 'plain',
type: 'pem',
},
};
}