rakomi-cli 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- rakomi_cli-0.1.0/.gitignore +12 -0
- rakomi_cli-0.1.0/LICENSE +21 -0
- rakomi_cli-0.1.0/PKG-INFO +58 -0
- rakomi_cli-0.1.0/README.md +36 -0
- rakomi_cli-0.1.0/pyproject.toml +35 -0
- rakomi_cli-0.1.0/src/rakomi_cli/__init__.py +4 -0
- rakomi_cli-0.1.0/src/rakomi_cli/discover.py +49 -0
- rakomi_cli-0.1.0/src/rakomi_cli/py.typed +0 -0
rakomi_cli-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 CRE8EVE Sp. z o.o.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: rakomi-cli
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Command-line tools for Rakomi: rakomi-discover prints an issuer's OpenID Connect metadata
|
|
5
|
+
Project-URL: Homepage, https://rakomi.com
|
|
6
|
+
Project-URL: Source, https://github.com/rakomidev/rakomi-python
|
|
7
|
+
Project-URL: Issues, https://github.com/rakomidev/rakomi-python/issues
|
|
8
|
+
Author: CRE8EVE Sp. z o.o.
|
|
9
|
+
License-Expression: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: discovery,oauth2,oidc,openid-connect,rakomi
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Operating System :: OS Independent
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
17
|
+
Classifier: Topic :: Security
|
|
18
|
+
Classifier: Typing :: Typed
|
|
19
|
+
Requires-Python: >=3.10
|
|
20
|
+
Requires-Dist: rakomi<0.2,>=0.1.0
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
|
|
23
|
+
# rakomi-cli
|
|
24
|
+
|
|
25
|
+
Command-line tools for [Rakomi](https://rakomi.com). Python 3.10 or later.
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
pipx install rakomi-cli
|
|
29
|
+
rakomi-discover https://api.rakomi.com
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
`rakomi-discover <issuer>` fetches the issuer's OpenID Connect metadata and its JWKS, checks them, and
|
|
33
|
+
prints the metadata as JSON. It exits with 1 and a message on stderr when discovery is refused.
|
|
34
|
+
|
|
35
|
+
Options: `--timeout SECONDS` (default 10), `--version`.
|
|
36
|
+
|
|
37
|
+
## What `discover` checks
|
|
38
|
+
|
|
39
|
+
- The issuer and every endpoint it reads use `https`; an issuer with credentials, a query or a
|
|
40
|
+
fragment is refused.
|
|
41
|
+
- Redirects are refused.
|
|
42
|
+
- The metadata names exactly the issuer you passed (`"https://api.rakomi.com"` and
|
|
43
|
+
`"https://api.rakomi.com/"` are different issuers).
|
|
44
|
+
- The metadata carries `issuer`, `authorization_endpoint`, `token_endpoint`, `jwks_uri`,
|
|
45
|
+
`response_types_supported`, `subject_types_supported` and `id_token_signing_alg_values_supported`.
|
|
46
|
+
- The JWKS is a JSON object with a `keys` list.
|
|
47
|
+
- Each request has a timeout (10 seconds by default) and each document is limited to 1 MiB.
|
|
48
|
+
|
|
49
|
+
Any refusal raises `DiscoveryError`. `discover` does not verify tokens.
|
|
50
|
+
|
|
51
|
+
## Security
|
|
52
|
+
|
|
53
|
+
Report vulnerabilities to security@rakomi.com. See
|
|
54
|
+
[SECURITY.md](https://github.com/rakomidev/rakomi-python/blob/main/SECURITY.md).
|
|
55
|
+
|
|
56
|
+
## License
|
|
57
|
+
|
|
58
|
+
MIT
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# rakomi-cli
|
|
2
|
+
|
|
3
|
+
Command-line tools for [Rakomi](https://rakomi.com). Python 3.10 or later.
|
|
4
|
+
|
|
5
|
+
```sh
|
|
6
|
+
pipx install rakomi-cli
|
|
7
|
+
rakomi-discover https://api.rakomi.com
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
`rakomi-discover <issuer>` fetches the issuer's OpenID Connect metadata and its JWKS, checks them, and
|
|
11
|
+
prints the metadata as JSON. It exits with 1 and a message on stderr when discovery is refused.
|
|
12
|
+
|
|
13
|
+
Options: `--timeout SECONDS` (default 10), `--version`.
|
|
14
|
+
|
|
15
|
+
## What `discover` checks
|
|
16
|
+
|
|
17
|
+
- The issuer and every endpoint it reads use `https`; an issuer with credentials, a query or a
|
|
18
|
+
fragment is refused.
|
|
19
|
+
- Redirects are refused.
|
|
20
|
+
- The metadata names exactly the issuer you passed (`"https://api.rakomi.com"` and
|
|
21
|
+
`"https://api.rakomi.com/"` are different issuers).
|
|
22
|
+
- The metadata carries `issuer`, `authorization_endpoint`, `token_endpoint`, `jwks_uri`,
|
|
23
|
+
`response_types_supported`, `subject_types_supported` and `id_token_signing_alg_values_supported`.
|
|
24
|
+
- The JWKS is a JSON object with a `keys` list.
|
|
25
|
+
- Each request has a timeout (10 seconds by default) and each document is limited to 1 MiB.
|
|
26
|
+
|
|
27
|
+
Any refusal raises `DiscoveryError`. `discover` does not verify tokens.
|
|
28
|
+
|
|
29
|
+
## Security
|
|
30
|
+
|
|
31
|
+
Report vulnerabilities to security@rakomi.com. See
|
|
32
|
+
[SECURITY.md](https://github.com/rakomidev/rakomi-python/blob/main/SECURITY.md).
|
|
33
|
+
|
|
34
|
+
## License
|
|
35
|
+
|
|
36
|
+
MIT
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling>=1.27"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "rakomi-cli"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Command-line tools for Rakomi: rakomi-discover prints an issuer's OpenID Connect metadata"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
license-files = ["LICENSE"]
|
|
13
|
+
authors = [{ name = "CRE8EVE Sp. z o.o." }]
|
|
14
|
+
keywords = ["rakomi", "openid-connect", "oidc", "oauth2", "discovery"]
|
|
15
|
+
classifiers = [
|
|
16
|
+
"Development Status :: 3 - Alpha",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"Operating System :: OS Independent",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
21
|
+
"Topic :: Security",
|
|
22
|
+
"Typing :: Typed",
|
|
23
|
+
]
|
|
24
|
+
dependencies = ["rakomi>=0.1.0,<0.2"]
|
|
25
|
+
|
|
26
|
+
[project.scripts]
|
|
27
|
+
rakomi-discover = "rakomi_cli.discover:main"
|
|
28
|
+
|
|
29
|
+
[project.urls]
|
|
30
|
+
Homepage = "https://rakomi.com"
|
|
31
|
+
Source = "https://github.com/rakomidev/rakomi-python"
|
|
32
|
+
Issues = "https://github.com/rakomidev/rakomi-python/issues"
|
|
33
|
+
|
|
34
|
+
[tool.hatch.build.targets.wheel]
|
|
35
|
+
packages = ["src/rakomi_cli"]
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# SPDX-License-Identifier: MIT
|
|
2
|
+
"""``rakomi-discover <issuer>``: print the OpenID Connect provider metadata of an issuer."""
|
|
3
|
+
|
|
4
|
+
from __future__ import annotations
|
|
5
|
+
|
|
6
|
+
import argparse
|
|
7
|
+
import json
|
|
8
|
+
import sys
|
|
9
|
+
from typing import Optional, Sequence
|
|
10
|
+
|
|
11
|
+
from rakomi import DiscoveryError, discover
|
|
12
|
+
from rakomi.discovery import DEFAULT_TIMEOUT, Opener
|
|
13
|
+
|
|
14
|
+
from rakomi_cli import __version__
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _parser() -> argparse.ArgumentParser:
|
|
18
|
+
parser = argparse.ArgumentParser(
|
|
19
|
+
prog="rakomi-discover",
|
|
20
|
+
description=(
|
|
21
|
+
"Fetch an issuer's OpenID Connect metadata and its JWKS over HTTPS, check them, "
|
|
22
|
+
"and print the metadata as JSON."
|
|
23
|
+
),
|
|
24
|
+
)
|
|
25
|
+
parser.add_argument("issuer", help="exact issuer identifier, e.g. https://api.rakomi.com")
|
|
26
|
+
parser.add_argument(
|
|
27
|
+
"--timeout",
|
|
28
|
+
type=float,
|
|
29
|
+
default=DEFAULT_TIMEOUT,
|
|
30
|
+
help=f"seconds allowed for each request (default {DEFAULT_TIMEOUT:g})",
|
|
31
|
+
)
|
|
32
|
+
parser.add_argument("--version", action="version", version=f"%(prog)s {__version__}")
|
|
33
|
+
return parser
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
def main(argv: Optional[Sequence[str]] = None, *, opener: Optional[Opener] = None) -> int:
|
|
37
|
+
args = _parser().parse_args(argv)
|
|
38
|
+
try:
|
|
39
|
+
result = discover(args.issuer, timeout=args.timeout, opener=opener)
|
|
40
|
+
except DiscoveryError as exc:
|
|
41
|
+
print(f"rakomi-discover: {exc}", file=sys.stderr)
|
|
42
|
+
return 1
|
|
43
|
+
json.dump(dict(result.metadata), sys.stdout, indent=2, sort_keys=True)
|
|
44
|
+
sys.stdout.write("\n")
|
|
45
|
+
return 0
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
if __name__ == "__main__":
|
|
49
|
+
sys.exit(main())
|
|
File without changes
|