Skip to content

Commit

Permalink
API V3.9 Specification (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgedias committed May 23, 2023
1 parent e1c24e6 commit 8369c19
Show file tree
Hide file tree
Showing 660 changed files with 57,408 additions and 2,056 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
26 changes: 19 additions & 7 deletions .github/workflows/generate-clients.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Generate OpenAPI Clients
# For testing use the PR name for 'branches:' - once done testing revert the 'branches:' name to main
on:
push:
branches: [ main ]
# pull_request:
# #types: [synchronize]
# branches: [ main ]
# branches: [ main ]

jobs:
generate-eMASS-clients:
Expand All @@ -15,7 +15,6 @@ jobs:
# Checkout your code
- name: Checkout 🛎️
uses: actions/checkout@v3
#uses: actions/checkout@v2
with:
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit.

Expand All @@ -26,7 +25,7 @@ jobs:

# Use the action to generate a client package
# This uses the default path for the openapi document and thus assumes there is an openapi.json in the current workspace.
- name: Generate Ruby Client 🔧
- name: Generate Ruby Client 🏭
uses: openapi-generators/openapitools-generator-action@v1
with:
generator: ruby
Expand All @@ -35,7 +34,7 @@ jobs:
openapi-file: eMASSRestOpenApi.yaml
if: contains(steps.changed-files.outputs.modified_files, 'eMASSRestOpenApi.yaml')

- name: Generate Typescript Client 🔧
- name: Generate Typescript Client 🏭
uses: openapi-generators/openapitools-generator-action@v1
with:
generator: typescript-axios
Expand All @@ -44,11 +43,20 @@ jobs:
openapi-file: eMASSRestOpenApi.yaml
if: contains(steps.changed-files.outputs.modified_files, 'eMASSRestOpenApi.yaml')

- name: Generate Python Client 🏭
uses: openapi-generators/openapitools-generator-action@v1
with:
generator: python
config-file: src/openapi/templates/python/python-generator-config.json
template-dir: src/openapi/templates/python/mustache
openapi-file: eMASSRestOpenApi.yaml
if: contains(steps.changed-files.outputs.modified_files, 'eMASSRestOpenApi.yaml')

# Publish the newly generated eMASS client to the current repo
- name: Publish Generated Clients 🚀
if: contains(steps.changed-files.outputs.modified_files, 'eMASSRestOpenApi.yaml')
env:
CI_COMMIT_MESSAGE: Continuous Integration Build Artifacts (eMASS Clients)
CI_COMMIT_MESSAGE: Continuous Integration Build Client Artifacts (eMASS Clients)
CI_COMMIT_AUTHOR: Continuous Integration
# Use previous user who made the last commit (from logs)
# CI_COMMIT_AUTHOR: "$(git log -n 1 --pretty=format:%an)"
Expand All @@ -63,10 +71,14 @@ jobs:
rm -R src/typescript_client
mv typescript-axios-client src/typescript_client
# echo "Renaming generated directory from python-client to python_client..."
rm -R src/python_client
mv python-client src/python_client
# echo "GIT commit and push eMASS clients..."
git config --global user.name "${{ env.CI_COMMIT_AUTHOR }}"
git config --global user.email "${{ env.CI_COMMIT_EMAIL }}"
git add src/ruby_client src/typescript_client
git add src/ruby_client src/typescript_client src/python_client
git commit -m "${{ env.CI_COMMIT_MESSAGE }}"
git push -f
echo "All done now."
2 changes: 1 addition & 1 deletion .github/workflows/generate_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: Generate Document with redoc
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3

# use the public name of the action
- name: redoc-cli test
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Copy Markdown Files to gh_pages
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Build Deploment Folder 🔧
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-gem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
steps:
- name: Setup ruby
uses: actions/setup-ruby@v1
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git fetch origin +refs/tags/*:refs/tags/*
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/publish-npm-gpr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ jobs:
build-deploy:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

- name: Setup node
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: "16.x"
registry-url: https://npm.pkg.github.com/
Expand All @@ -28,7 +28,7 @@ jobs:
npm pack
# Setup .npmrc file to publish to GitHub Package Registry
- uses: actions/setup-node@v1
- uses: actions/setup-node@v3
with:
registry-url: 'https://npm.pkg.github.com'
scope: '@mitre'
Expand All @@ -37,6 +37,7 @@ jobs:
- name: Publish emass_client to GPR
run: |
cd src/typescript_client
npm publish mitre-emass_client-*.tgz
# npm publish mitre-emass_client-*.tgz
npm publish --access public mitre-emass_client-*.tgz
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 2 additions & 14 deletions .github/workflows/publish-npm-registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ on:

jobs:
build-deploy:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- name: Setup node
uses: actions/setup-node@v1
uses: actions/setup-node@v3
with:
node-version: "16.x"
registry-url: 'https://registry.npmjs.org'
Expand All @@ -34,15 +34,3 @@ jobs:
npm publish --access public mitre-emass_client-*.tgz
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

# # Setup .npmrc file to publish to GitHub Packages
# - uses: actions/setup-node@v1
# if: always()
# with:
# registry-url: 'https://npm.pkg.github.com'

# - name: Publish emass_client to GitHub Packages
# if: always()
# run: npm publish --access public mitre-emass_client-*.tgz
# env:
# NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33 changes: 33 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# publish the python package to PyPI registry
name: Publish Python 🐍 distributions 📦 to PyPI

on:
release:
types: [published]

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install pypa/build
run: |
python -m pip install build --user
- name: Build a binary wheel and a source tarball
run: |
cd src/python_client
python -m build --sdist --wheel --outdir dist/
- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
44 changes: 44 additions & 0 deletions .github/workflows/publish-to-test-pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# publish a python package to the test pipy registry - await until the generate clients finishes
name: Publish Python 🐍 distributions 📦 to TestPyPI

# Push to TestPyPI unconditionally (need to rev version or del/yank same ver)
# Used for testing the python package - to test comment the
# on:
# workflow_run:
# workflows: ['generate-eMASS-clients']
# types:
# - completed
# and simply use on: push
on:
workflow_run:
workflows: ['generate-eMASS-clients']
types:
- completed

jobs:
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to TestPyPI
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Install pypa/build
run: |
python -m pip install build --user
- name: Build a binary wheel and a source tarball
run: |
cd src/python_client
python -m build --sdist --wheel --outdir dist/
- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: src/python_client/dist/
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![CodeQL Vulnerabilities and Errors](https://github.com/mitre/emass_client/actions/workflows/codeql-analysis.yml/badge.svg) ![Ruby Client Testing](https://github.com/mitre/emass_client/actions/workflows/test-ruby-client.yml/badge.svg)

![GitHub Release Date](https://img.shields.io/github/release-date/mitre/emass_client?label=Release%20Date&logo=github&color=blue) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/mitre/emass_client?label=Release%20Version&logo=github) ![Gem](https://img.shields.io/gem/v/emass_client?label=gem%20version&logo=ruby&logoColor=red) ![npm](https://img.shields.io/npm/v/@mitre/emass_client?label=npm%20package&logo=npm)
![GitHub Release Date](https://img.shields.io/github/release-date/mitre/emass_client?label=Release%20Date&logo=github&color=blue) ![GitHub release (latest by date)](https://img.shields.io/github/v/release/mitre/emass_client?label=Release%20Version&logo=github) ![Gem](https://img.shields.io/gem/v/emass_client?label=gem%20version&logo=ruby&logoColor=red) ![npm](https://img.shields.io/npm/v/@mitre/emass_client?label=npm%20version&logo=npm) ![PyPI](https://img.shields.io/pypi/v/emass-client-api?label=pypi%20version&logo=pypi&logoColor=yellow)

# eMASS Client
The eMASS client repository (```emass_client```) maintains the Enterprise Mission Assurance Support Service (eMASS) Representational State Transfer (REST) Application Programming Interface (API) specifications and executables. The executables packages currently provided are: RubyGem and TypeScript Node.
Expand All @@ -24,6 +24,8 @@ The following ```emass_client``` executable packages are generated by this repos
- Ruby - The ruby package is hosted and available in the [RubyGems](https://rubygems.org/gems/emass_client).

- Typescript - The typescript package is hosted and available in the [NpmRegistry](https://www.npmjs.com/package/@mitre/emass_client).

- Python - The python package is hosted and available in the [PyPIRegistry](https://pypi.org/manage/project/emass-client-api/releases/)

### Making Changes to eMASS Clients
The most appropriate way to propose modifications or make changes to the eMASS clients generated in this repository is by [forking](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/about-forks) this repository.
Expand Down Expand Up @@ -69,13 +71,13 @@ For detail information on how-to generating eMASS clients for other programming


## Repository Architecture
The process provided by this repository is depicted by the architecture diagram below. In a nutshell, it provides the capability of hosting the eMAASS API documentation, generating interactive visualization tools, static/dynamic testing, and generating API clients for ```ruby``` and ```typescript``` languages.
The process provided by this repository is depicted by the architecture diagram below. In a nutshell, it hosts the eMAASS API specification, documentation, interactive visualization tools, and generates clients for the following languages: `ruby`, `typescript`, and `python`.
<div align="center">
<img src="images/emass_client_architecture.jpg" alt="Alt text" title="Repository Architecture">
</div>

### Client Application
The ``emass_client`` executable packages can be included in other projects, or used to generate CLI tools that have a need to access an eMASS instance. This is demonstrated by the diagram below.
The ``emass_client`` executable packages can be included in other projects, or used to generate CLI tools that require access to an eMASS instance as demonstrated by the diagram below.
<div align="center">
<img src="images/emass_client_applications.jpg" alt="Alt text" title="Client Architecture">
</div>
Expand Down
Loading

0 comments on commit 8369c19

Please sign in to comment.