Skip to content

Commit

Permalink
Merge branch 'dev' into single-vector-directive
Browse files Browse the repository at this point in the history
  • Loading branch information
mjfwebb committed Jul 9, 2024
2 parents e77d14e + 0805e31 commit 5816b50
Show file tree
Hide file tree
Showing 21 changed files with 104 additions and 100 deletions.
5 changes: 5 additions & 0 deletions .changeset/small-cycles-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@neo4j/graphql": patch
---

Fix non-array validate argument on authorization directive #4534
2 changes: 1 addition & 1 deletion .github/workflows/lint-github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- uses: reviewdog/action-actionlint@afad3b6ab835e5611bda8c8193377e2d5c21413d # v1.51.0
- uses: reviewdog/action-actionlint@d99f1ceaf59e7db022a790dc308ccccb68dda71a # v1.53.0
with:
reporter: github-check
fail_on_error: true
2 changes: 1 addition & 1 deletion .github/workflows/performance-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:
working-directory: packages/graphql

- name: Archive performance test results
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4
with:
name: performance
path: packages/graphql/performance/
2 changes: 1 addition & 1 deletion .github/workflows/pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
cache: yarn
- name: Install dependencies
run: yarn --immutable
- uses: reviewdog/action-eslint@1815ece2a5cc53eb072eb53dee858f00563f3537 # v1.27.0
- uses: reviewdog/action-eslint@7b82dea8533d382fa3c6ef95bcb1f1004f6b0a95 # v1.29.0
with:
fail_on_error: true
eslint_flags: "."
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/reusable-api-library-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
run: yarn --cwd packages/graphql run test:schema --coverage
- if: ${{ !inputs.disable-coverage-archival }}
name: Archive coverage report
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4
with:
name: api-library-coverage-graphql
path: packages/graphql/coverage/
2 changes: 1 addition & 1 deletion .github/workflows/reusable-federation-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
mkdir prnumber
echo "$PULL_REQUEST_NUMBER" > ./prnumber/prnumber
- name: Archive PR number
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4
with:
name: prnumber
path: prnumber/
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
NEO_URL: neo4j://localhost:7687
- if: ${{ !inputs.disable-coverage-archival && matrix.packages.package == 'graphql' }}
name: Archive coverage report
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4
with:
name: integration-nightly-coverage-${{ matrix.packages.package }}-${{ matrix.graphql-version.coverage_path }}-${{ matrix.packages.coverage_name }}-${{ matrix.node.coverage_name }}
path: packages/${{ matrix.packages.package }}/coverage-nightly-${{ matrix.graphql-version.coverage_path }}/
Expand All @@ -130,7 +130,7 @@ jobs:
steps:
- if: ${{ !inputs.disable-coverage-archival }}
name: Merge Artifacts
uses: actions/upload-artifact/merge@65462800fd760344b1a7b4382951275a0abb4808 # v4
uses: actions/upload-artifact/merge@0b2256b8c012f0828dc542b3febcab082c67f72b # v4
with:
name: integration-nightly-coverage
pattern: integration-nightly-coverage-*
4 changes: 2 additions & 2 deletions .github/workflows/reusable-integration-tests-on-prem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
NEO_URL: bolt://localhost:7687
- if: ${{ !inputs.disable-coverage-archival && matrix.packages.package == 'graphql' }}
name: Archive coverage report
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4
with:
name: integration-coverage-${{ matrix.packages.package }}-${{ matrix.neo4j-version }}-${{ matrix.graphql-version.coverage_path }}-${{ matrix.packages.coverage_name }}
path: packages/${{ matrix.packages.package }}/coverage-${{ matrix.neo4j-version }}-${{ matrix.graphql-version.coverage_path }}/
Expand All @@ -83,7 +83,7 @@ jobs:
steps:
- if: ${{ !inputs.disable-coverage-archival }}
name: Merge Artifacts
uses: actions/upload-artifact/merge@65462800fd760344b1a7b4382951275a0abb4808 # v4
uses: actions/upload-artifact/merge@0b2256b8c012f0828dc542b3febcab082c67f72b # v4
with:
name: integration-coverage
pattern: integration-coverage-*
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
RABBITMQ_USER: guest
RABBITMQ_PASSWORD: guest
- name: Archive coverage report
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4
with:
name: e2e-coverage-graphql-amqp-subscriptions-engine-${{ matrix.graphql-version }}-${{ matrix.neo4j-version }}
path: packages/graphql-amqp-subscriptions-engine/coverage/
Expand All @@ -66,7 +66,7 @@ jobs:
needs: e2e-tests
steps:
- name: Merge Artifacts
uses: actions/upload-artifact/merge@65462800fd760344b1a7b4382951275a0abb4808 # v4
uses: actions/upload-artifact/merge@0b2256b8c012f0828dc542b3febcab082c67f72b # v4
with:
name: e2e-coverage-graphql-amqp-subscriptions-engine
pattern: e2e-coverage-graphql-amqp-subscriptions-engine-*
2 changes: 1 addition & 1 deletion .github/workflows/reusable-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
working-directory: packages/${{ matrix.package }}
- if: ${{ !inputs.disable-coverage-archival && matrix.package == 'graphql' }}
name: Archive coverage report
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4
with:
name: unit-coverage-${{ matrix.package }}
path: packages/${{ matrix.package }}/coverage/
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
},
"devDependencies": {
"@tsconfig/node16": "1.0.4",
"@typescript-eslint/eslint-plugin": "7.15.0",
"@typescript-eslint/parser": "7.15.0",
"@typescript-eslint/eslint-plugin": "7.16.0",
"@typescript-eslint/parser": "7.16.0",
"concurrently": "8.2.2",
"dotenv": "16.4.5",
"eslint": "8.57.0",
Expand All @@ -45,7 +45,7 @@
"neo4j-driver": "5.22.0",
"prettier": "2.8.8",
"set-tz": "0.2.0",
"ts-jest": "29.1.5",
"ts-jest": "29.2.0",
"typescript": "5.1.6"
},
"packageManager": "[email protected]",
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql-amqp-subscriptions-engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"pluralize": "8.0.0",
"randomstring": "1.3.0",
"supertest": "7.0.0",
"ts-jest": "29.1.5",
"ts-jest": "29.2.0",
"typescript": "5.1.6",
"ws": "8.18.0"
},
Expand Down
4 changes: 2 additions & 2 deletions packages/graphql/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,9 @@
"mock-jwks": "1.0.10",
"nock": "13.5.4",
"randomstring": "1.3.0",
"rimraf": "5.0.7",
"rimraf": "5.0.9",
"supertest": "7.0.0",
"ts-jest": "29.1.5",
"ts-jest": "29.2.0",
"ts-node": "10.9.2",
"typescript": "5.1.6",
"ws": "8.18.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/graphql/src/schema-model/generate-model.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ describe("ConcreteEntity generation", () => {
},
},
]);
expect(authAnnotation?.validate).toBeUndefined();
expect(authAnnotation?.validate).toEqual([]);
});

