# BoB Metadata Keys and URLs

This repository contains a Python module with the current [BoB](https://bob.samtrafiken.se/) Metadata keys and URLs. Inspired by [certifi](https://github.com/certifi/python-certifi).


## Installation

`bobifi` is available on PyPI. Simply install it with ``pip``:

    $ pip install bobifi


## Usage

`bobify` includes test and production keys and metadata URLs from Swedish Samtrafiken. Usage examples below.

    >>> from bobifi.samtrafiken import trusted_jwks, metadata_url, where

    >>> metadata_url(env="test")
    'https://bobmetadata-pp.samtrafiken.se/api/v2/participantMetadata'

    >>> where(env="test")
    '/home/bob/bobifi/data/samtrafiken-test.json'

    >>> import pprint
    >>> pprint.pprint(trusted_jwks(env="test"))
    {'keys': [{'crv': 'P-256',
               'kid': '16:samtrafiken_one',
               'kty': 'EC',
               'x': 'f83OJ3D2xF1Bg8vub9tLe1gHMzV76e8Tus9uPHvRVEU',
               'y': 'x_FEzRu9m36HLN_tue659LNpXW6pCyStikYjKIWI5a0'},
              {'e': 'AQAB',
               'kid': '16:samtrafiken_fallback_2023',
               'kty': 'RSA',
               'n': ' '}]}


For Samtrafiken, the `test` and `prod` environments are currently defined. The `prod` environment is used as default.

