Skip to content

Commit

Permalink
Run all the integration tests - 2023-09-21 PT
Browse files Browse the repository at this point in the history
  • Loading branch information
seratch committed Sep 22, 2023
1 parent 08b4e44 commit fc464f6
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 0 deletions.
19 changes: 19 additions & 0 deletions json-logs/raw/audit/v1/actions.json
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,25 @@
"workflow_trigger_permission_set",
"workflow_trigger_permission_added",
"workflow_trigger_permission_removed"
],
"canvas": [
"canvas_access_added",
"canvas_access_downgraded",
"canvas_access_revoked",
"canvas_access_upgraded",
"canvas_created",
"canvas_deleted",
"canvas_downloaded",
"canvas_edited",
"canvas_linksharing_disabled",
"canvas_linksharing_enabled",
"canvas_merged",
"canvas_opened",
"canvas_ownership_transferred",
"canvas_restored",
"canvas_shared",
"canvas_tombstoned",
"canvas_unshared"
]
}
}
3 changes: 3 additions & 0 deletions json-logs/samples/audit/v1/actions.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
],
"workflow_v2": [
""
],
"canvas": [
""
]
},
"ok": false,
Expand Down
23 changes: 23 additions & 0 deletions slack-api-client/src/main/java/com/slack/api/audit/Actions.java
Original file line number Diff line number Diff line change
Expand Up @@ -447,4 +447,27 @@ private WorkflowV2() {
public static final String workflow_trigger_permission_added = "workflow_trigger_permission_added";
public static final String workflow_trigger_permission_removed = "workflow_trigger_permission_removed";
}

public static class Canvas {
private Canvas() {
}

public static final String canvas_access_added = "canvas_access_added";
public static final String canvas_access_downgraded = "canvas_access_downgraded";
public static final String canvas_access_revoked = "canvas_access_revoked";
public static final String canvas_access_upgraded = "canvas_access_upgraded";
public static final String canvas_created = "canvas_created";
public static final String canvas_deleted = "canvas_deleted";
public static final String canvas_downloaded = "canvas_downloaded";
public static final String canvas_edited = "canvas_edited";
public static final String canvas_linksharing_disabled = "canvas_linksharing_disabled";
public static final String canvas_linksharing_enabled = "canvas_linksharing_enabled";
public static final String canvas_merged = "canvas_merged";
public static final String canvas_opened = "canvas_opened";
public static final String canvas_ownership_transferred = "canvas_ownership_transferred";
public static final String canvas_restored = "canvas_restored";
public static final String canvas_shared = "canvas_shared";
public static final String canvas_tombstoned = "canvas_tombstoned";
public static final String canvas_unshared = "canvas_unshared";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@ public static class Actions {
private List<String> accountTypeRole;
private List<String> appApprovalAutomationRule;
private List<String> workflowV2;
private List<String> canvas;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ public static class Entity {
private AccountTypeRole accountTypeRole;
private Workflow workflow;
private InformationBarrier barrier;
private WorkflowV2 workflowV2;
}

@Data
Expand Down Expand Up @@ -189,6 +190,24 @@ public static class DetailsChangedValue {
private Map<String, List<String>> namedStringValues;
}

@Data
public static class WorkflowV2 {
private String id;
private String appId;
private Integer dateUpdated;
private String callbackId;
private String name;
private String updatedBy;
private List<WorkflowV2StepConfiguration> stepConfiguration;
}

@Data
public static class WorkflowV2StepConfiguration {
private String name; // "Collect info in a form"
private String stepFunctionType; // "Custom", "Builtin"
private String stepFunctionAppId; // "A05QFAJ8LBA"
}

@Data
public static class Details {
private String type;
Expand Down Expand Up @@ -305,6 +324,10 @@ public static class Details {
private List<String> changedPermissions; // permissions_assigned
private String datastoreName; // app_datastore_created
private List<Attribute> attributes; // app_datastore_created
private String channel; // canvas_access_added
private String entityType; // canvas_access_added
private String actor; // canvas_access_added
private String accessLevel; // canvas_access_added
}

@Data
Expand Down Expand Up @@ -375,6 +398,7 @@ public static class FeatureEnablement {
@Data
public static class SharedWith {
private String channelId;
private String accessLevel;
}

@Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,12 @@ public void getActions_detectingNewOnes() throws IOException, AuditApiException
fail("Unknown action detected - " + action);
}
}
List<String> canvasNames = getAllPublicStaticFieldValues(Actions.Canvas.class);
for (String action : actions.getCanvas()) {
if (!canvasNames.contains(action)) {
fail("Unknown action detected - " + action);
}
}
}

@Test
Expand Down Expand Up @@ -305,6 +311,8 @@ public void getLogs_paginated() throws IOException, AuditApiException {
@Test
public void getLogs_all_actions() throws Exception {
if (orgAdminUserToken != null) {
verifyAllActions(orgAdminUserToken, Actions.WorkflowV2.class);
verifyAllActions(orgAdminUserToken, Actions.Canvas.class);
verifyAllActions(orgAdminUserToken, Actions.SlackCLI.class);
verifyAllActions(orgAdminUserToken, Actions.WorkspaceOrOrg.class);
verifyAllActions(orgAdminUserToken, Actions.User.class);
Expand Down

0 comments on commit fc464f6

Please sign in to comment.