authpi-admin 1.2.0__tar.gz → 1.3.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.
Files changed (64) hide show
  1. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/CHANGELOG.md +15 -0
  2. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/PKG-INFO +1 -1
  3. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/_version.py +1 -1
  4. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/models.py +119 -57
  5. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/account_api_keys.py +23 -6
  6. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/accounts.py +1 -0
  7. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/agent_verifiers.py +1 -0
  8. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/agents.py +1 -0
  9. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/approvals.py +1 -0
  10. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/auth_methods.py +3 -1
  11. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/clients.py +26 -10
  12. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/credits.py +1 -0
  13. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/deliveries.py +1 -0
  14. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/domains.py +1 -0
  15. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/events.py +1 -0
  16. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/groups.py +1 -0
  17. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/invitations.py +1 -0
  18. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/invoices.py +1 -0
  19. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/issuers.py +28 -5
  20. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/members.py +1 -0
  21. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/notes.py +1 -0
  22. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/organization_api_keys.py +21 -5
  23. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/organizations.py +1 -0
  24. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/trusted_devices.py +1 -0
  25. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/usage.py +1 -0
  26. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/user_sessions.py +1 -0
  27. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/user_tokens.py +1 -0
  28. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/user_verifiers.py +1 -0
  29. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/users.py +1 -0
  30. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/webhooks.py +1 -0
  31. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/pagination.py +1 -0
  32. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/pyproject.toml +1 -1
  33. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/tests/test_client.py +21 -0
  34. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/tests/test_pagination.py +3 -1
  35. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/tests/test_public_types.py +9 -0
  36. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/uv.lock +1 -1
  37. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/.gitignore +0 -0
  38. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/README.md +0 -0
  39. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/__init__.py +0 -0
  40. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/client.py +0 -0
  41. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/errors.py +0 -0
  42. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/__init__.py +0 -0
  43. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/__init__.py +0 -0
  44. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/account_tokens.py +0 -0
  45. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/issuer_sessions.py +0 -0
  46. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/issuer_tokens.py +0 -0
  47. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/payment_methods.py +0 -0
  48. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/redeliver.py +0 -0
  49. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/resources/sso.py +0 -0
  50. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/scopes/__init__.py +0 -0
  51. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/scopes/agent_scope.py +0 -0
  52. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/scopes/issuer_scope.py +0 -0
  53. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/scopes/organization_scope.py +0 -0
  54. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/scopes/user_scope.py +0 -0
  55. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/generated/scopes/webhook_scope.py +0 -0
  56. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/http_client.py +0 -0
  57. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/py.typed +0 -0
  58. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/types.py +0 -0
  59. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/authpi_admin/user_agent.py +0 -0
  60. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/tests/__init__.py +0 -0
  61. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/tests/test_errors.py +0 -0
  62. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/tests/test_http_client.py +0 -0
  63. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/tests/test_integration.py +0 -0
  64. {authpi_admin-1.2.0 → authpi_admin-1.3.0}/tests/test_version.py +0 -0
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.3.0](https://github.com/arbfay/authpi/compare/authpi-admin-v1.2.0...authpi-admin-v1.3.0) (2026-07-20)
4
+
5
+
6
+ ### Features
7
+
8
+ * **admin-py:** sync deployed Core API surface ([685f9a4](https://github.com/arbfay/authpi/commit/685f9a4420705fd30124ea1f1a5e5f268d838cde))
9
+ * **admin:** sync deployed Core API SDK surface ([ae9d632](https://github.com/arbfay/authpi/commit/ae9d63255a02170902002f8d3e6a1a3c9c92846a))
10
+ * **console:** rework issuer operations experience ([196f318](https://github.com/arbfay/authpi/commit/196f3182d862423d889fe28b0e66433fdf0f06de))
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * **admin-py:** expose page integrity metadata [skip ci] ([04eeb51](https://github.com/arbfay/authpi/commit/04eeb510108b1b02bcc346d8866f78219c2cb8f9))
16
+ * **admin-py:** renamed issuer related OpenAPI models ([f92cd7e](https://github.com/arbfay/authpi/commit/f92cd7e1d80eb32af4fa6bc162c854a7deea9c01))
17
+
3
18
  ## [1.2.0](https://github.com/arbfay/authpi/compare/authpi-admin-v1.1.0...authpi-admin-v1.2.0) (2026-07-15)
4
19
 
5
20
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: authpi-admin
3
- Version: 1.2.0
3
+ Version: 1.3.0
4
4
  Summary: Official Python Admin SDK for AuthPI Core API
5
5
  Project-URL: Homepage, https://authpi.com
6
6
  Project-URL: Documentation, https://docs.authpi.com/sdk/python/admin
@@ -1,5 +1,5 @@
1
1
  """SDK version — kept in sync with pyproject.toml via release-please."""
2
2
 
3
3
  # x-release-please-start-version
4
- SDK_VERSION = "1.2.0"
4
+ SDK_VERSION = "1.3.0"
5
5
  # x-release-please-end
@@ -377,6 +377,76 @@ class Issuer(BaseModel):
377
377
  created_at: int
378
378
  updated_at: int | None = None
379
379
 
380
+ class IssuerListItem(BaseModel):
381
+ model_config = ConfigDict(frozen=True)
382
+
383
+ _etag: str | None = PrivateAttr(default=None)
384
+
385
+ id: str
386
+ account_id: str
387
+ name: str | None = None
388
+ description: str | None
389
+ links: dict[str, Any] | None = None
390
+ available_scopes: list[str]
391
+ status: str
392
+ status_at: int | None = None
393
+ settings: dict[str, Any]
394
+ metadata: Metadata
395
+ created_at: int
396
+ updated_at: int | None = None
397
+ access_mode: str | None
398
+ auth_method_count: int
399
+ enabled_login_method_count: int
400
+ enabled_signup_method_count: int
401
+ available_scope_count: int
402
+ branding_configured: bool
403
+ readiness: str
404
+
405
+ CreateAuthMethodInput = dict[str, Any]
406
+
407
+ class CreateIssuerSettingsInput(BaseModel):
408
+ model_config = ConfigDict(frozen=True)
409
+
410
+ _etag: str | None = PrivateAttr(default=None)
411
+
412
+ portals: dict[str, Any] | None = None
413
+ branding: dict[str, Any] | None = None
414
+ access: dict[str, Any]
415
+ security: dict[str, Any] | None = None
416
+
417
+ class CreateIssuerInput(TypedDict):
418
+ name: str
419
+ description: NotRequired[str | None]
420
+ links: NotRequired[dict[str, Any] | None]
421
+ available_scopes: NotRequired[list[str] | None]
422
+ status: NotRequired[str | None]
423
+ settings: NotRequired[CreateIssuerSettingsInput | None]
424
+ metadata: NotRequired[dict[str, Any] | None]
425
+
426
+ class ClientListItem(BaseModel):
427
+ model_config = ConfigDict(frozen=True)
428
+
429
+ _etag: str | None = PrivateAttr(default=None)
430
+
431
+ id: str
432
+ issuer_id: str
433
+ status: str
434
+ type: str
435
+ confidential: bool
436
+ name: str
437
+ description: str | None
438
+ logo_url: str | None
439
+ scopes: list[str]
440
+ protocol: str
441
+ application_type: str | None
442
+ grant_types: list[str] | None = None
443
+ redirect_uri_count: int | None = None
444
+ configuration_indexed: bool | None = None
445
+ secret_rotated_at: int | None = None
446
+ status_at: int | None = None
447
+ created_at: int
448
+ updated_at: int | None = None
449
+
380
450
  class Client(BaseModel):
381
451
  model_config = ConfigDict(frozen=True)
382
452
 
@@ -645,6 +715,28 @@ class UpdateWebhook(TypedDict):
645
715
  circuit_breaker: NotRequired[dict[str, Any] | None]
646
716
  metadata: NotRequired[dict[str, Any] | None]
647
717
 
718
+ class ApiKeyListItem(BaseModel):
719
+ model_config = ConfigDict(frozen=True)
720
+
721
+ _etag: str | None = PrivateAttr(default=None)
722
+
723
+ id: str
724
+ org_id: str
725
+ issuer_id: str
726
+ type: str | None = None
727
+ status: str
728
+ name: str
729
+ description: str | None
730
+ tags: list[str] | None = None
731
+ scopes: list[str] | None = None
732
+ ip_allowlist: list[str] | None = None
733
+ expires_at: int | None
734
+ secret_hint: str | None
735
+ last_rotated_at: int | None = None
736
+ status_at: int | None = None
737
+ created_at: int
738
+ updated_at: int | None
739
+
648
740
  class CreateApiKeyResponse(BaseModel):
649
741
  """The new API key with secret"""
650
742
  model_config = ConfigDict(frozen=True)
@@ -670,6 +762,16 @@ class CreateApiKeyResponse(BaseModel):
670
762
  secret: dict[str, Any]
671
763
  secret_plain: str
672
764
 
765
+ class CreateAccountApiKey(TypedDict):
766
+ name: str
767
+ description: NotRequired[str | None]
768
+ tags: NotRequired[list[str] | None]
769
+ restrictions: dict[str, Any]
770
+ expires_at: NotRequired[int | None]
771
+ metadata: NotRequired[dict[str, Any] | None]
772
+ secret: NotRequired[str | None]
773
+ secret_hint: NotRequired[str | None]
774
+
673
775
  class ApiKey(BaseModel):
674
776
  """The API key details"""
675
777
  model_config = ConfigDict(frozen=True)
@@ -744,7 +846,6 @@ class PublicSession(BaseModel):
744
846
  status_reason: str | None = None
745
847
  status_by: str | None = None
746
848
  authentication: dict[str, Any] | None = None
747
- client: dict[str, Any] | None = None
748
849
  op_session_id: str | None = None
749
850
  device: dict[str, Any] | None = None
750
851
  location: dict[str, Any] | None = None
@@ -764,6 +865,7 @@ class PublicSession(BaseModel):
764
865
  updated_at: int | None = None
765
866
  expires_at: int | None = None
766
867
  revoked_at: int | None = None
868
+ client: dict[str, Any] | None = None
767
869
 
768
870
  class NoteMention(BaseModel):
769
871
  model_config = ConfigDict(frozen=True)
@@ -813,24 +915,6 @@ class UpdateNoteInput(TypedDict):
813
915
  content: NotRequired[str | None]
814
916
  pinned: NotRequired[bool | None]
815
917
 
816
- class ApiKeysListItem(BaseModel):
817
- model_config = ConfigDict(frozen=True)
818
-
819
- _etag: str | None = PrivateAttr(default=None)
820
-
821
- id: str
822
- org_id: str
823
- issuer_id: str
824
- status: str
825
- name: str
826
- description: str | None
827
- tags: list[str]
828
- scopes: list[str]
829
- expires_at: float | None
830
- secret_hint: str | None
831
- created_at: float
832
- updated_at: float | None
833
-
834
918
  class ApiKeysRotateResponse(BaseModel):
835
919
  model_config = ConfigDict(frozen=True)
836
920
 
@@ -907,26 +991,6 @@ class IssuerApprovalsListItem(BaseModel):
907
991
  created_at: float
908
992
  updated_at: float
909
993
 
910
- class IssuerClientsListItem(BaseModel):
911
- model_config = ConfigDict(frozen=True)
912
-
913
- _etag: str | None = PrivateAttr(default=None)
914
-
915
- id: str
916
- issuer_id: str
917
- status: str
918
- type: str
919
- confidential: bool
920
- name: str
921
- description: str | None
922
- logo_url: str | None
923
- scopes: list[str]
924
- protocol: str
925
- application_type: str | None
926
- status_at: float | None
927
- created_at: float
928
- updated_at: float | None
929
-
930
994
  class IssuerClientsCreateResponse(BaseModel):
931
995
  """The newly created client with secret (if confidential)"""
932
996
  model_config = ConfigDict(frozen=True)
@@ -977,24 +1041,6 @@ class IssuerOrganizationsListItem(BaseModel):
977
1041
  created_at: int
978
1042
  updated_at: int | None = None
979
1043
 
980
- class OrganizationApiKeysListItem(BaseModel):
981
- model_config = ConfigDict(frozen=True)
982
-
983
- _etag: str | None = PrivateAttr(default=None)
984
-
985
- id: str
986
- org_id: str
987
- issuer_id: str
988
- status: str
989
- name: str
990
- description: str | None
991
- tags: list[str]
992
- scopes: list[str]
993
- expires_at: float | None
994
- secret_hint: str | None
995
- created_at: float
996
- updated_at: float | None
997
-
998
1044
  class OrganizationSsoAddDomainResponse(BaseModel):
999
1045
  model_config = ConfigDict(frozen=True)
1000
1046
 
@@ -1223,6 +1269,15 @@ class WebhookDeliveriesRedeliverResponse(BaseModel):
1223
1269
  updated_at: int | None
1224
1270
  success: bool
1225
1271
 
1272
+ # Deprecated: use ClientListItem instead.
1273
+ IssuerClientsListItem = ClientListItem
1274
+
1275
+ # Deprecated: use ApiKeyListItem instead.
1276
+ ApiKeysListItem = ApiKeyListItem
1277
+
1278
+ # Deprecated: use ApiKeyListItem instead.
1279
+ OrganizationApiKeysListItem = ApiKeyListItem
1280
+
1226
1281
 
1227
1282
  __all__ = [
1228
1283
  "Account",
@@ -1235,14 +1290,20 @@ __all__ = [
1235
1290
  "AgentVerifiersListItem",
1236
1291
  "ApiError",
1237
1292
  "ApiKey",
1293
+ "ApiKeyListItem",
1238
1294
  "ApiKeysListItem",
1239
1295
  "ApiKeysRotateResponse",
1240
1296
  "CallerAccountAccess",
1241
1297
  "CallerIdentity",
1242
1298
  "CallerOrganizationAccess",
1243
1299
  "Client",
1300
+ "ClientListItem",
1301
+ "CreateAccountApiKey",
1244
1302
  "CreateApiKeyResponse",
1245
1303
  "CreateAuthInput",
1304
+ "CreateAuthMethodInput",
1305
+ "CreateIssuerInput",
1306
+ "CreateIssuerSettingsInput",
1246
1307
  "CreateNoteInput",
1247
1308
  "CreateWebhookInput",
1248
1309
  "CreateWebhookResponseAuth",
@@ -1259,6 +1320,7 @@ __all__ = [
1259
1320
  "IssuerClientsCreateResponse",
1260
1321
  "IssuerClientsListItem",
1261
1322
  "IssuerClientsRotateSecretResponse",
1323
+ "IssuerListItem",
1262
1324
  "IssuerOrganizationsListItem",
1263
1325
  "IssuerUsersListItem",
1264
1326
  "Metadata",
@@ -8,8 +8,9 @@ from typing import Any
8
8
 
9
9
  from authpi_admin.generated.models import (
10
10
  ApiKey,
11
- ApiKeysListItem,
11
+ ApiKeyListItem,
12
12
  ApiKeysRotateResponse,
13
+ CreateAccountApiKey,
13
14
  CreateApiKeyResponse,
14
15
  UpdateApiKey,
15
16
  )
@@ -31,19 +32,28 @@ class AccountApiKeysResource:
31
32
  self,
32
33
  limit: int | None = None,
33
34
  cursor: str | None = None,
35
+ q: str | None = None,
34
36
  status: str | None = None,
37
+ access: str | None = None,
38
+ readiness: str | None = None,
35
39
  *,
36
40
  timeout: float | None = None,
37
41
  headers: dict[str, str] | None = None,
38
- ) -> Page[ApiKeysListItem]:
42
+ ) -> Page[ApiKeyListItem]:
39
43
  """List Account API Keys"""
40
44
  query: dict[str, Any] = {}
41
45
  if limit is not None:
42
46
  query["limit"] = limit
43
47
  if cursor is not None:
44
48
  query["cursor"] = cursor
49
+ if q is not None:
50
+ query["q"] = q
45
51
  if status is not None:
46
52
  query["status"] = status
53
+ if access is not None:
54
+ query["access"] = access
55
+ if readiness is not None:
56
+ query["readiness"] = readiness
47
57
  resp = await self._client.request(
48
58
  "GET",
49
59
  self._base_path,
@@ -52,26 +62,33 @@ class AccountApiKeysResource:
52
62
  headers=headers,
53
63
  )
54
64
  data = resp.data
55
- items = [ApiKeysListItem(**item) for item in data.get("data", [])] if data else []
65
+ items = [ApiKeyListItem(**item) for item in data.get("data", [])] if data else []
56
66
  return Page(
57
67
  data=items,
58
68
  has_more=data.get("has_more", False) if data else False,
59
69
  next_cursor=data.get("next_cursor") if data else None,
70
+ invalid_count=data.get("invalid_count") if data else None,
60
71
  )
61
72
 
62
73
  async def list_all(
63
74
  self,
64
75
  limit: int | None = None,
76
+ q: str | None = None,
65
77
  status: str | None = None,
78
+ access: str | None = None,
79
+ readiness: str | None = None,
66
80
  *,
67
81
  timeout: float | None = None,
68
82
  headers: dict[str, str] | None = None,
69
- ) -> AsyncIterator[ApiKeysListItem]:
83
+ ) -> AsyncIterator[ApiKeyListItem]:
70
84
  """Auto-paginating iterator over all account_api_keys."""
71
- async def _fetch(cursor: str | None = None) -> Page[ApiKeysListItem]:
85
+ async def _fetch(cursor: str | None = None) -> Page[ApiKeyListItem]:
72
86
  return await self.list(
73
87
  limit=limit,
88
+ q=q,
74
89
  status=status,
90
+ access=access,
91
+ readiness=readiness,
75
92
  cursor=cursor,
76
93
  timeout=timeout,
77
94
  headers=headers,
@@ -81,7 +98,7 @@ class AccountApiKeysResource:
81
98
 
82
99
  async def create(
83
100
  self,
84
- body: dict[str, Any],
101
+ body: CreateAccountApiKey,
85
102
  *,
86
103
  idempotency_key: str | None = None,
87
104
  timeout: float | None = None,
@@ -50,6 +50,7 @@ class AccountsResource:
50
50
  data=items,
51
51
  has_more=data.get("has_more", False) if data else False,
52
52
  next_cursor=data.get("next_cursor") if data else None,
53
+ invalid_count=data.get("invalid_count") if data else None,
53
54
  )
54
55
 
55
56
  async def list_all(
@@ -45,6 +45,7 @@ class AgentVerifiersResource:
45
45
  data=items,
46
46
  has_more=data.get("has_more", False) if data else False,
47
47
  next_cursor=data.get("next_cursor") if data else None,
48
+ invalid_count=data.get("invalid_count") if data else None,
48
49
  )
49
50
 
50
51
  async def list_all(
@@ -62,6 +62,7 @@ class AgentsResource:
62
62
  data=items,
63
63
  has_more=data.get("has_more", False) if data else False,
64
64
  next_cursor=data.get("next_cursor") if data else None,
65
+ invalid_count=data.get("invalid_count") if data else None,
65
66
  )
66
67
 
67
68
  async def list_all(
@@ -51,6 +51,7 @@ class ApprovalsResource:
51
51
  data=items,
52
52
  has_more=data.get("has_more", False) if data else False,
53
53
  next_cursor=data.get("next_cursor") if data else None,
54
+ invalid_count=data.get("invalid_count") if data else None,
54
55
  )
55
56
 
56
57
  async def list_all(
@@ -7,6 +7,7 @@ import builtins
7
7
  from typing import Any
8
8
 
9
9
  from authpi_admin.generated.models import (
10
+ CreateAuthMethodInput,
10
11
  IssuerAuthMethod,
11
12
  )
12
13
  from authpi_admin.http_client import HttpClient
@@ -44,6 +45,7 @@ class AuthMethodsResource:
44
45
  data=items,
45
46
  has_more=data.get("has_more", False) if data else False,
46
47
  next_cursor=data.get("next_cursor") if data else None,
48
+ invalid_count=data.get("invalid_count") if data else None,
47
49
  )
48
50
 
49
51
  async def list_all(
@@ -63,7 +65,7 @@ class AuthMethodsResource:
63
65
 
64
66
  async def create(
65
67
  self,
66
- body: dict[str, Any],
68
+ body: CreateAuthMethodInput,
67
69
  *,
68
70
  idempotency_key: str | None = None,
69
71
  timeout: float | None = None,
@@ -8,8 +8,8 @@ from typing import Any
8
8
 
9
9
  from authpi_admin.generated.models import (
10
10
  Client,
11
+ ClientListItem,
11
12
  IssuerClientsCreateResponse,
12
- IssuerClientsListItem,
13
13
  IssuerClientsRotateSecretResponse,
14
14
  )
15
15
  from authpi_admin.http_client import HttpClient
@@ -28,22 +28,31 @@ class ClientsResource:
28
28
 
29
29
  async def list(
30
30
  self,
31
+ q: str | None = None,
32
+ status: str | None = None,
33
+ application_type: str | None = None,
34
+ readiness: str | None = None,
31
35
  limit: int | None = None,
32
36
  cursor: str | None = None,
33
- status: str | None = None,
34
37
  name: str | None = None,
35
38
  *,
36
39
  timeout: float | None = None,
37
40
  headers: dict[str, str] | None = None,
38
- ) -> Page[IssuerClientsListItem]:
41
+ ) -> Page[ClientListItem]:
39
42
  """List Clients"""
40
43
  query: dict[str, Any] = {}
44
+ if q is not None:
45
+ query["q"] = q
46
+ if status is not None:
47
+ query["status"] = status
48
+ if application_type is not None:
49
+ query["application_type"] = application_type
50
+ if readiness is not None:
51
+ query["readiness"] = readiness
41
52
  if limit is not None:
42
53
  query["limit"] = limit
43
54
  if cursor is not None:
44
55
  query["cursor"] = cursor
45
- if status is not None:
46
- query["status"] = status
47
56
  if name is not None:
48
57
  query["name"] = name
49
58
  resp = await self._client.request(
@@ -54,27 +63,34 @@ class ClientsResource:
54
63
  headers=headers,
55
64
  )
56
65
  data = resp.data
57
- items = [IssuerClientsListItem(**item) for item in data.get("data", [])] if data else []
66
+ items = [ClientListItem(**item) for item in data.get("data", [])] if data else []
58
67
  return Page(
59
68
  data=items,
60
69
  has_more=data.get("has_more", False) if data else False,
61
70
  next_cursor=data.get("next_cursor") if data else None,
71
+ invalid_count=data.get("invalid_count") if data else None,
62
72
  )
63
73
 
64
74
  async def list_all(
65
75
  self,
66
- limit: int | None = None,
76
+ q: str | None = None,
67
77
  status: str | None = None,
78
+ application_type: str | None = None,
79
+ readiness: str | None = None,
80
+ limit: int | None = None,
68
81
  name: str | None = None,
69
82
  *,
70
83
  timeout: float | None = None,
71
84
  headers: dict[str, str] | None = None,
72
- ) -> AsyncIterator[IssuerClientsListItem]:
85
+ ) -> AsyncIterator[ClientListItem]:
73
86
  """Auto-paginating iterator over all clients."""
74
- async def _fetch(cursor: str | None = None) -> Page[IssuerClientsListItem]:
87
+ async def _fetch(cursor: str | None = None) -> Page[ClientListItem]:
75
88
  return await self.list(
76
- limit=limit,
89
+ q=q,
77
90
  status=status,
91
+ application_type=application_type,
92
+ readiness=readiness,
93
+ limit=limit,
78
94
  name=name,
79
95
  cursor=cursor,
80
96
  timeout=timeout,
@@ -54,6 +54,7 @@ class CreditsResource:
54
54
  data=items,
55
55
  has_more=data.get("has_more", False) if data else False,
56
56
  next_cursor=data.get("next_cursor") if data else None,
57
+ invalid_count=data.get("invalid_count") if data else None,
57
58
  )
58
59
 
59
60
  async def ledger_all(
@@ -63,6 +63,7 @@ class DeliveriesResource:
63
63
  data=items,
64
64
  has_more=data.get("has_more", False) if data else False,
65
65
  next_cursor=data.get("next_cursor") if data else None,
66
+ invalid_count=data.get("invalid_count") if data else None,
66
67
  )
67
68
 
68
69
  async def list_all(
@@ -45,6 +45,7 @@ class DomainsResource:
45
45
  data=items,
46
46
  has_more=data.get("has_more", False) if data else False,
47
47
  next_cursor=data.get("next_cursor") if data else None,
48
+ invalid_count=data.get("invalid_count") if data else None,
48
49
  )
49
50
 
50
51
  async def list_all(
@@ -69,6 +69,7 @@ class EventsResource:
69
69
  data=items,
70
70
  has_more=data.get("has_more", False) if data else False,
71
71
  next_cursor=data.get("next_cursor") if data else None,
72
+ invalid_count=data.get("invalid_count") if data else None,
72
73
  )
73
74
 
74
75
  async def list_all(
@@ -50,6 +50,7 @@ class GroupsResource:
50
50
  data=items,
51
51
  has_more=data.get("has_more", False) if data else False,
52
52
  next_cursor=data.get("next_cursor") if data else None,
53
+ invalid_count=data.get("invalid_count") if data else None,
53
54
  )
54
55
 
55
56
  async def list_all(
@@ -53,6 +53,7 @@ class InvitationsResource:
53
53
  data=items,
54
54
  has_more=data.get("has_more", False) if data else False,
55
55
  next_cursor=data.get("next_cursor") if data else None,
56
+ invalid_count=data.get("invalid_count") if data else None,
56
57
  )
57
58
 
58
59
  async def list_all(
@@ -44,6 +44,7 @@ class InvoicesResource:
44
44
  data=items,
45
45
  has_more=data.get("has_more", False) if data else False,
46
46
  next_cursor=data.get("next_cursor") if data else None,
47
+ invalid_count=data.get("invalid_count") if data else None,
47
48
  )
48
49
 
49
50
  async def list_all(
@@ -7,7 +7,9 @@ import builtins
7
7
  from typing import Any
8
8
 
9
9
  from authpi_admin.generated.models import (
10
+ CreateIssuerInput,
10
11
  Issuer,
12
+ IssuerListItem,
11
13
  )
12
14
  from authpi_admin.http_client import HttpClient
13
15
  from authpi_admin.http_client import require_object_body as _require_object_body
@@ -25,14 +27,26 @@ class IssuersResource:
25
27
 
26
28
  async def list(
27
29
  self,
30
+ q: str | None = None,
31
+ status: str | None = None,
32
+ access_mode: str | None = None,
33
+ readiness: str | None = None,
28
34
  limit: int | None = None,
29
35
  cursor: str | None = None,
30
36
  *,
31
37
  timeout: float | None = None,
32
38
  headers: dict[str, str] | None = None,
33
- ) -> Page[Issuer]:
39
+ ) -> Page[IssuerListItem]:
34
40
  """List Issuers"""
35
41
  query: dict[str, Any] = {}
42
+ if q is not None:
43
+ query["q"] = q
44
+ if status is not None:
45
+ query["status"] = status
46
+ if access_mode is not None:
47
+ query["access_mode"] = access_mode
48
+ if readiness is not None:
49
+ query["readiness"] = readiness
36
50
  if limit is not None:
37
51
  query["limit"] = limit
38
52
  if cursor is not None:
@@ -45,23 +59,32 @@ class IssuersResource:
45
59
  headers=headers,
46
60
  )
47
61
  data = resp.data
48
- items = [Issuer(**item) for item in data.get("data", [])] if data else []
62
+ items = [IssuerListItem(**item) for item in data.get("data", [])] if data else []
49
63
  return Page(
50
64
  data=items,
51
65
  has_more=data.get("has_more", False) if data else False,
52
66
  next_cursor=data.get("next_cursor") if data else None,
67
+ invalid_count=data.get("invalid_count") if data else None,
53
68
  )
54
69
 
55
70
  async def list_all(
56
71
  self,
72
+ q: str | None = None,
73
+ status: str | None = None,
74
+ access_mode: str | None = None,
75
+ readiness: str | None = None,
57
76
  limit: int | None = None,
58
77
  *,
59
78
  timeout: float | None = None,
60
79
  headers: dict[str, str] | None = None,
61
- ) -> AsyncIterator[Issuer]:
80
+ ) -> AsyncIterator[IssuerListItem]:
62
81
  """Auto-paginating iterator over all issuers."""
63
- async def _fetch(cursor: str | None = None) -> Page[Issuer]:
82
+ async def _fetch(cursor: str | None = None) -> Page[IssuerListItem]:
64
83
  return await self.list(
84
+ q=q,
85
+ status=status,
86
+ access_mode=access_mode,
87
+ readiness=readiness,
65
88
  limit=limit,
66
89
  cursor=cursor,
67
90
  timeout=timeout,
@@ -72,7 +95,7 @@ class IssuersResource:
72
95
 
73
96
  async def create(
74
97
  self,
75
- body: dict[str, Any],
98
+ body: CreateIssuerInput,
76
99
  *,
77
100
  idempotency_key: str | None = None,
78
101
  timeout: float | None = None,
@@ -56,6 +56,7 @@ class MembersResource:
56
56
  data=items,
57
57
  has_more=data.get("has_more", False) if data else False,
58
58
  next_cursor=data.get("next_cursor") if data else None,
59
+ invalid_count=data.get("invalid_count") if data else None,
59
60
  )
60
61
 
61
62
  async def list_all(
@@ -71,6 +71,7 @@ class NotesResource:
71
71
  data=items,
72
72
  has_more=data.get("has_more", False) if data else False,
73
73
  next_cursor=data.get("next_cursor") if data else None,
74
+ invalid_count=data.get("invalid_count") if data else None,
74
75
  )
75
76
 
76
77
  async def list_all(
@@ -7,8 +7,8 @@ import builtins
7
7
  from typing import Any
8
8
 
9
9
  from authpi_admin.generated.models import (
10
+ ApiKeyListItem,
10
11
  CreateApiKeyResponse,
11
- OrganizationApiKeysListItem,
12
12
  )
13
13
  from authpi_admin.http_client import HttpClient
14
14
  from authpi_admin.http_client import require_object_body as _require_object_body
@@ -27,19 +27,28 @@ class OrganizationApiKeysResource:
27
27
  self,
28
28
  limit: int | None = None,
29
29
  cursor: str | None = None,
30
+ q: str | None = None,
30
31
  status: str | None = None,
32
+ access: str | None = None,
33
+ readiness: str | None = None,
31
34
  *,
32
35
  timeout: float | None = None,
33
36
  headers: dict[str, str] | None = None,
34
- ) -> Page[OrganizationApiKeysListItem]:
37
+ ) -> Page[ApiKeyListItem]:
35
38
  """List API Keys"""
36
39
  query: dict[str, Any] = {}
37
40
  if limit is not None:
38
41
  query["limit"] = limit
39
42
  if cursor is not None:
40
43
  query["cursor"] = cursor
44
+ if q is not None:
45
+ query["q"] = q
41
46
  if status is not None:
42
47
  query["status"] = status
48
+ if access is not None:
49
+ query["access"] = access
50
+ if readiness is not None:
51
+ query["readiness"] = readiness
43
52
  resp = await self._client.request(
44
53
  "GET",
45
54
  self._base_path,
@@ -48,26 +57,33 @@ class OrganizationApiKeysResource:
48
57
  headers=headers,
49
58
  )
50
59
  data = resp.data
51
- items = [OrganizationApiKeysListItem(**item) for item in data.get("data", [])] if data else []
60
+ items = [ApiKeyListItem(**item) for item in data.get("data", [])] if data else []
52
61
  return Page(
53
62
  data=items,
54
63
  has_more=data.get("has_more", False) if data else False,
55
64
  next_cursor=data.get("next_cursor") if data else None,
65
+ invalid_count=data.get("invalid_count") if data else None,
56
66
  )
57
67
 
58
68
  async def list_all(
59
69
  self,
60
70
  limit: int | None = None,
71
+ q: str | None = None,
61
72
  status: str | None = None,
73
+ access: str | None = None,
74
+ readiness: str | None = None,
62
75
  *,
63
76
  timeout: float | None = None,
64
77
  headers: dict[str, str] | None = None,
65
- ) -> AsyncIterator[OrganizationApiKeysListItem]:
78
+ ) -> AsyncIterator[ApiKeyListItem]:
66
79
  """Auto-paginating iterator over all organization_api_keys."""
67
- async def _fetch(cursor: str | None = None) -> Page[OrganizationApiKeysListItem]:
80
+ async def _fetch(cursor: str | None = None) -> Page[ApiKeyListItem]:
68
81
  return await self.list(
69
82
  limit=limit,
83
+ q=q,
70
84
  status=status,
85
+ access=access,
86
+ readiness=readiness,
71
87
  cursor=cursor,
72
88
  timeout=timeout,
73
89
  headers=headers,
@@ -66,6 +66,7 @@ class OrganizationsResource:
66
66
  data=items,
67
67
  has_more=data.get("has_more", False) if data else False,
68
68
  next_cursor=data.get("next_cursor") if data else None,
69
+ invalid_count=data.get("invalid_count") if data else None,
69
70
  )
70
71
 
71
72
  async def list_all(
@@ -46,6 +46,7 @@ class TrustedDevicesResource:
46
46
  data=items,
47
47
  has_more=data.get("has_more", False) if data else False,
48
48
  next_cursor=data.get("next_cursor") if data else None,
49
+ invalid_count=data.get("invalid_count") if data else None,
49
50
  )
50
51
 
51
52
  async def list_all(
@@ -46,6 +46,7 @@ class UsageResource:
46
46
  data=items,
47
47
  has_more=data.get("has_more", False) if data else False,
48
48
  next_cursor=data.get("next_cursor") if data else None,
49
+ invalid_count=data.get("invalid_count") if data else None,
49
50
  )
50
51
 
51
52
  async def list_all(
@@ -44,6 +44,7 @@ class UserSessionsResource:
44
44
  data=items,
45
45
  has_more=data.get("has_more", False) if data else False,
46
46
  next_cursor=data.get("next_cursor") if data else None,
47
+ invalid_count=data.get("invalid_count") if data else None,
47
48
  )
48
49
 
49
50
  async def list_all(
@@ -53,6 +53,7 @@ class UserTokensResource:
53
53
  data=items,
54
54
  has_more=data.get("has_more", False) if data else False,
55
55
  next_cursor=data.get("next_cursor") if data else None,
56
+ invalid_count=data.get("invalid_count") if data else None,
56
57
  )
57
58
 
58
59
  async def list_all(
@@ -48,6 +48,7 @@ class UserVerifiersResource:
48
48
  data=items,
49
49
  has_more=data.get("has_more", False) if data else False,
50
50
  next_cursor=data.get("next_cursor") if data else None,
51
+ invalid_count=data.get("invalid_count") if data else None,
51
52
  )
52
53
 
53
54
  async def list_all(
@@ -54,6 +54,7 @@ class UsersResource:
54
54
  data=items,
55
55
  has_more=data.get("has_more", False) if data else False,
56
56
  next_cursor=data.get("next_cursor") if data else None,
57
+ invalid_count=data.get("invalid_count") if data else None,
57
58
  )
58
59
 
59
60
  async def list_all(
@@ -58,6 +58,7 @@ class WebhooksResource:
58
58
  data=items,
59
59
  has_more=data.get("has_more", False) if data else False,
60
60
  next_cursor=data.get("next_cursor") if data else None,
61
+ invalid_count=data.get("invalid_count") if data else None,
61
62
  )
62
63
 
63
64
  async def list_all(
@@ -16,6 +16,7 @@ class Page(Generic[T]):
16
16
  data: list[T]
17
17
  has_more: bool
18
18
  next_cursor: str | None = None
19
+ invalid_count: int | None = None
19
20
 
20
21
 
21
22
  async def auto_paginate(
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "authpi-admin"
3
- version = "1.2.0"
3
+ version = "1.3.0"
4
4
  description = "Official Python Admin SDK for AuthPI Core API"
5
5
  readme = "README.md"
6
6
  license = { text = "MIT" }
@@ -165,6 +165,27 @@ async def test_explicit_account_id_skips_resolution(httpx_mock):
165
165
  assert all(r.url.path != "/v1/me" for r in httpx_mock.get_requests())
166
166
 
167
167
 
168
+ async def test_issuer_list_sends_search_and_operational_filters(httpx_mock):
169
+ httpx_mock.add_response(json={"data": [], "has_more": False, "invalid_count": 2})
170
+
171
+ async with AuthPIAdmin(api_key=("key_test", "s3cret"), account_id="acc_explicit") as admin:
172
+ page = await admin.issuers.list(
173
+ q="production",
174
+ status="active",
175
+ access_mode="approval",
176
+ readiness="review",
177
+ limit=25,
178
+ )
179
+
180
+ request = httpx_mock.get_requests()[0]
181
+ assert request.url.params["q"] == "production"
182
+ assert request.url.params["status"] == "active"
183
+ assert request.url.params["access_mode"] == "approval"
184
+ assert request.url.params["readiness"] == "review"
185
+ assert request.url.params["limit"] == "25"
186
+ assert page.invalid_count == 2
187
+
188
+
168
189
  async def test_whoami_returns_caller_identity(httpx_mock):
169
190
  httpx_mock.add_response(url="https://api.authpi.com/v1/me", json=_ME_SINGLE)
170
191
 
@@ -6,15 +6,17 @@ from authpi_admin.pagination import Page, auto_paginate
6
6
 
7
7
 
8
8
  def test_page_creation():
9
- page = Page(data=[1, 2, 3], has_more=True, next_cursor="abc")
9
+ page = Page(data=[1, 2, 3], has_more=True, next_cursor="abc", invalid_count=2)
10
10
  assert page.data == [1, 2, 3]
11
11
  assert page.has_more is True
12
12
  assert page.next_cursor == "abc"
13
+ assert page.invalid_count == 2
13
14
 
14
15
 
15
16
  def test_page_no_more():
16
17
  page = Page(data=[1], has_more=False)
17
18
  assert page.next_cursor is None
19
+ assert page.invalid_count is None
18
20
 
19
21
 
20
22
  def test_page_empty():
@@ -20,3 +20,12 @@ def test_types_module_all_is_schema_only():
20
20
  assert "Webhook" in types.__all__
21
21
  assert "Any" not in types.__all__
22
22
  assert "BaseModel" not in types.__all__
23
+
24
+
25
+ def test_renamed_generated_models_keep_compatibility_aliases():
26
+ assert models.IssuerClientsListItem is models.ClientListItem
27
+ assert models.ApiKeysListItem is models.ApiKeyListItem
28
+ assert models.OrganizationApiKeysListItem is models.ApiKeyListItem
29
+ assert "IssuerClientsListItem" in models.__all__
30
+ assert "ApiKeysListItem" in models.__all__
31
+ assert "OrganizationApiKeysListItem" in models.__all__
@@ -26,7 +26,7 @@ wheels = [
26
26
 
27
27
  [[package]]
28
28
  name = "authpi-admin"
29
- version = "1.2.0"
29
+ version = "1.3.0"
30
30
  source = { editable = "." }
31
31
  dependencies = [
32
32
  { name = "httpx" },
File without changes
File without changes