blockmachine 0.8.4__tar.gz → 0.9.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.
- {blockmachine-0.8.4 → blockmachine-0.9.0}/PKG-INFO +1 -1
- {blockmachine-0.8.4 → blockmachine-0.9.0}/blockmachine.egg-info/PKG-INFO +1 -1
- {blockmachine-0.8.4 → blockmachine-0.9.0}/commands/auth.py +2 -2
- {blockmachine-0.8.4 → blockmachine-0.9.0}/commands/validator.py +1 -1
- {blockmachine-0.8.4 → blockmachine-0.9.0}/config.py +1 -1
- {blockmachine-0.8.4 → blockmachine-0.9.0}/pyproject.toml +1 -1
- {blockmachine-0.8.4 → blockmachine-0.9.0}/settings.py +7 -1
- {blockmachine-0.8.4 → blockmachine-0.9.0}/tests/test_cli_config.py +3 -2
- {blockmachine-0.8.4 → blockmachine-0.9.0}/__init__.py +0 -0
- {blockmachine-0.8.4 → blockmachine-0.9.0}/auth_config.py +0 -0
- {blockmachine-0.8.4 → blockmachine-0.9.0}/blockmachine.egg-info/SOURCES.txt +0 -0
- {blockmachine-0.8.4 → blockmachine-0.9.0}/blockmachine.egg-info/dependency_links.txt +0 -0
- {blockmachine-0.8.4 → blockmachine-0.9.0}/blockmachine.egg-info/entry_points.txt +0 -0
- {blockmachine-0.8.4 → blockmachine-0.9.0}/blockmachine.egg-info/requires.txt +0 -0
- {blockmachine-0.8.4 → blockmachine-0.9.0}/blockmachine.egg-info/top_level.txt +0 -0
- {blockmachine-0.8.4 → blockmachine-0.9.0}/client.py +0 -0
- {blockmachine-0.8.4 → blockmachine-0.9.0}/commands/__init__.py +0 -0
- {blockmachine-0.8.4 → blockmachine-0.9.0}/commands/leaderboard.py +0 -0
- {blockmachine-0.8.4 → blockmachine-0.9.0}/commands/miner.py +0 -0
- {blockmachine-0.8.4 → blockmachine-0.9.0}/endpoints.py +0 -0
- {blockmachine-0.8.4 → blockmachine-0.9.0}/main.py +0 -0
- {blockmachine-0.8.4 → blockmachine-0.9.0}/setup.cfg +0 -0
- {blockmachine-0.8.4 → blockmachine-0.9.0}/testing.py +0 -0
- {blockmachine-0.8.4 → blockmachine-0.9.0}/tests/test_cli_endpoints_and_testing.py +0 -0
- {blockmachine-0.8.4 → blockmachine-0.9.0}/tests/test_leaderboard_cli.py +0 -0
- {blockmachine-0.8.4 → blockmachine-0.9.0}/utils.py +0 -0
|
@@ -26,7 +26,7 @@ def device_login(
|
|
|
26
26
|
|
|
27
27
|
Raises typer.Exit(1) on failure.
|
|
28
28
|
"""
|
|
29
|
-
client_id = client_id or settings.
|
|
29
|
+
client_id = client_id or settings.client_id()
|
|
30
30
|
auth_url = auth_url or settings.auth_url()
|
|
31
31
|
|
|
32
32
|
try:
|
|
@@ -157,7 +157,7 @@ def save_token(
|
|
|
157
157
|
|
|
158
158
|
config = load_config()
|
|
159
159
|
config.set_role(role)
|
|
160
|
-
config.client_id = client_id or settings.
|
|
160
|
+
config.client_id = client_id or settings.client_id()
|
|
161
161
|
config.auth_url = auth_url or settings.auth_url()
|
|
162
162
|
config.api_url = api_url or settings.api_url()
|
|
163
163
|
config.access_token = access_token
|
|
@@ -20,7 +20,7 @@ def login(
|
|
|
20
20
|
),
|
|
21
21
|
) -> None:
|
|
22
22
|
"""Login with validator scopes for the verification gateway."""
|
|
23
|
-
resolved_client_id = client_id or settings.
|
|
23
|
+
resolved_client_id = client_id or settings.client_id()
|
|
24
24
|
resolved_auth_url = auth_url or settings.auth_url()
|
|
25
25
|
|
|
26
26
|
token_data = device_login(
|
|
@@ -126,7 +126,7 @@ class CLIConfig:
|
|
|
126
126
|
|
|
127
127
|
@property
|
|
128
128
|
def client_id(self) -> str:
|
|
129
|
-
return self._net().client_id or settings.
|
|
129
|
+
return self._net().client_id or settings.client_id()
|
|
130
130
|
|
|
131
131
|
@client_id.setter
|
|
132
132
|
def client_id(self, value: Optional[str]) -> None:
|
|
@@ -15,18 +15,21 @@ class NetworkConfig:
|
|
|
15
15
|
auth_url: str
|
|
16
16
|
api_url: str
|
|
17
17
|
netuid: int
|
|
18
|
+
client_id: str
|
|
18
19
|
|
|
19
20
|
|
|
20
21
|
MAINNET = NetworkConfig(
|
|
21
22
|
auth_url="https://auth.taostats.io",
|
|
22
23
|
api_url="https://api.blockmachine.io",
|
|
23
24
|
netuid=19,
|
|
25
|
+
client_id="35cc50f5-6bf5-432b-8892-84c3b0e856b2",
|
|
24
26
|
)
|
|
25
27
|
|
|
26
28
|
TESTNET = NetworkConfig(
|
|
27
29
|
auth_url="https://test-auth.taostats.io",
|
|
28
30
|
api_url="https://testnet-registry.blockmachine.io",
|
|
29
31
|
netuid=417,
|
|
32
|
+
client_id="07f5c729-5ca7-412a-b5e7-4966e132548e",
|
|
30
33
|
)
|
|
31
34
|
|
|
32
35
|
# Active network — set by --testnet flag via main.py callback
|
|
@@ -57,10 +60,13 @@ def netuid() -> int:
|
|
|
57
60
|
return _network.netuid
|
|
58
61
|
|
|
59
62
|
|
|
60
|
-
CLIENT_ID = os.environ.get("BM_CLIENT_ID", "07f5c729-5ca7-412a-b5e7-4966e132548e")
|
|
61
63
|
AUDIENCE = "bittensor-apps"
|
|
62
64
|
|
|
63
65
|
|
|
66
|
+
def client_id() -> str:
|
|
67
|
+
return os.environ.get("BM_CLIENT_ID", _network.client_id)
|
|
68
|
+
|
|
69
|
+
|
|
64
70
|
def jwks_uri() -> str:
|
|
65
71
|
return f"{auth_url()}/.well-known/jwks.json"
|
|
66
72
|
|
|
@@ -71,7 +71,7 @@ class TestSettings:
|
|
|
71
71
|
s.set_network(s.MAINNET)
|
|
72
72
|
assert s.auth_url() == "https://auth.taostats.io"
|
|
73
73
|
assert s.api_url() == "https://api.blockmachine.io"
|
|
74
|
-
assert s.
|
|
74
|
+
assert s.client_id() == "35cc50f5-6bf5-432b-8892-84c3b0e856b2"
|
|
75
75
|
assert s.jwks_uri() == ("https://auth.taostats.io/.well-known/jwks.json")
|
|
76
76
|
assert s.miner_scopes() == ["subnet:19:miner"]
|
|
77
77
|
assert s.validator_scopes() == ["subnet:19:validator"]
|
|
@@ -101,7 +101,8 @@ class TestSettings:
|
|
|
101
101
|
|
|
102
102
|
assert s.auth_url() == "https://custom-auth.example.com"
|
|
103
103
|
assert s.api_url() == "https://custom-api.example.com"
|
|
104
|
-
|
|
104
|
+
s.set_network(s.MAINNET)
|
|
105
|
+
assert s.client_id() == "custom-client-id"
|
|
105
106
|
assert s.jwks_uri() == (
|
|
106
107
|
"https://custom-auth.example.com/.well-known/jwks.json"
|
|
107
108
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|