You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: lib/AuditLogs.php
+95Lines changed: 95 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -115,15 +115,110 @@ public function createExport($organizationId, $rangeStart, $rangeEnd, $actions =
115
115
* @param string $auditLogExportId Unique identifier of the Audit Log Export
116
116
*
117
117
* @throws Exception\WorkOSException
118
+
* @throws \InvalidArgumentException
118
119
*
119
120
* @return Resource\AuditLogExport
120
121
*/
121
122
publicfunctiongetExport($auditLogExportId)
122
123
{
124
+
// Validate export ID parameter to prevent path traversal
125
+
if (!is_string($auditLogExportId) || !preg_match('/^[a-zA-Z0-9._-]+$/', $auditLogExportId)) {
126
+
thrownew \InvalidArgumentException('Invalid export ID format. Export ID must be a string containing only alphanumeric characters, dots, underscores, and hyphens.');
* @param string $action The action name for the schema
140
+
* @param array $schema Array containing the schema definition
141
+
*
142
+
* @throws Exception\WorkOSException
143
+
* @throws \InvalidArgumentException
144
+
*
145
+
* @return array The created schema response
146
+
*/
147
+
publicfunctioncreateSchema($action, $schema)
148
+
{
149
+
// Validate action parameter to prevent path traversal
150
+
if (!is_string($action) || !preg_match('/^[a-zA-Z0-9._-]+$/', $action)) {
151
+
thrownew \InvalidArgumentException('Invalid action format. Action must be a string containing only alphanumeric characters, dots, underscores, and hyphens.');
* @return bool True if schema exists, false if not found
170
+
*/
171
+
publicfunctionschemaExists($action)
172
+
{
173
+
// Validate action parameter to prevent path traversal
174
+
if (!is_string($action) || !preg_match('/^[a-zA-Z0-9._-]+$/', $action)) {
175
+
thrownew \InvalidArgumentException('Invalid action format. Action must be a string containing only alphanumeric characters, dots, underscores, and hyphens.');
0 commit comments