HUB
Sign inSign up

ghga/test-oidc-provider

Sponsored OSS

By German Human Genome-Phenome Archive

•Updated about 11 hours ago

Test OpenID Connect provider

Image
0

50K+

ghga/test-oidc-provider repository overview

⁠Test Oidc Provider

Test OpenID Connect provider

The service ships as the container image ghga/test-oidc-provider and the Helm chart test-oidc-provider⁠.

⁠Description

A test OpenID Connect provider for the integration test bed and local front-end development. Test users log in through its /login endpoint, and it serves the discovery document, the JSON Web Key Set, and the authorization, token and user info endpoints that the auth service and the data portal use. It is built as a platform image only so that the test bed can deploy it, and it is never enabled outside test environments.

⁠Usage

The executable test-oidc-provider starts the service and takes no command. Running a service⁠ shows how to start, build and deploy it.

⁠Configuration

The settings take the prefix top: the environment variable TOP_HOST sets host, and the YAML file is .top.yaml. example_config.yaml⁠ holds a complete set to adapt, and Configuration⁠ says where the service looks for them.

⁠Parameters

The service requires the following configuration parameters:

  • enable_opentelemetry (boolean): If set to true, this will run necessary setup code.If set to false, no setup code is run, which leaves tracing disabled. Default: false.

  • otel_trace_sampling_rate (number): Determines which proportion of spans should be sampled. A value of 1.0 means all and is equivalent to the previous behaviour. Setting this to 0 will result in no spans being sampled, but this does not automatically set enable_opentelemetry to False. Minimum: 0. Maximum: 1. Default: 1.0.

  • enable_otel_metrics (boolean): Also export metrics via OTLP. Requires enable_opentelemetry and a collector with a metrics pipeline. Default: false.

  • log_level (string): The minimum log level to capture. Must be one of: "CRITICAL", "ERROR", "WARNING", "INFO", "DEBUG", or "TRACE". Default: "INFO".

  • service_name (string): Short name of this service. Default: "top".

  • service_instance_id (string): String that uniquely identifies this service instance in log messages. Default: "default".

  • log_format: If set, will replace JSON formatting with the specified string format. If not set, has no effect. In addition to the standard attributes, the following can also be specified: timestamp, service, instance, level, correlation_id, and details. Default: null.

    • Any of
      • string
      • null

    Examples:

    "%(timestamp)s - %(service)s - %(level)s - %(message)s"
    
    "%(asctime)s - Severity: %(levelno)s - %(msg)s"
    
  • log_traceback (boolean): Whether to include exception tracebacks in log messages. Default: true.

  • issuer (string, format: uri): test issuer URL. Length must be at least 1. Default: "https://op.test/".

  • user_domain (string): domain name of the home organization of the test users. Default: "home.org".

  • client_id (string): test client ID. Default: "test-client".

  • redirect_url (string, format: uri): test redirect URL. Length must be at least 1. Default: "https://client.test/oauth/callback".

  • valid_seconds (integer): default expiration time of access tokens in seconds. Exclusive minimum: 0. Default: 3600.

  • host (string): IP of the host. Default: "127.0.0.1".

  • port (integer): Port to expose the server on the specified host. Default: 8080.

  • auto_reload (boolean): A development feature. Set to True to automatically reload the server upon code changes. Default: false.

  • workers (integer): Number of workers processes to run. Default: 1.

  • timeout_keep_alive (integer): The time in seconds to keep an idle connection open for subsequent requests before closing it. This value should be higher than the timeout used by any client or reverse proxy to avoid premature connection closures. Default: 90.

    Examples:

    5
    
    90
    
    5400
    
  • api_root_path (string): Root path at which the API is reachable. This is relative to the specified host and port. Default: "".

  • openapi_url (string): Path to get the openapi specification in JSON format. This is relative to the specified host and port. Default: "/openapi.json".

  • docs_url (string): Path to host the swagger documentation. This is relative to the specified host and port. Default: "/docs".

  • cors_allowed_origins: A list of origins that should be permitted to make cross-origin requests. By default, cross-origin requests are not allowed. You can use ['*'] to allow any origin. Default: null.

    • Any of
      • array
        • Items (string)
      • null

    Examples:

    [
        "https://example.org",
        "https://www.example.org"
    ]
    
  • cors_allow_credentials: Indicate that cookies should be supported for cross-origin requests. Defaults to False. Also, cors_allowed_origins cannot be set to ['*'] for credentials to be allowed. The origins must be explicitly specified. Default: null.

    • Any of
      • boolean
      • null

    Examples:

    [
        "https://example.org",
        "https://www.example.org"
    ]
    
  • cors_allowed_methods: A list of HTTP methods that should be allowed for cross-origin requests. Defaults to ['GET']. You can use ['*'] to allow all standard methods. Default: null.

    • Any of
      • array
        • Items (string)
      • null

    Examples:

    [
        "*"
    ]
    
  • cors_allowed_headers: A list of HTTP request headers that should be supported for cross-origin requests. Defaults to []. You can use ['*'] to allow all request headers. The Accept, Accept-Language, Content-Language, Content-Type and some are always allowed for CORS requests. Default: null.

    • Any of
      • array
        • Items (string)
      • null

    Examples:

    []
    
  • cors_exposed_headers: A list of HTTP response headers that should be exposed for cross-origin responses. Defaults to []. Note that you can NOT use ['*'] to expose all response headers. The Cache-Control, Content-Language, Content-Length, Content-Type, Expires, Last-Modified and Pragma headers are always exposed for CORS responses. Default: null.

    • Any of
      • array
        • Items (string)
      • null

    Examples:

    []
    
  • generate_correlation_id (boolean): A flag, which, if False, will result in an error when inbound requests don't possess a correlation ID. If True, requests without a correlation ID will be assigned a newly generated ID in the correlation ID middleware function. Default: true.

    Examples:

    true
    
    false
    

⁠HTTP API

The service's OpenAPI specification is in openapi.yaml⁠.

⁠Architecture and Design

This is a Python-based service following the Triple Hexagonal Architecture pattern. It uses protocol/provider pairs and dependency injection mechanisms provided by the hexkit⁠ library.

⁠License

This repository is free to use and modify according to the Apache 2.0 License⁠.

Tag summary
Recent tags
Content type
Image
Digest
sha256:a1f8cdb82…
Size
72.3 MB
Last updated
about 11 hours ago
docker pull ghga/test-oidc-provider:16.1.0
This week's pulls