Skip to content
This repository was archived by the owner on Feb 20, 2024. It is now read-only.

Commit 4e8c730

Browse files
Merge pull request #34 from solace-iot-team/feat-mix
Feat mix
2 parents 00a0ef7 + 3eff0c7 commit 4e8c730

File tree

225 files changed

+9924
-10856
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

225 files changed

+9924
-10856
lines changed

ReleaseNotes.md

+38
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,44 @@
22

33
Solace Async API Management.
44

5+
## Version 0.2.3
6+
* [API-M Admin & Developer Portal](https://github.com/solace-iot-team/async-apim/tree/main/apim-portal): 0.2.3
7+
* [API-M Server OpenAPI](https://github.com/solace-iot-team/async-apim/blob/main/apim-server/server/common/api.yml): 0.2.2
8+
* [API-M Server](https://github.com/solace-iot-team/async-apim/tree/main/apim-server): 0.2.1
9+
* [API-M Connector OpenAPI](https://github.com/solace-iot-team/platform-api): 0.7.18
10+
11+
**Enhancements:**
12+
- **Admin Portal: APIs**
13+
- refactored APIs to be a managed asset
14+
- Async api spec validation in New/Edit API
15+
- new list of ReferencedBy Api Products in separate tab:
16+
- open & view API Product and navigate back to API
17+
- **Admin Portal: Organization: Asset Maintenance: APIs**
18+
- manage apis that are not managed assets and assign asset properties
19+
20+
**Framework:**
21+
- **APIM-Portal**
22+
- added refreshToken & page refresh support avoiding logging in again on page refresh
23+
- **APIM-Server**
24+
- logout all users on
25+
- server restart
26+
- updates to business groups
27+
- updates to organization
28+
- logout user on update to user record
29+
- **Release:**
30+
- **APIM-Portal**
31+
- added nginx conf to Docker image for seamless page refresh support
32+
33+
**Fixes:**
34+
* **Developer Portal:MyApps**
35+
- list apps: catch error when developer has not be registered yet with connector
36+
* **Admin Portal:Api Products:Search Select Apis**
37+
- fixed bug in displaying search & select apis
38+
* **Admin Portal:Api Products:Api Channel Parameters**
39+
- fixed bug when selecting empty value channel parameter
40+
* **Admin Portal:Manage Apps:View App**
41+
- fixed bug in displaying owner Id - using display name instead of id
42+
543
## Version 0.2.2
644
* [API-M Admin & Developer Portal](https://github.com/solace-iot-team/async-apim/tree/main/apim-portal): 0.2.2
745
* [API-M Server OpenAPI](https://github.com/solace-iot-team/async-apim/blob/main/apim-server/server/common/api.yml): 0.2.1

apim-portal/dev-build.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ const scriptName: string = path.basename(__filename);
1010
const scriptDir: string = path.dirname(__filename);
1111

1212
const CONSTANTS = new Constants(scriptDir);
13+
const createVersion = (version: string): string => {
14+
if(CONSTANTS.AlphaVersion) return `${version}-${CONSTANTS.AlphaVersion}`;
15+
return version;
16+
}
1317

1418
// names
1519
const AdminPortalName = 'async-apim-admin-portal';
@@ -110,7 +114,7 @@ const buildAbouts = () => {
110114
description: description,
111115
author: packageJson.author,
112116
license: packageJson.license,
113-
version: packageJson.version,
117+
version: createVersion(packageJson.version),
114118
build_date: tsDate.toUTCString(),
115119
"apim-connector-openapi-version": getApimConnectorOpenApiVersion(),
116120
"apim-server-openapi-version": getApimServerOpenApiVersion(),

apim-portal/devel/lib/Constants.ts

+7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11

2+
const ENV_VAR_APIM_RELEASE_ALPHA_VERSION = "APIM_RELEASE_ALPHA_VERSION";
3+
24
export class Constants {
35
private readonly _scriptDir: string;
46
private readonly _apimPortalDir: string;
@@ -9,6 +11,7 @@ export class Constants {
911
private readonly _workingApimServerDir: string;
1012
private readonly _generatedApimServerOpenApiSrcDir: string;
1113
private readonly _outputGeneratedApimServerOpenApiSrcDir: string;
14+
private _alphaVersion: string | undefined;
1215

1316
constructor(scriptDir: string) {
1417
this._scriptDir = scriptDir;
@@ -20,6 +23,7 @@ export class Constants {
2023
this._workingApimServerDir = `${this._workingDir}/apim-server`;
2124
this._generatedApimServerOpenApiSrcDir = `${this._workingApimServerDir}/src/@solace-iot-team/apim-server-openapi-browser`;
2225
this._outputGeneratedApimServerOpenApiSrcDir = `${this._apimPortalDir}/src/_generated/@solace-iot-team/apim-server-openapi-browser`;
26+
this._alphaVersion = process.env[ENV_VAR_APIM_RELEASE_ALPHA_VERSION];
2327
}
2428
public log() {
2529
console.log(`${Constants.name} = ${JSON.stringify(this, null, 2)}`);
@@ -34,4 +38,7 @@ export class Constants {
3438
public get WorkingApimServerDir() { return this._workingApimServerDir; }
3539
public get GeneratedApimServerOpenApiSrcDir() { return this._generatedApimServerOpenApiSrcDir; }
3640
public get OutputGeneratedApimServerOpenApiSrcDir() { return this._outputGeneratedApimServerOpenApiSrcDir; }
41+
42+
public get AlphaVersion() { return this._alphaVersion; }
43+
3744
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*
2+
!.gitignore
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
error_log error.log;
2+
pid nginx.pid;
3+
worker_rlimit_nofile 8192;
4+
5+
events {
6+
worker_connections 4096; ## Default: 1024
7+
}
8+
9+
http {
10+
index index.html index.htm index.php;
11+
12+
default_type application/octet-stream;
13+
log_format main '$remote_addr - $remote_user [$time_local] $status '
14+
'"$request" $body_bytes_sent "$http_referer" '
15+
'"$http_user_agent" "$http_x_forwarded_for"';
16+
access_log logs/access.log main;
17+
sendfile on;
18+
tcp_nopush on;
19+
server_names_hash_bucket_size 128; # this seems to be required for some vhosts
20+
21+
server { # simple reverse-proxy
22+
listen 80;
23+
server_name apim-devel-www;
24+
access_log logs/apim-devel-www.access.log main;
25+
26+
### apim-portal
27+
location / {
28+
# proxy_pass http://localhost:3001;
29+
proxy_pass http://host.docker.internal:3001;
30+
# kill cache
31+
expires -1;
32+
}
33+
}
34+
}
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
version: "3.7"
2+
services:
3+
# reverse proxy
4+
apim-devel-www:
5+
container_name: apim-devel-www
6+
image: nginx:1.21.4-alpine
7+
restart: unless-stopped
8+
ports:
9+
- 3002:80
10+
volumes:
11+
- ./docker-volumes/apim-www/nginx.conf:/etc/nginx/nginx.conf
12+
- ./docker-volumes/apim-www-logs:/etc/nginx/logs
13+
14+
##
15+
# The End.

apim-portal/devel/nginx/start.sh

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
scriptDir=$(cd $(dirname "$0") && pwd);
3+
scriptName=$(basename $(test -L "$0" && readlink "$0" || echo "$0"));
4+
5+
############################################################################################################################
6+
# Settings
7+
8+
dockerProjectName="apim-devel-nginx"
9+
dockerComposeFile="$scriptDir/docker.compose.yml"
10+
11+
############################################################################################################################
12+
# Run
13+
14+
export DOCKER_CLIENT_TIMEOUT=120
15+
export COMPOSE_HTTP_TIMEOUT=120
16+
17+
echo " >>> Docker-compose down for project: $dockerProjectName ..."
18+
# docker-compose -p $dockerProjectName -f "$dockerComposeFile" down --volumes
19+
docker-compose -p $dockerProjectName -f "$dockerComposeFile" down --volumes --rmi all
20+
if [[ $? != 0 ]]; then echo " >>> ERROR: docker compose down for '$dockerProjectName'"; exit 1; fi
21+
echo " >>> Success."
22+
23+
echo " >>> Docker-compose up for project: $dockerProjectName ..."
24+
docker-compose -p $dockerProjectName -f "$dockerComposeFile" up -d
25+
if [[ $? != 0 ]]; then echo " >>> ERROR: docker compose up for '$dockerProjectName'"; exit 1; fi
26+
docker ps -a
27+
echo " >>> Success."
28+
29+
###
30+
# The End.

apim-portal/devel/nginx/stop.sh

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env bash
2+
scriptDir=$(cd $(dirname "$0") && pwd);
3+
scriptName=$(basename $(test -L "$0" && readlink "$0" || echo "$0"));
4+
5+
############################################################################################################################
6+
# Settings
7+
8+
dockerProjectName="apim-devel-nginx"
9+
dockerComposeFile="$scriptDir/docker.compose.yml"
10+
11+
############################################################################################################################
12+
# Run
13+
14+
echo " >>> Docker-compose down for project: $dockerProjectName ..."
15+
16+
docker-compose -p $dockerProjectName -f "$dockerComposeFile" down --volumes --rmi all
17+
if [[ $? != 0 ]]; then echo " >>> ERROR: docker compose down for '$dockerProjectName'"; exit 1; fi
18+
docker ps -a
19+
20+
echo " >>> Success."
21+
22+
###
23+
# The End.

apim-portal/package-lock.json

+17-16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apim-portal/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "async-apim-portal",
3-
"version": "0.2.2",
3+
"version": "0.2.3",
44
"description": "Solace Async API Management Portal",
55
"repository": {
66
"type": "git",
@@ -23,8 +23,9 @@
2323
"url": "https://github.com/solace-iot-team/async-apim/issues"
2424
},
2525
"dependencies": {
26+
"@asyncapi/parser": "^1.15.1",
2627
"@asyncapi/react-component": "1.0.0-next.33",
27-
"@solace-iot-team/apim-connector-openapi-browser": "^0.7.15",
28+
"@solace-iot-team/apim-connector-openapi-browser": "^0.7.18",
2829
"async-mutex": "^0.3.2",
2930
"base-64": "^1.0.0",
3031
"js-yaml": "^4.1.0",

apim-portal/src/App.tsx

+11-4
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,12 @@ import {
2828
} from './utils/Globals';
2929
import { ProtectedRouteWithRbac } from "./auth/ProtectedRouteWithRbac";
3030
import { HomePage } from './pages/HomePage';
31-
import { UserLoginPage } from './pages/UserLoginPage';
31+
import { UserSecLoginPage } from "./pages/UserSecLoginPage";
32+
import { UserGetLoginPage } from "./pages/UserGetLoginPage";
3233
import { ManageUserAccountPage } from "./pages/ManageUserAccountPage";
3334
import { UnauthorizedPage } from "./pages/UnauthorizedPage";
3435
import { NoOrganizationPage } from "./pages/NoOrganizationPage";
35-
import { NotFoundPage } from './pages/NotFoundPage';
36+
// import { NotFoundPage } from './pages/NotFoundPage';
3637
import { NavBar } from './components/NavBar/NavBar';
3738
import { ShowUserMessage } from "./components/ShowUserMessage/ShowUserMessage";
3839
import { HealthCheckViewPage } from "./pages/HealthCheckViewPage";
@@ -42,6 +43,7 @@ import { RolesTestPage } from "./pages/devel/RolesTestPage";
4243
import { ContextsTestPage } from "./pages/devel/ContextsTestPage";
4344
import { ErrorTestPage } from "./pages/devel/ErrorTestPage";
4445
import { BusinessGroupsTestPage } from "./pages/devel/BusinessGroupsTestPage";
46+
import { SecTestPage } from "./pages/devel/SecTestPage";
4547

4648
import 'primereact/resources/themes/saga-blue/theme.css';
4749
import 'primereact/resources/primereact.min.css';
@@ -155,6 +157,7 @@ const App: React.FC = () => {
155157
<PerformSystemHealthCheck />
156158
<ShowUserMessage />
157159
<NavBar />
160+
{/* <UserSecVerify /> */}
158161
{ isDebug && userContext && displayStateInfo() }
159162
<div className="ap-app-grid">
160163
<div className="ap-app-grid-left">
@@ -181,7 +184,10 @@ const App: React.FC = () => {
181184
<Route path={EUICommonResourcePaths.HealthCheckView} component={HealthCheckViewPage} exact />
182185

183186
{/* User */}
184-
<Route path={EUICommonResourcePaths.Login} component={UserLoginPage} exact />
187+
<Route path={EUICommonResourcePaths.GetLogin} component={UserGetLoginPage} exact />
188+
<Route path={EUICommonResourcePaths.SecLogin} component={UserSecLoginPage} exact />
189+
190+
{/* <Route path={EUICommonResourcePaths.deleteme_Login} component={UserLoginPage} exact /> */}
185191
<ProtectedRouteWithRbac path={EUICommonResourcePaths.ManageUserAccount} component={ManageUserAccountPage} exact />
186192

187193
{/* Admin Portal */}
@@ -200,11 +206,12 @@ const App: React.FC = () => {
200206
<Route path={EUIDeveloperToolsResourcePaths.ViewContexts} key={EUIDeveloperToolsResourcePaths.ViewContexts} component={ContextsTestPage} exact />,
201207
<Route path={EUIDeveloperToolsResourcePaths.TestErrors} key={EUIDeveloperToolsResourcePaths.TestErrors} component={ErrorTestPage} exact />,
202208
<Route path={EUIDeveloperToolsResourcePaths.TestBusinessGroups} key={EUIDeveloperToolsResourcePaths.TestBusinessGroups} component={BusinessGroupsTestPage} exact />,
209+
<Route path={EUIDeveloperToolsResourcePaths.TestSec} key={EUIDeveloperToolsResourcePaths.TestSec} component={SecTestPage} exact />,
203210
]
204211
}
205212

206213
{/* Catch all */}
207-
<Route component={NotFoundPage} />
214+
<Route component={HomePage} />
208215
</Switch>
209216
</div>
210217
</div>

apim-portal/src/Config.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
import { TAPSClientOpenApiConfig } from './utils/APSClientOpenApi';
33

44
type TConfig = {
5-
useDevelTools: boolean,
6-
apsClientOpenApiConfig: TAPSClientOpenApiConfig
5+
useDevelTools: boolean;
6+
apsClientOpenApiConfig: TAPSClientOpenApiConfig;
77
}
88

99
export class Config {
@@ -72,4 +72,5 @@ export class Config {
7272
if(!Config.config) throw new Error(`${logName}: Config.config is undefined`);
7373
return Config.config.useDevelTools;
7474
}
75+
7576
}

0 commit comments

Comments
 (0)