Skip to main content

An extension to the Autosubmit package that serves its information as an API

Project description

Autosubmit API

Table of Contents

  1. Overview
  2. Installation
  3. Configuration options
  4. How to run tests

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: Default ALL. Possible values ALL, WRITEONLY, NONE.
    • If set to ALL, all the endpoints will be protected by needing a valid token inside the Authorization 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.
  • 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 and CAS_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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

autosubmit_api-4.0.1b3.tar.gz (145.3 kB view details)

Uploaded Source

Built Distribution

autosubmit_api-4.0.1b3-py3-none-any.whl (185.0 kB view details)

Uploaded Python 3

File details

Details for the file autosubmit_api-4.0.1b3.tar.gz.

File metadata

  • Download URL: autosubmit_api-4.0.1b3.tar.gz
  • Upload date:
  • Size: 145.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.9.19

File hashes

Hashes for autosubmit_api-4.0.1b3.tar.gz
Algorithm Hash digest
SHA256 a7e3b440d075f890fa1823b9af86725ea8cc55b8b1169a28cd549ba2d9c068cc
MD5 64ef21bdaa42ddbc1acc7f99d12fc210
BLAKE2b-256 f926eab0035f2975569cf23910af7ad0ddb89b2c9dfc2d9735e610beb62865ac

See more details on using hashes here.

File details

Details for the file autosubmit_api-4.0.1b3-py3-none-any.whl.

File metadata

File hashes

Hashes for autosubmit_api-4.0.1b3-py3-none-any.whl
Algorithm Hash digest
SHA256 c08523e2d364ae8834d0ff18da9cb727c997d336034fb8b90604fec4d8f19043
MD5 2734ac4325923beeafc55cadce4c4832
BLAKE2b-256 9e507569784ed9d1c919fd972f3f5b97545cf1c5b76e0ec8b897352991a7ea12

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page