Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SaaS Boost v3 #545

Draft
wants to merge 28 commits into
base: v3
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1e44966
Reworking ApiGatewayHelper to use OAuth app client for client
brtrvn Apr 26, 2023
1612741
Switch to using client credentials flow with an app client instead of
brtrvn May 5, 2023
036ead9
WIP split the Control Plane from the Application Plane
brtrvn Jun 22, 2023
1946490
Moving Cognito to its own template
brtrvn Jun 22, 2023
4347d65
WIP break apart control plane and application plane
brtrvn Oct 4, 2023
932f781
WIP new metrics service
brtrvn Oct 6, 2023
97e986d
Adding admin user to the onboarding form
brtrvn Oct 26, 2023
6741671
New UI for Identity Service
brtrvn Nov 13, 2023
6168c28
WIP on billing service, SwaggerUI, CloudWatch Metrics implementation for
brtrvn Dec 14, 2023
0dbbd60
Removing build target dir
brtrvn Dec 19, 2023
9d09f77
Removing our custom credentials provider from the installer now that …
brtrvn Feb 1, 2024
57f4bf3
Upgrade to Java 17 Lambda runtime
brtrvn Feb 1, 2024
36d1613
Remove transient build of the Swagger API Docs Lambda
brtrvn Feb 1, 2024
0f83c9e
Splitting AppConfig from Settings
brtrvn Feb 2, 2024
04e835a
Upgrade to Graviton for Lambda functions. Fixes for app config service.
brtrvn Feb 3, 2024
433198e
Create a separate log file for each run of the installer app
brtrvn Feb 3, 2024
05e4cbc
Adding the Identity Service to the API Gateway
brtrvn Feb 3, 2024
8cbed6d
API Docs (SwaggerUI) fixes
brtrvn Feb 8, 2024
926bef8
Adding CodeBuild waiter implementation modeled off the SDK's DynamoDB…
brtrvn Feb 13, 2024
6e78b5b
Add Lambda Layer permissions for the App Plane so we don't have to have
brtrvn Mar 5, 2024
fd207c8
Add delete markers to clear s3 bucket logic
brtrvn Mar 5, 2024
b371af4
Add a new property to the Maven POM files for the root directory to make
brtrvn Mar 5, 2024
7d66de1
Update Lambda runtime to Java 21
brtrvn Mar 5, 2024
51b6f66
Update script for API helper layer
brtrvn Mar 5, 2024
857888c
New Metrics Service WIP
brtrvn Mar 5, 2024
fadaa8a
Fix typo in comment
brtrvn Mar 14, 2024
56858bc
Fix maven warnings and update JaCoCo for Java 21
brtrvn Mar 14, 2024
ce5a35a
Update GitHub action to use Corretto 21 for Java
brtrvn Mar 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
33 changes: 7 additions & 26 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,44 +6,26 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout PR
uses: actions/checkout@v2

- name: Cache Maven packages
uses: actions/cache@v2
uses: actions/checkout@v3
- name: Setup Java
uses: actions/setup-java@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

# We use Corretto Java 11 for Lambda: https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtimes.html
# Currently amazon-corretto Java is not supported for GitHub actions on Ubuntu-latest. By default we're using Adopt JDK11
# https://github.com/actions/virtual-environments/blob/main/images/linux/Ubuntu2004-README.md
# We may want to either switch to using an AL2 container (to give us corretto) or contribute a new JDK to the GitHub runners
# There is an open issue (as of 2021/06/30) requesting Corretto support: https://github.com/actions/setup-java/issues/68
# - name: Set up JDK 11
# uses: actions/setup-java@v2
# with:
# java-version: '11'
# distribution: 'adopt'

distribution: corretto
java-version: '21'
cache: maven
- name: Maven Compile, Test, Install
run: mvn install -Dcheckstyle.skip -Dspotbugs.skip

- name: Spotbugs Check
run: mvn spotbugs:check

- name: Code Style Check
run: mvn checkstyle:check

Build-WebClient:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: 16

- name: Cache node modules
uses: actions/cache@v2
env:
Expand All @@ -56,7 +38,6 @@ jobs:
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-

# CI=false is required because GitHub hosted runners set CI=true, which causes Warnings to be treated as Errors when doing yarn build
# this is a workaround to allow the build to succeed until we can get around to fixing the warnings generated
# https://docs.github.com/en/actions/reference/environment-variables#default-environment-variables
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ node_modules/

# production
/build
resources/api-docs/build

