diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 5420675..b101257 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -14,7 +14,7 @@ jobs: max-parallel: 1 matrix: os: [ ubuntu-latest ] - php: [ 8.2, 8.3, 8.4 ] + php: [ 8.4 ] laravel: [ 12.* ] stability: [ prefer-lowest, prefer-stable ] @@ -47,10 +47,13 @@ jobs: - name: Execute tests run: vendor/bin/pest env: - DOCUWARE_URL: ${{ secrets.DOCUWARE_URL }} - DOCUWARE_USERNAME: ${{ secrets.DOCUWARE_USERNAME }} - DOCUWARE_PASSWORD: ${{ secrets.DOCUWARE_PASSWORD }} - DOCUWARE_COOKIES: ${{ secrets.DOCUWARE_COOKIES }} + M_FILES_URL: ${{ secrets.M_FILES_URL }} + M_FILES_USERNAME: ${{ secrets.M_FILES_USERNAME }} + M_FILES_PASSWORD: ${{ secrets.M_FILES_PASSWORD }} + M_FILES_VAULT_GUID: ${{ secrets.M_FILES_VAULT_GUID }} + M_FILES_CACHE_DRIVER: ${{ secrets.M_FILES_CACHE_DRIVER }} + M_FILES_CACHE_LIFETIME_IN_SECONDS: ${{ secrets.M_FILES_CACHE_LIFETIME_IN_SECONDS }} + SALOON_FIXTURE_REDACTION: true - name: Store Log Artifacts if: failure() diff --git a/.gitignore b/.gitignore index bad4681..91b23b2 100644 --- a/.gitignore +++ b/.gitignore @@ -10,4 +10,3 @@ vendor node_modules .phpactor.json build -tests/Fixtures/Saloon/ diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 9b2c8f6..a24eb3b 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -27,6 +27,7 @@ + diff --git a/src/DTO/Document.php b/src/DTO/Document.php index ec63b62..0a0eea9 100644 --- a/src/DTO/Document.php +++ b/src/DTO/Document.php @@ -44,7 +44,7 @@ public static function fromArray(array $data): self return new self( id: Arr::get($data, 'ObjVer.ID') ?: Arr::get($data, 'ID'), title: Arr::get($data, 'Title'), - objectType: $objVerType && $objVerType !== 0 ? (string) $objVerType : Arr::get($data, 'ObjectType'), + objectType: $objVerType && $objVerType != 0 ? (string) $objVerType : Arr::get($data, 'ObjectType'), objectTypeId: $objVerType !== null ? $objVerType : Arr::get($data, 'ObjectTypeID'), version: $objVerVersion ? (string) $objVerVersion : Arr::get($data, 'Version'), created: $created ? CarbonImmutable::parse($created) : null, diff --git a/src/DTO/PropertyValue.php b/src/DTO/PropertyValue.php index 33ca08b..5e6abc1 100644 --- a/src/DTO/PropertyValue.php +++ b/src/DTO/PropertyValue.php @@ -21,7 +21,7 @@ public static function fromArray(array $data): self { $typedValue = Arr::get($data, 'TypedValue', []); $dataTypeId = Arr::get($typedValue, 'DataType', 0); - $dataType = MFDataTypeEnum::tryFrom($dataTypeId) ?? MFDataTypeEnum::Uninitialized; + $dataType = MFDataTypeEnum::tryFrom($dataTypeId) ?? MFDataTypeEnum::UNINITIALIZED; return new self( propertyDef: Arr::get($data, 'PropertyDef'), diff --git a/src/Fixtures/AuthenticationTokenFixture.php b/src/Fixtures/AuthenticationTokenFixture.php index ff56c50..a08412c 100644 --- a/src/Fixtures/AuthenticationTokenFixture.php +++ b/src/Fixtures/AuthenticationTokenFixture.php @@ -15,22 +15,34 @@ protected function defineName(): string protected function defineSensitiveHeaders(): array { + if (! env('SALOON_FIXTURE_REDACTION', true)) { + return []; + } + return [ - // 'Set-Cookie' => 'REDACTED', + 'Set-Cookie' => 'REDACTED', ]; } protected function defineSensitiveJsonParameters(): array { + if (! env('SALOON_FIXTURE_REDACTION', true)) { + return []; + } + return [ - // 'Value' => 'REDACTED-AUTH-TOKEN', + 'Value' => 'REDACTED-AUTH-TOKEN', ]; } protected function defineSensitiveRegexPatterns(): array { + if (! env('SALOON_FIXTURE_REDACTION', true)) { + return []; + } + return [ - // '/[A-Za-z0-9_-]{100,}/' => 'REDACTED-AUTH-TOKEN', + '/[A-Za-z0-9_-]{100,}/' => 'REDACTED-AUTH-TOKEN', ]; } } diff --git a/src/Fixtures/CreateSingleFileDocumentFixture.php b/src/Fixtures/CreateSingleFileDocumentFixture.php index ad8c3a8..3a83093 100644 --- a/src/Fixtures/CreateSingleFileDocumentFixture.php +++ b/src/Fixtures/CreateSingleFileDocumentFixture.php @@ -15,7 +15,13 @@ protected function defineName(): string protected function defineSensitiveHeaders(): array { - return []; + if (! env('SALOON_FIXTURE_REDACTION', true)) { + return []; + } + + return [ + 'Set-Cookie' => 'REDACTED', + ]; } protected function defineSensitiveJsonParameters(): array @@ -25,6 +31,12 @@ protected function defineSensitiveJsonParameters(): array protected function defineSensitiveRegexPatterns(): array { - return []; + if (! env('SALOON_FIXTURE_REDACTION', true)) { + return []; + } + + return [ + '/2025-07-1[0-9]T[0-9]{2}:[0-9]{2}:[0-9]{2}Z/' => '2024-01-01T00:00:00Z', + ]; } } diff --git a/src/Fixtures/CurrentUserFixture.php b/src/Fixtures/CurrentUserFixture.php index 545777b..336de2a 100644 --- a/src/Fixtures/CurrentUserFixture.php +++ b/src/Fixtures/CurrentUserFixture.php @@ -15,17 +15,25 @@ protected function defineName(): string protected function defineSensitiveHeaders(): array { + if (! env('SALOON_FIXTURE_REDACTION', true)) { + return []; + } + return [ - // 'Set-Cookie' => 'REDACTED', + 'Set-Cookie' => 'REDACTED', ]; } protected function defineSensitiveJsonParameters(): array { + if (! env('SALOON_FIXTURE_REDACTION', true)) { + return []; + } + return [ - // 'AccountName' => 'redacted@example.com', - // 'SerialNumber' => 'REDACTED-SERIAL', - // 'FullName' => 'REDACTED USER', + 'AccountName' => 'redacted@example.com', + 'SerialNumber' => 'REDACTED-SERIAL', + 'FullName' => 'REDACTED USER', ]; } diff --git a/src/Fixtures/DocumentPropertiesFixture.php b/src/Fixtures/DocumentPropertiesFixture.php index c3ad4b4..80e9001 100644 --- a/src/Fixtures/DocumentPropertiesFixture.php +++ b/src/Fixtures/DocumentPropertiesFixture.php @@ -15,7 +15,13 @@ protected function defineName(): string protected function defineSensitiveHeaders(): array { - return []; + if (! env('SALOON_FIXTURE_REDACTION', true)) { + return []; + } + + return [ + 'Set-Cookie' => 'REDACTED', + ]; } protected function defineSensitiveJsonParameters(): array @@ -25,6 +31,12 @@ protected function defineSensitiveJsonParameters(): array protected function defineSensitiveRegexPatterns(): array { - return []; + if (! env('SALOON_FIXTURE_REDACTION', true)) { + return []; + } + + return [ + '/Fehlerreferenz-ID: [a-f0-9-]{36}/' => 'Fehlerreferenz-ID: REDACTED-ERROR-ID', + ]; } } diff --git a/src/Fixtures/DocumentsFixture.php b/src/Fixtures/DocumentsFixture.php index 1034830..c046012 100644 --- a/src/Fixtures/DocumentsFixture.php +++ b/src/Fixtures/DocumentsFixture.php @@ -15,16 +15,36 @@ protected function defineName(): string protected function defineSensitiveHeaders(): array { - return []; + if (! env('SALOON_FIXTURE_REDACTION', true)) { + return []; + } + + return [ + 'Set-Cookie' => 'REDACTED', + ]; } protected function defineSensitiveJsonParameters(): array { - return []; + if (! env('SALOON_FIXTURE_REDACTION', true)) { + return []; + } + + return [ + 'ObjectGUID' => 'REDACTED-GUID', + ]; } protected function defineSensitiveRegexPatterns(): array { - return []; + if (! env('SALOON_FIXTURE_REDACTION', true)) { + return []; + } + + return [ + '/\{[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}\}/i' => '{REDACTED-GUID}', + '/2025-07-1[0-9]T[0-9]{2}:[0-9]{2}:[0-9]{2}Z/' => '2024-01-01T00:00:00Z', + '/[0-9]{2}\.07\.2025 [0-9]{2}:[0-9]{2}/' => '01.01.2024 00:00', + ]; } } diff --git a/src/Fixtures/DownloadFileFixture.php b/src/Fixtures/DownloadFileFixture.php index 656c83a..d12844f 100644 --- a/src/Fixtures/DownloadFileFixture.php +++ b/src/Fixtures/DownloadFileFixture.php @@ -15,22 +15,34 @@ protected function defineName(): string protected function defineSensitiveHeaders(): array { + if (! env('SALOON_FIXTURE_REDACTION', true)) { + return []; + } + return [ - // 'Set-Cookie' => 'REDACTED', + 'Set-Cookie' => 'REDACTED', ]; } protected function defineSensitiveJsonParameters(): array { + if (! env('SALOON_FIXTURE_REDACTION', true)) { + return []; + } + return [ - // 'Value' => 'REDACTED-AUTH-TOKEN', + 'Value' => 'REDACTED-AUTH-TOKEN', ]; } protected function defineSensitiveRegexPatterns(): array { + if (! env('SALOON_FIXTURE_REDACTION', true)) { + return []; + } + return [ - // '/[A-Za-z0-9_-]{100,}/' => 'REDACTED-AUTH-TOKEN', + '/[A-Za-z0-9_-]{100,}/' => 'REDACTED-AUTH-TOKEN', ]; } } diff --git a/src/Fixtures/LogoutSessionFixture.php b/src/Fixtures/LogoutSessionFixture.php index 0bd85e1..c25ff27 100644 --- a/src/Fixtures/LogoutSessionFixture.php +++ b/src/Fixtures/LogoutSessionFixture.php @@ -15,8 +15,12 @@ protected function defineName(): string protected function defineSensitiveHeaders(): array { + if (! env('SALOON_FIXTURE_REDACTION', true)) { + return []; + } + return [ - // 'Set-Cookie' => 'REDACTED', + 'Set-Cookie' => 'REDACTED', ]; } diff --git a/src/Fixtures/UploadFileFixture.php b/src/Fixtures/UploadFileFixture.php index fa21c75..c723920 100644 --- a/src/Fixtures/UploadFileFixture.php +++ b/src/Fixtures/UploadFileFixture.php @@ -15,7 +15,13 @@ protected function defineName(): string protected function defineSensitiveHeaders(): array { - return []; + if (! env('SALOON_FIXTURE_REDACTION', true)) { + return []; + } + + return [ + 'Set-Cookie' => 'REDACTED', + ]; } protected function defineSensitiveJsonParameters(): array diff --git a/tests/Fixtures/Saloon/authentication-token.json b/tests/Fixtures/Saloon/authentication-token.json new file mode 100644 index 0000000..7acf4e3 --- /dev/null +++ b/tests/Fixtures/Saloon/authentication-token.json @@ -0,0 +1,18 @@ +{ + "statusCode": 200, + "headers": { + "Cache-Control": "private, must-revalidate, max-age=0", + "Content-Type": "application\/json; charset=utf-8", + "Expires": "Wed, 17 Jul 2024 00:31:06 GMT", + "X-Frame-Options": "SAMEORIGIN", + "Content-Security-Policy": "default-src 'none'; object-src 'self'; script-src 'unsafe-inline' 'unsafe-eval' 'self' blob: https:\/\/js.monitor.azure.com; style-src 'unsafe-inline' 'self'; font-src 'self' data:; connect-src 'self' https:\/\/northeurope-0.in.applicationinsights.azure.com https:\/\/js.monitor.azure.com; img-src 'self' blob: data:; manifest-src 'self'; form-action 'self' javascript:; frame-src * blob:; frame-ancestors 'self';", + "Set-Cookie": "REDACTED", + "X-XSS-Protection": "1; mode=block", + "X-Content-Type-Options": "nosniff", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains;", + "Date": "Fri, 18 Jul 2025 00:31:06 GMT", + "Content-Length": "354" + }, + "data": "{\"Value\":\"REDACTED-AUTH-TOKEN\"}", + "context": [] +} \ No newline at end of file diff --git a/tests/Fixtures/Saloon/create-single-file-document.json b/tests/Fixtures/Saloon/create-single-file-document.json new file mode 100644 index 0000000..72daaff --- /dev/null +++ b/tests/Fixtures/Saloon/create-single-file-document.json @@ -0,0 +1,17 @@ +{ + "statusCode": 200, + "headers": { + "Cache-Control": "private", + "Content-Type": "application/json; charset=utf-8", + "X-Frame-Options": "SAMEORIGIN", + "Content-Security-Policy": "default-src 'none'; object-src 'self'; script-src 'unsafe-inline' 'unsafe-eval' 'self' blob: https://js.monitor.azure.com; style-src 'unsafe-inline' 'self'; font-src 'self' data:; connect-src 'self' https://northeurope-0.in.applicationinsights.azure.com https://js.monitor.azure.com; img-src 'self' blob: data:; manifest-src 'self'; form-action 'self' javascript:; frame-src * blob:; frame-ancestors 'self';", + "Set-Cookie": "REDACTED", + "X-XSS-Protection": "1; mode=block", + "X-Content-Type-Options": "nosniff", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains;", + "Date": "Fri, 18 Jul 2025 01:21:01 GMT", + "Content-Length": "490" + }, + "data": "{\"Title\":\"Sample Document\",\"ObjVer\":{\"Version\":1,\"VersionType\":4,\"ID\":123,\"Type\":0},\"ObjectCheckedOut\":false,\"IsDeleted\":false,\"Files\":[{\"Name\":\"test-1.pdf\",\"Extension\":\"pdf\",\"Size\":8600,\"ID\":456,\"LastModified\":\"2024-01-01T00:00:00Z\"}]}", + "context": [] +} \ No newline at end of file diff --git a/tests/Fixtures/Saloon/current-user.json b/tests/Fixtures/Saloon/current-user.json new file mode 100644 index 0000000..bf5a0a3 --- /dev/null +++ b/tests/Fixtures/Saloon/current-user.json @@ -0,0 +1,18 @@ +{ + "statusCode": 200, + "headers": { + "Cache-Control": "private, must-revalidate, max-age=0", + "Content-Type": "application/json; charset=utf-8", + "Expires": "Wed, 17 Jul 2024 00:31:09 GMT", + "X-Frame-Options": "SAMEORIGIN", + "Content-Security-Policy": "default-src 'none'; object-src 'self'; script-src 'unsafe-inline' 'unsafe-eval' 'self' blob: https://js.monitor.azure.com; style-src 'unsafe-inline' 'self'; font-src 'self' data:; connect-src 'self' https://northeurope-0.in.applicationinsights.azure.com https://js.monitor.azure.com; img-src 'self' blob: data:; manifest-src 'self'; form-action 'self' javascript:; frame-src * blob:; frame-ancestors 'self';", + "Set-Cookie": "REDACTED", + "X-XSS-Protection": "1; mode=block", + "X-Content-Type-Options": "nosniff", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains;", + "Date": "Fri, 18 Jul 2025 00:31:09 GMT", + "Content-Length": "2446" + }, + "data": "{\"LicenseAllowsModifications\":true,\"HasFullControlOfVault\":true,\"IsAdminUser\":false,\"AccountName\":\"redacted@example.com\",\"LoginHint\":\"\",\"ACLMode\":1,\"AuthenticationType\":3,\"CanCreateobjects\":true,\"CanForceUndoCheckout\":true,\"CanManageCommonUISettings\":true,\"CanManageTraditionalFolders\":true,\"CanManageCommonViews\":true,\"CanMaterializeViews\":true,\"CanSeeAllObjects\":true,\"CanSeeDeletedObjects\":true,\"InternalUser\":true,\"UserID\":123,\"FullName\":\"REDACTED USER\",\"isReadOnlyLicense\":false,\"ServerVaultCapabilities\":{\"VaultLoginAccountsSupported\":false,\"PublicLinkSharingSupported\":true,\"LatestVersionPublicLinkSharingSupported\":false,\"FacetSearchSupported\":true,\"PropertyDefSearchabilitySupported\":true,\"AutomaticMetadataSupported\":false,\"FileStreamingSupported\":true,\"SearchOptionsSupported\":true,\"JSONExtApplicationsSupported\":true,\"SearchReferencedValueListItemsSupported\":true,\"GetTextContentWithOptionsSupported\":true,\"DetectTextLanguageSupported\":true,\"ObjectDataRetrievalInChunksSupported\":true,\"SettingsManagerSupported\":true,\"ExternalRepositoryObjectMigrationSupported\":true,\"ClientHttpApiSupported\":true,\"ReverseGroupingLevelSupported\":true,\"ReplicationConfigurationIDSupported\":true,\"AsyncNACLChangePropagationSupported\":true,\"AsyncTasksRetrievalSupported\":true,\"FindDuplicatesSupported\":true,\"FavorFullTextSearchSupported\":true,\"ApplicationTaskQueueSupported\":true,\"ObjectPermissionsForClientSupported\":true,\"UndeleteUserAccountByGUIDSupported\":true,\"UseUserVisibleACLInSearches\":true,\"NamedValueStorageConflictDetectionSupported\":true,\"HierarchicalObjectTypePropertiesSupported\":true,\"EmbeddingToSharePointSupported\":true,\"EmbeddingToSalesforceSupported\":true,\"AsyncModifyObjectClassSupported\":true,\"WebUserInterfaceSupported\":true,\"RemoveFromRecentsSupported\":true,\"EmbeddingToGoogleGSuiteSupported\":true,\"FullControlVaultUserCanModifyCodeSupported\":false,\"EmbeddingToArcGisSupported\":true,\"WebClientsProductionTelemetryEnabled\":true,\"SharedLinkBasedWOPIOperationSupported\":true,\"MdccResolvedOnServer\":true,\"GreenLightsSupported\":false,\"NewWebWOPICoAuthoringSupported\":true,\"MFilesLinkSupported\":true,\"MdccConversionOnServer\":true,\"VaultLevelOptimizationJobsSupported\":true,\"ImportViewsWithOlderLastModifiedSupported\":true,\"VisitorLinksSupported\":true,\"AddObjectWithMultipleFilesSupported\":true},\"SerialNumber\":\"REDACTED-SERIAL\",\"Deployment\":\"OnPremise\",\"licenseString\":\"Named\",\"licenseType\":1,\"AutomaticMetadataEnabled\":false,\"CanDestroyObjects\":true}", + "context": [] +} \ No newline at end of file diff --git a/tests/Fixtures/Saloon/document-properties.json b/tests/Fixtures/Saloon/document-properties.json new file mode 100644 index 0000000..12d8854 --- /dev/null +++ b/tests/Fixtures/Saloon/document-properties.json @@ -0,0 +1,17 @@ +{ + "statusCode": 404, + "headers": { + "Cache-Control": "private", + "Content-Type": "application\/json; charset=utf-8", + "X-Frame-Options": "SAMEORIGIN", + "Content-Security-Policy": "default-src 'none'; object-src 'self'; script-src 'unsafe-inline' 'unsafe-eval' 'self' blob: https:\/\/js.monitor.azure.com; style-src 'unsafe-inline' 'self'; font-src 'self' data:; connect-src 'self' https:\/\/northeurope-0.in.applicationinsights.azure.com https:\/\/js.monitor.azure.com; img-src 'self' blob: data:; manifest-src 'self'; form-action 'self' javascript:; frame-src * blob:; frame-ancestors 'self';", + "Set-Cookie": "REDACTED", + "X-XSS-Protection": "1; mode=block", + "X-Content-Type-Options": "nosniff", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains;", + "Date": "Fri, 18 Jul 2025 01:21:21 GMT", + "Content-Length": "414" + }, + "data": "{\"Status\":404,\"URL\":\"\/objects\/251\/properties\",\"Method\":\"GET\",\"Exception\":{\"Name\":\"NotFoundException\",\"Message\":\"Eine Ausnahme vom Typ \\\"MFWS.NotFoundException\\\" wurde ausgel\u00f6st.\"},\"Stack\":\"Fehlerreferenz-ID: REDACTED-ERROR-ID\",\"Message\":\"Eine Ausnahme vom Typ \\\"MFWS.NotFoundException\\\" wurde ausgel\u00f6st.\",\"IsLoggedToVault\":true,\"IsLoggedToApplication\":true,\"ExceptionName\":\"NotFoundException\"}", + "context": [] +} \ No newline at end of file diff --git a/tests/Fixtures/Saloon/documents.json b/tests/Fixtures/Saloon/documents.json new file mode 100644 index 0000000..75b650b --- /dev/null +++ b/tests/Fixtures/Saloon/documents.json @@ -0,0 +1,17 @@ +{ + "statusCode": 200, + "headers": { + "Cache-Control": "private, must-revalidate, max-age=0", + "Content-Type": "application/json; charset=utf-8", + "Expires": "Wed, 17 Jul 2024 00:31:08 GMT", + "X-Frame-Options": "SAMEORIGIN", + "Content-Security-Policy": "default-src 'none'; object-src 'self'; script-src 'unsafe-inline' 'unsafe-eval' 'self' blob: https://js.monitor.azure.com; style-src 'unsafe-inline' 'self'; font-src 'self' data:; connect-src 'self' https://northeurope-0.in.applicationinsights.azure.com https://js.monitor.azure.com; img-src 'self' blob: data:; manifest-src 'self'; form-action 'self' javascript:; frame-src * blob:; frame-ancestors 'self';", + "Set-Cookie": "REDACTED", + "X-XSS-Protection": "1; mode=block", + "X-Content-Type-Options": "nosniff", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains;", + "Date": "Fri, 18 Jul 2025 00:31:07 GMT", + "Content-Length": "1500" + }, + "data": "{\"Items\":[{\"Title\":\"Sample Document 1\",\"EscapedTitleWithID\":\"Sample Document 1 (ID 154-1)\",\"DisplayID\":\"1\",\"ObjVer\":{\"Version\":1,\"VersionType\":4,\"ID\":1,\"Type\":154},\"Class\":189,\"CheckedOutAtUtc\":\"1601-01-01T00:00:00Z\",\"CheckedOutAt\":\"1601-01-01T00:00:00Z\",\"LastModifiedUtc\":\"2024-01-01T00:00:00Z\",\"LastModified\":\"2024-01-01T00:00:00Z\",\"ObjectCheckedOut\":false,\"ObjectCheckedOutToThisUser\":false,\"CheckedOutTo\":0,\"SingleFile\":false,\"HasRelationshipsFrom\":false,\"HasRelationshipsTo\":false,\"HasRelationshipsFromThis\":false,\"HasRelationshipsToThis\":false,\"HasAssignments\":false,\"Deleted\":false,\"IsDeleted\":false,\"IsStub\":false,\"ThisVersionLatestToThisUser\":true,\"CreatedUtc\":\"2024-01-01T00:00:00Z\",\"Created\":\"2024-01-01T00:00:00Z\",\"Files\":[{\"ID\":101,\"Name\":\"sample-document-1\",\"Extension\":\"pdf\",\"Size\":1024,\"LastModified\":\"2024-01-01T00:00:00Z\"}],\"VisibleAfterOperation\":true,\"PathInIDView\":\"154\\\\0-999\\\\1\\\\S\\\\v1\",\"LastModifiedDisplayValue\":\"01.01.2024 00:00\",\"CheckedOutAtDisplayValue\":\"01.01.1601 00:00\",\"CreatedDisplayValue\":\"01.01.2024 00:00\",\"ObjectVersionFlags\":2,\"Score\":0,\"LastAccessedByMe\":\"1899-12-30T00:00:00Z\",\"AccessedByMeUtc\":\"1899-12-30T00:00:00Z\",\"AccessedByMe\":\"1899-12-30T00:00:00Z\",\"ObjectGUID\":\"{REDACTED-GUID-1}\",\"ObjectCapabilityFlags\":-1,\"ObjectFlags\":64,\"propertyID\":0,\"LatestCheckedInVersion\":1,\"BaseProperties\":[]},{\"Title\":\"Sample Document 2\",\"EscapedTitleWithID\":\"Sample Document 2 (ID 154-2)\",\"DisplayID\":\"2\",\"ObjVer\":{\"Version\":1,\"VersionType\":4,\"ID\":2,\"Type\":154},\"Class\":189,\"CheckedOutAtUtc\":\"1601-01-01T00:00:00Z\",\"CheckedOutAt\":\"1601-01-01T00:00:00Z\",\"LastModifiedUtc\":\"2024-01-01T00:00:00Z\",\"LastModified\":\"2024-01-01T00:00:00Z\",\"ObjectCheckedOut\":false,\"ObjectCheckedOutToThisUser\":false,\"CheckedOutTo\":0,\"SingleFile\":false,\"HasRelationshipsFrom\":false,\"HasRelationshipsTo\":false,\"HasRelationshipsFromThis\":false,\"HasRelationshipsToThis\":false,\"HasAssignments\":false,\"Deleted\":false,\"IsDeleted\":false,\"IsStub\":false,\"ThisVersionLatestToThisUser\":true,\"CreatedUtc\":\"2024-01-01T00:00:00Z\",\"Created\":\"2024-01-01T00:00:00Z\",\"Files\":[{\"ID\":102,\"Name\":\"sample-document-2\",\"Extension\":\"docx\",\"Size\":2048,\"LastModified\":\"2024-01-01T00:00:00Z\"}],\"VisibleAfterOperation\":true,\"PathInIDView\":\"154\\\\0-999\\\\2\\\\S\\\\v1\",\"LastModifiedDisplayValue\":\"01.01.2024 00:00\",\"CheckedOutAtDisplayValue\":\"01.01.1601 00:00\",\"CreatedDisplayValue\":\"01.01.2024 00:00\",\"ObjectVersionFlags\":2,\"Score\":0,\"LastAccessedByMe\":\"1899-12-30T00:00:00Z\",\"AccessedByMeUtc\":\"1899-12-30T00:00:00Z\",\"AccessedByMe\":\"1899-12-30T00:00:00Z\",\"ObjectGUID\":\"{REDACTED-GUID-2}\",\"ObjectCapabilityFlags\":-1,\"ObjectFlags\":64,\"propertyID\":0,\"LatestCheckedInVersion\":1,\"BaseProperties\":[]}],\"TotalCount\":2,\"Page\":1,\"PageSize\":10}" +} \ No newline at end of file diff --git a/tests/Fixtures/Saloon/download-file.json b/tests/Fixtures/Saloon/download-file.json new file mode 100644 index 0000000..d8142b5 --- /dev/null +++ b/tests/Fixtures/Saloon/download-file.json @@ -0,0 +1,11 @@ +{ + "statusCode": 200, + "headers": { + "Content-Disposition": "attachment; filename=\"sample-document-1.pdf\"", + "Content-Length": "1024", + "Content-Type": "application/pdf", + "Last-Modified": "Tue, 15 Jul 2025 22:04:38 GMT" + }, + "data": "This is the content of sample-document-1.pdf file from M-Files. It contains sample data for testing purposes.", + "context": [] +} \ No newline at end of file diff --git a/tests/Fixtures/Saloon/logout-session.json b/tests/Fixtures/Saloon/logout-session.json new file mode 100644 index 0000000..1d99aa6 --- /dev/null +++ b/tests/Fixtures/Saloon/logout-session.json @@ -0,0 +1,17 @@ +{ + "statusCode": 200, + "headers": { + "Cache-Control": "private, must-revalidate, max-age=0", + "Content-Type": "application\/json; charset=utf-8", + "Expires": "Wed, 17 Jul 2024 00:31:06 GMT", + "X-Frame-Options": "SAMEORIGIN", + "Content-Security-Policy": "default-src 'none'; object-src 'self'; script-src 'unsafe-inline' 'unsafe-eval' 'self' blob: https:\/\/js.monitor.azure.com; style-src 'unsafe-inline' 'self'; font-src 'self' data:; connect-src 'self' https:\/\/northeurope-0.in.applicationinsights.azure.com https:\/\/js.monitor.azure.com; img-src 'self' blob: data:; manifest-src 'self'; form-action 'self' javascript:; frame-src * blob:; frame-ancestors 'self';", + "X-XSS-Protection": "1; mode=block", + "X-Content-Type-Options": "nosniff", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains;", + "Date": "Fri, 18 Jul 2025 00:31:06 GMT", + "Content-Length": "14" + }, + "data": "{\"Value\":true}", + "context": [] +} \ No newline at end of file diff --git a/tests/Fixtures/Saloon/upload-file.json b/tests/Fixtures/Saloon/upload-file.json new file mode 100644 index 0000000..82ce0d1 --- /dev/null +++ b/tests/Fixtures/Saloon/upload-file.json @@ -0,0 +1,18 @@ +{ + "statusCode": 200, + "headers": { + "Cache-Control": "private, must-revalidate, max-age=0", + "Content-Type": "application/json; charset=utf-8", + "Expires": "Wed, 17 Jul 2024 00:31:07 GMT", + "X-Frame-Options": "SAMEORIGIN", + "Content-Security-Policy": "default-src 'none'; object-src 'self'; script-src 'unsafe-inline' 'unsafe-eval' 'self' blob: https://js.monitor.azure.com; style-src 'unsafe-inline' 'self'; font-src 'self' data:; connect-src 'self' https://northeurope-0.in.applicationinsights.azure.com https://js.monitor.azure.com; img-src 'self' blob: data:; manifest-src 'self'; form-action 'self' javascript:; frame-src * blob:; frame-ancestors 'self';", + "Set-Cookie": "REDACTED", + "X-XSS-Protection": "1; mode=block", + "X-Content-Type-Options": "nosniff", + "Strict-Transport-Security": "max-age=31536000; includeSubDomains;", + "Date": "Fri, 18 Jul 2025 00:31:07 GMT", + "Content-Length": "50" + }, + "data": "{\"ID\":456,\"Title\":\"test-1\",\"Extension\":\"pdf\",\"Size\":8785}", + "context": [] +} \ No newline at end of file