stackit-core 0.0.1a0__tar.gz → 0.0.1a6__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.
- {stackit_core-0.0.1a0 → stackit_core-0.0.1a6}/PKG-INFO +7 -29
- stackit_core-0.0.1a6/README.md +13 -0
- {stackit_core-0.0.1a0 → stackit_core-0.0.1a6}/pyproject.toml +44 -36
- {stackit_core-0.0.1a0 → stackit_core-0.0.1a6}/src/stackit/core/authorization.py +19 -12
- stackit_core-0.0.1a0/README.md +0 -35
- {stackit_core-0.0.1a0 → stackit_core-0.0.1a6}/LICENSE +0 -0
- {stackit_core-0.0.1a0 → stackit_core-0.0.1a6}/src/stackit/core/__init__.py +0 -0
- {stackit_core-0.0.1a0 → stackit_core-0.0.1a6}/src/stackit/core/auth_methods/key_auth.py +0 -0
- {stackit_core-0.0.1a0 → stackit_core-0.0.1a6}/src/stackit/core/auth_methods/token_auth.py +0 -0
- {stackit_core-0.0.1a0 → stackit_core-0.0.1a6}/src/stackit/core/configuration.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: stackit-core
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.1a6
|
|
4
4
|
Summary: Core functionality for the STACKIT SDK for Python
|
|
5
5
|
Author: STACKIT Developer Tools
|
|
6
6
|
Author-email: developer-tools@stackit.cloud
|
|
@@ -14,11 +14,11 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
14
14
|
Classifier: Programming Language :: Python :: 3.11
|
|
15
15
|
Classifier: Programming Language :: Python :: 3.12
|
|
16
16
|
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
-
Requires-Dist: cryptography (>=43.0.1
|
|
18
|
-
Requires-Dist: pydantic (>=2.9.2
|
|
19
|
-
Requires-Dist: pyjwt (>=2.9.0
|
|
20
|
-
Requires-Dist: requests (>=2.32.3
|
|
21
|
-
Requires-Dist: urllib3 (>=2.2.3
|
|
17
|
+
Requires-Dist: cryptography (>=43.0.1)
|
|
18
|
+
Requires-Dist: pydantic (>=2.9.2)
|
|
19
|
+
Requires-Dist: pyjwt (>=2.9.0)
|
|
20
|
+
Requires-Dist: requests (>=2.32.3)
|
|
21
|
+
Requires-Dist: urllib3 (>=2.2.3)
|
|
22
22
|
Description-Content-Type: text/markdown
|
|
23
23
|
|
|
24
24
|
> ⓘ INFO: The STACKIT Python SDK is in beta and in active development.
|
|
@@ -31,29 +31,7 @@ Description-Content-Type: text/markdown
|
|
|
31
31
|
The STACKIT Python core package consists of core functionality which is needed
|
|
32
32
|
to use the [STACKIT Python SDK](https://github.com/stackitcloud/stackit-sdk-python).
|
|
33
33
|
|
|
34
|
-
## Compilation and Installation
|
|
35
|
-
|
|
36
|
-
You can install this package by running the following command from the root of the this repository:
|
|
37
|
-
```bash
|
|
38
|
-
make install
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
### Development Mode
|
|
42
|
-
|
|
43
|
-
When developing, you can use a feature of `pip` called _Editable Installs_,
|
|
44
|
-
which installs the local files like a package so you can test features without
|
|
45
|
-
reinstalling the package every time.
|
|
46
|
-
This package also defines additional depencies for development, like testing and linting.
|
|
47
|
-
It requires [`poetry`](https://python-poetry.org/) to be installed. An installation guide can be found [here](https://python-poetry.org/docs/#installation).
|
|
48
|
-
|
|
49
|
-
After installing `poetry` execute the following in the root folder of this repository:
|
|
50
|
-
|
|
51
|
-
```bash
|
|
52
|
-
make install-dev
|
|
53
|
-
```
|
|
54
|
-
|
|
55
34
|
## Usage
|
|
56
35
|
|
|
57
|
-
The core package does nothing on its own and must be used in conjunction with
|
|
58
|
-
the [STACKIT Python SDK](https://github.com/stackitcloud/stackit-sdk-python).
|
|
36
|
+
The core package does nothing on its own and must be used in conjunction with the services of the [STACKIT Python SDK](https://github.com/stackitcloud/stackit-sdk-python).
|
|
59
37
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
> ⓘ INFO: The STACKIT Python SDK is in beta and in active development.
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
# STACKIT Python SDK Core
|
|
5
|
+
|
|
6
|
+
## Introduction
|
|
7
|
+
|
|
8
|
+
The STACKIT Python core package consists of core functionality which is needed
|
|
9
|
+
to use the [STACKIT Python SDK](https://github.com/stackitcloud/stackit-sdk-python).
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
The core package does nothing on its own and must be used in conjunction with the services of the [STACKIT Python SDK](https://github.com/stackitcloud/stackit-sdk-python).
|
|
@@ -1,59 +1,54 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "stackit-core"
|
|
3
|
-
version = "
|
|
4
|
-
authors = [
|
|
5
|
-
"STACKIT Developer Tools <developer-tools@stackit.cloud>",
|
|
6
|
-
]
|
|
3
|
+
version = "v0.0.1a6"
|
|
4
|
+
authors = ["STACKIT Developer Tools <developer-tools@stackit.cloud>"]
|
|
7
5
|
description = "Core functionality for the STACKIT SDK for Python"
|
|
8
6
|
readme = "README.md"
|
|
9
7
|
classifiers = [
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
]
|
|
14
|
-
packages = [
|
|
15
|
-
{ include = "stackit", from="src" }
|
|
8
|
+
"Programming Language :: Python :: 3",
|
|
9
|
+
"License :: OSI Approved :: Apache Software License",
|
|
10
|
+
"Operating System :: OS Independent",
|
|
16
11
|
]
|
|
12
|
+
packages = [{ include = "stackit", from = "src" }]
|
|
17
13
|
|
|
18
14
|
|
|
19
15
|
[tool.poetry.dependencies]
|
|
20
16
|
python = ">=3.8,<4.0"
|
|
21
|
-
pyjwt = "
|
|
22
|
-
pydantic = "
|
|
23
|
-
urllib3 = "
|
|
24
|
-
cryptography = "
|
|
25
|
-
requests = "
|
|
17
|
+
pyjwt = ">=2.9.0"
|
|
18
|
+
pydantic = ">=2.9.2"
|
|
19
|
+
urllib3 = ">=2.2.3"
|
|
20
|
+
cryptography = ">=43.0.1"
|
|
21
|
+
requests = ">=2.32.3"
|
|
26
22
|
|
|
27
23
|
|
|
28
24
|
[tool.poetry.group.dev.dependencies]
|
|
29
|
-
black = "24.8.0"
|
|
30
|
-
pytest = "
|
|
31
|
-
flake8 =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
flake8-
|
|
36
|
-
flake8-
|
|
37
|
-
flake8-
|
|
38
|
-
flake8-
|
|
39
|
-
|
|
40
|
-
|
|
25
|
+
black = ">=24.8.0"
|
|
26
|
+
pytest = ">=8.3.3"
|
|
27
|
+
flake8 = [
|
|
28
|
+
{ version = ">=5.0.3", python = "<3.12" },
|
|
29
|
+
{ version = ">=6.0.1", python = ">=3.12" },
|
|
30
|
+
]
|
|
31
|
+
flake8-black = ">=0.3.6"
|
|
32
|
+
flake8-pyproject = ">=1.2.3"
|
|
33
|
+
flake8-quotes = ">=3.4.0"
|
|
34
|
+
flake8-bandit = ">=4.1.1"
|
|
35
|
+
flake8-bugbear = ">=23.1.14"
|
|
36
|
+
flake8-eradicate = ">=1.5.0"
|
|
37
|
+
flake8-eol = ">=0.0.8"
|
|
38
|
+
autoimport = ">=1.6.1"
|
|
39
|
+
isort = ">=5.13.2"
|
|
41
40
|
|
|
42
41
|
[project.urls]
|
|
43
|
-
Homepage = "https://github.com/stackitcloud/stackit-sdk-python
|
|
44
|
-
Issues = "https://github.com/stackitcloud/stackit-sdk-python
|
|
42
|
+
Homepage = "https://github.com/stackitcloud/stackit-sdk-python"
|
|
43
|
+
Issues = "https://github.com/stackitcloud/stackit-sdk-python/issues"
|
|
45
44
|
|
|
46
45
|
[build-system]
|
|
47
46
|
requires = ["setuptools", "poetry-core"]
|
|
48
47
|
build-backend = "poetry.core.masonry.api"
|
|
49
48
|
|
|
50
49
|
[tool.pytest.ini_options]
|
|
51
|
-
pythonpath = [
|
|
52
|
-
|
|
53
|
-
]
|
|
54
|
-
testpaths = [
|
|
55
|
-
"tests"
|
|
56
|
-
]
|
|
50
|
+
pythonpath = ["src"]
|
|
51
|
+
testpaths = ["tests"]
|
|
57
52
|
|
|
58
53
|
[tool.black]
|
|
59
54
|
line-length = 120
|
|
@@ -80,7 +75,20 @@ exclude = """
|
|
|
80
75
|
profile = 'black'
|
|
81
76
|
|
|
82
77
|
[tool.flake8]
|
|
83
|
-
exclude= [
|
|
78
|
+
exclude = [
|
|
79
|
+
".eggs",
|
|
80
|
+
".git",
|
|
81
|
+
".hg",
|
|
82
|
+
".mypy_cache",
|
|
83
|
+
".tox",
|
|
84
|
+
".venv",
|
|
85
|
+
".devcontainer",
|
|
86
|
+
"venv",
|
|
87
|
+
"_build",
|
|
88
|
+
"buck-out",
|
|
89
|
+
"build",
|
|
90
|
+
"dist",
|
|
91
|
+
]
|
|
84
92
|
statistics = true
|
|
85
93
|
show-source = false
|
|
86
94
|
max-line-length = 120
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import json
|
|
2
2
|
from dataclasses import dataclass
|
|
3
3
|
from pathlib import Path
|
|
4
|
-
from typing import
|
|
4
|
+
from typing import Optional
|
|
5
5
|
|
|
6
6
|
from requests.auth import AuthBase
|
|
7
7
|
|
|
@@ -22,6 +22,7 @@ class Credentials:
|
|
|
22
22
|
STACKIT_SERVICE_ACCOUNT_TOKEN: str = None,
|
|
23
23
|
STACKIT_SERVICE_ACCOUNT_KEY_PATH: str = None,
|
|
24
24
|
STACKIT_PRIVATE_KEY_PATH: str = None,
|
|
25
|
+
**kwargs,
|
|
25
26
|
):
|
|
26
27
|
self.service_account_mail = STACKIT_SERVICE_ACCOUNT_EMAIL
|
|
27
28
|
self.service_account_token = STACKIT_SERVICE_ACCOUNT_TOKEN
|
|
@@ -29,10 +30,6 @@ class Credentials:
|
|
|
29
30
|
self.private_key_path = STACKIT_PRIVATE_KEY_PATH
|
|
30
31
|
|
|
31
32
|
|
|
32
|
-
def either_this_or_that(this: Any, that: Any) -> Optional[Any]:
|
|
33
|
-
return this if this else that
|
|
34
|
-
|
|
35
|
-
|
|
36
33
|
class Authorization:
|
|
37
34
|
DEFAULT_CREDENTIALS_FILE_PATH = ".stackit/credentials.json"
|
|
38
35
|
service_account_mail: Optional[str] = None
|
|
@@ -45,16 +42,26 @@ class Authorization:
|
|
|
45
42
|
|
|
46
43
|
def __init__(self, configuration: Configuration):
|
|
47
44
|
credentials = self.__read_credentials_file(configuration.credentials_file_path)
|
|
48
|
-
self.service_account_mail =
|
|
49
|
-
configuration.service_account_mail
|
|
45
|
+
self.service_account_mail = (
|
|
46
|
+
configuration.service_account_mail
|
|
47
|
+
if configuration.service_account_mail is not None
|
|
48
|
+
else credentials.service_account_mail
|
|
49
|
+
)
|
|
50
|
+
self.service_account_token = (
|
|
51
|
+
configuration.service_account_token
|
|
52
|
+
if configuration.service_account_token is not None
|
|
53
|
+
else credentials.service_account_token
|
|
50
54
|
)
|
|
51
|
-
self.
|
|
52
|
-
configuration.
|
|
55
|
+
self.service_account_key_path = (
|
|
56
|
+
configuration.service_account_key_path
|
|
57
|
+
if configuration.service_account_key_path is not None
|
|
58
|
+
else credentials.service_account_key_path
|
|
53
59
|
)
|
|
54
|
-
self.
|
|
55
|
-
configuration.
|
|
60
|
+
self.private_key_path = (
|
|
61
|
+
configuration.private_key_path
|
|
62
|
+
if configuration.private_key_path is not None
|
|
63
|
+
else credentials.private_key_path
|
|
56
64
|
)
|
|
57
|
-
self.private_key_path = either_this_or_that(configuration.private_key_path, credentials.private_key_path)
|
|
58
65
|
self.auth_method = configuration.custom_auth
|
|
59
66
|
self.token_endpoint = configuration.token_endpoint
|
|
60
67
|
self.__read_keys()
|
stackit_core-0.0.1a0/README.md
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
> ⓘ INFO: The STACKIT Python SDK is in beta and in active development.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
# STACKIT Python SDK Core
|
|
5
|
-
|
|
6
|
-
## Introduction
|
|
7
|
-
|
|
8
|
-
The STACKIT Python core package consists of core functionality which is needed
|
|
9
|
-
to use the [STACKIT Python SDK](https://github.com/stackitcloud/stackit-sdk-python).
|
|
10
|
-
|
|
11
|
-
## Compilation and Installation
|
|
12
|
-
|
|
13
|
-
You can install this package by running the following command from the root of the this repository:
|
|
14
|
-
```bash
|
|
15
|
-
make install
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
### Development Mode
|
|
19
|
-
|
|
20
|
-
When developing, you can use a feature of `pip` called _Editable Installs_,
|
|
21
|
-
which installs the local files like a package so you can test features without
|
|
22
|
-
reinstalling the package every time.
|
|
23
|
-
This package also defines additional depencies for development, like testing and linting.
|
|
24
|
-
It requires [`poetry`](https://python-poetry.org/) to be installed. An installation guide can be found [here](https://python-poetry.org/docs/#installation).
|
|
25
|
-
|
|
26
|
-
After installing `poetry` execute the following in the root folder of this repository:
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
make install-dev
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Usage
|
|
33
|
-
|
|
34
|
-
The core package does nothing on its own and must be used in conjunction with
|
|
35
|
-
the [STACKIT Python SDK](https://github.com/stackitcloud/stackit-sdk-python).
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|