npm-debug.log*
yarn-debug.log*
Expand All @@ -69,4 +70,4 @@ jmeter.log
*.factorypath
installer/*.log
security-check/*.log
saas-boost-install*.log*
*install*.log*
17 changes: 17 additions & 0 deletions client/web/buildspec_no_post_build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 0.2
phases:
pre_build:
commands:
- if [ "$REACT_APP_AWS_REGION" = "cn-northwest-1" ] || [ "$REACT_APP_AWS_REGION" = "cn-north-1" ]; then npm config set registry https://registry.npm.taobao.org; fi
- npm install --global yarn
- aws s3 cp s3://$SOURCE_BUCKET/${SOURCE_BUCKET_PREFIX}client/web/src.zip src.zip
- unzip src.zip
build:
commands:
- cd ./client/web
- yarn
- yarn build
- cd ../../
cache:
paths:
- $CODEBUILD_SRC_DIR/client/web/node_modules/**/*
4 changes: 0 additions & 4 deletions client/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"amazon-cognito-auth-js": "^1.3.3",
"amazon-cognito-identity-js": "^3.2.7",
"aws-amplify": "^4.3.16",
"aws-amplify-react": "^5.1.9",
"aws-sdk": "^2.649.0",
"axios": "^0.21.1",
"bootstrap": "^5.1.3",
Expand Down
74 changes: 49 additions & 25 deletions client/web/src/_nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,32 @@ import React from 'react'
import CIcon from '@coreui/icons-react'
import {
cilHome,
cilLayers,
cilPeople,
cilPowerStandby,
cilSpeedometer,
cilCog,
cilFactory,
cilBarChart,
cilUserPlus,
cilGift,
cilShieldAlt,
cilCreditCard
} from '@coreui/icons'
import { CNavGroup, CNavItem } from '@coreui/react'
import { BaseUserRoute } from './users'

const _nav = [
{
component: CNavItem,
name: 'Summary',
name: 'Home',
to: '/summary',
icon: <CIcon icon={cilHome} customClassName="nav-icon" />,
},
{
component: CNavGroup,
name: 'Dashboard',
icon: <CIcon icon={cilSpeedometer} customClassName="nav-icon" />,
//component: CNavGroup,
component: CNavItem,
name: 'Metrics',
icon: <CIcon icon={cilBarChart} customClassName="nav-icon" />,
to: '/metrics',
/*
items: [
{
component: CNavItem,
Expand All @@ -54,44 +60,62 @@ const _nav = [
to: '/dashboard/accesslogging',
},
],
*/
},
{
component: CNavItem,
name: 'Application',
to: '/application',
icon: <CIcon icon={cilPowerStandby} customClassName="nav-icon" />,
badge: {
color: 'danger',
text: 'SETUP',
},
name: 'Tiers',
to: '/tiers',
icon: <CIcon icon={cilGift} customClassName="nav-icon" />,
//disabled: false,
},
{
component: CNavItem,
name: 'Onboarding',
to: '/onboarding',
name: 'Billing',
to: '/billing',
icon: <CIcon icon={cilCreditCard} customClassName="nav-icon" />,
//disabled: false,
},
{
component: CNavItem,
name: 'Identity',
to: '/providers',
icon: <CIcon icon={cilUserPlus} customClassName="nav-icon" />,
disabled: true,
//disabled: false,
},
{
component: CNavItem,
name: 'Tenants',
to: '/tenants',
icon: <CIcon icon={cilLayers} customClassName="nav-icon" />,
disabled: true,
icon: <CIcon icon={cilPeople} customClassName="nav-icon" />,
//disabled: true,
},
{
component: CNavItem,
name: 'Tiers',
to: '/tiers',
icon: <CIcon icon={cilLayers} customClassName="nav-icon" />,
disabled: false,
name: 'Application',
to: '/application',
icon: <CIcon icon={cilCog} customClassName="nav-icon" />,
/*
badge: {
color: 'danger',
text: 'SETUP',
},
*/
},
{
component: CNavItem,
name: 'Onboarding',
to: '/onboarding',
icon: <CIcon icon={cilFactory} customClassName="nav-icon" />,
//disabled: true,
},
{
component: CNavItem,
name: 'System Users',
to: BaseUserRoute,
icon: <CIcon icon={cilPeople} customClassName="nav-icon" />,
},
icon: <CIcon icon={cilShieldAlt} customClassName="nav-icon" />,
}
// AppSidebar.js adds the last menu entry for redirect to api docs
]

