Skip to content

Commit

Permalink
DO NOT MERGE: add orchestrator with GH identity provider (1.32, 11/2024)
Browse files Browse the repository at this point in the history
  • Loading branch information
mareklibra committed Nov 22, 2024
1 parent ea9ad11 commit 6659a55
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 16 deletions.
31 changes: 16 additions & 15 deletions app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ backend:
# Uncomment the following host directive to bind to specific interfaces
# host: 127.0.0.1
csp:
connect-src: ["'self'", 'http:', 'https:']
connect-src: ["'self'", "http:", "https:"]
# Content-Security-Policy directives follow the Helmet format: https://helmetjs.github.io/#reference
# Default Helmet Content-Security-Policy values can be removed by setting the key to false
cors:
Expand All @@ -29,37 +29,33 @@ backend:
# The production database configuration is stored in app-config.production.yaml
database:
client: better-sqlite3
connection: ':memory:'
connection: ":memory:"
cache:
store: memory
# workingDirectory: /tmp # Use this to configure a working directory for the scaffolder, defaults to the OS temp-dir

integrations: {}

proxy:
'/quay/api':
target: 'https://quay.io'
"/quay/api":
target: "https://quay.io"
headers:
X-Requested-With: 'XMLHttpRequest'
X-Requested-With: "XMLHttpRequest"
# Uncomment the following line to access a private Quay Repository using a token
# Authorization: 'Bearer <YOUR TOKEN>'
changeOrigin: true
# Change to "false" in case of using self hosted quay instance with a self-signed certificate
secure: true

quay:
uiUrl: 'https://quay.io'
uiUrl: "https://quay.io"

techdocs:
builder: 'local' # Alternatives - 'external'
builder: "local" # Alternatives - 'external'
generator:
runIn: 'docker' # Alternatives - 'local'
runIn: "docker" # Alternatives - 'local'
publisher:
type: 'local' # Alternatives - 'googleGcs' or 'awsS3'. Read documentation for using alternatives.

auth:
# see https://backstage.io/docs/auth/ to learn about auth providers
providers: { guest: {} }
type: "local" # Alternatives - 'googleGcs' or 'awsS3'. Read documentation for using alternatives.

scaffolder:
{}
Expand All @@ -70,13 +66,18 @@ catalog:
entityFilename: catalog-info.yaml
pullRequestBranchName: backstage-integration
rules:
- allow: [Component, System, Group, Resource, Location, Template, API]
- allow: [Component, System, Group, Resource, Location, Template, API, User]
locations:
- type: url
target: https://github.com/janus-idp/backstage-showcase/blob/main/catalog-entities/all.yaml

- type: url
target: https://github.com/redhat-developer/red-hat-developer-hub-software-templates/blob/main/templates.yaml

- type: file
target: /home/mlibra/src/janus-idp-backstage-plugins/plugins/orchestrator-backend/user.yaml
rules:
- allow: [User]

dynamicPlugins:
frontend: {}
1 change: 1 addition & 0 deletions packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"@backstage/plugin-user-settings": "^0.8.14",
"@emotion/react": "11.11.4",
"@emotion/styled": "^11.13.0",
"@janus-idp/backstage-plugin-orchestrator": "*",
"@mui/icons-material": "5.15.16",
"@mui/material": "5.15.16",
"@mui/styles": "5.15.16",
Expand Down
20 changes: 19 additions & 1 deletion packages/app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
OAuthRequestDialog,
SignInPage,
} from '@backstage/core-components';
import { githubAuthApiRef } from '@backstage/core-plugin-api';
import { apiDocsPlugin, ApiExplorerPage } from '@backstage/plugin-api-docs';
import {
CatalogEntityPage,
Expand Down Expand Up @@ -34,6 +35,8 @@ import { UserSettingsPage } from '@backstage/plugin-user-settings';

import { getThemes } from '@redhat-developer/red-hat-developer-hub-theme';

import { OrchestratorPage } from '@janus-idp/backstage-plugin-orchestrator';

import { apis } from './apis';
import { entityPage } from './components/catalog/EntityPage';
import { Root } from './components/Root';
Expand All @@ -59,7 +62,21 @@ const app = createApp({
});
},
components: {
SignInPage: props => <SignInPage {...props} auto providers={['guest']} />,
SignInPage: props => (
<SignInPage
{...props}
auto
providers={[
'guest',
{
id: 'github-auth-provider',
title: 'GitHub',
message: 'Sign in using GitHub',
apiRef: githubAuthApiRef,
},
]}
/>
),
},
themes: getThemes(),
});
Expand Down Expand Up @@ -98,6 +115,7 @@ const routes = (
</Route>
<Route path="/settings" element={<UserSettingsPage />} />
<Route path="/catalog-graph" element={<CatalogGraphPage />} />
<Route path="/orchestrator" element={<OrchestratorPage />} />
</FlatRoutes>
);

