bt-cli 0.4.30__tar.gz → 0.4.31__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.
- {bt_cli-0.4.30 → bt_cli-0.4.31}/CLAUDE.md +1 -1
- {bt_cli-0.4.30 → bt_cli-0.4.31}/PKG-INFO +1 -1
- {bt_cli-0.4.30 → bt_cli-0.4.31}/pyproject.toml +1 -1
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/__init__.py +1 -1
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pws/client/passwordsafe.py +48 -24
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pws/commands/users.py +11 -5
- {bt_cli-0.4.30 → bt_cli-0.4.31}/.claude/skills/bt/SKILL.md +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/.claude/skills/entitle/SKILL.md +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/.claude/skills/epmw/SKILL.md +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/.claude/skills/pra/SKILL.md +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/.claude/skills/pws/SKILL.md +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/.env.example +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/.github/workflows/ci.yml +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/.github/workflows/release.yml +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/.gitignore +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/README.md +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/assets/cli-help.png +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/assets/cli-output.png +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/bt-cli.spec +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/bt_entry.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/scripts/bt_entry.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/scripts/sync-package-data.sh +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/cli.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/commands/__init__.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/commands/configure.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/commands/learn.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/commands/quick.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/core/__init__.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/core/auth.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/core/client.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/core/config.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/core/config_file.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/core/csv_utils.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/core/errors.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/core/output.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/core/prompts.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/core/rest_debug.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/data/CLAUDE.md +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/data/__init__.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/data/skills/bt/SKILL.md +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/data/skills/entitle/SKILL.md +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/data/skills/epmw/SKILL.md +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/data/skills/pra/SKILL.md +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/data/skills/pws/SKILL.md +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/entitle/__init__.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/entitle/client/__init__.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/entitle/client/base.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/entitle/commands/__init__.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/entitle/commands/accounts.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/entitle/commands/applications.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/entitle/commands/auth.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/entitle/commands/bundles.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/entitle/commands/integrations.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/entitle/commands/permissions.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/entitle/commands/policies.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/entitle/commands/resources.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/entitle/commands/roles.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/entitle/commands/users.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/entitle/commands/workflows.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/entitle/models/__init__.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/entitle/models/bundle.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/entitle/models/common.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/entitle/models/integration.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/entitle/models/permission.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/entitle/models/policy.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/entitle/models/resource.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/entitle/models/role.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/entitle/models/user.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/entitle/models/workflow.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/epmw/__init__.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/epmw/client/__init__.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/epmw/client/base.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/epmw/commands/__init__.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/epmw/commands/audits.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/epmw/commands/auth.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/epmw/commands/computers.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/epmw/commands/events.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/epmw/commands/groups.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/epmw/commands/policies.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/epmw/commands/quick.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/epmw/commands/requests.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/epmw/commands/roles.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/epmw/commands/tasks.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/epmw/commands/users.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/epmw/models/__init__.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pra/__init__.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pra/client/__init__.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pra/client/base.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pra/commands/__init__.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pra/commands/auth.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pra/commands/import_export.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pra/commands/jump_clients.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pra/commands/jump_groups.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pra/commands/jump_items.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pra/commands/jumpoints.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pra/commands/policies.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pra/commands/quick.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pra/commands/teams.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pra/commands/users.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pra/commands/vault.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pra/models/__init__.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pra/models/common.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pra/models/jump_client.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pra/models/jump_group.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pra/models/jump_item.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pra/models/jumpoint.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pra/models/team.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pra/models/user.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pra/models/vault.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pws/__init__.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pws/client/__init__.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pws/client/base.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pws/client/beyondinsight.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pws/commands/__init__.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pws/commands/accounts.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pws/commands/assets.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pws/commands/attributes.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pws/commands/auth.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pws/commands/clouds.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pws/commands/config.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pws/commands/credentials.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pws/commands/databases.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pws/commands/directories.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pws/commands/functional.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pws/commands/import_export.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pws/commands/platforms.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pws/commands/quick.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pws/commands/search.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pws/commands/secrets.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pws/commands/systems.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pws/commands/workgroups.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pws/config.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pws/models/__init__.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pws/models/account.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pws/models/asset.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pws/models/common.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/src/bt_cli/pws/models/system.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/__init__.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/conftest.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/core/__init__.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/core/test_auth.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/core/test_config.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/core/test_errors.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/core/test_rest_debug.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/entitle/__init__.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/entitle/test_client.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/entitle/test_commands.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/entitle-smoke-test.sh +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/epmw/__init__.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/epmw/test_client.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/epmw/test_commands.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/epmw-quick-test-plan.md +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/fixtures/__init__.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/fixtures/responses.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/integration/__init__.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/integration/conftest.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/integration/helpers.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/integration/test_entitle_integration.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/integration/test_epmw_integration.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/integration/test_epmw_lifecycle.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/integration/test_pra_integration.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/integration/test_pra_lifecycle.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/integration/test_pws_integration.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/integration/test_pws_lifecycle.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/pra/__init__.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/pra/test_client.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/pra/test_commands.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/pra-smoke-test.sh +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/pra-test-plan.md +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/pws/__init__.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/pws/test_client.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/pws/test_commands.py +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/pws-quick-test-plan.md +0 -0
- {bt_cli-0.4.30 → bt_cli-0.4.31}/tests/pws-smoke-test.sh +0 -0
|
@@ -821,16 +821,29 @@ class PasswordSafeMixin:
|
|
|
821
821
|
) -> list[dict[str, Any]]:
|
|
822
822
|
"""List user groups.
|
|
823
823
|
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
Returns:
|
|
828
|
-
List of user group objects
|
|
824
|
+
/UserGroups does not support pagination. The ``name`` server-side
|
|
825
|
+
param is an exact match, so filtering is handled client-side.
|
|
829
826
|
"""
|
|
830
|
-
|
|
827
|
+
result = self.get("/UserGroups")
|
|
828
|
+
if isinstance(result, list):
|
|
829
|
+
groups = result
|
|
830
|
+
elif isinstance(result, dict):
|
|
831
|
+
if "GroupID" in result:
|
|
832
|
+
groups = [result]
|
|
833
|
+
else:
|
|
834
|
+
groups = result.get("Data", result.get("results", []))
|
|
835
|
+
else:
|
|
836
|
+
groups = []
|
|
837
|
+
|
|
831
838
|
if search:
|
|
832
|
-
|
|
833
|
-
|
|
839
|
+
search_lower = search.lower()
|
|
840
|
+
groups = [
|
|
841
|
+
g for g in groups
|
|
842
|
+
if search_lower in (g.get("Name", "") or "").lower()
|
|
843
|
+
or search_lower in (g.get("Description", "") or "").lower()
|
|
844
|
+
]
|
|
845
|
+
|
|
846
|
+
return groups
|
|
834
847
|
|
|
835
848
|
def get_user_group(self: "PasswordSafeClient", group_id: int) -> dict[str, Any]:
|
|
836
849
|
"""Get a user group by ID.
|
|
@@ -848,13 +861,16 @@ class PasswordSafeMixin:
|
|
|
848
861
|
) -> list[dict[str, Any]]:
|
|
849
862
|
"""Get users in a user group.
|
|
850
863
|
|
|
851
|
-
|
|
852
|
-
group_id: User group ID
|
|
853
|
-
|
|
854
|
-
Returns:
|
|
855
|
-
List of user objects (includes ClientID, AccessPolicyID for API users)
|
|
864
|
+
/UserGroups/{id}/Users does not support pagination.
|
|
856
865
|
"""
|
|
857
|
-
|
|
866
|
+
result = self.get(f"/UserGroups/{group_id}/Users")
|
|
867
|
+
if isinstance(result, list):
|
|
868
|
+
return result
|
|
869
|
+
if isinstance(result, dict):
|
|
870
|
+
if "UserID" in result:
|
|
871
|
+
return [result]
|
|
872
|
+
return result.get("Data", result.get("results", []))
|
|
873
|
+
return []
|
|
858
874
|
|
|
859
875
|
# =========================================================================
|
|
860
876
|
# Users
|
|
@@ -864,20 +880,29 @@ class PasswordSafeMixin:
|
|
|
864
880
|
self: "PasswordSafeClient",
|
|
865
881
|
search: Optional[str] = None,
|
|
866
882
|
limit: Optional[int] = None,
|
|
883
|
+
include_inactive: bool = False,
|
|
867
884
|
) -> list[dict[str, Any]]:
|
|
868
885
|
"""List users.
|
|
869
886
|
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
Returns:
|
|
875
|
-
List of user objects
|
|
887
|
+
/Users does not support pagination. The ``username`` server-side
|
|
888
|
+
param is an exact match (returns a single user dict or 404), so
|
|
889
|
+
searching is handled client-side across username/first/last/email.
|
|
876
890
|
"""
|
|
877
|
-
|
|
878
|
-
|
|
891
|
+
params: dict[str, Any] = {}
|
|
892
|
+
if include_inactive:
|
|
893
|
+
params["includeInactive"] = "true"
|
|
894
|
+
|
|
895
|
+
result = self.get("/Users", params=params)
|
|
896
|
+
if isinstance(result, list):
|
|
897
|
+
users = result
|
|
898
|
+
elif isinstance(result, dict):
|
|
899
|
+
if "UserID" in result:
|
|
900
|
+
users = [result]
|
|
901
|
+
else:
|
|
902
|
+
users = result.get("Data", result.get("results", []))
|
|
903
|
+
else:
|
|
904
|
+
users = []
|
|
879
905
|
|
|
880
|
-
# Apply client-side search filter
|
|
881
906
|
if search:
|
|
882
907
|
search_lower = search.lower()
|
|
883
908
|
users = [
|
|
@@ -888,7 +913,6 @@ class PasswordSafeMixin:
|
|
|
888
913
|
or search_lower in (u.get("EmailAddress", "") or "").lower()
|
|
889
914
|
]
|
|
890
915
|
|
|
891
|
-
# Apply limit
|
|
892
916
|
if limit is not None:
|
|
893
917
|
users = users[:limit]
|
|
894
918
|
|
|
@@ -179,23 +179,29 @@ def print_roles_table(roles: list[dict], title: str = "Roles") -> None:
|
|
|
179
179
|
|
|
180
180
|
@app.command("list")
|
|
181
181
|
def list_users(
|
|
182
|
-
search: Optional[str] = typer.Option(None, "--search", "-s", help="Search by username"),
|
|
182
|
+
search: Optional[str] = typer.Option(None, "--search", "-s", help="Search by username (also matches first/last/email)"),
|
|
183
183
|
limit: int = typer.Option(50, "--limit", "-l", help="Maximum results (default: 50)"),
|
|
184
|
-
fetch_all: bool = typer.Option(False, "--all", help="Fetch all results
|
|
184
|
+
fetch_all: bool = typer.Option(False, "--all", help="Fetch all results"),
|
|
185
|
+
include_inactive: bool = typer.Option(False, "--include-inactive", help="Include inactive users"),
|
|
185
186
|
output: str = typer.Option("table", "--output", "-o", help="Output format: table or json"),
|
|
186
187
|
) -> None:
|
|
187
188
|
"""List all users.
|
|
188
189
|
|
|
189
190
|
Examples:
|
|
190
|
-
bt pws users list # First 50 users
|
|
191
|
-
bt pws users list --all # All users
|
|
191
|
+
bt pws users list # First 50 active users
|
|
192
|
+
bt pws users list --all # All active users
|
|
193
|
+
bt pws users list --include-inactive # Include inactive users
|
|
192
194
|
bt pws users list -s "admin" # Search by username
|
|
193
195
|
bt pws users list -o json # JSON output
|
|
194
196
|
"""
|
|
195
197
|
try:
|
|
196
198
|
with get_client() as client:
|
|
197
199
|
client.authenticate()
|
|
198
|
-
users = client.list_users(
|
|
200
|
+
users = client.list_users(
|
|
201
|
+
search=search,
|
|
202
|
+
limit=None if fetch_all else limit,
|
|
203
|
+
include_inactive=include_inactive,
|
|
204
|
+
)
|
|
199
205
|
|
|
200
206
|
if output == "json":
|
|
201
207
|
console.print_json(json.dumps(users, default=str))
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|