export default _nav
3 changes: 2 additions & 1 deletion client/web/src/components/AppContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ const AppContent = () => {
)
)
})}
<Redirect from="/" to="/dashboard" />
{/* <Redirect from="/" to="/dashboard" /> */}
<Redirect from="/" to="/summary" />
</Switch>
</Suspense>
</CContainer>
Expand Down
2 changes: 1 addition & 1 deletion client/web/src/components/AppFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const AppFooter = (props) => {
const { children, ...attributes } = props
const version = useSelector((state) => selectSettingsById(state, SETTINGS.VERSION))
const saasBoostEnvironment = useSelector((state) =>
selectSettingsById(state, 'SAAS_BOOST_ENVIRONMENT'),
selectSettingsById(state, 'ENVIRONMENT'),
)

const prettyVersion = (versionParameter) => {
Expand Down
97 changes: 56 additions & 41 deletions client/web/src/components/AppSidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,59 +15,74 @@
*/
// Based on CoreUI Template https://github.com/coreui/coreui-free-react-admin-template
// SPDX-LicenseIdentifier: MIT
import React, { useState } from 'react'
import React, {useState} from 'react'
import PropTypes from 'prop-types'
import {
CSidebar,
CSidebarBrand,
CSidebarNav,
CSidebarToggler,
CSidebar,
CSidebarBrand,
CSidebarNav,
CSidebarToggler,
} from '@coreui/react'

import { AppSidebarNav } from './AppSidebarNav'

import {AppSidebarNav} from './AppSidebarNav'
import SimpleBar from 'simplebar-react'
import 'simplebar/dist/simplebar.min.css'
import appConfig from "../config/appConfig";
import CIcon from "@coreui/icons-react";
import {cilSchool} from "@coreui/icons";

const {apiUri} = appConfig

const AppSidebar = (props) => {
const [sidebarNarrow, setSidebarNarrow] = useState(false)
const { navigation } = props
const getText = (isNarrow) => {
return (
!isNarrow && (
<>
<span style={{ color: '#FF9900' }}>
const [sidebarNarrow, setSidebarNarrow] = useState(false)
const {navigation} = props
const APIDocNavItem = () => {
const href = apiUri + '/docs/'; // Make sure you inlude the trailing / or SwaggerUI won't redirect properly
return (
<li className="nav-item">
<a className="nav-link" href={href}>
<CIcon icon={cilSchool} customClassName="nav-icon"/>
API Docs
</a>
</li>
)
}
const getText = (isNarrow) => {
return (
!isNarrow && (
<>
<span style={{color: '#FF9900'}}>
<strong>AWS</strong>
</span>
&nbsp;
<span style={{ color: '#232F3E' }}>SaaS Boost</span>
</>
)
&nbsp;
<span style={{color: '#232F3E'}}>SaaS Boost</span>
</>
)
)
}
return (
<CSidebar position="fixed" narrow={sidebarNarrow}>
<CSidebarBrand className="d-none d-md-flex bg-body" to="/">
<img src="/saas-boost-logo.png" alt="logo" height="40"/>
{getText(sidebarNarrow)}
</CSidebarBrand>
<CSidebarNav>
<SimpleBar>
<AppSidebarNav items={navigation}/>
<APIDocNavItem/>
</SimpleBar>
</CSidebarNav>
<CSidebarToggler
className="d-lg-flex"
onClick={() => {
setSidebarNarrow(!sidebarNarrow)
}}
/>
</CSidebar>
)
}
return (
<CSidebar position="fixed" narrow={sidebarNarrow}>
<CSidebarBrand className="d-none d-md-flex bg-body" to="/">
<img src="/saas-boost-logo.png" alt="logo" height="40" />
{getText(sidebarNarrow)}
</CSidebarBrand>
<CSidebarNav>
<SimpleBar>
<AppSidebarNav items={navigation} />
</SimpleBar>
</CSidebarNav>
<CSidebarToggler
className="d-lg-flex"
onClick={() => {
setSidebarNarrow(!sidebarNarrow)
}}
/>
</CSidebar>
)
}

AppSidebar.propTypes = {
navigation: PropTypes.array,
navigation: PropTypes.array,
}

export default React.memo(AppSidebar)
export default React.memo(AppSidebar)
2 changes: 1 addition & 1 deletion client/web/src/dashboard/DashboardComponent.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const DashboardComponent = (props) => {
)

const saasBoostEnvironment = useSelector(
(state) => selectSettingsById(state, 'SAAS_BOOST_ENVIRONMENT')?.value
(state) => selectSettingsById(state, 'ENVIRONMENT')?.value
)

const countActiveTenants = useSelector((state) => {
Expand Down
Loading
Loading