-
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.
Refactor to
hana
and add documentation
- Loading branch information
1 parent
1370058
commit 4c2bfc9
Showing
25 changed files
with
79 additions
and
42 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
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
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
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,5 +1,42 @@ | ||
# Diana Services API | ||
This package provides an HTTP front-end for accessing services in a | ||
[Neon DIANA](https://github.com/NeonGeckoCom/neon-diana-utils) deployment. This | ||
should generally be hosted as part of a Diana deployment to safely expose services | ||
via HTTP. | ||
# HANA | ||
HANA (HTTP API for Neon Applications) provides a unified front-end for | ||
accessing services in a [Neon DIANA](https://github.com/NeonGeckoCom/neon-diana-utils) deployment. This API should generally | ||
be hosted as part of a Diana deployment to safely expose services to outside | ||
traffic. | ||
|
||
Full API documentation is automatically generated and accessible at `/docs`. | ||
|
||
## Configuration | ||
User configuration belongs in `diana.yaml`, mounted in the container path | ||
`/config/neon/`. An example user configuration could be: | ||
```yaml | ||
MQ: | ||
server: mq.mydomain.com | ||
hana: | ||
mq_default_timeout: 10 | ||
access_token_ttl: 86400 # 1 day | ||
refresh_token_ttl: 604800 # 1 week | ||
requests_per_minute: 60 | ||
access_token_secret: a800445648142061fc238d1f84e96200da87f4f9fa7835cac90db8b4391b117b | ||
refresh_token_secret: 833d369ac73d883123743a44b4a7fe21203cffc956f4c8fec712e71aafa8e1aa | ||
fastapi_title: "My HANA API Host" | ||
fastapi_summary: "Personal HTTP API to access my DIANA backend." | ||
disable_auth: True | ||
``` | ||
It is recommended to generate unique values for configured tokens, these are 32 | ||
bytes in hexadecimal representation. | ||
## Deployment | ||
You can build a Docker container from this repository, or pull a built container | ||
from the GitHub Container Registry. Start Hana via: | ||
```shell | ||
docker run -p 8080:8080 -v ~/.config/neon:/config/neon ghcr.io/neongeckocom/neon-hana | ||
``` | ||
> This assumes you have configuration defined in `~/.config/neon/diana.yaml` and | ||
are using the default port 8080 | ||
|
||
## Usage | ||
Full API documentation is available at `/docs`. The `/auth/login` endpoint should | ||
be used to generate a `client_id`, `access_token`, and `refresh_token`. The | ||
`access_token` should be included in every request and upon expiration of the | ||
`access_token`, a new token can be obtained from the `auth/refresh` endpoint. |
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
File renamed without changes.
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
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
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
File renamed without changes.
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
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
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
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
|
@@ -52,7 +52,7 @@ def get_requirements(requirements_filename: str): | |
with open(path.join(BASE_PATH, "README.md"), "r") as f: | ||
long_description = f.read() | ||
|
||
with open(path.join(BASE_PATH, "diana_services_api", | ||
with open(path.join(BASE_PATH, "hana", | ||
"version.py"), "r", encoding="utf-8") as v: | ||
for line in v.readlines(): | ||
if line.startswith("__version__"): | ||
|
@@ -63,12 +63,12 @@ def get_requirements(requirements_filename: str): | |
|
||
|
||
setup( | ||
name='diana-services-api', | ||
name='neon-hana', | ||
version=version, | ||
description='Web API to access Neon DIANA Services', | ||
description='Web API to access DIANA Services', | ||
long_description=long_description, | ||
long_description_content_type="text/markdown", | ||
url='https://github.com/NeonGeckoCom/diana-services-api', | ||
url='https://github.com/NeonGeckoCom/neon-hana', | ||
author='NeonGecko', | ||
author_email='[email protected]', | ||
license='BSD-3-Clause', | ||
|
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