Expand Down
7 changes: 7 additions & 0 deletions packages/app/src/components/Root/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import GroupIcon from '@mui/icons-material/People';
import SearchIcon from '@mui/icons-material/Search';
import { makeStyles } from 'tss-react/mui';

import { OrchestratorIcon } from '@janus-idp/backstage-plugin-orchestrator';

import LogoFull from './LogoFull';
import LogoIcon from './LogoIcon';

Expand Down Expand Up @@ -78,6 +80,11 @@ export const Root = ({
<SidebarItem icon={ExtensionIcon} to="api-docs" text="APIs" />
<SidebarItem icon={LibraryBooks} to="docs" text="Docs" />
<SidebarItem icon={CreateComponentIcon} to="create" text="Create..." />
<SidebarItem
icon={OrchestratorIcon}
to="orchestrator"
text="Orchestrator"
/>
{/* End global nav */}
<SidebarDivider />
<SidebarScrollWrapper>
Expand Down
2 changes: 2 additions & 0 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"@backstage/plugin-app-backend": "^0.3.76",
"@backstage/plugin-auth-backend": "^0.23.1",
"@backstage/plugin-auth-backend-module-guest-provider": "^0.2.1",
"@backstage/plugin-auth-backend-module-github-provider": "^0.2.1",
"@backstage/plugin-catalog-backend": "^1.27.1",
"@backstage/plugin-catalog-backend-module-logs": "^0.1.3",
"@backstage/plugin-catalog-backend-module-scaffolder-entity-model": "^0.2.1",
Expand All @@ -38,6 +39,7 @@
"@backstage/plugin-search-backend-module-pg": "^0.5.37",
"@backstage/plugin-search-backend-module-techdocs": "^0.3.1",
"@backstage/plugin-techdocs-backend": "^1.11.1",
"@janus-idp/backstage-plugin-orchestrator-backend": "*",
"@janus-idp/backstage-plugin-rbac-backend": "*",
"@manypkg/get-packages": "1.1.3",
"app": "*",
Expand Down
3 changes: 3 additions & 0 deletions packages/backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ backend.add(import('@backstage/plugin-auth-backend'));
// See https://backstage.io/docs/backend-system/building-backends/migrating#the-auth-plugin
backend.add(import('@backstage/plugin-auth-backend-module-guest-provider'));
// See https://backstage.io/docs/auth/guest/provider
backend.add(import('@backstage/plugin-auth-backend-module-github-provider'));

// catalog plugin
backend.add(import('@backstage/plugin-catalog-backend/alpha'));
Expand All @@ -66,4 +67,6 @@ backend.add(import('@backstage/plugin-search-backend-module-pg/alpha'));
backend.add(import('@backstage/plugin-search-backend-module-catalog/alpha'));
backend.add(import('@backstage/plugin-search-backend-module-techdocs/alpha'));

backend.add(import('@janus-idp/backstage-plugin-orchestrator-backend'));

backend.start();
10 changes: 10 additions & 0 deletions plugins/orchestrator-backend/user.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
apiVersion: backstage.io/v1alpha1
kind: User
metadata:
name: mareklibra
spec:
profile:
displayName: Marek Libra
email: marek.libra@gmail.com
memberOf: []

0 comments on commit 6659a55

Please sign in to comment.