From 45c799632e208a0164a217b6c48c97b7a9c978e8 Mon Sep 17 00:00:00 2001 From: Vincent Date: Sun, 25 Dec 2022 14:31:01 +1300 Subject: [PATCH 01/11] Initial Pioneer setup and audit --- implementations/pioneer-swift/.gitignore | 9 + .../pioneer-swift/Package.resolved | 212 ++++++++++++++++++ implementations/pioneer-swift/Package.swift | 27 +++ implementations/pioneer-swift/README.md | 194 ++++++++++++++++ .../pioneer-swift/Sources/audit/main.swift | 25 +++ yarn.lock | 8 +- 6 files changed, 471 insertions(+), 4 deletions(-) create mode 100644 implementations/pioneer-swift/.gitignore create mode 100644 implementations/pioneer-swift/Package.resolved create mode 100644 implementations/pioneer-swift/Package.swift create mode 100644 implementations/pioneer-swift/README.md create mode 100644 implementations/pioneer-swift/Sources/audit/main.swift diff --git a/implementations/pioneer-swift/.gitignore b/implementations/pioneer-swift/.gitignore new file mode 100644 index 00000000..3b298120 --- /dev/null +++ b/implementations/pioneer-swift/.gitignore @@ -0,0 +1,9 @@ +.DS_Store +/.build +/Packages +/*.xcodeproj +xcuserdata/ +DerivedData/ +.swiftpm/config/registries.json +.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +.netrc diff --git a/implementations/pioneer-swift/Package.resolved b/implementations/pioneer-swift/Package.resolved new file mode 100644 index 00000000..e3490f6a --- /dev/null +++ b/implementations/pioneer-swift/Package.resolved @@ -0,0 +1,212 @@ +{ + "pins" : [ + { + "identity" : "async-http-client", + "kind" : "remoteSourceControl", + "location" : "https://github.com/swift-server/async-http-client.git", + "state" : { + "revision" : "5bee16a79922e3efcb5cea06ecd27e6f8048b56b", + "version" : "1.13.1" + } + }, + { + "identity" : "async-kit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/vapor/async-kit.git", + "state" : { + "revision" : "929808e51fea04f01de0e911ce826ef70c4db4ea", + "version" : "1.15.0" + } + }, + { + "identity" : "console-kit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/vapor/console-kit.git", + "state" : { + "revision" : "a7e67a1719933318b5ab7eaaed355cde020465b1", + "version" : "4.5.0" + } + }, + { + "identity" : "graphiti", + "kind" : "remoteSourceControl", + "location" : "https://github.com/GraphQLSwift/Graphiti.git", + "state" : { + "revision" : "8c0048e217b185da163c8ba83475948dc5b0174e", + "version" : "1.2.2" + } + }, + { + "identity" : "graphql", + "kind" : "remoteSourceControl", + "location" : "https://github.com/GraphQLSwift/GraphQL", + "state" : { + "revision" : "30b8e2d192b44b6188644f87f5d60d416bcc5537", + "version" : "2.4.4" + } + }, + { + "identity" : "multipart-kit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/vapor/multipart-kit.git", + "state" : { + "revision" : "0d55c35e788451ee27222783c7d363cb88092fab", + "version" : "4.5.2" + } + }, + { + "identity" : "pioneer", + "kind" : "remoteSourceControl", + "location" : "https://github.com/d-exclaimation/pioneer", + "state" : { + "revision" : "5976f54c84297c8ca95ca34a70db3dfd78978b11", + "version" : "1.0.2" + } + }, + { + "identity" : "routing-kit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/vapor/routing-kit.git", + "state" : { + "revision" : "ffac7b3a127ce1e85fb232f1a6271164628809ad", + "version" : "4.6.0" + } + }, + { + "identity" : "swift-algorithms", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-algorithms.git", + "state" : { + "revision" : "b14b7f4c528c942f121c8b860b9410b2bf57825e", + "version" : "1.0.0" + } + }, + { + "identity" : "swift-atomics", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-atomics.git", + "state" : { + "revision" : "ff3d2212b6b093db7f177d0855adbc4ef9c5f036", + "version" : "1.0.3" + } + }, + { + "identity" : "swift-backtrace", + "kind" : "remoteSourceControl", + "location" : "https://github.com/swift-server/swift-backtrace.git", + "state" : { + "revision" : "f25620d5d05e2f1ba27154b40cafea2b67566956", + "version" : "1.3.3" + } + }, + { + "identity" : "swift-collections", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-collections", + "state" : { + "revision" : "937e904258d22af6e447a0b72c0bc67583ef64a2", + "version" : "1.0.4" + } + }, + { + "identity" : "swift-crypto", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-crypto.git", + "state" : { + "revision" : "92a04c10fc5ce0504f8396aac7392126033e547c", + "version" : "2.2.2" + } + }, + { + "identity" : "swift-log", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-log.git", + "state" : { + "revision" : "6fe203dc33195667ce1759bf0182975e4653ba1c", + "version" : "1.4.4" + } + }, + { + "identity" : "swift-metrics", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-metrics.git", + "state" : { + "revision" : "9b39d811a83cf18b79d7d5513b06f8b290198b10", + "version" : "2.3.3" + } + }, + { + "identity" : "swift-nio", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-nio.git", + "state" : { + "revision" : "7e3b50b38e4e66f31db6cf4a784c6af148bac846", + "version" : "2.46.0" + } + }, + { + "identity" : "swift-nio-extras", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-nio-extras.git", + "state" : { + "revision" : "91dd2d61fb772e1311bb5f13b59266b579d77e42", + "version" : "1.15.0" + } + }, + { + "identity" : "swift-nio-http2", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-nio-http2.git", + "state" : { + "revision" : "d6656967f33ed8b368b38e4b198631fc7c484a40", + "version" : "1.23.1" + } + }, + { + "identity" : "swift-nio-ssl", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-nio-ssl.git", + "state" : { + "revision" : "4fb7ead803e38949eb1d6fabb849206a72c580f3", + "version" : "2.23.0" + } + }, + { + "identity" : "swift-nio-transport-services", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-nio-transport-services.git", + "state" : { + "revision" : "c0d9a144cfaec8d3d596aadde3039286a266c15c", + "version" : "1.15.0" + } + }, + { + "identity" : "swift-numerics", + "kind" : "remoteSourceControl", + "location" : "https://github.com/apple/swift-numerics", + "state" : { + "revision" : "0a5bc04095a675662cf24757cc0640aa2204253b", + "version" : "1.0.2" + } + }, + { + "identity" : "vapor", + "kind" : "remoteSourceControl", + "location" : "https://github.com/vapor/vapor.git", + "state" : { + "revision" : "eb2da0d749e185789970c32f7fd9c114a339fa13", + "version" : "4.67.5" + } + }, + { + "identity" : "websocket-kit", + "kind" : "remoteSourceControl", + "location" : "https://github.com/vapor/websocket-kit.git", + "state" : { + "revision" : "2d9d2188a08eef4a869d368daab21b3c08510991", + "version" : "2.6.1" + } + } + ], + "version" : 2 +} diff --git a/implementations/pioneer-swift/Package.swift b/implementations/pioneer-swift/Package.swift new file mode 100644 index 00000000..269147d4 --- /dev/null +++ b/implementations/pioneer-swift/Package.swift @@ -0,0 +1,27 @@ +// swift-tools-version: 5.7 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "audit", + platforms: [ + .macOS(.v12) + ], + dependencies: [ + // Dependencies declare other packages that this package depends on. + // .package(url: /* package url */, from: "1.0.0") , + .package(url: "https://github.com/d-exclaimation/pioneer", from: "1.0.0"), + .package(url: "https://github.com/GraphQLSwift/GraphQL", from: "2.4.4") + ], + targets: [ + // Targets are the basic building blocks of a package. A target can define a module or a test suite. + // Targets can depend on other targets in this package, and on products in packages this package depends on. + .executableTarget( + name: "audit", + dependencies: [ + .product(name: "Pioneer", package: "pioneer"), + "GraphQL" + ]), + ] +) diff --git a/implementations/pioneer-swift/README.md b/implementations/pioneer-swift/README.md new file mode 100644 index 00000000..77d2df7f --- /dev/null +++ b/implementations/pioneer-swift/README.md @@ -0,0 +1,194 @@ +_* This report was auto-generated by graphql-http_ + +# GraphQL over HTTP audit report + +- **79** audits in total +- ✅ **45** pass +- ⚠️ **34** warnings (optional) + +## Passing +1. MUST accept application/json and match the content-type +2. SHOULD accept \*/\* and use application/json for the content-type +3. SHOULD assume application/json content-type when accept is missing +4. MUST use utf-8 encoding when responding +5. MUST accept utf-8 encoding +6. MUST assume utf-8 if encoding is unspecified +7. MUST accept POST requests +8. MAY accept application/x-www-form-urlencoded formatted GET requests +9. MAY NOT allow executing mutations on GET requests +10. SHOULD respond with 4xx status code if content-type is not supplied on POST requests +11. MUST accept application/json POST requests +12. MUST require a request body on POST +13. SHOULD use 400 status code on missing {query} parameter when accepting application/graphql-response+json +14. SHOULD use 400 status code on object {query} parameter when accepting application/graphql-response+json +15. SHOULD use 400 status code on number {query} parameter when accepting application/graphql-response+json +16. SHOULD use 400 status code on boolean {query} parameter when accepting application/graphql-response+json +17. SHOULD use 400 status code on array {query} parameter when accepting application/graphql-response+json +18. SHOULD allow string {query} parameter when accepting application/graphql-response+json +19. MUST allow string {query} parameter when accepting application/json +20. SHOULD allow string {operationName} parameter when accepting application/graphql-response+json +21. MUST allow string {operationName} parameter when accepting application/json +22. SHOULD allow null {variables} parameter when accepting application/graphql-response+json +23. MUST allow null {variables} parameter when accepting application/json +24. SHOULD allow null {operationName} parameter when accepting application/graphql-response+json +25. MUST allow null {operationName} parameter when accepting application/json +26. SHOULD allow null {extensions} parameter when accepting application/graphql-response+json +27. MUST allow null {extensions} parameter when accepting application/json +28. SHOULD allow map {variables} parameter when accepting application/graphql-response+json +29. MUST allow map {variables} parameter when accepting application/json +30. MAY allow URL-encoded JSON string {variables} parameter in GETs when accepting application/graphql-response+json +31. MAY allow URL-encoded JSON string {variables} parameter in GETs when accepting application/json +32. SHOULD allow map {extensions} parameter when accepting application/graphql-response+json +33. MUST allow map {extensions} parameter when accepting application/json +34. SHOULD use 4xx or 5xx status codes on JSON parsing failure when accepting application/graphql-response+json +35. SHOULD use 400 status code on JSON parsing failure when accepting application/graphql-response+json +36. SHOULD not contain the data entry on JSON parsing failure when accepting application/graphql-response+json +37. SHOULD use 4xx or 5xx status codes if parameters are invalid when accepting application/graphql-response+json +38. SHOULD use 400 status code if parameters are invalid when accepting application/graphql-response+json +39. SHOULD not contain the data entry if parameters are invalid when accepting application/graphql-response+json +40. SHOULD use 4xx or 5xx status codes on document parsing failure when accepting application/graphql-response+json +41. SHOULD use 400 status code on document parsing failure when accepting application/graphql-response+json +42. SHOULD not contain the data entry on document parsing failure when accepting application/graphql-response+json +43. SHOULD use 4xx or 5xx status codes on document validation failure when accepting application/graphql-response+json +44. SHOULD use 400 status code on document validation failure when accepting application/graphql-response+json +45. SHOULD not contain the data entry on document validation failure when accepting application/graphql-response+json + +## Warnings +The server _SHOULD_ support these, but is not required. +1. SHOULD accept application/graphql-response+json and match the content-type
+``` +Content-Type header "application/json; charset=utf-8" does not contain "application/graphql-response+json" +``` +2. SHOULD use 200 status code with errors field on missing {query} parameter when accepting application/json
+``` +Status code 400 is not 200 +``` +3. SHOULD use 200 status code with errors field on object {query} parameter when accepting application/json
+``` +Status code 400 is not 200 +``` +4. SHOULD use 200 status code with errors field on number {query} parameter when accepting application/json
+``` +Status code 400 is not 200 +``` +5. SHOULD use 200 status code with errors field on boolean {query} parameter when accepting application/json
+``` +Status code 400 is not 200 +``` +6. SHOULD use 200 status code with errors field on array {query} parameter when accepting application/json
+``` +Status code 400 is not 200 +``` +7. SHOULD use 400 status code on object {operationName} parameter when accepting application/graphql-response+json
+``` +Status code 200 is not 400 +``` +8. SHOULD use 400 status code on number {operationName} parameter when accepting application/graphql-response+json
+``` +Status code 200 is not 400 +``` +9. SHOULD use 400 status code on boolean {operationName} parameter when accepting application/graphql-response+json
+``` +Status code 200 is not 400 +``` +10. SHOULD use 400 status code on array {operationName} parameter when accepting application/graphql-response+json
+``` +Status code 200 is not 400 +``` +11. SHOULD use 200 status code with errors field on object {operationName} parameter when accepting application/json
+``` +Execution result {"data":{"__typename":"Query"}} does not have a property 'errors' +``` +12. SHOULD use 200 status code with errors field on number {operationName} parameter when accepting application/json
+``` +Execution result {"data":{"__typename":"Query"}} does not have a property 'errors' +``` +13. SHOULD use 200 status code with errors field on boolean {operationName} parameter when accepting application/json
+``` +Execution result {"data":{"__typename":"Query"}} does not have a property 'errors' +``` +14. SHOULD use 200 status code with errors field on array {operationName} parameter when accepting application/json
+``` +Execution result {"data":{"__typename":"Query"}} does not have a property 'errors' +``` +15. SHOULD use 400 status code on string {variables} parameter when accepting application/graphql-response+json
+``` +Status code 200 is not 400 +``` +16. SHOULD use 400 status code on number {variables} parameter when accepting application/graphql-response+json
+``` +Status code 200 is not 400 +``` +17. SHOULD use 400 status code on boolean {variables} parameter when accepting application/graphql-response+json
+``` +Status code 200 is not 400 +``` +18. SHOULD use 400 status code on array {variables} parameter when accepting application/graphql-response+json
+``` +Status code 200 is not 400 +``` +19. SHOULD use 200 status code with errors field on string {variables} parameter when accepting application/json
+``` +Execution result {"data":{"__typename":"Query"}} does not have a property 'errors' +``` +20. SHOULD use 200 status code with errors field on number {variables} parameter when accepting application/json
+``` +Execution result {"data":{"__typename":"Query"}} does not have a property 'errors' +``` +21. SHOULD use 200 status code with errors field on boolean {variables} parameter when accepting application/json
+``` +Execution result {"data":{"__typename":"Query"}} does not have a property 'errors' +``` +22. SHOULD use 200 status code with errors field on array {variables} parameter when accepting application/json
+``` +Execution result {"data":{"__typename":"Query"}} does not have a property 'errors' +``` +23. SHOULD use 400 status code on string {extensions} parameter when accepting application/graphql-response+json
+``` +Status code 200 is not 400 +``` +24. SHOULD use 400 status code on number {extensions} parameter when accepting application/graphql-response+json
+``` +Status code 200 is not 400 +``` +25. SHOULD use 400 status code on boolean {extensions} parameter when accepting application/graphql-response+json
+``` +Status code 200 is not 400 +``` +26. SHOULD use 400 status code on array {extensions} parameter when accepting application/graphql-response+json
+``` +Status code 200 is not 400 +``` +27. SHOULD use 200 status code with errors field on string {extensions} parameter when accepting application/json
+``` +Execution result {"data":{"__typename":"Query"}} does not have a property 'errors' +``` +28. SHOULD use 200 status code with errors field on number {extensions} parameter when accepting application/json
+``` +Execution result {"data":{"__typename":"Query"}} does not have a property 'errors' +``` +29. SHOULD use 200 status code with errors field on boolean {extensions} parameter when accepting application/json
+``` +Execution result {"data":{"__typename":"Query"}} does not have a property 'errors' +``` +30. SHOULD use 200 status code with errors field on array {extensions} parameter when accepting application/json
+``` +Execution result {"data":{"__typename":"Query"}} does not have a property 'errors' +``` +31. SHOULD use 200 status code on JSON parsing failure when accepting application/json
+``` +Status code 400 is not 200 +``` +32. SHOULD use 200 status code if parameters are invalid when accepting application/json
+``` +Status code 400 is not 200 +``` +33. SHOULD use 200 status code on document parsing failure when accepting application/json
+``` +Status code 400 is not 200 +``` +34. SHOULD use 200 status code on document validation failure when accepting application/json
+``` +Status code 400 is not 200 +``` + diff --git a/implementations/pioneer-swift/Sources/audit/main.swift b/implementations/pioneer-swift/Sources/audit/main.swift new file mode 100644 index 00000000..48d6042d --- /dev/null +++ b/implementations/pioneer-swift/Sources/audit/main.swift @@ -0,0 +1,25 @@ +import class Foundation.ProcessInfo +import Pioneer +import GraphQL + +let schema = try GraphQLSchema( + query: GraphQLObjectType( + name: "Query", + fields: [ + "_": GraphQLField( + type: GraphQLString, + resolve: { _, _, _, _ in + "_" + } + ) + ] + ) +) + +let server = Pioneer(schema: schema, resolver: ()) + + +try server.standaloneServer( + port: ProcessInfo.processInfo.environment["PORT"]?.intValue ?? 4000, + host: "127.0.0.1" +) \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 84264779..7dc53bd2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6704,7 +6704,7 @@ __metadata: "fsevents@patch:fsevents@^2.3.2#~builtin, fsevents@patch:fsevents@~2.3.2#~builtin": version: 2.3.2 - resolution: "fsevents@patch:fsevents@npm%3A2.3.2#~builtin::version=2.3.2&hash=df0bf1" + resolution: "fsevents@patch:fsevents@npm%3A2.3.2#~builtin::version=2.3.2&hash=18f3a7" dependencies: node-gyp: latest conditions: os=darwin @@ -10781,7 +10781,7 @@ __metadata: "resolve@patch:resolve@^1.10.0#~builtin, resolve@patch:resolve@^1.14.2#~builtin, resolve@patch:resolve@^1.20.0#~builtin, resolve@patch:resolve@^1.22.1#~builtin": version: 1.22.1 - resolution: "resolve@patch:resolve@npm%3A1.22.1#~builtin::version=1.22.1&hash=c3c19d" + resolution: "resolve@patch:resolve@npm%3A1.22.1#~builtin::version=1.22.1&hash=07638b" dependencies: is-core-module: ^2.9.0 path-parse: ^1.0.7 @@ -11944,11 +11944,11 @@ __metadata: "typescript@patch:typescript@4.9.4#~builtin, typescript@patch:typescript@^4.9.4#~builtin": version: 4.9.4 - resolution: "typescript@patch:typescript@npm%3A4.9.4#~builtin::version=4.9.4&hash=ad5954" + resolution: "typescript@patch:typescript@npm%3A4.9.4#~builtin::version=4.9.4&hash=701156" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 1caaea6cb7f813e64345190fddc4e6c924d0b698ab81189b503763c4a18f7f5501c69362979d36e19c042d89d936443e768a78b0675690b35eb663d19e0eae71 + checksum: 37f6e2c3c5e2aa5934b85b0fddbf32eeac8b1bacf3a5b51d01946936d03f5377fe86255d4e5a4ae628fd0cd553386355ad362c57f13b4635064400f3e8e05b9d languageName: node linkType: hard From 4d92914d689d25eb8f573f3aa4e99830fb48e620 Mon Sep 17 00:00:00 2001 From: Vincent Date: Sun, 25 Dec 2022 23:04:15 +1300 Subject: [PATCH 02/11] Updated Pioneer version and re-run audit --- .../pioneer-swift/Package.resolved | 9 - implementations/pioneer-swift/Package.swift | 2 +- implementations/pioneer-swift/README.md | 255 ++++++------------ 3 files changed, 82 insertions(+), 184 deletions(-) diff --git a/implementations/pioneer-swift/Package.resolved b/implementations/pioneer-swift/Package.resolved index e3490f6a..8bb1107b 100644 --- a/implementations/pioneer-swift/Package.resolved +++ b/implementations/pioneer-swift/Package.resolved @@ -54,15 +54,6 @@ "version" : "4.5.2" } }, - { - "identity" : "pioneer", - "kind" : "remoteSourceControl", - "location" : "https://github.com/d-exclaimation/pioneer", - "state" : { - "revision" : "5976f54c84297c8ca95ca34a70db3dfd78978b11", - "version" : "1.0.2" - } - }, { "identity" : "routing-kit", "kind" : "remoteSourceControl", diff --git a/implementations/pioneer-swift/Package.swift b/implementations/pioneer-swift/Package.swift index 269147d4..0261099f 100644 --- a/implementations/pioneer-swift/Package.swift +++ b/implementations/pioneer-swift/Package.swift @@ -11,7 +11,7 @@ let package = Package( dependencies: [ // Dependencies declare other packages that this package depends on. // .package(url: /* package url */, from: "1.0.0") , - .package(url: "https://github.com/d-exclaimation/pioneer", from: "1.0.0"), + .package(path: "../../../../libs/pioneer"), .package(url: "https://github.com/GraphQLSwift/GraphQL", from: "2.4.4") ], targets: [ diff --git a/implementations/pioneer-swift/README.md b/implementations/pioneer-swift/README.md index 77d2df7f..2151f612 100644 --- a/implementations/pioneer-swift/README.md +++ b/implementations/pioneer-swift/README.md @@ -3,191 +3,98 @@ _* This report was auto-generated by graphql-http_ # GraphQL over HTTP audit report - **79** audits in total -- ✅ **45** pass -- ⚠️ **34** warnings (optional) +- ✅ **76** pass +- ⚠️ **3** warnings (optional) ## Passing -1. MUST accept application/json and match the content-type -2. SHOULD accept \*/\* and use application/json for the content-type -3. SHOULD assume application/json content-type when accept is missing -4. MUST use utf-8 encoding when responding -5. MUST accept utf-8 encoding -6. MUST assume utf-8 if encoding is unspecified -7. MUST accept POST requests -8. MAY accept application/x-www-form-urlencoded formatted GET requests -9. MAY NOT allow executing mutations on GET requests -10. SHOULD respond with 4xx status code if content-type is not supplied on POST requests -11. MUST accept application/json POST requests -12. MUST require a request body on POST -13. SHOULD use 400 status code on missing {query} parameter when accepting application/graphql-response+json -14. SHOULD use 400 status code on object {query} parameter when accepting application/graphql-response+json -15. SHOULD use 400 status code on number {query} parameter when accepting application/graphql-response+json -16. SHOULD use 400 status code on boolean {query} parameter when accepting application/graphql-response+json -17. SHOULD use 400 status code on array {query} parameter when accepting application/graphql-response+json -18. SHOULD allow string {query} parameter when accepting application/graphql-response+json -19. MUST allow string {query} parameter when accepting application/json -20. SHOULD allow string {operationName} parameter when accepting application/graphql-response+json -21. MUST allow string {operationName} parameter when accepting application/json -22. SHOULD allow null {variables} parameter when accepting application/graphql-response+json -23. MUST allow null {variables} parameter when accepting application/json -24. SHOULD allow null {operationName} parameter when accepting application/graphql-response+json -25. MUST allow null {operationName} parameter when accepting application/json -26. SHOULD allow null {extensions} parameter when accepting application/graphql-response+json -27. MUST allow null {extensions} parameter when accepting application/json -28. SHOULD allow map {variables} parameter when accepting application/graphql-response+json -29. MUST allow map {variables} parameter when accepting application/json -30. MAY allow URL-encoded JSON string {variables} parameter in GETs when accepting application/graphql-response+json -31. MAY allow URL-encoded JSON string {variables} parameter in GETs when accepting application/json -32. SHOULD allow map {extensions} parameter when accepting application/graphql-response+json -33. MUST allow map {extensions} parameter when accepting application/json -34. SHOULD use 4xx or 5xx status codes on JSON parsing failure when accepting application/graphql-response+json -35. SHOULD use 400 status code on JSON parsing failure when accepting application/graphql-response+json -36. SHOULD not contain the data entry on JSON parsing failure when accepting application/graphql-response+json -37. SHOULD use 4xx or 5xx status codes if parameters are invalid when accepting application/graphql-response+json -38. SHOULD use 400 status code if parameters are invalid when accepting application/graphql-response+json -39. SHOULD not contain the data entry if parameters are invalid when accepting application/graphql-response+json -40. SHOULD use 4xx or 5xx status codes on document parsing failure when accepting application/graphql-response+json -41. SHOULD use 400 status code on document parsing failure when accepting application/graphql-response+json -42. SHOULD not contain the data entry on document parsing failure when accepting application/graphql-response+json -43. SHOULD use 4xx or 5xx status codes on document validation failure when accepting application/graphql-response+json -44. SHOULD use 400 status code on document validation failure when accepting application/graphql-response+json -45. SHOULD not contain the data entry on document validation failure when accepting application/graphql-response+json +1. SHOULD accept application/graphql-response+json and match the content-type +2. MUST accept application/json and match the content-type +3. SHOULD accept \*/\* and use application/json for the content-type +4. SHOULD assume application/json content-type when accept is missing +5. MUST use utf-8 encoding when responding +6. MUST accept utf-8 encoding +7. MUST assume utf-8 if encoding is unspecified +8. MUST accept POST requests +9. MAY accept application/x-www-form-urlencoded formatted GET requests +10. MAY NOT allow executing mutations on GET requests +11. SHOULD respond with 4xx status code if content-type is not supplied on POST requests +12. MUST accept application/json POST requests +13. MUST require a request body on POST +14. SHOULD use 400 status code on missing {query} parameter when accepting application/graphql-response+json +15. SHOULD use 200 status code with errors field on missing {query} parameter when accepting application/json +16. SHOULD use 400 status code on object {query} parameter when accepting application/graphql-response+json +17. SHOULD use 400 status code on number {query} parameter when accepting application/graphql-response+json +18. SHOULD use 400 status code on boolean {query} parameter when accepting application/graphql-response+json +19. SHOULD use 400 status code on array {query} parameter when accepting application/graphql-response+json +20. SHOULD use 200 status code with errors field on object {query} parameter when accepting application/json +21. SHOULD use 200 status code with errors field on number {query} parameter when accepting application/json +22. SHOULD use 200 status code with errors field on boolean {query} parameter when accepting application/json +23. SHOULD use 200 status code with errors field on array {query} parameter when accepting application/json +24. SHOULD allow string {query} parameter when accepting application/graphql-response+json +25. MUST allow string {query} parameter when accepting application/json +26. SHOULD use 400 status code on object {operationName} parameter when accepting application/graphql-response+json +27. SHOULD use 400 status code on number {operationName} parameter when accepting application/graphql-response+json +28. SHOULD use 400 status code on boolean {operationName} parameter when accepting application/graphql-response+json +29. SHOULD use 400 status code on array {operationName} parameter when accepting application/graphql-response+json +30. SHOULD use 200 status code with errors field on object {operationName} parameter when accepting application/json +31. SHOULD use 200 status code with errors field on number {operationName} parameter when accepting application/json +32. SHOULD use 200 status code with errors field on boolean {operationName} parameter when accepting application/json +33. SHOULD use 200 status code with errors field on array {operationName} parameter when accepting application/json +34. SHOULD allow string {operationName} parameter when accepting application/graphql-response+json +35. MUST allow string {operationName} parameter when accepting application/json +36. SHOULD allow null {variables} parameter when accepting application/graphql-response+json +37. MUST allow null {variables} parameter when accepting application/json +38. SHOULD allow null {operationName} parameter when accepting application/graphql-response+json +39. MUST allow null {operationName} parameter when accepting application/json +40. SHOULD allow null {extensions} parameter when accepting application/graphql-response+json +41. MUST allow null {extensions} parameter when accepting application/json +42. SHOULD use 400 status code on string {variables} parameter when accepting application/graphql-response+json +43. SHOULD use 400 status code on number {variables} parameter when accepting application/graphql-response+json +44. SHOULD use 400 status code on boolean {variables} parameter when accepting application/graphql-response+json +45. SHOULD use 400 status code on array {variables} parameter when accepting application/graphql-response+json +46. SHOULD use 200 status code with errors field on string {variables} parameter when accepting application/json +47. SHOULD use 200 status code with errors field on number {variables} parameter when accepting application/json +48. SHOULD use 200 status code with errors field on boolean {variables} parameter when accepting application/json +49. SHOULD use 200 status code with errors field on array {variables} parameter when accepting application/json +50. SHOULD allow map {variables} parameter when accepting application/graphql-response+json +51. MUST allow map {variables} parameter when accepting application/json +52. MAY allow URL-encoded JSON string {variables} parameter in GETs when accepting application/graphql-response+json +53. MAY allow URL-encoded JSON string {variables} parameter in GETs when accepting application/json +54. SHOULD use 400 status code on string {extensions} parameter when accepting application/graphql-response+json +55. SHOULD use 400 status code on number {extensions} parameter when accepting application/graphql-response+json +56. SHOULD use 400 status code on boolean {extensions} parameter when accepting application/graphql-response+json +57. SHOULD use 400 status code on array {extensions} parameter when accepting application/graphql-response+json +58. SHOULD use 200 status code with errors field on string {extensions} parameter when accepting application/json +59. SHOULD use 200 status code with errors field on number {extensions} parameter when accepting application/json +60. SHOULD use 200 status code with errors field on boolean {extensions} parameter when accepting application/json +61. SHOULD use 200 status code with errors field on array {extensions} parameter when accepting application/json +62. SHOULD allow map {extensions} parameter when accepting application/graphql-response+json +63. MUST allow map {extensions} parameter when accepting application/json +64. SHOULD use 200 status code if parameters are invalid when accepting application/json +65. SHOULD use 4xx or 5xx status codes on JSON parsing failure when accepting application/graphql-response+json +66. SHOULD use 400 status code on JSON parsing failure when accepting application/graphql-response+json +67. SHOULD not contain the data entry on JSON parsing failure when accepting application/graphql-response+json +68. SHOULD use 4xx or 5xx status codes if parameters are invalid when accepting application/graphql-response+json +69. SHOULD use 400 status code if parameters are invalid when accepting application/graphql-response+json +70. SHOULD not contain the data entry if parameters are invalid when accepting application/graphql-response+json +71. SHOULD use 4xx or 5xx status codes on document parsing failure when accepting application/graphql-response+json +72. SHOULD use 400 status code on document parsing failure when accepting application/graphql-response+json +73. SHOULD not contain the data entry on document parsing failure when accepting application/graphql-response+json +74. SHOULD use 4xx or 5xx status codes on document validation failure when accepting application/graphql-response+json +75. SHOULD use 400 status code on document validation failure when accepting application/graphql-response+json +76. SHOULD not contain the data entry on document validation failure when accepting application/graphql-response+json ## Warnings The server _SHOULD_ support these, but is not required. -1. SHOULD accept application/graphql-response+json and match the content-type
-``` -Content-Type header "application/json; charset=utf-8" does not contain "application/graphql-response+json" -``` -2. SHOULD use 200 status code with errors field on missing {query} parameter when accepting application/json
-``` -Status code 400 is not 200 -``` -3. SHOULD use 200 status code with errors field on object {query} parameter when accepting application/json
-``` -Status code 400 is not 200 -``` -4. SHOULD use 200 status code with errors field on number {query} parameter when accepting application/json
-``` -Status code 400 is not 200 -``` -5. SHOULD use 200 status code with errors field on boolean {query} parameter when accepting application/json
-``` -Status code 400 is not 200 -``` -6. SHOULD use 200 status code with errors field on array {query} parameter when accepting application/json
-``` -Status code 400 is not 200 -``` -7. SHOULD use 400 status code on object {operationName} parameter when accepting application/graphql-response+json
-``` -Status code 200 is not 400 -``` -8. SHOULD use 400 status code on number {operationName} parameter when accepting application/graphql-response+json
-``` -Status code 200 is not 400 -``` -9. SHOULD use 400 status code on boolean {operationName} parameter when accepting application/graphql-response+json
-``` -Status code 200 is not 400 -``` -10. SHOULD use 400 status code on array {operationName} parameter when accepting application/graphql-response+json
-``` -Status code 200 is not 400 -``` -11. SHOULD use 200 status code with errors field on object {operationName} parameter when accepting application/json
-``` -Execution result {"data":{"__typename":"Query"}} does not have a property 'errors' -``` -12. SHOULD use 200 status code with errors field on number {operationName} parameter when accepting application/json
-``` -Execution result {"data":{"__typename":"Query"}} does not have a property 'errors' -``` -13. SHOULD use 200 status code with errors field on boolean {operationName} parameter when accepting application/json
-``` -Execution result {"data":{"__typename":"Query"}} does not have a property 'errors' -``` -14. SHOULD use 200 status code with errors field on array {operationName} parameter when accepting application/json
-``` -Execution result {"data":{"__typename":"Query"}} does not have a property 'errors' -``` -15. SHOULD use 400 status code on string {variables} parameter when accepting application/graphql-response+json
-``` -Status code 200 is not 400 -``` -16. SHOULD use 400 status code on number {variables} parameter when accepting application/graphql-response+json
-``` -Status code 200 is not 400 -``` -17. SHOULD use 400 status code on boolean {variables} parameter when accepting application/graphql-response+json
-``` -Status code 200 is not 400 -``` -18. SHOULD use 400 status code on array {variables} parameter when accepting application/graphql-response+json
-``` -Status code 200 is not 400 -``` -19. SHOULD use 200 status code with errors field on string {variables} parameter when accepting application/json
-``` -Execution result {"data":{"__typename":"Query"}} does not have a property 'errors' -``` -20. SHOULD use 200 status code with errors field on number {variables} parameter when accepting application/json
-``` -Execution result {"data":{"__typename":"Query"}} does not have a property 'errors' -``` -21. SHOULD use 200 status code with errors field on boolean {variables} parameter when accepting application/json
-``` -Execution result {"data":{"__typename":"Query"}} does not have a property 'errors' -``` -22. SHOULD use 200 status code with errors field on array {variables} parameter when accepting application/json
-``` -Execution result {"data":{"__typename":"Query"}} does not have a property 'errors' -``` -23. SHOULD use 400 status code on string {extensions} parameter when accepting application/graphql-response+json
-``` -Status code 200 is not 400 -``` -24. SHOULD use 400 status code on number {extensions} parameter when accepting application/graphql-response+json
-``` -Status code 200 is not 400 -``` -25. SHOULD use 400 status code on boolean {extensions} parameter when accepting application/graphql-response+json
-``` -Status code 200 is not 400 -``` -26. SHOULD use 400 status code on array {extensions} parameter when accepting application/graphql-response+json
-``` -Status code 200 is not 400 -``` -27. SHOULD use 200 status code with errors field on string {extensions} parameter when accepting application/json
-``` -Execution result {"data":{"__typename":"Query"}} does not have a property 'errors' -``` -28. SHOULD use 200 status code with errors field on number {extensions} parameter when accepting application/json
-``` -Execution result {"data":{"__typename":"Query"}} does not have a property 'errors' -``` -29. SHOULD use 200 status code with errors field on boolean {extensions} parameter when accepting application/json
-``` -Execution result {"data":{"__typename":"Query"}} does not have a property 'errors' -``` -30. SHOULD use 200 status code with errors field on array {extensions} parameter when accepting application/json
-``` -Execution result {"data":{"__typename":"Query"}} does not have a property 'errors' -``` -31. SHOULD use 200 status code on JSON parsing failure when accepting application/json
-``` -Status code 400 is not 200 -``` -32. SHOULD use 200 status code if parameters are invalid when accepting application/json
+1. SHOULD use 200 status code on JSON parsing failure when accepting application/json
``` Status code 400 is not 200 ``` -33. SHOULD use 200 status code on document parsing failure when accepting application/json
+2. SHOULD use 200 status code on document parsing failure when accepting application/json
``` Status code 400 is not 200 ``` -34. SHOULD use 200 status code on document validation failure when accepting application/json
+3. SHOULD use 200 status code on document validation failure when accepting application/json
``` Status code 400 is not 200 ``` From 9650bf6b0a542693d2c5ff9076705a03ea2204bd Mon Sep 17 00:00:00 2001 From: Vincent Date: Sun, 25 Dec 2022 23:30:24 +1300 Subject: [PATCH 03/11] Create docker compose config --- implementations/pioneer-swift/Dockerfile | 6 ++++++ implementations/pioneer-swift/Package.resolved | 9 +++++++++ implementations/pioneer-swift/Package.swift | 2 +- .../pioneer-swift/Sources/audit/main.swift | 2 +- implementations/pioneer-swift/docker-compose.yml | 13 +++++++++++++ implementations/pioneer-swift/package.json | 8 ++++++++ 6 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 implementations/pioneer-swift/Dockerfile create mode 100644 implementations/pioneer-swift/docker-compose.yml create mode 100644 implementations/pioneer-swift/package.json diff --git a/implementations/pioneer-swift/Dockerfile b/implementations/pioneer-swift/Dockerfile new file mode 100644 index 00000000..5172cbd1 --- /dev/null +++ b/implementations/pioneer-swift/Dockerfile @@ -0,0 +1,6 @@ +FROM swift:latest as builder +WORKDIR /root +COPY ./Package.* ./ +RUN swift package resolve +COPY . . +RUN swift build \ No newline at end of file diff --git a/implementations/pioneer-swift/Package.resolved b/implementations/pioneer-swift/Package.resolved index 8bb1107b..e3490f6a 100644 --- a/implementations/pioneer-swift/Package.resolved +++ b/implementations/pioneer-swift/Package.resolved @@ -54,6 +54,15 @@ "version" : "4.5.2" } }, + { + "identity" : "pioneer", + "kind" : "remoteSourceControl", + "location" : "https://github.com/d-exclaimation/pioneer", + "state" : { + "revision" : "5976f54c84297c8ca95ca34a70db3dfd78978b11", + "version" : "1.0.2" + } + }, { "identity" : "routing-kit", "kind" : "remoteSourceControl", diff --git a/implementations/pioneer-swift/Package.swift b/implementations/pioneer-swift/Package.swift index 0261099f..269147d4 100644 --- a/implementations/pioneer-swift/Package.swift +++ b/implementations/pioneer-swift/Package.swift @@ -11,7 +11,7 @@ let package = Package( dependencies: [ // Dependencies declare other packages that this package depends on. // .package(url: /* package url */, from: "1.0.0") , - .package(path: "../../../../libs/pioneer"), + .package(url: "https://github.com/d-exclaimation/pioneer", from: "1.0.0"), .package(url: "https://github.com/GraphQLSwift/GraphQL", from: "2.4.4") ], targets: [ diff --git a/implementations/pioneer-swift/Sources/audit/main.swift b/implementations/pioneer-swift/Sources/audit/main.swift index 48d6042d..6e0fba4d 100644 --- a/implementations/pioneer-swift/Sources/audit/main.swift +++ b/implementations/pioneer-swift/Sources/audit/main.swift @@ -21,5 +21,5 @@ let server = Pioneer(schema: schema, resolver: ()) try server.standaloneServer( port: ProcessInfo.processInfo.environment["PORT"]?.intValue ?? 4000, - host: "127.0.0.1" + host: ProcessInfo.processInfo.environment["HOST"] ?? "127.0.0.1" ) \ No newline at end of file diff --git a/implementations/pioneer-swift/docker-compose.yml b/implementations/pioneer-swift/docker-compose.yml new file mode 100644 index 00000000..f2c84146 --- /dev/null +++ b/implementations/pioneer-swift/docker-compose.yml @@ -0,0 +1,13 @@ +services: + server: + build: . + environment: + - HOST=0.0.0.0 + - PORT=${PORT} + ports: + - ${PORT}:${PORT} + entrypoint: swift run + healthcheck: + test: curl -f http://localhost:$$PORT/graphql?query=%7B__typename%7D || exit 1 + interval: 3s + timeout: 1s \ No newline at end of file diff --git a/implementations/pioneer-swift/package.json b/implementations/pioneer-swift/package.json new file mode 100644 index 00000000..c6ef1ad4 --- /dev/null +++ b/implementations/pioneer-swift/package.json @@ -0,0 +1,8 @@ +{ + "private": true, + "name": "pioneer", + "packageManager": "yarn@3.2.3", + "scripts": { + "start": "docker compose up --build" + } +} \ No newline at end of file From 0357e974963835420e8fdef2b7f33c8fd6b54f08 Mon Sep 17 00:00:00 2001 From: Vincent Date: Sun, 25 Dec 2022 23:45:53 +1300 Subject: [PATCH 04/11] Fixed Pioneer package dependencies --- implementations/pioneer-swift/Package.resolved | 4 ++-- implementations/pioneer-swift/Package.swift | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/implementations/pioneer-swift/Package.resolved b/implementations/pioneer-swift/Package.resolved index e3490f6a..af57094c 100644 --- a/implementations/pioneer-swift/Package.resolved +++ b/implementations/pioneer-swift/Package.resolved @@ -59,8 +59,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/d-exclaimation/pioneer", "state" : { - "revision" : "5976f54c84297c8ca95ca34a70db3dfd78978b11", - "version" : "1.0.2" + "revision" : "1c3fb676fd67cfd4b99e374f1f4302d35aa2c64e", + "version" : "1.1.0" } }, { diff --git a/implementations/pioneer-swift/Package.swift b/implementations/pioneer-swift/Package.swift index 269147d4..477a1f12 100644 --- a/implementations/pioneer-swift/Package.swift +++ b/implementations/pioneer-swift/Package.swift @@ -11,7 +11,7 @@ let package = Package( dependencies: [ // Dependencies declare other packages that this package depends on. // .package(url: /* package url */, from: "1.0.0") , - .package(url: "https://github.com/d-exclaimation/pioneer", from: "1.0.0"), + .package(url: "https://github.com/d-exclaimation/pioneer", from: "1.1.0"), .package(url: "https://github.com/GraphQLSwift/GraphQL", from: "2.4.4") ], targets: [ From 28fb5bf28118e3e374e6eedc4f3369b7008083e2 Mon Sep 17 00:00:00 2001 From: Vincent Date: Sun, 25 Dec 2022 23:56:07 +1300 Subject: [PATCH 05/11] Rename pioneer-swift to pioneer --- implementations/{pioneer-swift => pioneer}/.gitignore | 0 implementations/{pioneer-swift => pioneer}/Dockerfile | 0 implementations/{pioneer-swift => pioneer}/Package.resolved | 0 implementations/{pioneer-swift => pioneer}/Package.swift | 0 implementations/{pioneer-swift => pioneer}/README.md | 0 .../{pioneer-swift => pioneer}/Sources/audit/main.swift | 0 implementations/{pioneer-swift => pioneer}/docker-compose.yml | 0 implementations/{pioneer-swift => pioneer}/package.json | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename implementations/{pioneer-swift => pioneer}/.gitignore (100%) rename implementations/{pioneer-swift => pioneer}/Dockerfile (100%) rename implementations/{pioneer-swift => pioneer}/Package.resolved (100%) rename implementations/{pioneer-swift => pioneer}/Package.swift (100%) rename implementations/{pioneer-swift => pioneer}/README.md (100%) rename implementations/{pioneer-swift => pioneer}/Sources/audit/main.swift (100%) rename implementations/{pioneer-swift => pioneer}/docker-compose.yml (100%) rename implementations/{pioneer-swift => pioneer}/package.json (100%) diff --git a/implementations/pioneer-swift/.gitignore b/implementations/pioneer/.gitignore similarity index 100% rename from implementations/pioneer-swift/.gitignore rename to implementations/pioneer/.gitignore diff --git a/implementations/pioneer-swift/Dockerfile b/implementations/pioneer/Dockerfile similarity index 100% rename from implementations/pioneer-swift/Dockerfile rename to implementations/pioneer/Dockerfile diff --git a/implementations/pioneer-swift/Package.resolved b/implementations/pioneer/Package.resolved similarity index 100% rename from implementations/pioneer-swift/Package.resolved rename to implementations/pioneer/Package.resolved diff --git a/implementations/pioneer-swift/Package.swift b/implementations/pioneer/Package.swift similarity index 100% rename from implementations/pioneer-swift/Package.swift rename to implementations/pioneer/Package.swift diff --git a/implementations/pioneer-swift/README.md b/implementations/pioneer/README.md similarity index 100% rename from implementations/pioneer-swift/README.md rename to implementations/pioneer/README.md diff --git a/implementations/pioneer-swift/Sources/audit/main.swift b/implementations/pioneer/Sources/audit/main.swift similarity index 100% rename from implementations/pioneer-swift/Sources/audit/main.swift rename to implementations/pioneer/Sources/audit/main.swift diff --git a/implementations/pioneer-swift/docker-compose.yml b/implementations/pioneer/docker-compose.yml similarity index 100% rename from implementations/pioneer-swift/docker-compose.yml rename to implementations/pioneer/docker-compose.yml diff --git a/implementations/pioneer-swift/package.json b/implementations/pioneer/package.json similarity index 100% rename from implementations/pioneer-swift/package.json rename to implementations/pioneer/package.json From 1fa4e72f84e8da652e0ab409496a9c6d36423c1f Mon Sep 17 00:00:00 2001 From: Vincent Date: Sun, 25 Dec 2022 23:56:27 +1300 Subject: [PATCH 06/11] Add pioneer audit to workflow --- .github/workflows/audits.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/.github/workflows/audits.yml b/.github/workflows/audits.yml index 281db15d..d9740be5 100644 --- a/.github/workflows/audits.yml +++ b/.github/workflows/audits.yml @@ -252,6 +252,33 @@ jobs: with: name: postgraphile-report path: README.md + pioneer: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, '[skip ci]')" + env: + PORT: 4000 + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up node + uses: actions/setup-node@v3 + with: + node-version: 18 + cache: yarn + - name: Install + run: yarn install --immutable + - name: Build + run: yarn build:esm + - name: Start + run: yarn workspace pioneer start -d --wait + # TODO: cache docker build artifacts + - name: Audit + run: node scripts/audit-implementation.mjs README.md + - name: Upload report + uses: actions/upload-artifact@v3 + with: + name: pioneer-report + path: README.md report: name: Report @@ -268,6 +295,7 @@ jobs: thegraph, hotchocolate, postgraphile, + pioneer, ] steps: - name: Checkout @@ -320,6 +348,11 @@ jobs: with: name: postgraphile-report path: implementations/postgraphile + - name: Download pioneer report + uses: actions/download-artifact@v3 + with: + name: pioneer-report + path: implementations/pioneer - name: Commit run: | git config user.name "github-actions[bot]" From ce4fc6c46616cfed326891af8d2ebbf163c1f281 Mon Sep 17 00:00:00 2001 From: Vincent Date: Mon, 26 Dec 2022 10:08:08 +1300 Subject: [PATCH 07/11] Ran yarn install --- implementations/pioneer/package.json | 2 +- yarn.lock | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/implementations/pioneer/package.json b/implementations/pioneer/package.json index c6ef1ad4..7ffeddac 100644 --- a/implementations/pioneer/package.json +++ b/implementations/pioneer/package.json @@ -5,4 +5,4 @@ "scripts": { "start": "docker compose up --build" } -} \ No newline at end of file +} diff --git a/yarn.lock b/yarn.lock index 7dc53bd2..62f8c32e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10164,6 +10164,12 @@ __metadata: languageName: node linkType: hard +"pioneer@workspace:implementations/pioneer": + version: 0.0.0-use.local + resolution: "pioneer@workspace:implementations/pioneer" + languageName: unknown + linkType: soft + "pirates@npm:^4.0.4": version: 4.0.5 resolution: "pirates@npm:4.0.5" From 079528d89f9b5728284ba5303630878a0ad0839a Mon Sep 17 00:00:00 2001 From: Vincent Date: Tue, 27 Dec 2022 01:37:40 +1300 Subject: [PATCH 08/11] re-run yarn install --- yarn.lock | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/yarn.lock b/yarn.lock index 62f8c32e..33d1b483 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6704,7 +6704,7 @@ __metadata: "fsevents@patch:fsevents@^2.3.2#~builtin, fsevents@patch:fsevents@~2.3.2#~builtin": version: 2.3.2 - resolution: "fsevents@patch:fsevents@npm%3A2.3.2#~builtin::version=2.3.2&hash=18f3a7" + resolution: "fsevents@patch:fsevents@npm%3A2.3.2#~builtin::version=2.3.2&hash=df0bf1" dependencies: node-gyp: latest conditions: os=darwin @@ -10787,14 +10787,13 @@ __metadata: "resolve@patch:resolve@^1.10.0#~builtin, resolve@patch:resolve@^1.14.2#~builtin, resolve@patch:resolve@^1.20.0#~builtin, resolve@patch:resolve@^1.22.1#~builtin": version: 1.22.1 - resolution: "resolve@patch:resolve@npm%3A1.22.1#~builtin::version=1.22.1&hash=07638b" + resolution: "resolve@patch:resolve@npm%3A1.22.1#~builtin::version=1.22.1&hash=c3c19d" dependencies: is-core-module: ^2.9.0 path-parse: ^1.0.7 supports-preserve-symlinks-flag: ^1.0.0 bin: resolve: bin/resolve - checksum: 5656f4d0bedcf8eb52685c1abdf8fbe73a1603bb1160a24d716e27a57f6cecbe2432ff9c89c2bd57542c3a7b9d14b1882b73bfe2e9d7849c9a4c0b8b39f02b8b languageName: node linkType: hard @@ -11950,11 +11949,10 @@ __metadata: "typescript@patch:typescript@4.9.4#~builtin, typescript@patch:typescript@^4.9.4#~builtin": version: 4.9.4 - resolution: "typescript@patch:typescript@npm%3A4.9.4#~builtin::version=4.9.4&hash=701156" + resolution: "typescript@patch:typescript@npm%3A4.9.4#~builtin::version=4.9.4&hash=ad5954" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 37f6e2c3c5e2aa5934b85b0fddbf32eeac8b1bacf3a5b51d01946936d03f5377fe86255d4e5a4ae628fd0cd553386355ad362c57f13b4635064400f3e8e05b9d languageName: node linkType: hard From 7f9020017ceb3253f1a0842efad81e428db65568 Mon Sep 17 00:00:00 2001 From: Vincent Date: Tue, 27 Dec 2022 09:02:49 +1300 Subject: [PATCH 09/11] fixed curl not installed on swift docker image --- implementations/pioneer/Dockerfile | 8 +++++--- implementations/pioneer/Sources/audit/main.swift | 4 ++-- implementations/pioneer/docker-compose.yml | 6 +++--- implementations/pioneer/package.json | 2 +- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/implementations/pioneer/Dockerfile b/implementations/pioneer/Dockerfile index 5172cbd1..10df9cce 100644 --- a/implementations/pioneer/Dockerfile +++ b/implementations/pioneer/Dockerfile @@ -1,6 +1,8 @@ -FROM swift:latest as builder +FROM swift:latest WORKDIR /root +RUN apt update +RUN apt install curl COPY ./Package.* ./ RUN swift package resolve -COPY . . -RUN swift build \ No newline at end of file +COPY ./Sources ./Sources +RUN swift build -c release diff --git a/implementations/pioneer/Sources/audit/main.swift b/implementations/pioneer/Sources/audit/main.swift index 6e0fba4d..eef79017 100644 --- a/implementations/pioneer/Sources/audit/main.swift +++ b/implementations/pioneer/Sources/audit/main.swift @@ -21,5 +21,5 @@ let server = Pioneer(schema: schema, resolver: ()) try server.standaloneServer( port: ProcessInfo.processInfo.environment["PORT"]?.intValue ?? 4000, - host: ProcessInfo.processInfo.environment["HOST"] ?? "127.0.0.1" -) \ No newline at end of file + host: "0.0.0.0" +) diff --git a/implementations/pioneer/docker-compose.yml b/implementations/pioneer/docker-compose.yml index f2c84146..73c20c12 100644 --- a/implementations/pioneer/docker-compose.yml +++ b/implementations/pioneer/docker-compose.yml @@ -2,12 +2,12 @@ services: server: build: . environment: - - HOST=0.0.0.0 - PORT=${PORT} ports: - ${PORT}:${PORT} - entrypoint: swift run + entrypoint: .build/release/audit healthcheck: test: curl -f http://localhost:$$PORT/graphql?query=%7B__typename%7D || exit 1 + start_period: 2s interval: 3s - timeout: 1s \ No newline at end of file + timeout: 1s diff --git a/implementations/pioneer/package.json b/implementations/pioneer/package.json index 7ffeddac..e6201593 100644 --- a/implementations/pioneer/package.json +++ b/implementations/pioneer/package.json @@ -3,6 +3,6 @@ "name": "pioneer", "packageManager": "yarn@3.2.3", "scripts": { - "start": "docker compose up --build" + "start": "PORT=${PORT} docker compose up --build" } } From 8110e4c0c1c8f87997cca44ad3cff3b3877729eb Mon Sep 17 00:00:00 2001 From: Vincent Date: Tue, 27 Dec 2022 09:04:21 +1300 Subject: [PATCH 10/11] Removed unnecesary delay --- implementations/pioneer/docker-compose.yml | 1 - implementations/pioneer/package.json | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/implementations/pioneer/docker-compose.yml b/implementations/pioneer/docker-compose.yml index 73c20c12..f5283d7c 100644 --- a/implementations/pioneer/docker-compose.yml +++ b/implementations/pioneer/docker-compose.yml @@ -8,6 +8,5 @@ services: entrypoint: .build/release/audit healthcheck: test: curl -f http://localhost:$$PORT/graphql?query=%7B__typename%7D || exit 1 - start_period: 2s interval: 3s timeout: 1s diff --git a/implementations/pioneer/package.json b/implementations/pioneer/package.json index e6201593..7ffeddac 100644 --- a/implementations/pioneer/package.json +++ b/implementations/pioneer/package.json @@ -3,6 +3,6 @@ "name": "pioneer", "packageManager": "yarn@3.2.3", "scripts": { - "start": "PORT=${PORT} docker compose up --build" + "start": "docker compose up --build" } } From fe5f4e6637633179e57a2e66842f890388ac4f99 Mon Sep 17 00:00:00 2001 From: Vincent Date: Tue, 27 Dec 2022 23:40:34 +1300 Subject: [PATCH 11/11] pioneer in readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d839bd40..2b0388d3 100644 --- a/README.md +++ b/README.md @@ -733,6 +733,7 @@ If you want a feature-full server with bleeding edge technologies, you're recomm | ------------------------------------------------------------------ | -------------------------------------------------------- | | [graphql-yoga](https://www.the-guild.dev/graphql/yoga-server) | [✅ Compliant](/implementations/graphql-yoga/README.md) | | [hotchocolate](https://chillicream.com/docs/hotchocolate) | [✅ Compliant](/implementations/hotchocolate/README.md) | +| [pioneer](https://pioneer.dexclaimation.com/) | [✅ Compliant](/implementations/pioneer/README.md) | | [postgraphile](https://www.graphile.org/postgraphile/) | [✅ Compliant](/implementations/postgraphile/README.md) | | [apollo-server](https://www.apollographql.com/docs/apollo-server/) | [✅ Compliant](/implementations/apollo-server/README.md) |