Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
0e3f82a
Initial Commit for REST API ASP.NET
juileetikekar Jan 13, 2022
a236372
Add Generated Swagger Code for Asp.Net core Rest APIs
juileetikekar Jan 13, 2022
c78c99a
Change launchSettings.json
aorzelskiGH Jan 14, 2022
2c92124
Changed the formatting
juileetikekar Jan 21, 2022
784a620
Corrected the code formatting
juileetikekar Jan 21, 2022
6b70887
Merge branch 'jtikekar/asp.net/restapi' of https://github.com/admin-s…
aorzelskiGH Jan 24, 2022
e7fa58d
Support for "Content" and "Extent" modifiers
juileetikekar Jan 31, 2022
2226a17
Merge branch 'jtikekar/asp.net/restapi' of https://github.com/admin-s…
juileetikekar Jan 31, 2022
8a8e861
Removing Basic Authentification
juileetikekar Jan 31, 2022
74cceae
Wrapping Server Side exception
juileetikekar Feb 2, 2022
21b3d0d
Swagger Project path fixed, Swagger Test Project added (#93)
br-iosb Feb 9, 2022
3c47de1
added test project (#94)
br-iosb Feb 9, 2022
bdaaad1
BugFix:DotSeperated IdShortPath
juileetikekar Feb 9, 2022
12a3f8a
test for fixing blob modifier (#95)
br-iosb Feb 10, 2022
26c9cd5
BugFix: Corrected "WithoutBlobValue" modifier
juileetikekar Feb 10, 2022
7c7ef09
Validation against applicable output modifiers, PUT vs POST
juileetikekar Feb 14, 2022
87161df
Support for GetSerialization API
juileetikekar Feb 21, 2022
2b46b5b
License of spec changed
aorzelskiGH Feb 21, 2022
f9bc48b
Initial Commit for REST API ASP.NET
juileetikekar Jan 13, 2022
b7979e5
Add Generated Swagger Code for Asp.Net core Rest APIs
juileetikekar Jan 13, 2022
7ceac1c
Changed the formatting
juileetikekar Jan 21, 2022
33bb55c
Corrected the code formatting
juileetikekar Jan 21, 2022
bb69aa9
Support for "Content" and "Extent" modifiers
juileetikekar Jan 31, 2022
6db1a08
Change launchSettings.json
aorzelskiGH Jan 14, 2022
8167710
Removing Basic Authentification
juileetikekar Jan 31, 2022
1a0083f
Wrapping Server Side exception
juileetikekar Feb 2, 2022
2246856
Swagger Project path fixed, Swagger Test Project added (#93)
br-iosb Feb 9, 2022
def7c55
added test project (#94)
br-iosb Feb 9, 2022
94b8afe
BugFix:DotSeperated IdShortPath
juileetikekar Feb 9, 2022
4955697
test for fixing blob modifier (#95)
br-iosb Feb 10, 2022
d170f2e
BugFix: Corrected "WithoutBlobValue" modifier
juileetikekar Feb 10, 2022
2594dc0
Validation against applicable output modifiers, PUT vs POST
juileetikekar Feb 14, 2022
e089c02
Support for GetSerialization API
juileetikekar Feb 21, 2022
a8aeefa
License of spec changed
aorzelskiGH Feb 21, 2022
ee0f54e
Merge branch 'jtikekar/asp.net/restapi' of https://github.com/admin-s…
juileetikekar Feb 21, 2022
df9aa93
Fix failing checks (#106)
br-iosb Feb 22, 2022
7eafa86
Merge remote-tracking branch 'origin/jtikekar/asp.net/restapi' into b…
br-iosb Feb 22, 2022
327b5a7
Test did not respect some requirements, also blob value is strangely …
br-iosb Feb 22, 2022
0de310c
fixed assembly reference for SwaggerDoc
br-iosb Feb 23, 2022
8945262
Merge remote-tracking branch 'origin/jtikekar/asp.net/restapi' into b…
br-iosb Feb 23, 2022
6dcacd8
first documented API tests
br-iosb Feb 23, 2022
799a405
github action with newman
br-iosb Feb 23, 2022
a3ca9fe
uncomment github event
br-iosb Feb 23, 2022
39f0f62
Update run_newman.yml
br-iosb Feb 23, 2022
ccb7fe6
Update run_newman.yml
br-iosb Feb 23, 2022
32ede41
Update run_newman.yml
br-iosb Feb 23, 2022
b8996e2
Update run_newman.yml
br-iosb Feb 23, 2022
64f9247
Fix wrong appsettings
br-iosb Feb 24, 2022
004fa88
fix simultaneous start of aspnet and grapevine
br-iosb Feb 24, 2022
b2c9a34
uncomment broken code, also needed for connect feature (?)
br-iosb Feb 24, 2022
b0ae20d
fixes
br-iosb Feb 24, 2022
0215435
fix typo
br-iosb Feb 24, 2022
e98ddb8
removed UseUrls()
br-iosb Feb 24, 2022
f315da6
workaround inconsistent build
br-iosb Feb 24, 2022
d7a85fa
fixed report location after WD workaround
br-iosb Feb 24, 2022
e44f0f1
Merge branch 'master' into broessl/api-test-project
br-iosb Apr 8, 2022
e51467f
launchsetting for quick dev tests
br-iosb Apr 8, 2022
9f4b777
format code
br-iosb Apr 11, 2022
f89969e
test
AlexanderWollbrink Aug 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/run_newman.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: newman_tests

on:
push
#workflow_dispatch

jobs:
api-test:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.x
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: Install Newman and HTML Reporter
run: |
npm install -g [email protected]
npm install -g [email protected]
- name: Restore dependencies
run: dotnet restore ./src/AasxServerBlazor/AasxServerBlazor.csproj
- name: Build
run: dotnet build ./src/AasxServerBlazor/AasxServerBlazor.csproj -c Release -o ./build
- name: Start Test Server And Execute Test Scripts
run: |
cd build
dotnet ./AasxServerBlazor.dll --aspnet --data-path ../test/rest_api/data &
sleep 10
cd ..
newman run ./test/rest_api/postman/SubmodelElementTest.json.postman_collection -e ./test/rest_api/postman/GitHubActionEnvironment.json.postman_environment --reporters cli,htmlextra --reporter-htmlextra-export report.html --insecure
kill -9 `lsof -i:5001 -t`
- name: Upload Report
uses: actions/upload-artifact@v2
if: always()
with:
name: report.html
path: ./report.html
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ https://github.com/admin-shell-io/aasx-server/workflows/Build-and-publish-docker
)

AASX Server serves Industrie 4.0 AASX packages accessible by REST, OPC UA and
MQTT protocols.
MQTT protocols..

The AASX Server is based on code of AASX Package Explorer (
https://github.com/admin-shell-io/aasx-package-explorer
Expand Down
4 changes: 4 additions & 0 deletions src/AasxServer.sln
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IO.Swagger.Lib", "IO.Swagge
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IO.Swagger.Registry", "IO.Swagger.Registry.Lib\IO.Swagger.Registry.csproj", "{F7B9E4DC-FDCD-4F6B-A5C5-DF416802B067}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IO.Swagger", "IO.Swagger\IO.Swagger.csproj", "{478697A0-89E4-4039-902E-0F13EA4EAD72}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger.Test", "IO.Swagger.Test\IO.Swagger.Test.csproj", "{1E721E5E-6E56-4E2C-A8ED-AB381B6C7E8A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
2 changes: 0 additions & 2 deletions src/AasxServerBlazor/AasxServerBlazor.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
<ProjectReference Include="..\IO.Swagger.Registry.Lib\IO.Swagger.Registry.csproj" />
</ItemGroup>

<ProjectExtensions><VisualStudio><UserProperties appsettings_1json__JsonSchema="Url&quot;" /></VisualStudio></ProjectExtensions>

<ItemGroup>
<Content Include="startForDemo.sh">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Expand Down
12 changes: 10 additions & 2 deletions src/AasxServerBlazor/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,19 @@ public static void Main(string[] args)
{
Console.WriteLine(Directory.GetCurrentDirectory());

//TODO DELETE this piece of code make wrong assumptions about the current directory
/*
var config = new ConfigurationBuilder()
.SetBasePath(Directory.GetCurrentDirectory())
.AddJsonFile("appsettings.json").Build();
*/

//TODO REFACTOR it is not ensured that this is the actual endpoint. Why is this information needed so early in the lifecycle?
/*
string[] url = config["Kestrel:Endpoints:Http:Url"].Split(':');
if (url[2] != null)
AasxServer.Program.blazorPort = url[2];
AasxServer.Program.blazorHostPort = url[2];
*/

CreateHostBuilder(args).Build().RunAsync();

Expand All @@ -38,7 +45,8 @@ public static IHostBuilder CreateHostBuilder(string[] args) =>
{
webBuilder
.UseStartup<Startup>()
.UseUrls("http://*:5000")
//TODO CHECK why is a manuel override used? server does not uses same port consistently (sometimes 5000, sometimes port specified in appconfig.json) across different platforms
//.UseUrls("http://*:5000")
/*
.UseKestrel(options =>
{
Expand Down
12 changes: 11 additions & 1 deletion src/AasxServerBlazor/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,17 @@
},
"AasxServerBlazor": {
"commandName": "Project",
"commandLineArgs": "--rest --no-security --data-path \"C:\\Development\\PCF\" --edit --external-blazor http://localhost:5001",
"commandLineArgs": "--aspnet --no-security --data-path \"C:\\Development\\AASX\" --edit --external-blazor http://localhost:5001",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:5001",
"jsWebView2Debugging": true
},
"TestRestApi": {
"commandName": "Project",
"commandLineArgs": "--aspnet --no-security --data-path \"..\\..\\test\\rest_api\\data\" --edit --external-blazor http://localhost:5001",
"launchBrowser": true,
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
Expand Down
14 changes: 13 additions & 1 deletion src/AasxServerStandardBib/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ private class CommandLineArguments
public bool Rest { get; set; }
public bool Opc { get; set; }
public bool Mqtt { get; set; }
public bool AspNet { get; set; }//hack solution to start without grapevine
public bool DebugWait { get; set; }
public int? OpcClientRate { get; set; }
public string[] Connect { get; set; }
Expand Down Expand Up @@ -474,6 +475,11 @@ private static int Run(CommandLineArguments a)
envi++;
}
}
else
{
Console.WriteLine($"AASX Data Path does not exist. \n\tCurrent Dir\t{Directory.GetCurrentDirectory()}\n\tAASX Data Path\t{AasxHttpContextHelper.DataPath}");
throw new Exception("Invalid AASX Data Path.");
}

AasxHttpContextHelper.securityInit(); // read users and access rights form AASX Security
AasxHttpContextHelper.serverCertsInit(); // load certificates of auth servers
Expand Down Expand Up @@ -695,6 +701,10 @@ public static void Main(string[] args)
new[] {"--mqtt"},
"If set, starts a MQTT publisher"),

new Option<bool>(
new[] {"--aspnet"},
"If set, app is running using aspnet framework"),

new Option<bool>(
new[] {"--debug-wait"},
"If set, waits for Debugger to attach"),
Expand All @@ -704,6 +714,7 @@ public static void Main(string[] args)
"If set, starts an OPC client and refreshes on the given period " +
"(in milliseconds)"),

//TODO CHECK is the connect feature legacy code from Package Explorer?
new Option<string[]>(
new[] {"--connect"},
"If set, connects to AAS connect server. " +
Expand Down Expand Up @@ -755,7 +766,7 @@ public static void Main(string[] args)
rootCommand.Handler = System.CommandLine.Invocation.CommandHandler.Create(
(CommandLineArguments a) =>
{
if (!(a.Rest || a.Opc || a.Mqtt))
if (!(a.Rest || a.Opc || a.Mqtt || a.AspNet))
{
Console.Error.WriteLine($"Please specify --rest and/or --opc and/or --mqtt{nl}");
new HelpBuilder(new SystemConsole()).Write(rootCommand);
Expand Down Expand Up @@ -979,6 +990,7 @@ public static void connectPublish(string type, string json)

public static void connectThreadLoop()
{
//TODO CHECK is this leagy code?
bool newConnectData = false;

while (connectLoop)
Expand Down
208 changes: 208 additions & 0 deletions src/IO.Swagger/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
PID

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.

# User-specific files
*.suo
*.user
*.userosscache
*.sln.docstates

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
build/
bld/
[Bb]in/
[Oo]bj/

# Visual Studio 2015 cache/options directory
.vs/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# NUNIT
*.VisualState.xml
TestResult.xml

# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c

# DNX
project.lock.json
artifacts/

*_i.c
*_p.c
*_i.h
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc

# Chutzpah Test files
_Chutzpah*

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile

# Visual Studio profiler
*.psess
*.vsp
*.vspx

# TFS 2012 Local Workspace
$tf/

# Guidance Automation Toolkit
*.gpState

# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user

# JustCode is a .NET coding add-in
.JustCode

# TeamCity is a build add-in
_TeamCity*

# DotCover is a Code Coverage Tool
*.dotCover

# NCrunch
_NCrunch_*
.*crunch*.local.xml

# MightyMoose
*.mm.*
AutoTest.Net/

# Web workbench (sass)
.sass-cache/

# Installshield output folder
[Ee]xpress/

# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html

# Click-Once directory
publish/

# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj

# NuGet Packages
*.nupkg
# The packages folder can be ignored because of Package Restore
**/packages/*
# except build/, which is used as an MSBuild target.
!**/packages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/packages/repositories.config

# Windows Azure Build Output
csx/
*.build.csdef

# Windows Store app package directory
AppPackages/

# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!*.[Cc]ache/

# Others
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.pfx
*.publishsettings
node_modules/
bower_components/
orleans.codegen.cs

# RIA/Silverlight projects
Generated_Code/

# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm

# SQL Server files
*.mdf
*.ldf

# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings

# Microsoft Fakes
FakesAssemblies/

# Node.js Tools for Visual Studio
.ntvs_analysis.dat

# Visual Studio 6 build log
*.plg

# Visual Studio 6 workspace options file
*.opt
Loading