Skip to content

Commit

Permalink
Merge pull request #616 from immobiliare/test/added-local-start-front…
Browse files Browse the repository at this point in the history
…end-plugin

test(frontend): added local start
  • Loading branch information
antoniomuso authored Mar 1, 2024
2 parents cb44c85 + 507c7d6 commit 4488d01
Show file tree
Hide file tree
Showing 4 changed files with 1,262 additions and 33 deletions.
55 changes: 55 additions & 0 deletions packages/ldap-auth/app-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
app:
title: Backstage Example App
baseUrl: http://localhost:3000
#datadogRum:
# clientToken: '123456789'
# applicationId: qwerty
# site: # datadoghq.eu default = datadoghq.com
# env: # optional
support:
url: https://github.com/backstage/backstage/issues # Used by common ErrorPage
items: # Used by common SupportButton component
- title: Issues
icon: github
links:
- url: https://github.com/backstage/backstage/issues
title: GitHub Issues
- title: Discord Chatroom
icon: chat
links:
- url: https://discord.gg/MUpMjP2
title: '#backstage'

backend:
# Used for enabling authentication, secret is shared by all backend plugins
# See https://backstage.io/docs/tutorials/backend-to-backend-auth for
# information on the format
# auth:
# keys:
# - secret: ${BACKEND_SECRET}
baseUrl: http://localhost:7007
listen:
port: 7007
database:
client: better-sqlite3
connection: ':memory:'
cache:
store: memory
cors:
origin: http://localhost:3000
methods: [GET, HEAD, PATCH, POST, PUT, DELETE]
credentials: true
csp:
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
reading:
allow:
- host: example.com
- host: '*.mozilla.org'
- host: gitlab.com
# workingDirectory: /tmp # Use this to configure a working directory for the scaffolder, defaults to the OS temp-dir

integrations:
gitlab:
- host: gitlab.com
24 changes: 24 additions & 0 deletions packages/ldap-auth/dev/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react';
import { createDevApp } from '@backstage/dev-utils';
import { LdapAuthFrontendPage, ldapAuthFrontendPlugin } from '../src';
import { IdentityApi } from '@backstage/core-plugin-api';

createDevApp()
.registerPlugin(ldapAuthFrontendPlugin)
.addPage({
element: (
<LdapAuthFrontendPage
provider="ldap"
options={{
helperTextUsername:
"Usually it's the first letter of your name followed by the surname, e.g. Dario Rossi 👉 drossi",
}}
onSignInSuccess={function (_identityApi: IdentityApi): void {
console.log('LoggedIn');
}}
></LdapAuthFrontendPage>
),
title: 'Root Page',
path: '/backstage-plugin-ldap',
})
.render();
1 change: 1 addition & 0 deletions packages/ldap-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
},
"devDependencies": {
"@backstage/cli": "^0.22.0",
"@backstage/dev-utils": "^1.0.27",
"@testing-library/jest-dom": "^5.10.1",
"@types/jest": "^29.0.3",
"@types/node": "^20.5.9",
Expand Down
Loading

0 comments on commit 4488d01

Please sign in to comment.