@backstage/backend-app-api 0.3.0-next.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of @backstage/backend-app-api might be problematic. Click here for more details.
- package/CHANGELOG.md +36 -0
- package/alpha/package.json +1 -1
- package/dist/index.alpha.d.ts +138 -16
- package/dist/index.beta.d.ts +138 -16
- package/dist/index.cjs.js +538 -198
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +138 -16
- package/package.json +18 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,41 @@
|
|
|
1
1
|
# @backstage/backend-app-api
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 02b119ff93: **BREAKING**: The `httpRouterFactory` now accepts a `getPath` option rather than `indexPlugin`. To set up custom index path, configure the new `rootHttpRouterFactory` with a custom `indexPath` instead.
|
|
8
|
+
|
|
9
|
+
Added an implementation for the new `rootHttpRouterServiceRef`.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- ecc6bfe4c9: Use new `ServiceFactoryOrFunction` type.
|
|
14
|
+
- b99c030f1b: Moved over implementation of the root HTTP service from `@backstage/backend-common`, and replaced the `middleware` option with a `configure` callback option.
|
|
15
|
+
- 170282ece6: Fixed a bug in the default token manager factory where it created multiple incompatible instances.
|
|
16
|
+
- 843a0a158c: Added service factory for the new core identity service.
|
|
17
|
+
- 150a7dd790: An error will now be thrown if attempting to override the plugin metadata service.
|
|
18
|
+
- 483e907eaf: Internal updates of `createServiceFactory` from `@backstage/backend-plugin-api`.
|
|
19
|
+
- 015a6dced6: The `createSpecializedBackend` function will now throw an error if duplicate service implementations are provided.
|
|
20
|
+
- e3fca10038: Tweaked the plugin logger to use `plugin` as the label for the plugin ID, rather than `pluginId`.
|
|
21
|
+
- ecbec4ec4c: Internal refactor to match new options pattern in the experimental backend system.
|
|
22
|
+
- 51b7a7ed07: Exported the default root HTTP router implementation as `DefaultRootHttpRouter`. It only implements the routing layer and needs to be exposed via an HTTP server similar to the built-in setup in the `rootHttpRouterFactory`.
|
|
23
|
+
- 0e63aab311: Moved over logging and configuration loading implementations from `@backstage/backend-common`. There is a now `WinstonLogger` which implements the `RootLoggerService` through Winston with accompanying utilities. For configuration the `loadBackendConfig` function has been moved over, but it now instead returns an object with a `config` property.
|
|
24
|
+
- 8e06f3cf00: Switched imports of `loggerToWinstonLogger` to `@backstage/backend-common`.
|
|
25
|
+
- 3b8fd4169b: Internal folder structure refactor.
|
|
26
|
+
- 6cfd4d7073: Updated implementations for the new `RootLifecycleService`.
|
|
27
|
+
- Updated dependencies
|
|
28
|
+
- @backstage/backend-plugin-api@0.3.0
|
|
29
|
+
- @backstage/backend-common@0.18.0
|
|
30
|
+
- @backstage/backend-tasks@0.4.1
|
|
31
|
+
- @backstage/config@1.0.6
|
|
32
|
+
- @backstage/cli-common@0.1.11
|
|
33
|
+
- @backstage/config-loader@1.1.8
|
|
34
|
+
- @backstage/errors@1.1.4
|
|
35
|
+
- @backstage/types@1.0.2
|
|
36
|
+
- @backstage/plugin-auth-node@0.2.9
|
|
37
|
+
- @backstage/plugin-permission-node@0.7.3
|
|
38
|
+
|
|
3
39
|
## 0.3.0-next.1
|
|
4
40
|
|
|
5
41
|
### Minor Changes
|
package/alpha/package.json
CHANGED
package/dist/index.alpha.d.ts
CHANGED
|
@@ -13,11 +13,16 @@ import { CorsOptions } from 'cors';
|
|
|
13
13
|
import { ErrorRequestHandler } from 'express';
|
|
14
14
|
import { Express as Express_2 } from 'express';
|
|
15
15
|
import { ExtensionPoint } from '@backstage/backend-plugin-api';
|
|
16
|
+
import { Format } from 'logform';
|
|
17
|
+
import { Handler } from 'express';
|
|
16
18
|
import { HelmetOptions } from 'helmet';
|
|
17
19
|
import * as http from 'http';
|
|
18
20
|
import { HttpRouterService } from '@backstage/backend-plugin-api';
|
|
21
|
+
import { IdentityService } from '@backstage/backend-plugin-api';
|
|
19
22
|
import { LifecycleService } from '@backstage/backend-plugin-api';
|
|
23
|
+
import { LoadConfigOptionsRemote } from '@backstage/config-loader';
|
|
20
24
|
import { LoggerService } from '@backstage/backend-plugin-api';
|
|
25
|
+
import { LogMeta } from '@backstage/backend-plugin-api';
|
|
21
26
|
import { PermissionsService } from '@backstage/backend-plugin-api';
|
|
22
27
|
import { PluginCacheManager } from '@backstage/backend-common';
|
|
23
28
|
import { PluginDatabaseManager } from '@backstage/backend-common';
|
|
@@ -32,6 +37,7 @@ import { ServiceFactory } from '@backstage/backend-plugin-api';
|
|
|
32
37
|
import { ServiceFactoryOrFunction } from '@backstage/backend-plugin-api';
|
|
33
38
|
import { ServiceRef } from '@backstage/backend-plugin-api';
|
|
34
39
|
import { TokenManagerService } from '@backstage/backend-plugin-api';
|
|
40
|
+
import { transport } from 'winston';
|
|
35
41
|
import { UrlReader } from '@backstage/backend-common';
|
|
36
42
|
|
|
37
43
|
/**
|
|
@@ -44,10 +50,28 @@ export declare interface Backend {
|
|
|
44
50
|
}
|
|
45
51
|
|
|
46
52
|
/** @public */
|
|
47
|
-
export declare const cacheFactory: (
|
|
53
|
+
export declare const cacheFactory: () => ServiceFactory<PluginCacheManager>;
|
|
48
54
|
|
|
49
55
|
/** @public */
|
|
50
|
-
export declare const configFactory: (
|
|
56
|
+
export declare const configFactory: () => ServiceFactory<ConfigService>;
|
|
57
|
+
|
|
58
|
+
/** @public */
|
|
59
|
+
export declare interface ConfigFactoryOptions {
|
|
60
|
+
/**
|
|
61
|
+
* Process arguments to use instead of the default `process.argv()`.
|
|
62
|
+
*/
|
|
63
|
+
argv?: string[];
|
|
64
|
+
/**
|
|
65
|
+
* Enables and sets options for remote configuration loading.
|
|
66
|
+
*/
|
|
67
|
+
remote?: LoadConfigOptionsRemote;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** @public */
|
|
71
|
+
export declare function createConfigSecretEnumerator(options: {
|
|
72
|
+
logger: LoggerService;
|
|
73
|
+
dir?: string;
|
|
74
|
+
}): Promise<(config: Config) => Iterable<string>>;
|
|
51
75
|
|
|
52
76
|
/**
|
|
53
77
|
* Creates a Node.js HTTP or HTTPS server instance.
|
|
@@ -71,10 +95,37 @@ export declare interface CreateSpecializedBackendOptions {
|
|
|
71
95
|
}
|
|
72
96
|
|
|
73
97
|
/** @public */
|
|
74
|
-
export declare const databaseFactory: (
|
|
98
|
+
export declare const databaseFactory: () => ServiceFactory<PluginDatabaseManager>;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* The default implementation of the {@link @backstage/backend-plugin-api#RootHttpRouterService} interface for
|
|
102
|
+
* {@link @backstage/backend-plugin-api#coreServices.rootHttpRouter}.
|
|
103
|
+
*
|
|
104
|
+
* @public
|
|
105
|
+
*/
|
|
106
|
+
export declare class DefaultRootHttpRouter implements RootHttpRouterService {
|
|
107
|
+
#private;
|
|
108
|
+
static create(options?: DefaultRootHttpRouterOptions): DefaultRootHttpRouter;
|
|
109
|
+
private constructor();
|
|
110
|
+
use(path: string, handler: Handler): void;
|
|
111
|
+
handler(): Handler;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Options for the {@link DefaultRootHttpRouter} class.
|
|
116
|
+
*
|
|
117
|
+
* @public
|
|
118
|
+
*/
|
|
119
|
+
export declare interface DefaultRootHttpRouterOptions {
|
|
120
|
+
/**
|
|
121
|
+
* The path to forward all unmatched requests to. Defaults to '/api/app' if
|
|
122
|
+
* not given. Disables index path behavior if false is given.
|
|
123
|
+
*/
|
|
124
|
+
indexPath?: string | false;
|
|
125
|
+
}
|
|
75
126
|
|
|
76
127
|
/** @public */
|
|
77
|
-
export declare const discoveryFactory: (
|
|
128
|
+
export declare const discoveryFactory: () => ServiceFactory<PluginEndpointDiscovery>;
|
|
78
129
|
|
|
79
130
|
/**
|
|
80
131
|
* An HTTP server extended with utility methods.
|
|
@@ -93,12 +144,12 @@ export declare const httpRouterFactory: (options?: HttpRouterFactoryOptions | un
|
|
|
93
144
|
/**
|
|
94
145
|
* @public
|
|
95
146
|
*/
|
|
96
|
-
export declare
|
|
147
|
+
export declare interface HttpRouterFactoryOptions {
|
|
97
148
|
/**
|
|
98
149
|
* A callback used to generate the path for each plugin, defaults to `/api/{pluginId}`.
|
|
99
150
|
*/
|
|
100
151
|
getPath(pluginId: string): string;
|
|
101
|
-
}
|
|
152
|
+
}
|
|
102
153
|
|
|
103
154
|
/**
|
|
104
155
|
* Options for configuring HTTPS for an HTTP server.
|
|
@@ -129,13 +180,42 @@ export declare type HttpServerOptions = {
|
|
|
129
180
|
};
|
|
130
181
|
};
|
|
131
182
|
|
|
183
|
+
/** @public */
|
|
184
|
+
export declare const identityFactory: (options?: IdentityFactoryOptions | undefined) => ServiceFactory<IdentityService>;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* An identity client options object which allows extra configurations
|
|
188
|
+
*
|
|
189
|
+
* @public
|
|
190
|
+
*/
|
|
191
|
+
export declare type IdentityFactoryOptions = {
|
|
192
|
+
issuer?: string;
|
|
193
|
+
/** JWS "alg" (Algorithm) Header Parameter values. Defaults to an array containing just ES256.
|
|
194
|
+
* More info on supported algorithms: https://github.com/panva/jose */
|
|
195
|
+
algorithms?: string[];
|
|
196
|
+
};
|
|
197
|
+
|
|
132
198
|
/**
|
|
133
199
|
* Allows plugins to register shutdown hooks that are run when the process is about to exit.
|
|
134
200
|
* @public */
|
|
135
|
-
export declare const lifecycleFactory: (
|
|
201
|
+
export declare const lifecycleFactory: () => ServiceFactory<LifecycleService>;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Load configuration for a Backend.
|
|
205
|
+
*
|
|
206
|
+
* This function should only be called once, during the initialization of the backend.
|
|
207
|
+
*
|
|
208
|
+
* @public
|
|
209
|
+
*/
|
|
210
|
+
export declare function loadBackendConfig(options: {
|
|
211
|
+
remote?: LoadConfigOptionsRemote;
|
|
212
|
+
argv: string[];
|
|
213
|
+
}): Promise<{
|
|
214
|
+
config: Config;
|
|
215
|
+
}>;
|
|
136
216
|
|
|
137
217
|
/** @public */
|
|
138
|
-
export declare const loggerFactory: (
|
|
218
|
+
export declare const loggerFactory: () => ServiceFactory<LoggerService>;
|
|
139
219
|
|
|
140
220
|
/**
|
|
141
221
|
* A utility to configure common middleware.
|
|
@@ -261,7 +341,7 @@ export declare interface MiddlewareFactoryOptions {
|
|
|
261
341
|
}
|
|
262
342
|
|
|
263
343
|
/** @public */
|
|
264
|
-
export declare const permissionsFactory: (
|
|
344
|
+
export declare const permissionsFactory: () => ServiceFactory<PermissionsService>;
|
|
265
345
|
|
|
266
346
|
/**
|
|
267
347
|
* Attempts to read a CORS options object from the backend configuration object.
|
|
@@ -320,14 +400,15 @@ export declare interface RootHttpRouterConfigureOptions {
|
|
|
320
400
|
}
|
|
321
401
|
|
|
322
402
|
/** @public */
|
|
323
|
-
export declare const rootHttpRouterFactory: (
|
|
403
|
+
export declare const rootHttpRouterFactory: () => ServiceFactory<RootHttpRouterService>;
|
|
324
404
|
|
|
325
405
|
/**
|
|
326
406
|
* @public
|
|
327
407
|
*/
|
|
328
408
|
export declare type RootHttpRouterFactoryOptions = {
|
|
329
409
|
/**
|
|
330
|
-
* The path to forward all unmatched requests to. Defaults to '/api/app'
|
|
410
|
+
* The path to forward all unmatched requests to. Defaults to '/api/app' if
|
|
411
|
+
* not given. Disables index path behavior if false is given.
|
|
331
412
|
*/
|
|
332
413
|
indexPath?: string | false;
|
|
333
414
|
configure?(options: RootHttpRouterConfigureOptions): void;
|
|
@@ -336,13 +417,13 @@ export declare type RootHttpRouterFactoryOptions = {
|
|
|
336
417
|
/**
|
|
337
418
|
* Allows plugins to register shutdown hooks that are run when the process is about to exit.
|
|
338
419
|
* @public */
|
|
339
|
-
export declare const rootLifecycleFactory: (
|
|
420
|
+
export declare const rootLifecycleFactory: () => ServiceFactory<RootLifecycleService>;
|
|
340
421
|
|
|
341
422
|
/** @public */
|
|
342
|
-
export declare const rootLoggerFactory: (
|
|
423
|
+
export declare const rootLoggerFactory: () => ServiceFactory<RootLoggerService>;
|
|
343
424
|
|
|
344
425
|
/** @public */
|
|
345
|
-
export declare const schedulerFactory: (
|
|
426
|
+
export declare const schedulerFactory: () => ServiceFactory<SchedulerService>;
|
|
346
427
|
|
|
347
428
|
/**
|
|
348
429
|
* @public
|
|
@@ -350,9 +431,50 @@ export declare const schedulerFactory: (options?: undefined) => ServiceFactory<S
|
|
|
350
431
|
export declare type ServiceOrExtensionPoint<T = unknown> = ExtensionPoint<T> | ServiceRef<T>;
|
|
351
432
|
|
|
352
433
|
/** @public */
|
|
353
|
-
export declare const tokenManagerFactory: (
|
|
434
|
+
export declare const tokenManagerFactory: () => ServiceFactory<TokenManagerService>;
|
|
354
435
|
|
|
355
436
|
/** @public */
|
|
356
|
-
export declare const urlReaderFactory: (
|
|
437
|
+
export declare const urlReaderFactory: () => ServiceFactory<UrlReader>;
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* A {@link @backstage/backend-plugin-api#LoggerService} implementation based on winston.
|
|
441
|
+
*
|
|
442
|
+
* @public
|
|
443
|
+
*/
|
|
444
|
+
export declare class WinstonLogger implements RootLoggerService {
|
|
445
|
+
#private;
|
|
446
|
+
/**
|
|
447
|
+
* Creates a {@link WinstonLogger} instance.
|
|
448
|
+
*/
|
|
449
|
+
static create(options: WinstonLoggerOptions): WinstonLogger;
|
|
450
|
+
/**
|
|
451
|
+
* Creates a winston log formatter for redacting secrets.
|
|
452
|
+
*/
|
|
453
|
+
static redacter(): {
|
|
454
|
+
format: Format;
|
|
455
|
+
add: (redactions: Iterable<string>) => void;
|
|
456
|
+
};
|
|
457
|
+
/**
|
|
458
|
+
* Creates a pretty printed winston log formatter.
|
|
459
|
+
*/
|
|
460
|
+
static colorFormat(): Format;
|
|
461
|
+
private constructor();
|
|
462
|
+
error(message: string, meta?: LogMeta): void;
|
|
463
|
+
warn(message: string, meta?: LogMeta): void;
|
|
464
|
+
info(message: string, meta?: LogMeta): void;
|
|
465
|
+
debug(message: string, meta?: LogMeta): void;
|
|
466
|
+
child(meta: LogMeta): LoggerService;
|
|
467
|
+
addRedactions(redactions: Iterable<string>): void;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* @public
|
|
472
|
+
*/
|
|
473
|
+
export declare interface WinstonLoggerOptions {
|
|
474
|
+
meta?: LogMeta;
|
|
475
|
+
level: string;
|
|
476
|
+
format: Format;
|
|
477
|
+
transports: transport[];
|
|
478
|
+
}
|
|
357
479
|
|
|
358
480
|
export { }
|
package/dist/index.beta.d.ts
CHANGED
|
@@ -13,11 +13,16 @@ import { CorsOptions } from 'cors';
|
|
|
13
13
|
import { ErrorRequestHandler } from 'express';
|
|
14
14
|
import { Express as Express_2 } from 'express';
|
|
15
15
|
import { ExtensionPoint } from '@backstage/backend-plugin-api';
|
|
16
|
+
import { Format } from 'logform';
|
|
17
|
+
import { Handler } from 'express';
|
|
16
18
|
import { HelmetOptions } from 'helmet';
|
|
17
19
|
import * as http from 'http';
|
|
18
20
|
import { HttpRouterService } from '@backstage/backend-plugin-api';
|
|
21
|
+
import { IdentityService } from '@backstage/backend-plugin-api';
|
|
19
22
|
import { LifecycleService } from '@backstage/backend-plugin-api';
|
|
23
|
+
import { LoadConfigOptionsRemote } from '@backstage/config-loader';
|
|
20
24
|
import { LoggerService } from '@backstage/backend-plugin-api';
|
|
25
|
+
import { LogMeta } from '@backstage/backend-plugin-api';
|
|
21
26
|
import { PermissionsService } from '@backstage/backend-plugin-api';
|
|
22
27
|
import { PluginCacheManager } from '@backstage/backend-common';
|
|
23
28
|
import { PluginDatabaseManager } from '@backstage/backend-common';
|
|
@@ -32,6 +37,7 @@ import { ServiceFactory } from '@backstage/backend-plugin-api';
|
|
|
32
37
|
import { ServiceFactoryOrFunction } from '@backstage/backend-plugin-api';
|
|
33
38
|
import { ServiceRef } from '@backstage/backend-plugin-api';
|
|
34
39
|
import { TokenManagerService } from '@backstage/backend-plugin-api';
|
|
40
|
+
import { transport } from 'winston';
|
|
35
41
|
import { UrlReader } from '@backstage/backend-common';
|
|
36
42
|
|
|
37
43
|
/**
|
|
@@ -44,10 +50,28 @@ export declare interface Backend {
|
|
|
44
50
|
}
|
|
45
51
|
|
|
46
52
|
/** @public */
|
|
47
|
-
export declare const cacheFactory: (
|
|
53
|
+
export declare const cacheFactory: () => ServiceFactory<PluginCacheManager>;
|
|
48
54
|
|
|
49
55
|
/** @public */
|
|
50
|
-
export declare const configFactory: (
|
|
56
|
+
export declare const configFactory: () => ServiceFactory<ConfigService>;
|
|
57
|
+
|
|
58
|
+
/** @public */
|
|
59
|
+
export declare interface ConfigFactoryOptions {
|
|
60
|
+
/**
|
|
61
|
+
* Process arguments to use instead of the default `process.argv()`.
|
|
62
|
+
*/
|
|
63
|
+
argv?: string[];
|
|
64
|
+
/**
|
|
65
|
+
* Enables and sets options for remote configuration loading.
|
|
66
|
+
*/
|
|
67
|
+
remote?: LoadConfigOptionsRemote;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** @public */
|
|
71
|
+
export declare function createConfigSecretEnumerator(options: {
|
|
72
|
+
logger: LoggerService;
|
|
73
|
+
dir?: string;
|
|
74
|
+
}): Promise<(config: Config) => Iterable<string>>;
|
|
51
75
|
|
|
52
76
|
/**
|
|
53
77
|
* Creates a Node.js HTTP or HTTPS server instance.
|
|
@@ -71,10 +95,37 @@ export declare interface CreateSpecializedBackendOptions {
|
|
|
71
95
|
}
|
|
72
96
|
|
|
73
97
|
/** @public */
|
|
74
|
-
export declare const databaseFactory: (
|
|
98
|
+
export declare const databaseFactory: () => ServiceFactory<PluginDatabaseManager>;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* The default implementation of the {@link @backstage/backend-plugin-api#RootHttpRouterService} interface for
|
|
102
|
+
* {@link @backstage/backend-plugin-api#coreServices.rootHttpRouter}.
|
|
103
|
+
*
|
|
104
|
+
* @public
|
|
105
|
+
*/
|
|
106
|
+
export declare class DefaultRootHttpRouter implements RootHttpRouterService {
|
|
107
|
+
#private;
|
|
108
|
+
static create(options?: DefaultRootHttpRouterOptions): DefaultRootHttpRouter;
|
|
109
|
+
private constructor();
|
|
110
|
+
use(path: string, handler: Handler): void;
|
|
111
|
+
handler(): Handler;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Options for the {@link DefaultRootHttpRouter} class.
|
|
116
|
+
*
|
|
117
|
+
* @public
|
|
118
|
+
*/
|
|
119
|
+
export declare interface DefaultRootHttpRouterOptions {
|
|
120
|
+
/**
|
|
121
|
+
* The path to forward all unmatched requests to. Defaults to '/api/app' if
|
|
122
|
+
* not given. Disables index path behavior if false is given.
|
|
123
|
+
*/
|
|
124
|
+
indexPath?: string | false;
|
|
125
|
+
}
|
|
75
126
|
|
|
76
127
|
/** @public */
|
|
77
|
-
export declare const discoveryFactory: (
|
|
128
|
+
export declare const discoveryFactory: () => ServiceFactory<PluginEndpointDiscovery>;
|
|
78
129
|
|
|
79
130
|
/**
|
|
80
131
|
* An HTTP server extended with utility methods.
|
|
@@ -93,12 +144,12 @@ export declare const httpRouterFactory: (options?: HttpRouterFactoryOptions | un
|
|
|
93
144
|
/**
|
|
94
145
|
* @public
|
|
95
146
|
*/
|
|
96
|
-
export declare
|
|
147
|
+
export declare interface HttpRouterFactoryOptions {
|
|
97
148
|
/**
|
|
98
149
|
* A callback used to generate the path for each plugin, defaults to `/api/{pluginId}`.
|
|
99
150
|
*/
|
|
100
151
|
getPath(pluginId: string): string;
|
|
101
|
-
}
|
|
152
|
+
}
|
|
102
153
|
|
|
103
154
|
/**
|
|
104
155
|
* Options for configuring HTTPS for an HTTP server.
|
|
@@ -129,13 +180,42 @@ export declare type HttpServerOptions = {
|
|
|
129
180
|
};
|
|
130
181
|
};
|
|
131
182
|
|
|
183
|
+
/** @public */
|
|
184
|
+
export declare const identityFactory: (options?: IdentityFactoryOptions | undefined) => ServiceFactory<IdentityService>;
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* An identity client options object which allows extra configurations
|
|
188
|
+
*
|
|
189
|
+
* @public
|
|
190
|
+
*/
|
|
191
|
+
export declare type IdentityFactoryOptions = {
|
|
192
|
+
issuer?: string;
|
|
193
|
+
/** JWS "alg" (Algorithm) Header Parameter values. Defaults to an array containing just ES256.
|
|
194
|
+
* More info on supported algorithms: https://github.com/panva/jose */
|
|
195
|
+
algorithms?: string[];
|
|
196
|
+
};
|
|
197
|
+
|
|
132
198
|
/**
|
|
133
199
|
* Allows plugins to register shutdown hooks that are run when the process is about to exit.
|
|
134
200
|
* @public */
|
|
135
|
-
export declare const lifecycleFactory: (
|
|
201
|
+
export declare const lifecycleFactory: () => ServiceFactory<LifecycleService>;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Load configuration for a Backend.
|
|
205
|
+
*
|
|
206
|
+
* This function should only be called once, during the initialization of the backend.
|
|
207
|
+
*
|
|
208
|
+
* @public
|
|
209
|
+
*/
|
|
210
|
+
export declare function loadBackendConfig(options: {
|
|
211
|
+
remote?: LoadConfigOptionsRemote;
|
|
212
|
+
argv: string[];
|
|
213
|
+
}): Promise<{
|
|
214
|
+
config: Config;
|
|
215
|
+
}>;
|
|
136
216
|
|
|
137
217
|
/** @public */
|
|
138
|
-
export declare const loggerFactory: (
|
|
218
|
+
export declare const loggerFactory: () => ServiceFactory<LoggerService>;
|
|
139
219
|
|
|
140
220
|
/**
|
|
141
221
|
* A utility to configure common middleware.
|
|
@@ -261,7 +341,7 @@ export declare interface MiddlewareFactoryOptions {
|
|
|
261
341
|
}
|
|
262
342
|
|
|
263
343
|
/** @public */
|
|
264
|
-
export declare const permissionsFactory: (
|
|
344
|
+
export declare const permissionsFactory: () => ServiceFactory<PermissionsService>;
|
|
265
345
|
|
|
266
346
|
/**
|
|
267
347
|
* Attempts to read a CORS options object from the backend configuration object.
|
|
@@ -320,14 +400,15 @@ export declare interface RootHttpRouterConfigureOptions {
|
|
|
320
400
|
}
|
|
321
401
|
|
|
322
402
|
/** @public */
|
|
323
|
-
export declare const rootHttpRouterFactory: (
|
|
403
|
+
export declare const rootHttpRouterFactory: () => ServiceFactory<RootHttpRouterService>;
|
|
324
404
|
|
|
325
405
|
/**
|
|
326
406
|
* @public
|
|
327
407
|
*/
|
|
328
408
|
export declare type RootHttpRouterFactoryOptions = {
|
|
329
409
|
/**
|
|
330
|
-
* The path to forward all unmatched requests to. Defaults to '/api/app'
|
|
410
|
+
* The path to forward all unmatched requests to. Defaults to '/api/app' if
|
|
411
|
+
* not given. Disables index path behavior if false is given.
|
|
331
412
|
*/
|
|
332
413
|
indexPath?: string | false;
|
|
333
414
|
configure?(options: RootHttpRouterConfigureOptions): void;
|
|
@@ -336,13 +417,13 @@ export declare type RootHttpRouterFactoryOptions = {
|
|
|
336
417
|
/**
|
|
337
418
|
* Allows plugins to register shutdown hooks that are run when the process is about to exit.
|
|
338
419
|
* @public */
|
|
339
|
-
export declare const rootLifecycleFactory: (
|
|
420
|
+
export declare const rootLifecycleFactory: () => ServiceFactory<RootLifecycleService>;
|
|
340
421
|
|
|
341
422
|
/** @public */
|
|
342
|
-
export declare const rootLoggerFactory: (
|
|
423
|
+
export declare const rootLoggerFactory: () => ServiceFactory<RootLoggerService>;
|
|
343
424
|
|
|
344
425
|
/** @public */
|
|
345
|
-
export declare const schedulerFactory: (
|
|
426
|
+
export declare const schedulerFactory: () => ServiceFactory<SchedulerService>;
|
|
346
427
|
|
|
347
428
|
/**
|
|
348
429
|
* @public
|
|
@@ -350,9 +431,50 @@ export declare const schedulerFactory: (options?: undefined) => ServiceFactory<S
|
|
|
350
431
|
export declare type ServiceOrExtensionPoint<T = unknown> = ExtensionPoint<T> | ServiceRef<T>;
|
|
351
432
|
|
|
352
433
|
/** @public */
|
|
353
|
-
export declare const tokenManagerFactory: (
|
|
434
|
+
export declare const tokenManagerFactory: () => ServiceFactory<TokenManagerService>;
|
|
354
435
|
|
|
355
436
|
/** @public */
|
|
356
|
-
export declare const urlReaderFactory: (
|
|
437
|
+
export declare const urlReaderFactory: () => ServiceFactory<UrlReader>;
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* A {@link @backstage/backend-plugin-api#LoggerService} implementation based on winston.
|
|
441
|
+
*
|
|
442
|
+
* @public
|
|
443
|
+
*/
|
|
444
|
+
export declare class WinstonLogger implements RootLoggerService {
|
|
445
|
+
#private;
|
|
446
|
+
/**
|
|
447
|
+
* Creates a {@link WinstonLogger} instance.
|
|
448
|
+
*/
|
|
449
|
+
static create(options: WinstonLoggerOptions): WinstonLogger;
|
|
450
|
+
/**
|
|
451
|
+
* Creates a winston log formatter for redacting secrets.
|
|
452
|
+
*/
|
|
453
|
+
static redacter(): {
|
|
454
|
+
format: Format;
|
|
455
|
+
add: (redactions: Iterable<string>) => void;
|
|
456
|
+
};
|
|
457
|
+
/**
|
|
458
|
+
* Creates a pretty printed winston log formatter.
|
|
459
|
+
*/
|
|
460
|
+
static colorFormat(): Format;
|
|
461
|
+
private constructor();
|
|
462
|
+
error(message: string, meta?: LogMeta): void;
|
|
463
|
+
warn(message: string, meta?: LogMeta): void;
|
|
464
|
+
info(message: string, meta?: LogMeta): void;
|
|
465
|
+
debug(message: string, meta?: LogMeta): void;
|
|
466
|
+
child(meta: LogMeta): LoggerService;
|
|
467
|
+
addRedactions(redactions: Iterable<string>): void;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* @public
|
|
472
|
+
*/
|
|
473
|
+
export declare interface WinstonLoggerOptions {
|
|
474
|
+
meta?: LogMeta;
|
|
475
|
+
level: string;
|
|
476
|
+
format: Format;
|
|
477
|
+
transports: transport[];
|
|
478
|
+
}
|
|
357
479
|
|
|
358
480
|
export { }
|