dataspring-cli 0.5.1__tar.gz → 0.6.1__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.
- {dataspring_cli-0.5.1 → dataspring_cli-0.6.1}/PKG-INFO +1 -2
- {dataspring_cli-0.5.1 → dataspring_cli-0.6.1}/README.md +0 -1
- {dataspring_cli-0.5.1 → dataspring_cli-0.6.1}/cli/auth.py +158 -74
- {dataspring_cli-0.5.1 → dataspring_cli-0.6.1}/cli/bundled_manifest.py +8 -5
- {dataspring_cli-0.5.1 → dataspring_cli-0.6.1}/cli/contract.py +213 -53
- {dataspring_cli-0.5.1 → dataspring_cli-0.6.1}/cli/forspring.py +52 -14
- {dataspring_cli-0.5.1 → dataspring_cli-0.6.1}/cli/generated.py +98 -20
- {dataspring_cli-0.5.1 → dataspring_cli-0.6.1}/cli/main.py +692 -168
- {dataspring_cli-0.5.1 → dataspring_cli-0.6.1}/cli/output.py +1 -1
- {dataspring_cli-0.5.1 → dataspring_cli-0.6.1}/cli/refusals.py +58 -11
- {dataspring_cli-0.5.1 → dataspring_cli-0.6.1}/cli/skills_commands.py +5 -3
- {dataspring_cli-0.5.1 → dataspring_cli-0.6.1}/cli/skilltree.py +1 -3
- {dataspring_cli-0.5.1 → dataspring_cli-0.6.1}/cli/upgrade.py +6 -3
- {dataspring_cli-0.5.1 → dataspring_cli-0.6.1}/cli/version.py +25 -11
- {dataspring_cli-0.5.1 → dataspring_cli-0.6.1}/pyproject.toml +11 -1
- {dataspring_cli-0.5.1 → dataspring_cli-0.6.1}/settings.py +20 -0
- {dataspring_cli-0.5.1 → dataspring_cli-0.6.1}/skills/dataspring-author/SKILL.md +34 -11
- {dataspring_cli-0.5.1 → dataspring_cli-0.6.1}/skills/dataspring-consume/SKILL.md +2 -2
- {dataspring_cli-0.5.1 → dataspring_cli-0.6.1}/.gitignore +0 -0
- {dataspring_cli-0.5.1 → dataspring_cli-0.6.1}/cli/__init__.py +0 -0
- {dataspring_cli-0.5.1 → dataspring_cli-0.6.1}/cli/runtime.py +0 -0
- {dataspring_cli-0.5.1 → dataspring_cli-0.6.1}/cli/transport.py +0 -0
- {dataspring_cli-0.5.1 → dataspring_cli-0.6.1}/hatch_build.py +0 -0
- {dataspring_cli-0.5.1 → dataspring_cli-0.6.1}/skills/dataspring-correct/SKILL.md +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: dataspring-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.1
|
|
4
4
|
Summary: DataSpring CLI - Query metrics and manage dashboards from the terminal
|
|
5
5
|
Project-URL: Homepage, https://dataspring.app
|
|
6
6
|
Project-URL: Documentation, https://dataspring.app/docs
|
|
@@ -202,5 +202,4 @@ uv run pytest tests/ -v
|
|
|
202
202
|
| Variable | Description |
|
|
203
203
|
|----------|-------------|
|
|
204
204
|
| `FIRESTORE_EMULATOR_HOST` | Use Firestore emulator |
|
|
205
|
-
| `FIREBASE_AUTH_EMULATOR_HOST` | Use Auth emulator |
|
|
206
205
|
| `ENV` | Environment: `production`, `development`, `test` |
|
|
@@ -170,5 +170,4 @@ uv run pytest tests/ -v
|
|
|
170
170
|
| Variable | Description |
|
|
171
171
|
|----------|-------------|
|
|
172
172
|
| `FIRESTORE_EMULATOR_HOST` | Use Firestore emulator |
|
|
173
|
-
| `FIREBASE_AUTH_EMULATOR_HOST` | Use Auth emulator |
|
|
174
173
|
| `ENV` | Environment: `production`, `development`, `test` |
|
|
@@ -168,8 +168,9 @@ class Refused(AuthenticationError):
|
|
|
168
168
|
``orgs`` (``[{org, org_name}]``) rides along in the JSON body of
|
|
169
169
|
``org_required`` and ``not_signed_in``, as cli-kit's refusals carry it."""
|
|
170
170
|
|
|
171
|
-
def __init__(
|
|
172
|
-
|
|
171
|
+
def __init__(
|
|
172
|
+
self, reason: str, note: str, fix: str | None = None, *, org: str | None = None, orgs: list[dict] | None = None
|
|
173
|
+
):
|
|
173
174
|
self.refusal = Refusal(reason, note, fix, org=org)
|
|
174
175
|
self.orgs = orgs
|
|
175
176
|
super().__init__(self.refusal.message)
|
|
@@ -371,8 +372,11 @@ class CLIAuthManager:
|
|
|
371
372
|
"""DataSpring's sign-ins that this account issued, by org: a token is
|
|
372
373
|
only ever sent back to its own issuer (``FORSPRING_ACCOUNT_URL``)."""
|
|
373
374
|
issuer = self.account()
|
|
374
|
-
return {
|
|
375
|
-
|
|
375
|
+
return {
|
|
376
|
+
p["org"]: p
|
|
377
|
+
for p in self.account_store().list(forspring.PRODUCT)
|
|
378
|
+
if p.get("issuer") == issuer and isinstance(p.get("org"), str)
|
|
379
|
+
}
|
|
376
380
|
|
|
377
381
|
def signed_in(self) -> list[dict]:
|
|
378
382
|
"""Every org there is a credential for here, ``[{org, org_name}]``,
|
|
@@ -399,7 +403,9 @@ class CLIAuthManager:
|
|
|
399
403
|
current = store.tokens(p)
|
|
400
404
|
if current is None:
|
|
401
405
|
where = "credentials file" if p.get("storage") == "file" else "keychain"
|
|
402
|
-
raise Refused(
|
|
406
|
+
raise Refused(
|
|
407
|
+
"not_signed_in", f"The stored sign-in to {org} is gone from the {where}.", f"Run '{LOGIN}'.", org=org
|
|
408
|
+
)
|
|
403
409
|
if p.get("access_expires_at", 0) - forspring.REFRESH_MARGIN_MS > self.clock():
|
|
404
410
|
return current["access_token"], p
|
|
405
411
|
|
|
@@ -422,11 +428,15 @@ class CLIAuthManager:
|
|
|
422
428
|
raise Refused(reason, note, fix, org=org)
|
|
423
429
|
now = self.clock()
|
|
424
430
|
meta = {k: v for k, v in latest.items() if k not in ("storage", "access_token", "refresh_token")}
|
|
425
|
-
meta.update(
|
|
426
|
-
|
|
427
|
-
|
|
431
|
+
meta.update(
|
|
432
|
+
org_name=answer["org_name"] or latest.get("org_name"),
|
|
433
|
+
resource=answer["resource"] or latest.get("resource"),
|
|
434
|
+
access_expires_at=now + int(answer["expires_in"] * 1000),
|
|
435
|
+
)
|
|
428
436
|
# The rotated pair is stored before the new token is used.
|
|
429
|
-
nxt = store.put_locked(
|
|
437
|
+
nxt = store.put_locked(
|
|
438
|
+
meta, {"access_token": answer["access_token"], "refresh_token": answer["refresh_token"]}
|
|
439
|
+
)
|
|
430
440
|
return answer["access_token"], nxt
|
|
431
441
|
|
|
432
442
|
# -- which org, which credential (hub D-99, cli-kit credentialFor) -----
|
|
@@ -476,7 +486,12 @@ class CLIAuthManager:
|
|
|
476
486
|
return self._legacy(org, legacy[org], org_from, path)
|
|
477
487
|
raise
|
|
478
488
|
return ResolvedOrg(
|
|
479
|
-
token,
|
|
489
|
+
token,
|
|
490
|
+
org,
|
|
491
|
+
org_from,
|
|
492
|
+
path,
|
|
493
|
+
kind="account",
|
|
494
|
+
source="account",
|
|
480
495
|
org_name=profile.get("org_name") or org,
|
|
481
496
|
expires_at=forspring.iso(int(profile["access_expires_at"])),
|
|
482
497
|
grant_expires_at=forspring.iso(int(profile["grant_expires_at"])),
|
|
@@ -495,10 +510,16 @@ class CLIAuthManager:
|
|
|
495
510
|
f"Not signed in to '{org}' on this machine (named by {where}); "
|
|
496
511
|
f"signed in to: {', '.join(o['org'] for o in orgs)}.",
|
|
497
512
|
f"Run '{LOGIN}' and approve {org}, or name one of the orgs signed in to.",
|
|
498
|
-
org=org,
|
|
513
|
+
org=org,
|
|
514
|
+
orgs=orgs,
|
|
499
515
|
)
|
|
500
|
-
raise Refused(
|
|
501
|
-
|
|
516
|
+
raise Refused(
|
|
517
|
+
"not_signed_in",
|
|
518
|
+
f"Not signed in to DataSpring (the org '{org}' was named by {where}).",
|
|
519
|
+
f"Run '{LOGIN}' (or set DATASPRING_API_KEY).",
|
|
520
|
+
org=org,
|
|
521
|
+
orgs=[],
|
|
522
|
+
)
|
|
502
523
|
if len(orgs) == 1:
|
|
503
524
|
return use(orgs[0]["org"], FROM_ONLY, None)
|
|
504
525
|
if orgs:
|
|
@@ -513,8 +534,9 @@ class CLIAuthManager:
|
|
|
513
534
|
|
|
514
535
|
@staticmethod
|
|
515
536
|
def _legacy(org: str, p: dict, org_from: str, path: str | None) -> ResolvedOrg:
|
|
516
|
-
return ResolvedOrg(
|
|
517
|
-
|
|
537
|
+
return ResolvedOrg(
|
|
538
|
+
p["api_key"], org, org_from, path, kind="legacy", source=LEGACY_FROM, org_name=p.get("org_name") or org
|
|
539
|
+
)
|
|
518
540
|
|
|
519
541
|
def _key_org(self, key: str) -> str | None:
|
|
520
542
|
"""The org a key not stored here belongs to, as the server says.
|
|
@@ -542,8 +564,7 @@ class CLIAuthManager:
|
|
|
542
564
|
|
|
543
565
|
# -- login (cli-kit login) ---------------------------------------------
|
|
544
566
|
|
|
545
|
-
async def login(self, *, open_browser: bool = True, org: str | None = None,
|
|
546
|
-
device_name: str | None = None) -> dict:
|
|
567
|
+
async def login(self, *, open_browser: bool = True, org: str | None = None, device_name: str | None = None) -> dict:
|
|
547
568
|
"""The device flow at the Forspring account: print a code and a link,
|
|
548
569
|
wait for the approval, store one profile per org ticked.
|
|
549
570
|
|
|
@@ -574,17 +595,21 @@ class CLIAuthManager:
|
|
|
574
595
|
opened = bool(webbrowser.open(started["verification_uri_complete"]))
|
|
575
596
|
except Exception:
|
|
576
597
|
opened = False # no browser here: the link below is enough
|
|
577
|
-
_say(
|
|
578
|
-
""
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
598
|
+
_say(
|
|
599
|
+
"\n".join(
|
|
600
|
+
[
|
|
601
|
+
"",
|
|
602
|
+
f" Your code: {started['user_code']}",
|
|
603
|
+
"",
|
|
604
|
+
" A browser window should open. If it did not, go to:" if opened else " On any device, open:",
|
|
605
|
+
f" {started['verification_uri_complete']}",
|
|
606
|
+
f" (or {started['verification_uri']} and enter the code)",
|
|
607
|
+
"",
|
|
608
|
+
f" Waiting for you to approve {forspring.PRODUCT_NAME} CLI on {device_name} at your Forspring account...",
|
|
609
|
+
"",
|
|
610
|
+
]
|
|
611
|
+
)
|
|
612
|
+
)
|
|
588
613
|
|
|
589
614
|
interval = max(1.0, float(started["interval"]))
|
|
590
615
|
deadline = self.clock() + int(started["expires_in"] * 1000)
|
|
@@ -619,21 +644,26 @@ class CLIAuthManager:
|
|
|
619
644
|
before = store.get(forspring.PRODUCT, t["org"])
|
|
620
645
|
# Read the old refresh token before the new one overwrites it (in the keychain, too).
|
|
621
646
|
old = store.tokens(before) if before is not None and before.get("issuer") == account else None
|
|
622
|
-
p = store.put_locked(
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
647
|
+
p = store.put_locked(
|
|
648
|
+
{
|
|
649
|
+
"product": forspring.PRODUCT,
|
|
650
|
+
"org": t["org"],
|
|
651
|
+
"org_name": t["org_name"],
|
|
652
|
+
"resource": t["resource"],
|
|
653
|
+
"client_id": forspring.CLIENT_ID,
|
|
654
|
+
"issuer": account,
|
|
655
|
+
"access_expires_at": now + int(t["expires_in"] * 1000),
|
|
656
|
+
"grant_expires_at": now + forspring.GRANT_TTL_MS,
|
|
657
|
+
"created_at": created,
|
|
658
|
+
"device_name": device_name,
|
|
659
|
+
},
|
|
660
|
+
{"access_token": t["access_token"], "refresh_token": t["refresh_token"]},
|
|
661
|
+
)
|
|
634
662
|
if old is not None:
|
|
635
663
|
replaced.append(old["refresh_token"])
|
|
636
|
-
orgs.append(
|
|
664
|
+
orgs.append(
|
|
665
|
+
{"org": t["org"], "org_name": t["org_name"], "resource": t["resource"], "storage": p["storage"]}
|
|
666
|
+
)
|
|
637
667
|
# Signing in again leaves the last grant alive, in no file, acting as you: end it.
|
|
638
668
|
for token in replaced:
|
|
639
669
|
forspring.revoke(http, account, forspring.CLIENT_ID, token)
|
|
@@ -641,8 +671,13 @@ class CLIAuthManager:
|
|
|
641
671
|
note = f"Signed in to {names}."
|
|
642
672
|
if len(orgs) > 1:
|
|
643
673
|
note += f" Name the org per command: {NAME_AN_ORG}."
|
|
644
|
-
return {
|
|
645
|
-
|
|
674
|
+
return {
|
|
675
|
+
"ok": True,
|
|
676
|
+
"product": forspring.PRODUCT,
|
|
677
|
+
"orgs": orgs,
|
|
678
|
+
"expires_at": forspring.iso(now + forspring.GRANT_TTL_MS),
|
|
679
|
+
"note": note,
|
|
680
|
+
}
|
|
646
681
|
|
|
647
682
|
async def store_key(self, key: str) -> "UserContext":
|
|
648
683
|
"""``--key``: keep a key you already have (a ``ds_`` key, or the
|
|
@@ -650,7 +685,11 @@ class CLIAuthManager:
|
|
|
650
685
|
Kept with the legacy profiles in ``~/.dataspring/credentials.json``."""
|
|
651
686
|
me = await self._me(key)
|
|
652
687
|
data = self._load()
|
|
653
|
-
self._add_profile(
|
|
688
|
+
self._add_profile(
|
|
689
|
+
data,
|
|
690
|
+
{"api_key": key, "key_id": None, "org_id": me["org_id"], "org_name": me.get("org_name")},
|
|
691
|
+
me.get("email"),
|
|
692
|
+
)
|
|
654
693
|
self._save(data)
|
|
655
694
|
return self._context(me)
|
|
656
695
|
|
|
@@ -703,20 +742,28 @@ class CLIAuthManager:
|
|
|
703
742
|
if r.status_code == 403:
|
|
704
743
|
text = str(detail or "Access denied")
|
|
705
744
|
raise Refused(
|
|
706
|
-
classify(text) or "not_a_member",
|
|
707
|
-
|
|
708
|
-
f"or run '{LOGIN}' again.",
|
|
745
|
+
classify(text) or "not_a_member",
|
|
746
|
+
text,
|
|
747
|
+
f"An owner or admin of the org fixes this at https://account.forspring.ai; or run '{LOGIN}' again.",
|
|
709
748
|
)
|
|
710
749
|
if r.status_code == 503:
|
|
711
|
-
raise Refused(
|
|
712
|
-
|
|
750
|
+
raise Refused(
|
|
751
|
+
"account_unavailable",
|
|
752
|
+
str(detail or "The Forspring account cannot be reached."),
|
|
753
|
+
EN["account_unavailable"]["fix"],
|
|
754
|
+
)
|
|
713
755
|
raise AuthenticationError(f"Failed to resolve user context (HTTP {r.status_code})")
|
|
714
756
|
|
|
715
757
|
@staticmethod
|
|
716
758
|
def _context(me: dict) -> "UserContext":
|
|
717
759
|
org_id = me.get("org_id")
|
|
718
|
-
return UserContext(
|
|
719
|
-
|
|
760
|
+
return UserContext(
|
|
761
|
+
uid=me["uid"],
|
|
762
|
+
email=me.get("email") or "",
|
|
763
|
+
org_id=org_id,
|
|
764
|
+
org_name=me.get("org_name") or org_id,
|
|
765
|
+
role=me.get("org_role"),
|
|
766
|
+
)
|
|
720
767
|
|
|
721
768
|
async def get_user(self) -> "UserContext":
|
|
722
769
|
"""The person and the credential's org, as ``GET /api/me`` reports them."""
|
|
@@ -774,15 +821,23 @@ class CLIAuthManager:
|
|
|
774
821
|
org, source, path = named
|
|
775
822
|
if org not in orgs:
|
|
776
823
|
where = f"{source} {path}" if path else source
|
|
777
|
-
return {
|
|
778
|
-
|
|
824
|
+
return {
|
|
825
|
+
"ok": True,
|
|
826
|
+
"signed_out": [],
|
|
827
|
+
"exit_code": 0,
|
|
828
|
+
"note": f"Not signed in to '{org}' (named by {where}); signed in to: {', '.join(orgs)}.",
|
|
829
|
+
}
|
|
779
830
|
targets = [org]
|
|
780
831
|
elif len(orgs) == 1:
|
|
781
832
|
targets = orgs
|
|
782
833
|
else:
|
|
783
834
|
listing = self.signed_in()
|
|
784
|
-
raise Refused(
|
|
785
|
-
|
|
835
|
+
raise Refused(
|
|
836
|
+
"org_required",
|
|
837
|
+
f"Signed in to {', '.join(orgs)} and none was named.",
|
|
838
|
+
"Sign out of one with --org <org>, or of every one with --all.",
|
|
839
|
+
orgs=listing,
|
|
840
|
+
)
|
|
786
841
|
|
|
787
842
|
results: list[dict] = []
|
|
788
843
|
for org in targets:
|
|
@@ -792,30 +847,43 @@ class CLIAuthManager:
|
|
|
792
847
|
results.append(self._logout_legacy(org, legacy[org]))
|
|
793
848
|
failed = [r for r in results if r.get("reason")]
|
|
794
849
|
# The first failure decides the exit code: its refusal's, else 1.
|
|
795
|
-
return {
|
|
796
|
-
|
|
850
|
+
return {
|
|
851
|
+
"ok": not failed,
|
|
852
|
+
"signed_out": results,
|
|
853
|
+
"note": " ".join(r["note"] for r in results),
|
|
854
|
+
"exit_code": failed[0]["exit_code"] if failed else 0,
|
|
855
|
+
}
|
|
797
856
|
|
|
798
857
|
def _logout_account(self, p: dict) -> dict:
|
|
799
858
|
store = self.account_store()
|
|
800
859
|
org, name = p["org"], p.get("org_name") or p["org"]
|
|
801
860
|
tokens = store.tokens(p)
|
|
802
|
-
revoked = tokens is not None and forspring.revoke(
|
|
861
|
+
revoked = tokens is not None and forspring.revoke(
|
|
862
|
+
self._http(), p["issuer"], p["client_id"], tokens["refresh_token"]
|
|
863
|
+
)
|
|
803
864
|
# Removed whatever the account said: the person asked to sign out here.
|
|
804
865
|
store.remove(forspring.PRODUCT, org)
|
|
805
866
|
out = {"org": org, "org_name": name, "kind": "account", "revoked": revoked}
|
|
806
867
|
if revoked:
|
|
807
|
-
out["note"] =
|
|
868
|
+
out["note"] = (
|
|
869
|
+
f"Signed out of {name} ({org}): the sign-in was revoked at the Forspring account and removed here."
|
|
870
|
+
)
|
|
808
871
|
return out
|
|
809
|
-
why = (
|
|
810
|
-
|
|
872
|
+
why = (
|
|
873
|
+
"its tokens were already gone from this machine"
|
|
874
|
+
if tokens is None
|
|
875
|
+
else "the Forspring account did not answer"
|
|
876
|
+
)
|
|
811
877
|
url = account_agents_url(org)
|
|
812
878
|
out.update(
|
|
813
879
|
reason="account_unavailable" if tokens is not None else "store_failed",
|
|
814
880
|
exit_code=EXIT_FAILURE,
|
|
815
881
|
revoke_at=url,
|
|
816
|
-
note=(
|
|
817
|
-
|
|
818
|
-
|
|
882
|
+
note=(
|
|
883
|
+
f"Could not revoke the sign-in to {name} ({org}) at the Forspring account: {why}. "
|
|
884
|
+
f"It is removed from this machine, but the grant may still be live: revoke it under "
|
|
885
|
+
f"Agents and keys at {url}"
|
|
886
|
+
),
|
|
819
887
|
)
|
|
820
888
|
return out
|
|
821
889
|
|
|
@@ -828,22 +896,34 @@ class CLIAuthManager:
|
|
|
828
896
|
# A key stored with --key: not minted by this CLI, so not its to
|
|
829
897
|
# revoke. Said plainly, not counted as a failure.
|
|
830
898
|
self._forget_legacy(org)
|
|
831
|
-
out.update(
|
|
832
|
-
|
|
833
|
-
|
|
899
|
+
out.update(
|
|
900
|
+
revoke_at=url,
|
|
901
|
+
note=(
|
|
902
|
+
f"Forgot the key for {name} ({org}) on this machine. It was stored with --key, so it was "
|
|
903
|
+
f"not revoked and stays live until it is revoked at {url}"
|
|
904
|
+
),
|
|
905
|
+
)
|
|
834
906
|
return out
|
|
835
907
|
reason: str | None = None
|
|
836
908
|
exit_code: int | None = None
|
|
837
909
|
detail = ""
|
|
838
910
|
try:
|
|
839
|
-
r = httpx.delete(
|
|
840
|
-
|
|
911
|
+
r = httpx.delete(
|
|
912
|
+
f"{_host()}/api/keys/{p['key_id']}", headers={"Authorization": f"Bearer {key}"}, timeout=API_TIMEOUT
|
|
913
|
+
)
|
|
841
914
|
except httpx.HTTPError as e:
|
|
842
915
|
r = None
|
|
843
|
-
reason, exit_code, detail =
|
|
916
|
+
reason, exit_code, detail = (
|
|
917
|
+
"server_unreachable",
|
|
918
|
+
EXIT_FAILURE,
|
|
919
|
+
f"DataSpring did not answer ({type(e).__name__})",
|
|
920
|
+
)
|
|
844
921
|
if r is not None and 200 <= r.status_code < 300:
|
|
845
922
|
self._forget_legacy(org)
|
|
846
|
-
out.update(
|
|
923
|
+
out.update(
|
|
924
|
+
revoked=True,
|
|
925
|
+
note=f"Signed out of {name} ({org}): the key was revoked on the server and forgotten here.",
|
|
926
|
+
)
|
|
847
927
|
return out
|
|
848
928
|
if r is not None:
|
|
849
929
|
try:
|
|
@@ -860,14 +940,18 @@ class CLIAuthManager:
|
|
|
860
940
|
reason = "not_signed_in"
|
|
861
941
|
if reason is None:
|
|
862
942
|
reason, exit_code = f"http_{r.status_code}", exit_for_status(r.status_code)
|
|
863
|
-
detail = f"the server answered {r.status_code}" + (
|
|
943
|
+
detail = f"the server answered {r.status_code}" + (
|
|
944
|
+
f" ({text})" if isinstance(text, str) and text else ""
|
|
945
|
+
)
|
|
864
946
|
self._forget_legacy(org)
|
|
865
947
|
out.update(
|
|
866
948
|
reason=reason,
|
|
867
949
|
exit_code=exit_code if exit_code is not None else exit_for_reason(reason),
|
|
868
950
|
revoke_at=url,
|
|
869
|
-
note=(
|
|
870
|
-
|
|
951
|
+
note=(
|
|
952
|
+
f"Could not revoke the key for {name} ({org}) on the server: {detail}. It is forgotten on this "
|
|
953
|
+
f"machine but still live: revoke it at {url}"
|
|
954
|
+
),
|
|
871
955
|
)
|
|
872
956
|
return out
|
|
873
957
|
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"""GENERATED by `python -m services.skill_tables`; do not edit.
|
|
2
2
|
|
|
3
|
-
The
|
|
4
|
-
``GET /api/dispatch`` answers. ``dataspring
|
|
5
|
-
the server's to say whether the server has
|
|
6
|
-
know
|
|
3
|
+
The hashes of the dispatch manifest this CLI was built against, the ones
|
|
4
|
+
``GET /api/dispatch`` answers. ``dataspring`` compares INTERFACE_HASH (the
|
|
5
|
+
callable surface, no prose) with the server's to say whether the server has
|
|
6
|
+
operations or fields this CLI does not know; MANIFEST_HASH covers prose too.
|
|
7
|
+
tests/test_skills_surface.py asserts both are current.
|
|
7
8
|
"""
|
|
8
9
|
|
|
9
|
-
MANIFEST_HASH = "
|
|
10
|
+
MANIFEST_HASH = "565745ddfe84ed4d8bb4715bf43293fd4ab2009c4af274670d6517962baabcf6"
|
|
11
|
+
INTERFACE_HASH = "f5f5166453208ffa2438b27d10f9ea805b8a0988f45ebcaf75402df561c3eb32"
|
|
10
12
|
TOOL_KEYS = (
|
|
11
13
|
"business_context_edit",
|
|
12
14
|
"semantic_model_edit",
|
|
@@ -31,4 +33,5 @@ TOOL_KEYS = (
|
|
|
31
33
|
"board_edit",
|
|
32
34
|
"board_fetch",
|
|
33
35
|
"watch_edit",
|
|
36
|
+
"python_run",
|
|
34
37
|
)
|