diff --git a/.env b/.env new file mode 100644 index 0000000..be70e44 --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ +AUTH_GITHUB_CLIENT_ID=400cfa04377727669c97 +AUTH_GITHUB_CLIENT_SECRET=f1ba2aafd884f564915fed034e856a81f36351e4 \ No newline at end of file diff --git a/sreez-showcase/app-config.yaml b/sreez-showcase/app-config.yaml index 66c7820..db6643d 100644 --- a/sreez-showcase/app-config.yaml +++ b/sreez-showcase/app-config.yaml @@ -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: @@ -29,19 +29,46 @@ backend: # The production database configuration is stored in app-config.production.yaml database: client: better-sqlite3 - connection: ':memory:' + connection: ":memory:" # workingDirectory: /tmp # Use this to configure a working directory for the scaffolder, defaults to the OS temp-dir integrations: github: - host: github.com - # This is a Personal Access Token or PAT from GitHub. You can find out how to generate this token, and more information - # about setting up the GitHub integration here: https://backstage.io/docs/integrations/github/locations#configuration - token: ${GITHUB_TOKEN} - ### Example for how to add your GitHub Enterprise instance using the API: - # - host: ghe.example.net - # apiBaseUrl: https://ghe.example.net/api/v3 - # token: ${GHE_TOKEN} + apps: + - appId: 880885 + webhookUrl: https://smee.io/Nj4FT0Aq729ugz7yunjy + clientId: Iv1.62e73edda444f42c + clientSecret: 3f723fe4e40239d3817cb0a6a1190b7a71e86395 + webhookSecret: 707dd0e621c9fa7c00acd060e406d9f3a07fbe88 + privateKey: | + -----BEGIN RSA PRIVATE KEY----- + MIIEpAIBAAKCAQEA3NUeQ8dwqOxLgxqhSs8XQT2rWWNeJDrtqhGLYoTkP9jcm+YV + NvqHT3mRbOlff9d1sk+lmLbtTQc/ToOTifwAyIHrHU0ZuGqAiQSKLNSFYYtEe/r6 + bqaJMmClHXBLkNt027MIWHuU1nM6zsbAhizBRZbmpMyr/gOfgH4WzXeeM4RYlbwp + qTujlCigWX51BJCJlBxAmq+UHURZooQreP5hBZBd4GpUctaDElZAfOOOYV42U0Al + 651FBt8kZOzBBjZbx0yrBsl2A9yCjWq5xNTKMHC9Xg0MhDv8ge41DX2Kb4zDkG8Q + xJg6rrId6isOsjACGh5mfC+T1Xn7bzs2uyhfkQIDAQABAoIBAFNvLe0b2EPqaylQ + kWoLTlT28NtoALSdkxfzYv9JCFfbHpbEWnWYODFd1AUbM1rA1BYXo5BMZOH6f/+x + FLhIfx9CfstmSvZzPrcGARKpBO/yx2A0VhQiVamz/A5gVByZ3c/4F4oevwA7Lxfa + 3fiTxj39oozXS5BAXC4W9ZSRwjLh9U3+z8vyR0udc4aYL60Vme9aNf+Vo4SLCBxE + mMjhHD5DHkbVgEHULUM53mWDMUMj5Q2r3EQAcDzeO1gQCJxDd63gsjkc9JlVvXLI + YJh907YgPsgny5NHn5LJck7vXej/yqPHAem1hIG4GGeXLAMUeBkAauWQGmd0hJG2 + MCkdO0ECgYEA75IMrA2ISi1mJg5BCK1jcDumlvcXO2dUN0Vt3EvVDYliztMocAmA + py8A51nKxA+OK3M+m4oyqtFPZa383doHV3UdrBzvwz4qvQQ9RzBs5r+Di/f8edu0 + H1BUNU4kqUHJyhrY4xuHkOKQlbc/bkk9WNjQGnIdFwaceMfR4JmVSjkCgYEA6/oZ + puoUG6DAup8nJopMghlhf4/knXZL+kwqXbfeTmT+msQktw/ZJqI30GRETGjlzcGc + WDpuhLDg2dnbldXCr+adShl4H5M/anyTh4RoQi/NeW+CKyJ+9ryeDQTBUvwjZfBa + iWuohJXgepCytH7nEclG5T2PRG9YdafZJFi1IBkCgYEAgVex3cZkmd/O8abqd7vd + HwAlngYDlf/gmQK0IKcUfP16yj147JxEyH55F28EKTxYvp6245UGa/Eb08LO7hxD + sHU7suvgiuHqgyhhySic8yvc4tndhxEWO33MKQdqhbNONf6usFbxp0ibVSmdZnbG + V0yfdle72u2n1xHS/1cMIgkCgYAEqMWE5C5NdVkY1jehrS1hjDq+mAq9iS5q3MIh + Y5YCGkBksea/rpJtDtrnRHOMxq1y6JW7sDuqZwupgYGybawQaQ9F/Ua/6Nphsd// + 1v9v/x2hfjAlxeKX4JWGUEe46b2RL7O57uQ+6e6qvNyqb68ETOMXd6WyhjhK6muB + Kjc5UQKBgQDGMob1La4FPI+qSYo8jw7xrk5Pl15RnFAbYmC7Jxsl6ilx4Y0d9q0o + EkcZ2Cft85Tx+Jnuzm2V8HnufqO4EVcmy44vGetsMMcuMqqtwYn/K51o1G4S49rR + knI0blhVopibXjvzViuJu+WrJyI98itcaYJUXd1u4osLpHk6Fd18oQ== + -----END RSA PRIVATE KEY----- proxy: ### Example for how to add a proxy endpoint for the frontend. @@ -56,18 +83,20 @@ proxy: # and an external cloud storage when deploying TechDocs for production use-case. # https://backstage.io/docs/features/techdocs/how-to-guides#how-to-migrate-from-techdocs-basic-to-recommended-deployment-approach 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. + type: "local" # Alternatives - 'googleGcs' or 'awsS3'. Read documentation for using alternatives. auth: # see https://backstage.io/docs/auth/ to learn about auth providers providers: # See https://backstage.io/docs/auth/guest/provider - guest: {} - + github: + development: + clientId: 400cfa04377727669c97 + clientSecret: 5f058d2257c63dac4ef773a20369e01d0baea6bf scaffolder: # see https://backstage.io/docs/features/software-templates/configuration for software template options diff --git a/sreez-showcase/packages/app/package.json b/sreez-showcase/packages/app/package.json index 7ca04af..93c8b07 100644 --- a/sreez-showcase/packages/app/package.json +++ b/sreez-showcase/packages/app/package.json @@ -14,6 +14,7 @@ "lint": "backstage-cli package lint" }, "dependencies": { + "@backstage-community/plugin-github-actions": "^0.6.16", "@backstage/app-defaults": "^1.5.4", "@backstage/catalog-model": "^1.4.5", "@backstage/cli": "^0.26.3", @@ -51,10 +52,10 @@ "devDependencies": { "@backstage/test-utils": "^1.5.4", "@playwright/test": "^1.32.3", + "@testing-library/dom": "^9.0.0", "@testing-library/jest-dom": "^6.0.0", "@testing-library/react": "^14.0.0", "@testing-library/user-event": "^14.0.0", - "@testing-library/dom": "^9.0.0", "@types/react-dom": "*", "cross-env": "^7.0.0" }, diff --git a/sreez-showcase/packages/app/src/App.tsx b/sreez-showcase/packages/app/src/App.tsx index f751cf6..49cef97 100644 --- a/sreez-showcase/packages/app/src/App.tsx +++ b/sreez-showcase/packages/app/src/App.tsx @@ -37,6 +37,8 @@ import { AppRouter, FlatRoutes } from '@backstage/core-app-api'; import { CatalogGraphPage } from '@backstage/plugin-catalog-graph'; import { RequirePermission } from '@backstage/plugin-permission-react'; import { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common/alpha'; +import { githubAuthApiRef } from '@backstage/core-plugin-api'; + const app = createApp({ apis, @@ -58,7 +60,19 @@ const app = createApp({ }); }, components: { - SignInPage: props => , + SignInPage: props => ( + + ), + }, }); diff --git a/sreez-showcase/packages/app/src/components/catalog/EntityPage.tsx b/sreez-showcase/packages/app/src/components/catalog/EntityPage.tsx index 7c6a71e..d3dd7d0 100644 --- a/sreez-showcase/packages/app/src/components/catalog/EntityPage.tsx +++ b/sreez-showcase/packages/app/src/components/catalog/EntityPage.tsx @@ -71,9 +71,8 @@ const cicdContent = ( // You can for example enforce that all components of type 'service' should use GitHubActions - + -