rakomi-cli 0.1.0__py3-none-any.whl

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/__init__.py ADDED
@@ -0,0 +1,4 @@
1
+ # SPDX-License-Identifier: MIT
2
+ """Command-line tools for Rakomi."""
3
+
4
+ __version__ = "0.1.0"
rakomi_cli/discover.py ADDED
@@ -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())
rakomi_cli/py.typed ADDED
File without changes
@@ -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,8 @@
1
+ rakomi_cli/__init__.py,sha256=IG8yPep9WntFwaHmPfcC3T6cCFOrmYTz0fN3-sbFfzE,91
2
+ rakomi_cli/discover.py,sha256=LVlyMRldQdTaY4qJMeQaV_yZptiRZChj4Lq8A1Sa_HU,1543
3
+ rakomi_cli/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ rakomi_cli-0.1.0.dist-info/METADATA,sha256=vOv4UG1Ce5C8oujakerGKDlQnVovXAX9TFMpejdRThY,2147
5
+ rakomi_cli-0.1.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
6
+ rakomi_cli-0.1.0.dist-info/entry_points.txt,sha256=yW4rsqeHk7EJou_Hqsc513ys6nDnd7E_OX2j-NMXRBQ,61
7
+ rakomi_cli-0.1.0.dist-info/licenses/LICENSE,sha256=zhT57pzViqMkFauNrDBqP_jY8vMGQl7Y-77jRfss1LQ,1075
8
+ rakomi_cli-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ rakomi-discover = rakomi_cli.discover:main
@@ -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.