This topic tells you about API references for surfaces in Tanzu Developer Portal.
The following packages are described:
@tpb/plugin-catalog
The following sections describe the package.
EntityPageSurface
This class can manipulate the contents of pages for Backstage catalog entities.
Each catalog entity subtype can specify a dedicated template. This surface standardizes the contents of those templates and allows for some amount of external configuration.
This example adds a tab to the template for Backstage Service entities:
context.applyWithDependency(
AppRouteSurface,
EntityPageSurface,
(_, surface) => {
surface.servicePage.addTab(
<EntityLayout.Route path="/some-subpath" title="Additional content for Services">
<MyAdditionalContent />
</EntityLayout.Route>,
);
},
);
Property | Type | Description |
---|---|---|
apiPage |
ApiPage |
|
componentPageCases |
ReactElement[] |
|
defaultPage |
BasicPage |
|
domainPage |
BasicPage |
|
groupPage |
BasicPage |
|
packagePage |
BasicPage |
|
servicePage |
BasicPage |
|
systemPage |
BasicPage |
|
userPage |
BasicPage |
|
websitePage |
BasicPage |
The package has the following constructor(s).
This constructor constructs a new instance of the EntityPageSurface
class.
The package has the following methods.
addComponentPageCase(pageCase: ReactElement)
: voidThis table describes the parameters.
Parameter | Type | Description |
---|---|---|
pageCase |
ReactElement |
addOverviewContent(content: ReactElement)
: voidThis table describes the parameters.
Parameter | Type | Description |
---|---|---|
content |
ReactElement |
@vmware-tanzu/core-backend
The following sections describe the package.
The package has the following types.
BackendPluginInterface<T = {}> = (config?: T & BackendPluginConfig) => TpbPluginInterface;
CatalogProcessorBuilder = (env: PluginEnvironment) => CatalogProcessor[] | CatalogProcessor;
EntityProviderBuilder = (env: PluginEnvironment) => EntityProvider[] | EntityProvider;
PermissionRuleBuilder = (env: PluginEnvironment) => CatalogPermissionRule[] | CatalogPermissionRule;
PluginFn = (env: PluginEnvironment) => Promise<Router>;
RouterBuilder = (env: PluginEnvironment) => Promise<Router>;
BackendCatalogSurface
This class can manipulate the catalog backend.
This class provides extension points for registering catalog processors, entity providers, routes, and permissions.
The package has the following constructor(s).
This constructor constructs a new instance of the BackendCatalogSurface
class.
The package has the following methods.
addCatalogProcessorBuilder(builder: CatalogProcessorBuilder)
: voidThis method registers a Backstage CatalogProcessor
that applies transformations to unprocessed entities.
For more information about processors, see the Backstage documentation.
For more information about processing, see the Backstage documentation.
Parameter | Type | Description |
---|---|---|
builder |
CatalogProcessorBuilder | Builds a CatalogProcessor for a given PluginEnvironment . |
addEntityProviderBuilder(builder: EntityProviderBuilder)
: voidThis method registers a Backstage EntityProvider
to ingest generate catalog entries for further processing.
For more information about ingestion, see the Backstage documentation.
Parameter | Type | Description |
---|---|---|
builder |
EntityProviderBuilder | Builds an EntityProvider for a given PluginEnvironment . |
addPermissionRuleBuilder(builder: PermissionRuleBuilder)
: voidThis method registers Backstage CatalogPermissionRules
to limit access to catalog entries.
For more information about custom permission rules, see the Backstage documentation.
Parameter | Type | Description |
---|---|---|
builder |
PermissionRuleBuilder | Builds CatalogPermissionRules for a given PluginEnvironment . |
addRouterBuilder(routerBuilder: RouterBuilder)
: voidThis method registers an Express Router to handle arbitrary requests made to the Backstage backend.
Parameter | Type | Description |
---|---|---|
routerBuilder |
RouterBuilder | Builds an Express Router for a given PluginEnvironment . |
BackendPluginSurface
You can use this class to add plug-ins to the Backstage backend.
The package has the following constructor(s).
This constructor constructs a new instance of the BackendPluginSurface
class.
The package has the following methods.
addPlugin(plugin: Plugin)
: voidThis method registers a named plug-in to handle backend requests at a subpath.
Plug-ins must have unique names. The first plug-in registered with a given name wins.
Parameter | Type | Description |
---|---|---|
plugin |
Plugin | Plug-in to add |
@vmware-tanzu/core-frontend
The following sections describe the package.
The package has the following type.
AppPluginInterface<T = {}> = (config?: T) => TpbPluginInterface;
ApiSurface
You can use this class to add Backstage ApiFactories
.
The package has the following methods.
add(factory: AnyApiFactory):
voidThis method registers a new Backstage ApiFactory
. Factories must specify an API with a unique ID. The last factory registered with a given ID wins.
Factories that specify APIs with IDs on the ignored list will not be registered.
Parameter | Type | Description |
---|---|---|
factory |
AnyApiFactory |
AppComponentSurface
You can use this class to replace core components of the Backstage app.
The package has the following constructor(s).
This constructor constructs a new instance of the AppComponentSurface
class.
The package has the following methods.
add<K extends keyof AppComponents>(key: K, component: AppComponents\[K\])
: voidThis method replaces a given Backstage AppComponent
with another. AppComponents
must be unique by key. The last AppComponent
registered with a given key wins.
Parameter | Type | Description |
---|---|---|
key |
Unique key for the AppComponent . |
|
component |
AppComponents |
Custom AppComponent to substitute for Backstage’s default. |
AppPluginSurface
You can use this class to register additional frontend plug-ins with the Backstage app.
https://backstage.io/docs/plugins/
The package has the following constructor(s).
Constructs a new instance of the AppPluginSurface
class
The package has the following methods.
add(plugin: BackstagePlugin)
: voidThis method registers a frontend BackstagePlugin
.
Parameter | Type | Description |
---|---|---|
plugin |
BackstagePlugin |
AppRouteSurface
Manipulate routes in the frontend Backstage app.
https://backstage.io/docs/plugins/composability/#routing-system
The package has the following constructor(s).
Constructs a new instance of the AppRouteSurface
class
The package has the following methods.
add(route: ReactElement)
: voidThis method registers a react-router Route.
Parameter | Type | Description |
---|---|---|
route |
ReactElement |
Route to register. Intended to be a react-router#Route or a subclass of it. |
addRouteBinder(routeBinder: RouteBinder)
: voidThis method binds external routes.
https://backstage.io/docs/plugins/composability/#binding-external-routes-in-the-app
Parameter | Type | Description |
---|---|---|
routeBinder |
RouteBinder |
BannerSurface
You can use this class to add page-level banners to the Backstage app.
The package has the following constructor(s).
Constructs a new instance of the BannerSurface
class
The package has the following methods.
add(banner: ReactElement)
: voidThis method adds a new page-level banner.
Parameter | Type | Description |
---|---|---|
banner |
ReactElement |
SettingsTabsSurface
You can use this class to add tabs to the Settings page.
The package has the following constructor(s).
This constructor constructs a new instance of the SettingsTabsSurface
class.
The package has the following methods.
add(tab: ReactElement)
: voidThis method adds a new tab to the Settings page.
Parameter | Type | Description |
---|---|---|
tab |
ReactElement |
Typically an instance of @ backstage/ @ plugin-user-settings#SettingsLayout.Route |
SidebarItemSurface
You can use this class to manipulate entries in sidebar.
Entries are split into two sections: top items appear above a divider and main items appear below it. Tabs within each section are rendered in order of registration.
The package has the following constructor(s).
This constructor constructs a new instance of the SidebarItemSurface
class.
The package has the following methods.
addMainItem(item: ReactElement)
: voidThis method adds an item to the main items section.
Parameter | Type | Description |
---|---|---|
item |
ReactElement |
addTopItem(item: ReactElement)
: voidThis method adds an item to the top items section.
Parameter | Type | Description |
---|---|---|
item |
ReactElement |
ThemeSurface
You can use this class to manipulate themes available to the Backstage application.
The package has the following constructor(s).
This constructor constructs a new instance of the ThemeSurface
class.
The package has the following methods.
addTheme(theme: AppTheme)
: voidThis method registers an additional theme.
Parameter | Type | Description |
---|---|---|
theme |
AppTheme |
setRootBuilder(builder: (children: JSX.Element) => ReactElement)
: voidThis method registers the factory that renders the application’s root element.
Parameter | Type | Description |
---|---|---|
builder |
JSX.ElementReactElement |
@vmware-tanzu/tdp-plugin-auth-backend
The following sections describe the package.
SignInProviderSurface
You can use this class to register additional Auth Providers.
https://backstage.io/docs/auth/add-auth-provider
The package has the following methods.
add(signInProvider: SignInProvider)
: voidThis method registers an additional Auth Provider. The Auth Provider named last wins.
Parameter | Type | Description |
---|---|---|
signInProvider |
SignInProvider |
Map of @ backstage/plugin-auth-backend#AuthProviderFactory instances. |
SignInResolverSurface
You can use this class to register SignInResolvers
and provide utility methods to log in with them.
The package has the following methods.
add(authProviderKey: string, resolver: SignInResolver<any>)
: voidThis method registers a new SignInResolver
.
Parameter | Type | Description |
---|---|---|
authProviderKey |
Name resolver to add. Uniqueness of name is not enforced, but the behavior of duplicate named entries is undefined. | |
resolver |
SignInResolver |
Resolver to add. |
getResolver<TAuthResult>(authProviderKey: string)
: SignInResolver<TAuthResult>
This method gets the first named provider, or fall back to the guest resolver.
Parameter | Type | Description |
---|---|---|
authProviderKey |
signInAsGuestResolver<TAuthResult>()
: SignInResolver<TAuthResult>
This method gets a resolver that creates an ad-hoc guest user.
signInWithEmail(email: string, context: AuthResolverContext)
: Promise<BackstageSignInResult>
This method provides a utility function to sign in as a user by email address.
The method attempts to match the given email address with a catalog user’s email address for sign-in. If that fails, the method signs the user in without associating with a catalog user.
Parameter | Type | Description |
---|---|---|
email |
Email address to attempt sign-in with. | |
context |
AuthResolverContext |
signInWithName(name: string, context: AuthResolverContext)
: Promise<BackstageSignInResult>
This method provides a utility function to sign in as a user by name.
The method attempts to match the name with a catalog user for signing in. If that fails, the method signs the user in with that name without associating with a catalog user.
Parameter | Type | Description |
---|---|---|
name |
Username to attempt sign-in with. | |
context |
AuthResolverContext |
@vmware-tanzu/tdp-plugin-custom-logger
The following sections describe the package.
LoggerOptionsSurface
You can use this class to allow for configuration of the Backstage logger.
The package has the following constructor(s).
This constructor constructs a new instance of the LoggerOptionsSurface
class.
The package has the following methods.
setLoggerOptions(loggerOptions: LoggerOptions)
: voidThis method sets options for the Backstage logger. This method can be invoked multiple times. The last invocation wins.
Parameter | Type | Description |
---|---|---|
loggerOptions |
LoggerOptions |
@vmware-tanzu/tdp-plugin-home
The following sections describe the package.
HomeSurface
You can use this class to add content to the Backstage Home screen.
The package has the following constructor(s).
This constructor constructs a new instance of the HomeSurface
class.
The package has the following methods.
addContent(item: ReactElement)
: voidThis method adds content to the main section below the widget grid.
Parameter | Type | Description |
---|---|---|
item |
ReactElement |
Item to add. |
addWidget(item: ReactElement, config?: LayoutConfiguration)
: voidThis method adds a widget to the Home screen’s widget grid.
Parameter | Type | Description |
---|---|---|
item |
ReactElement |
Widget to add. |
config |
LayoutConfiguration |
(Optional) layout configuration for the widget. The config.component field must match the added widget either by name (if provided as string) or by direct reference (if provided as a React element). |
addWidgetConfig(config: LayoutConfiguration)
: voidThis method specifies the layout configuration for a widget.
Parameter | Type | Description |
---|---|---|
config |
LayoutConfiguration |
Optional layout configuration for a widget. The config.component field must match some registered widget either by name (if provided as string) or by direct reference (if provided as a React element). |
@vmware-tanzu/tdp-plugin-ldap-backend
The following sections describe the package.
LdapSurface
You can use this class to allow for manipulation of LDAP groups and users during ingestion.
The package has the following constructor(s).
This constructor constructs a new instance of the LdapSurface
class.
The package has the following methods.
setGroupTransformerBuilder(builder: GroupTransformerBuilder)
: voidThis method specifies the transformation of LDAP groups during ingestion.
Parameter | Type | Description |
---|---|---|
builder |
GroupTransformerBuilder |
setUserTransformerBuilder(builder: UserTransformerBuilder)
: voidThis method specifies the transformation of LDAP users during ingestion.
Parameter | Type | Description |
---|---|---|
builder |
UserTransformerBuilder |
@vmware-tanzu/tdp-plugin-login
The following sections describe the package.
LoginSurface
You can use this class to register new login providers with Backstage’s SignIn
page.
For more information about sign-in configuration, see the Backstage documentation.
The package has the following methods.
add(provider: Provider)
: voidThis method registers a login provider.
Parameter | Type | Description |
---|---|---|
provider |
Provider |
@vmware-tanzu/tdp-plugin-microsoft-graph-org-reader-processor
The following sections describe the package.
MicrosoftGraphOrgReaderProcessorTransformersSurface
You can use this class to allow for manipulation of Microsoft Graph groups and users during ingestion.
The package has the following methods.
setGroupTransformer(groupTransformer: GroupTransformer)
: voidThis method specifies the transformation of Microsoft Graph groups during ingestion.
Parameter | Type | Description |
---|---|---|
groupTransformer |
GroupTransformer |
setOrganizationTransformer(organizationTransformer: OrganizationTransformer)
: voidThis method specifies the transformation of Microsoft Graph organizations during ingestion.
Parameter | Type | Description |
---|---|---|
organizationTransformer |
OrganizationTransformer |
setUserTransformer(userTransformer: UserTransformer)
: voidThis method specifies the transformation of Microsoft Graph users during ingestion.
Parameter | Type | Description |
---|---|---|
userTransformer |
UserTransformer |
@vmware-tanzu/tdp-plugin-permission-backend
The following sections describe the package.
CustomPermissionPolicy
The package has the following methods.
handle(request: PolicyQuery)
: Promise<PolicyDecision>
Parameter | Type | Description |
---|---|---|
request |
PolicyQuery |
PermissionPolicySurface
You can use this class to define a PermissionPolicy
for the Backstage application.
https://backstage.io/docs/permissions/writing-a-policy
The package has the following methods.
set(permissionPolicy: PermissionPolicy)
: voidThis method defines the PermissionPolicy
for the Backstage application. This method can be invoked only once.
Parameter | Type | Description |
---|---|---|
permissionPolicy |
PermissionPolicy |