test("authorization annotation is correct on User entity", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
* limitations under the License.
*/
import type { DirectiveNode } from "graphql";
import { asArray } from "../../../utils/utils";
import type {
AuthorizationFilterRuleConstructor,
AuthorizationValidateRuleConstructor,
Expand All @@ -34,7 +35,7 @@ export function parseAuthorizationAnnotation(directive: DirectiveNode): Authoriz
validate?: Record<string, any>[];
};
const filterRules = filter?.map((rule) => new AuthorizationFilterRule(rule as AuthorizationFilterRuleConstructor));
const validateRules = validate?.map(
const validateRules = asArray(validate).map(
(rule) => new AuthorizationValidateRule(rule as AuthorizationValidateRuleConstructor)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,11 @@ describe("Cypher Auth Allow", () => {
extend type User
@authorization(
validate: [
{
when: AFTER
operations: [CREATE, UPDATE, CREATE_RELATIONSHIP, DELETE_RELATIONSHIP]
where: { node: { id: "$jwt.sub" } }
}
]
validate: {
when: AFTER
operations: [CREATE, UPDATE, CREATE_RELATIONSHIP, DELETE_RELATIONSHIP]
where: { node: { id: "$jwt.sub" } }
}
)
extend type Post
Expand Down
2 changes: 1 addition & 1 deletion packages/introspector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@types/node": "20.14.8",
"@types/pluralize": "0.0.33",
"jest": "29.7.0",
"ts-jest": "29.1.5",
"ts-jest": "29.2.0",
"typescript": "5.1.6"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/ogm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"pluralize": "8.0.0",
"randomstring": "1.3.0",
"semver": "7.6.2",
"ts-jest": "29.1.5",
"ts-jest": "29.2.0",
"typescript": "5.1.6"
}
}
2 changes: 1 addition & 1 deletion packages/package-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
},
"author": "Neo4j Inc.",
"devDependencies": {
"rimraf": "5.0.7"
"rimraf": "5.0.9"
}
}
Loading

0 comments on commit 5816b50

Please sign in to comment.