@budibase/worker 2.5.5-alpha.0 → 2.5.5-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@budibase/worker",
3
3
  "email": "hi@budibase.com",
4
- "version": "2.5.5-alpha.0",
4
+ "version": "2.5.5-alpha.2",
5
5
  "description": "Budibase background service",
6
6
  "main": "src/index.ts",
7
7
  "repository": {
@@ -37,10 +37,10 @@
37
37
  "author": "Budibase",
38
38
  "license": "GPL-3.0",
39
39
  "dependencies": {
40
- "@budibase/backend-core": "2.5.5-alpha.0",
41
- "@budibase/pro": "2.5.4",
42
- "@budibase/string-templates": "2.5.5-alpha.0",
43
- "@budibase/types": "2.5.5-alpha.0",
40
+ "@budibase/backend-core": "2.5.5-alpha.2",
41
+ "@budibase/pro": "2.5.5-alpha.1",
42
+ "@budibase/string-templates": "2.5.5-alpha.2",
43
+ "@budibase/types": "2.5.5-alpha.2",
44
44
  "@koa/router": "8.0.8",
45
45
  "@sentry/node": "6.17.7",
46
46
  "@techpass/passport-openidconnect": "0.3.2",
@@ -102,5 +102,5 @@
102
102
  "typescript": "4.7.3",
103
103
  "update-dotenv": "1.1.1"
104
104
  },
105
- "gitHead": "84e8cc00315e223433e388b72fae3bd048ff5760"
105
+ "gitHead": "696bf03033e57dae59175aae552fc2fd45cfd0cf"
106
106
  }
@@ -585,6 +585,59 @@ describe("scim", () => {
585
585
  totalResults: groupCount,
586
586
  })
587
587
  })
588
+
589
+ it("can fetch groups using displayName filters", async () => {
590
+ const groupToFetch = _.sample(groups)
591
+ const response = await getScimGroups({
592
+ params: { filter: `displayName eq "${groupToFetch!.displayName}"` },
593
+ })
594
+
595
+ expect(response).toEqual({
596
+ Resources: [groupToFetch],
597
+ itemsPerPage: 1,
598
+ schemas: ["urn:ietf:params:scim:api:messages:2.0:ListResponse"],
599
+ startIndex: 1,
600
+ totalResults: 1,
601
+ })
602
+ })
603
+
604
+ it("can fetch groups excluding members", async () => {
605
+ const response = await getScimGroups({
606
+ params: { excludedAttributes: "members" },
607
+ })
608
+
609
+ expect(response).toEqual({
610
+ Resources: expect.arrayContaining(
611
+ groups.map(g => {
612
+ const { members, ...groupData } = g
613
+ return groupData
614
+ })
615
+ ),
616
+ itemsPerPage: 25,
617
+ schemas: ["urn:ietf:params:scim:api:messages:2.0:ListResponse"],
618
+ startIndex: 1,
619
+ totalResults: groupCount,
620
+ })
621
+ })
622
+
623
+ it("can fetch groups excluding multiple fields", async () => {
624
+ const response = await getScimGroups({
625
+ params: { excludedAttributes: "members,displayName" },
626
+ })
627
+
628
+ expect(response).toEqual({
629
+ Resources: expect.arrayContaining(
630
+ groups.map(g => {
631
+ const { members, displayName, ...groupData } = g
632
+ return groupData
633
+ })
634
+ ),
635
+ itemsPerPage: 25,
636
+ schemas: ["urn:ietf:params:scim:api:messages:2.0:ListResponse"],
637
+ startIndex: 1,
638
+ totalResults: groupCount,
639
+ })
640
+ })
588
641
  })
589
642
  })
590
643
 
@@ -662,6 +715,16 @@ describe("scim", () => {
662
715
  status: 404,
663
716
  })
664
717
  })
718
+
719
+ it("should allow excluding members", async () => {
720
+ const response = await findScimGroup(group.id, {
721
+ qs: "excludedAttributes=members",
722
+ })
723
+
724
+ const { members, ...expectedResponse } = group
725
+
726
+ expect(response).toEqual(expectedResponse)
727
+ })
665
728
  })
666
729
 
667
730
  describe("DELETE /api/global/scim/v2/groups/:id", () => {
@@ -18,6 +18,7 @@ export class ScimGroupsAPI extends ScimTestAPI {
18
18
  startIndex?: number
19
19
  pageSize?: number
20
20
  filter?: string
21
+ excludedAttributes?: string
21
22
  }
22
23
  }
23
24
  ) => {
@@ -32,6 +33,9 @@ export class ScimGroupsAPI extends ScimTestAPI {
32
33
  if (params?.filter) {
33
34
  url += `filter=${params.filter}&`
34
35
  }
36
+ if (params?.excludedAttributes) {
37
+ url += `excludedAttributes=${params.excludedAttributes}&`
38
+ }
35
39
  const res = await this.call(url, "get", requestSettings)
36
40
  return res.body as ScimGroupListResponse
37
41
  }
@@ -54,9 +58,12 @@ export class ScimGroupsAPI extends ScimTestAPI {
54
58
  return res.body as ScimGroupResponse
55
59
  }
56
60
 
57
- find = async (id: string, requestSettings?: Partial<RequestSettings>) => {
61
+ find = async (
62
+ id: string,
63
+ requestSettings?: Partial<RequestSettings> & { qs?: string }
64
+ ) => {
58
65
  const res = await this.call(
59
- `/api/global/scim/v2/groups/${id}`,
66
+ `/api/global/scim/v2/groups/${id}?${requestSettings?.qs}`,
60
67
  "get",
61
68
  requestSettings
62
69
  )