Skip to content

Commit

Permalink
fix: retool action naming
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgrittner committed Nov 21, 2024
1 parent 8f8adb7 commit 7409415
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 27 deletions.
12 changes: 6 additions & 6 deletions admyral/actions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
)
from admyral.actions.integrations.compliance import (
list_retool_inactive_users,
list_groups_per_user,
list_retool_groups_per_user,
list_1password_audit_events,
search_github_enterprise_audit_logs,
list_github_merged_pull_requests,
Expand All @@ -91,8 +91,8 @@
get_kandji_application_firewall,
get_kandji_desktop_and_screensaver,
get_kandji_library_item_statuses,
list_groups_and_apps_per_user,
list_used_groups_and_apps_per_user,
list_retool_groups_and_apps_per_user,
list_retool_used_groups_and_apps_per_user,
list_google_drive_files_with_link_sharing_enabled,
)
from admyral.actions.integrations.cloud import (
Expand Down Expand Up @@ -146,7 +146,7 @@
"list_sentinel_one_alerts",
"list_wiz_alerts",
"list_retool_inactive_users",
"list_groups_per_user",
"list_retool_groups_per_user",
"list_1password_audit_events",
"okta_search_users",
"okta_get_all_user_types",
Expand Down Expand Up @@ -188,8 +188,8 @@
"join_lists",
"leakcheck_v2_lookup",
"leakcheck_public_lookup",
"list_groups_and_apps_per_user",
"list_used_groups_and_apps_per_user",
"list_retool_groups_and_apps_per_user",
"list_retool_used_groups_and_apps_per_user",
"list_google_drive_files_with_link_sharing_enabled",
"get_jira_project",
"get_jira_transitions",
Expand Down
12 changes: 6 additions & 6 deletions admyral/actions/integrations/compliance/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
from admyral.actions.integrations.compliance.retool import (
list_retool_inactive_users,
list_groups_per_user,
list_groups_and_apps_per_user,
list_used_groups_and_apps_per_user,
list_retool_groups_per_user,
list_retool_groups_and_apps_per_user,
list_retool_used_groups_and_apps_per_user,
)
from admyral.actions.integrations.compliance.one_password import (
list_1password_audit_events,
Expand Down Expand Up @@ -36,7 +36,7 @@

__all__ = [
"list_retool_inactive_users",
"list_groups_per_user",
"list_retool_groups_per_user",
"list_1password_audit_events",
"search_github_enterprise_audit_logs",
"list_github_merged_pull_requests",
Expand All @@ -55,7 +55,7 @@
"get_kandji_application_firewall",
"get_kandji_desktop_and_screensaver",
"get_kandji_library_item_statuses",
"list_groups_and_apps_per_user",
"list_used_groups_and_apps_per_user",
"list_retool_groups_and_apps_per_user",
"list_retool_used_groups_and_apps_per_user",
"list_google_drive_files_with_link_sharing_enabled",
]
6 changes: 3 additions & 3 deletions admyral/actions/integrations/compliance/retool.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def list_retool_inactive_users(
description="List all groups a user is a member of as well as the last time a user was active in Retool.",
secrets_placeholders=["RETOOL_SECRET"],
)
def list_groups_per_user() -> dict[str, JsonValue]:
def list_retool_groups_per_user() -> dict[str, JsonValue]:
# Get all permission groups for an organization or space. The API token must have the "Groups > Read" scope.
# https://docs.retool.com/reference/api/#tag/Users/paths/~1users~1%7BuserId%7D/patch
# https://docs.retool.com/reference/api/v2/#tag/Groups/paths/~1groups~1%7BgroupId%7D/put
Expand Down Expand Up @@ -171,7 +171,7 @@ def list_groups_per_user() -> dict[str, JsonValue]:
description="List all groups a user is a member of and all the apps a user has access to.",
secrets_placeholders=["RETOOL_SECRET"],
)
def list_groups_and_apps_per_user() -> list[dict[str, JsonValue]]:
def list_retool_groups_and_apps_per_user() -> list[dict[str, JsonValue]]:
secret = ctx.get().secrets.get("RETOOL_SECRET")
secret = RetoolSecret.model_validate(secret)

Expand Down Expand Up @@ -271,7 +271,7 @@ def _validate_date_format(date_str: str) -> str:
description="List all apps a user has used as viewer and/or editor within a certain time range.",
secrets_placeholders=["RETOOL_SECRET"],
)
def list_used_groups_and_apps_per_user(
def list_retool_used_groups_and_apps_per_user(
start_date: Annotated[
str,
ArgumentMetadata(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ List all groups a user is a member of and all the apps a user has access to.
**SDK Import:**

```python
from admyral.actions import list_groups_and_apps_per_user
from admyral.actions import list_retool_groups_and_apps_per_user
```

## Arguments
Expand Down Expand Up @@ -57,7 +57,7 @@ Schema:
## SDK Example

```python
groups_per_user = list_groups_and_apps_per_user(
groups_per_user = list_retool_groups_and_apps_per_user(
secrets={"RETOOL_SECRET": "my_stored_retool_secret"}
)
```
4 changes: 2 additions & 2 deletions docs/pages/integrations/retool/apis/list_groups_per_user.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This method lists all groups a user is a member of, along with the last time a u
**SDK Import:**

```python
from admyral.actions import list_groups_per_user
from admyral.actions import list_retool_groups_per_user
```

## Arguments
Expand Down Expand Up @@ -51,7 +51,7 @@ Schema:
## SDK Example

```python
groups_per_user = list_groups_per_user(
groups_per_user = list_retool_groups_per_user(
secrets={"RETOOL_SECRET": "my_stored_retool_secret"}
)
```
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ List all apps a user has used as viewer and/or editor within a certain time rang
**SDK Import:**

```python
from admyral.actions import list_used_groups_and_apps_per_user
from admyral.actions import list_retool_used_groups_and_apps_per_user
```

## Arguments
Expand Down Expand Up @@ -61,7 +61,7 @@ Schema:
## SDK Example

```python
groups_per_user = list_used_groups_and_apps_per_user(
groups_per_user = list_retool_used_groups_and_apps_per_user(
start_date="2024-10-01",
end_date="2024-10-31",
secrets={"RETOOL_SECRET": "my_stored_retool_secret"}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
from admyral.workflow import workflow
from admyral.typings import JsonValue
from admyral.actions import (
list_groups_and_apps_per_user,
list_used_groups_and_apps_per_user,
list_retool_groups_and_apps_per_user,
list_retool_used_groups_and_apps_per_user,
join_lists,
format_json_to_list_view_string,
send_slack_message_to_user_by_email,
Expand Down Expand Up @@ -63,13 +63,13 @@ def retool_access_optimization(payload: dict[str, JsonValue]):
only_date=True,
)

used_groups_and_apps_per_user = list_used_groups_and_apps_per_user(
used_groups_and_apps_per_user = list_retool_used_groups_and_apps_per_user(
start_date=start_and_end_time[0],
end_date=start_and_end_time[1],
secrets={"RETOOL_SECRET": "retool_secret"},
)

groups_and_apps_per_user = list_groups_and_apps_per_user(
groups_and_apps_per_user = list_retool_groups_and_apps_per_user(
secrets={"RETOOL_SECRET": "retool_secret"}
)

Expand Down
6 changes: 4 additions & 2 deletions examples/access_review/workflows/retool_access_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from admyral.workflow import workflow
from admyral.typings import JsonValue
from admyral.actions import (
list_groups_per_user,
list_retool_groups_per_user,
batched_send_slack_message_to_user_by_email,
)
from admyral.action import action, ArgumentMetadata
Expand Down Expand Up @@ -166,7 +166,9 @@ def build_review_requests_as_slack_message_for_managers(
description="This workflow sends Slack messages to managers for Retool access review.",
)
def retool_access_review(payload: dict[str, JsonValue]):
groups_per_user = list_groups_per_user(secrets={"RETOOL_SECRET": "retool_secret"})
groups_per_user = list_retool_groups_per_user(
secrets={"RETOOL_SECRET": "retool_secret"}
)
messages = build_review_requests_as_slack_message_for_managers(
groups_per_user=groups_per_user,
)
Expand Down

0 comments on commit 7409415

Please sign in to comment.