Skip to content

Commit

Permalink
Merge pull request #229 from snyk/feat/remove-tenancy-rule
Browse files Browse the repository at this point in the history
feat: remove tenancy rules
  • Loading branch information
cmars authored Mar 30, 2022
2 parents bc28a01 + a343c37 commit c4495cb
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 1,573 deletions.
21 changes: 0 additions & 21 deletions src/rulesets/operations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,27 +155,6 @@ export const rules = {
},
);
},
orgOrGroupTenant: ({ operations }: SnykApiCheckDsl) => {
operations.added.must(
"have an org or group tenant",
(operation, context, docs) => {
docs.includeDocsLink(links.standards.orgAndGroupTenantResources);
const url = operation.pathPattern;
if (
!(
url.startsWith("/orgs/{org_id}") ||
url.startsWith("/groups/{group_id}") ||
url.startsWith("/test") ||
url === "/orgs" ||
url === "/groups" ||
url === "/self"
)
) {
expect.fail(`expected support for org or group tenant in ${url}`);
}
},
);
},
pathElementsCasing: ({ specification }: SnykApiCheckDsl) => {
specification.requirement.must(
"use the right casing for path elements",
Expand Down
90 changes: 0 additions & 90 deletions src/rulesets/tests/__snapshots__/end-end.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8482,78 +8482,6 @@ Array [
},
"where": "requirement for operation: PATCH /orgs/{org_id}/thing2/{thing_id}",
},
Object {
"change": null,
"condition": "have an org or group tenant",
"docsLink": "https://github.com/snyk/sweater-comb/blob/main/docs/standards.md#organization-and-group-tenants-for-resources",
"effectiveOnDate": undefined,
"isMust": true,
"isShould": false,
"passed": true,
"sourcemap": Object {
"endLine": 383,
"endPosition": 15907,
"filePath": "/end-end-tests/api-standards/resources/thing/2021-11-10/003-jsonapi.yaml",
"preview": "",
"startLine": 336,
"startPosition": 13863,
},
"where": "added operation: GET /orgs/{org_id}/thing2",
},
Object {
"change": null,
"condition": "have an org or group tenant",
"docsLink": "https://github.com/snyk/sweater-comb/blob/main/docs/standards.md#organization-and-group-tenants-for-resources",
"effectiveOnDate": undefined,
"isMust": true,
"isShould": false,
"passed": true,
"sourcemap": Object {
"endLine": 335,
"endPosition": 13858,
"filePath": "/end-end-tests/api-standards/resources/thing/2021-11-10/003-jsonapi.yaml",
"preview": "",
"startLine": 290,
"startPosition": 11954,
},
"where": "added operation: POST /orgs/{org_id}/thing2",
},
Object {
"change": null,
"condition": "have an org or group tenant",
"docsLink": "https://github.com/snyk/sweater-comb/blob/main/docs/standards.md#organization-and-group-tenants-for-resources",
"effectiveOnDate": undefined,
"isMust": true,
"isShould": false,
"passed": true,
"sourcemap": Object {
"endLine": 430,
"endPosition": 17888,
"filePath": "/end-end-tests/api-standards/resources/thing/2021-11-10/003-jsonapi.yaml",
"preview": "",
"startLine": 385,
"startPosition": 15948,
},
"where": "added operation: GET /orgs/{org_id}/thing2/{thing_id}",
},
Object {
"change": null,
"condition": "have an org or group tenant",
"docsLink": "https://github.com/snyk/sweater-comb/blob/main/docs/standards.md#organization-and-group-tenants-for-resources",
"effectiveOnDate": undefined,
"isMust": true,
"isShould": false,
"passed": true,
"sourcemap": Object {
"endLine": 488,
"endPosition": 20573,
"filePath": "/end-end-tests/api-standards/resources/thing/2021-11-10/003-jsonapi.yaml",
"preview": "",
"startLine": 431,
"startPosition": 17893,
},
"where": "added operation: PATCH /orgs/{org_id}/thing2/{thing_id}",
},
Object {
"change": null,
"condition": "use the right casing for path elements",
Expand Down Expand Up @@ -79858,24 +79786,6 @@ Array [
},
"where": "requirement for operation: DELETE /orgs/{org_id}/thing/{thing_id}",
},
Object {
"change": null,
"condition": "have an org or group tenant",
"docsLink": "https://github.com/snyk/sweater-comb/blob/main/docs/standards.md#organization-and-group-tenants-for-resources",
"effectiveOnDate": undefined,
"isMust": true,
"isShould": false,
"passed": true,
"sourcemap": Object {
"endLine": 99,
"endPosition": 4708,
"filePath": "/end-end-tests/api-standards/resources/thing/2021-11-10/002-ok-add-operation.yaml",
"preview": "",
"startLine": 75,
"startPosition": 3674,
},
"where": "added operation: DELETE /orgs/{org_id}/thing",
},
Object {
"change": null,
"condition": "use the right casing for path elements",
Expand Down
Loading

0 comments on commit c4495cb

Please sign in to comment.