-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from AppThreat/feature/openapi_conversion
Feature/openapi conversion
- Loading branch information
Showing
21 changed files
with
88,670 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
on: [push, pull_request] | ||
|
||
permissions: | ||
contents: read | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.12" | ||
- uses: pre-commit/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,6 @@ dist/ | |
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: mixed-line-ending | ||
- id: trailing-whitespace | ||
types: [ python ] | ||
- id: end-of-file-fixer | ||
types: [ python ] | ||
- id: check-docstring-first | ||
types: [ python ] | ||
# - id: double-quote-string-fixer | ||
# types: [ python ] | ||
|
||
# - repo: https://github.com/psf/black | ||
# rev: 23.11.0 | ||
# hooks: | ||
# - id: black | ||
|
||
- repo: https://github.com/pycqa/pylint | ||
rev: v3.0.2 | ||
hooks: | ||
- id: pylint | ||
exclude: 'cli|test' | ||
args: [] | ||
|
||
- repo: https://github.com/PyCQA/flake8 | ||
rev: 6.1.0 | ||
hooks: | ||
- id: flake8 | ||
exclude: 'cli|test' | ||
args: [--statistics] | ||
|
||
ci: | ||
autofix_prs: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include atom_tools/atom_data/openapi_slices_schemas.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,87 @@ | ||
# atom-tools | ||
Collection of tools for use with [appthreat/atom](https://github.com/appthreat/atom). | ||
Collection of tools for use with slices generated by [AppThreat/atom](https://github.com/appthreat/atom). | ||
|
||
## Install atom | ||
|
||
This program does not generate slices; its purpose is to manipulate slices | ||
generated by atom. The current documentation for atom is housed in the | ||
[AppThreat/atom](https://github.com/AppThreat/atom?tab=readme-ov-file) GitHub | ||
repository. | ||
|
||
Atom can easily be installed from a | ||
[native image](https://github.com/AppThreat/atom#atom-native-image) or via npm | ||
`npm install @appthreat/atom`. | ||
|
||
## Atom-tools installation | ||
|
||
`pip install atom-tools` | ||
|
||
## CLI Usage | ||
|
||
Atom-tools uses py-poetry/cleo to construct its command-line interface and | ||
therefore uses the same sorts of conventions as the package management utility | ||
poetry. | ||
|
||
To access the commands help menu, enter `atom-tools list` for a list of | ||
available commands. | ||
|
||
Individual command options can be accessed with `atom help ` and the command | ||
name (e.g. `atom help convert`). | ||
``` | ||
Atom Tools (version 0.1.0) | ||
Usage: | ||
command [options] [arguments] | ||
Options: | ||
-h, --help Display help for the given command. When no command is given display help for the list command. | ||
-q, --quiet Do not output any message. | ||
-V, --version Display this application version. | ||
--ansi Force ANSI output. | ||
--no-ansi Disable ANSI output. | ||
-n, --no-interaction Do not ask any interactive question. | ||
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. | ||
Available commands: | ||
convert Convert an atom slice to a different format | ||
help Displays help for a command. | ||
list Lists commands. | ||
``` | ||
|
||
## Features | ||
### Convert | ||
The convert command can be used to output an atom slice in a different format. | ||
The current capabilities are limited to processing usages in order to generate | ||
endpoints for an openapi 3.x paths object. Future iterations will populate the | ||
path item objects with more details based on atom slices. | ||
|
||
``` | ||
Description: | ||
Convert an atom slice to a different format | ||
Usage: | ||
convert [options] | ||
Options: | ||
-f, --format=FORMAT Destination format [default: "openapi3.1.0"] | ||
-u, --usages-slice=USAGES-SLICE Usages slice file | ||
-t, --type=TYPE Origin type of source on which the atom slice was generated. [default: "java"] | ||
-o, --output-file=OUTPUT-FILE Output file [default: "openapi_from_slice.json"] | ||
-h, --help Display help for the given command. When no command is given display help for the list command. | ||
-q, --quiet Do not output any message. | ||
-V, --version Display this application version. | ||
--ansi Force ANSI output. | ||
--no-ansi Disable ANSI output. | ||
-n, --no-interaction Do not ask any interactive question. | ||
-v|vv|vvv, --verbose Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug. | ||
Help: | ||
The convert command converts an atom slice to a different format. | ||
Currently supports outputting an OpenAPI 3.x document based on a usages | ||
slice. | ||
``` | ||
|
||
**Example** | ||
>`atom-tools convert -u usages.slices.json -f openapi3.1.0 -o openapi_usages.json -t java` | ||
Note: Supported languages include the following: jar, java, javascript, python, typescript |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
""" | ||
A cli, classes and functions for converting an atom slice to a different format | ||
""" | ||
__version__ = '0.1.0' |
Empty file.
Oops, something went wrong.