An extension to the Autosubmit package that serves its information as an API
Project description
Autosubmit API
Table of Contents
Overview
Autosubmit API is a package that consumes the information generated by Autosubmit and serves it as an API.
Distribution: https://pypi.org/project/autosubmit-api/
See the openapi.json
specification and the repository wiki for more information.
Installation
Autosubmit API can be easily installed via pip
pip install autosubmit-api # >=4.0 (recommended)
# Check installation and serving options
autosubmit_api start -h
Start the server:
autosubmit_api start
Configuration options
The Autosubmit API have some configuration options that can be modified by setting their specific environment variable before starting the server:
PROTECTION_LEVEL
: DefaultALL
. Possible valuesALL
,WRITEONLY
,NONE
.- If set to
ALL
, all the endpoints will be protected by needing a valid token inside theAuthorization
header of the request. - If set to
WRITEONLY
, only a subset of the endpoints will be protected. - If set to
NONE
, none of the endpoints will be protected.
- If set to
SECRET_KEY
: The secret key to encode the JWT tokens from the Authorization Module. Important to be set up on production.CAS_SERVER_URL
: CAS Protocol server base URL to request a ticket and verify it. Used for/v4
endpoints.CAS_LOGIN_URL
andCAS_VERIFY_URL
can be empty if this variable is set (the API will append the protocol URL subpaths).CAS_LOGIN_URL
: CAS Protocol URL to request a ticket. Used for/v3
endpoints.CAS_VERIFY_URL
: CAS Protocol URL to verify a given ticket. Used for/v3
endpoints.GITHUB_OAUTH_CLIENT_ID
: Client ID of the Github Oauth app.GITHUB_OAUTH_CLIENT_SECRET
: Secret key of the Github Oauth app.GITHUB_OAUTH_WHITELIST_ORGANIZATION
: Used to use authorization based on the membership of a Github organization.GITHUB_OAUTH_WHITELIST_TEAM
: Used to use authorization based on the membership of a Github team in an organization.GITHUB_OAUTH_WHITELIST_ORGANIZATION
is required
How to run tests
Install pytest
pip install -e .[test]
Run tests:
pytest
Run tests with coverage HTML report:
pytest --cov=autosubmit_api --cov-config=.coveragerc --cov-report=html tests/
You will find the report in htmlcov/index.html
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file autosubmit_api-4.0.1b4.tar.gz
.
File metadata
- Download URL: autosubmit_api-4.0.1b4.tar.gz
- Upload date:
- Size: 146.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9b99b0d30d9433ff0f9188196f2440f24c902476c7232ac515190a37a8f1b6a |
|
MD5 | 49fada99d16927302a3dae67a97a4aac |
|
BLAKE2b-256 | 8a81a8f0b57c20e2b39b2b9c8185ceff91e24a0050b60907776187115f15ef63 |
File details
Details for the file autosubmit_api-4.0.1b4-py3-none-any.whl
.
File metadata
- Download URL: autosubmit_api-4.0.1b4-py3-none-any.whl
- Upload date:
- Size: 188.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f6659395e7531acaae84b2f68e890b01c47c50a6b1aead29b8724355f9ceb19 |
|
MD5 | 59f1eb9d559e2ef24a1628f52da658bb |
|
BLAKE2b-256 | a913cbf7580c669141cd33842dcd96cf519468f589b40660a4786a982b0335f2 |