Metadata-Version: 2.5
Name: rakomi
Version: 0.1.0
Summary: OpenID Connect discovery client for Rakomi issuers
Project-URL: Homepage, https://rakomi.com
Project-URL: Source, https://github.com/rakomidev/rakomi-python
Project-URL: Issues, https://github.com/rakomidev/rakomi-python/issues
Author: CRE8EVE Sp. z o.o.
License-Expression: MIT
License-File: LICENSE
Keywords: discovery,oauth2,oidc,openid-connect,rakomi
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Security
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# rakomi

OpenID Connect discovery for [Rakomi](https://rakomi.com) issuers. Python 3.10 or later, no
dependencies outside the standard library.

```sh
pip install rakomi
```

```python
from rakomi import DiscoveryError, discover

try:
    result = discover("https://api.rakomi.com", timeout=5.0)
except DiscoveryError as exc:
    raise SystemExit(f"discovery failed: {exc}")

print(result.issuer)
print(result.metadata["authorization_endpoint"])
print(result.jwks["keys"])
```

`discover` fetches `<issuer>/.well-known/openid-configuration`, then the JSON Web Key Set at its
`jwks_uri`, and returns both as a `Discovery` (`metadata`, `jwks`).

## What `discover` checks

- The issuer and every endpoint it reads use `https`; an issuer with credentials, a query or a
  fragment is refused.
- Redirects are refused.
- The metadata names exactly the issuer you passed (`"https://api.rakomi.com"` and
  `"https://api.rakomi.com/"` are different issuers).
- The metadata carries `issuer`, `authorization_endpoint`, `token_endpoint`, `jwks_uri`,
  `response_types_supported`, `subject_types_supported` and `id_token_signing_alg_values_supported`.
- The JWKS is a JSON object with a `keys` list.
- Each request has a timeout (10 seconds by default) and each document is limited to 1 MiB.

Any refusal raises `DiscoveryError`. `discover` does not verify tokens.

## Security

Report vulnerabilities to security@rakomi.com. See
[SECURITY.md](https://github.com/rakomidev/rakomi-python/blob/main/SECURITY.md).

## License

MIT
