@adobe/helix-admin-support 1.6.33 → 1.6.35

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/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [1.6.35](https://github.com/adobe/helix-admin-support/compare/v1.6.34...v1.6.35) (2023-03-27)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * use stateless fetch context ([2168b67](https://github.com/adobe/helix-admin-support/commit/2168b6796736511e892aaed42f6f9c0606b96350))
7
+
8
+ ## [1.6.34](https://github.com/adobe/helix-admin-support/compare/v1.6.33...v1.6.34) (2023-03-21)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **deps:** update dependency @adobe/helix-shared-config to v10.0.2 ([#123](https://github.com/adobe/helix-admin-support/issues/123)) ([8388e66](https://github.com/adobe/helix-admin-support/commit/8388e663c868c760fb111b5fbb253a99f03a1405))
14
+
1
15
  ## [1.6.33](https://github.com/adobe/helix-admin-support/compare/v1.6.32...v1.6.33) (2023-03-20)
2
16
 
3
17
 
package/docs/README.md CHANGED
@@ -32,6 +32,8 @@
32
32
 
33
33
  * [Untitled object in ConfigAll](./project-config-all-properties-headers.md "Headers modifier (from /") – `https://ns.adobe.com/helix/config/all#/properties/headers`
34
34
 
35
+ * [Untitled object in ProjectConfig](./project-config-properties-siteaccessconfig-properties-require.md) – `https://ns.adobe.com/helix/config/project#/properties/access/properties/require`
36
+
35
37
  ### Arrays
36
38
 
37
39
  * [Untitled array in ProjectCDNConfig](./project-config-cdn-defs-stringorarray-oneof-1.md) – `https://ns.adobe.com/helix/config/cdn#/$defs/stringOrArray/oneOf/1`
@@ -0,0 +1,57 @@
1
+ # Untitled object in ProjectConfig Schema
2
+
3
+ ```txt
4
+ https://ns.adobe.com/helix/config/project#/properties/access/properties/require
5
+ ```
6
+
7
+
8
+
9
+ | Abstract | Extensible | Status | Identifiable | Custom Properties | Additional Properties | Access Restrictions | Defined In |
10
+ | :------------------ | :--------- | :------------- | :----------- | :---------------- | :-------------------- | :------------------ | :-------------------------------------------------------------------------------- |
11
+ | Can be instantiated | No | Unknown status | No | Forbidden | Forbidden | none | [project-config.schema.json\*](project-config.schema.json "open original schema") |
12
+
13
+ ## require Type
14
+
15
+ `object` ([Details](project-config-properties-siteaccessconfig-properties-require.md))
16
+
17
+ # require Properties
18
+
19
+ | Property | Type | Required | Nullable | Defined by |
20
+ | :------------------------ | :----- | :------- | :------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------- |
21
+ | [repository](#repository) | Merged | Required | cannot be null | [ProjectConfig](project-config-defs-emailglob.md "https://ns.adobe.com/helix/config/project#/properties/access/properties/require/properties/repository") |
22
+
23
+ ## repository
24
+
25
+ matches one or several users or group of users
26
+
27
+ `repository`
28
+
29
+ * is required
30
+
31
+ * Type: merged type ([Details](project-config-defs-emailglob.md))
32
+
33
+ * cannot be null
34
+
35
+ * defined in: [ProjectConfig](project-config-defs-emailglob.md "https://ns.adobe.com/helix/config/project#/properties/access/properties/require/properties/repository")
36
+
37
+ ### repository Type
38
+
39
+ merged type ([Details](project-config-defs-emailglob.md))
40
+
41
+ one (and only one) of
42
+
43
+ * [Untitled string in ProjectConfig](project-config-defs-emailglob-oneof-0.md "check type definition")
44
+
45
+ * [Untitled array in ProjectConfig](project-config-defs-emailglob-oneof-1.md "check type definition")
46
+
47
+ ### repository Examples
48
+
49
+ ```yaml
50
+ adobe/*
51
+
52
+ ```
53
+
54
+ ```yaml
55
+ hlxsites/wknd
56
+
57
+ ```
@@ -16,9 +16,10 @@ https://ns.adobe.com/helix/config/project#/properties/access
16
16
 
17
17
  # access Properties
18
18
 
19
- | Property | Type | Required | Nullable | Defined by |
20
- | :-------------- | :----- | :------- | :------------- | :-------------------------------------------------------------------------------------------------------------------------------- |
21
- | [allow](#allow) | Merged | Required | cannot be null | [ProjectConfig](project-config-defs-emailglob.md "https://ns.adobe.com/helix/config/project#/properties/access/properties/allow") |
19
+ | Property | Type | Required | Nullable | Defined by |
20
+ | :------------------ | :------- | :------- | :------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
21
+ | [allow](#allow) | Merged | Required | cannot be null | [ProjectConfig](project-config-defs-emailglob.md "https://ns.adobe.com/helix/config/project#/properties/access/properties/allow") |
22
+ | [require](#require) | `object` | Optional | cannot be null | [ProjectConfig](project-config-properties-siteaccessconfig-properties-require.md "https://ns.adobe.com/helix/config/project#/properties/access/properties/require") |
22
23
 
23
24
  ## allow
24
25
 
@@ -43,3 +44,21 @@ one (and only one) of
43
44
  * [Untitled string in ProjectConfig](project-config-defs-emailglob-oneof-0.md "check type definition")
44
45
 
45
46
  * [Untitled array in ProjectConfig](project-config-defs-emailglob-oneof-1.md "check type definition")
47
+
48
+ ## require
49
+
50
+
51
+
52
+ `require`
53
+
54
+ * is optional
55
+
56
+ * Type: `object` ([Details](project-config-properties-siteaccessconfig-properties-require.md))
57
+
58
+ * cannot be null
59
+
60
+ * defined in: [ProjectConfig](project-config-properties-siteaccessconfig-properties-require.md "https://ns.adobe.com/helix/config/project#/properties/access/properties/require")
61
+
62
+ ### require Type
63
+
64
+ `object` ([Details](project-config-properties-siteaccessconfig-properties-require.md))
@@ -1 +1 @@
1
- {"meta:license":["Copyright 2023 Adobe. All rights reserved.","This file is licensed to you under the Apache License, Version 2.0 (the \"License\");","you may not use this file except in compliance with the License. You may obtain a copy","of the License at http://www.apache.org/licenses/LICENSE-2.0","","Unless required by applicable law or agreed to in writing, software distributed under","the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS","OF ANY KIND, either express or implied. See the License for the specific language","governing permissions and limitations under the License."],"$id":"https://ns.adobe.com/helix/config/project","$schema":"http://json-schema.org/draft-07/schema#","$defs":{"emailglob":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"matches one or several users or group of users"}},"title":"ProjectConfig","type":"object","properties":{"name":{"type":"string","description":"Name of the project used by the slack bot when reporting."},"project":{"type":"string","description":"Name of the project used by the sidekick."},"timezone":{"type":"string","description":"Timezone to be used by the slack bot when reporting times.","examples":["Europe/Zurich"]},"host":{"type":"string","description":"Production host use by the slack bot to display project information."},"slack":{"description":"the slack teamId/channelID(s) where the slack bot is used.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"cdn":{"description":"The CDN config","$ref":"./project-config-cdn.schema.json"},"access":{"type":"object","title":"SiteAccessConfig","properties":{"allow":{"description":"The email glob of the users that are allowed.","$ref":"#/$defs/emailglob"}},"required":["allow"],"additionalProperties":false},"admin":{"title":"AdminConfig","type":"object","properties":{"role":{"title":"Role","type":"object","properties":{"author":{"description":"The email glob of the users with author role.","$ref":"#/$defs/emailglob"},"publish":{"description":"The email glob of the users with publish role.","$ref":"#/$defs/emailglob"}},"required":["role"],"additionalProperties":false}},"additionalProperties":false}},"additionalProperties":false}
1
+ {"meta:license":["Copyright 2023 Adobe. All rights reserved.","This file is licensed to you under the Apache License, Version 2.0 (the \"License\");","you may not use this file except in compliance with the License. You may obtain a copy","of the License at http://www.apache.org/licenses/LICENSE-2.0","","Unless required by applicable law or agreed to in writing, software distributed under","the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS","OF ANY KIND, either express or implied. See the License for the specific language","governing permissions and limitations under the License."],"$id":"https://ns.adobe.com/helix/config/project","$schema":"http://json-schema.org/draft-07/schema#","$defs":{"emailglob":{"oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"matches one or several users or group of users"}},"title":"ProjectConfig","type":"object","properties":{"name":{"type":"string","description":"Name of the project used by the slack bot when reporting."},"project":{"type":"string","description":"Name of the project used by the sidekick."},"timezone":{"type":"string","description":"Timezone to be used by the slack bot when reporting times.","examples":["Europe/Zurich"]},"host":{"type":"string","description":"Production host use by the slack bot to display project information."},"slack":{"description":"the slack teamId/channelID(s) where the slack bot is used.","oneOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}]},"cdn":{"description":"The CDN config","$ref":"./project-config-cdn.schema.json"},"access":{"type":"object","title":"SiteAccessConfig","properties":{"allow":{"description":"The email glob of the users that are allowed.","$ref":"#/$defs/emailglob"},"require":{"type":"object","properties":{"repository":{"description":"The list of owner/repo pointers to projects that are allowed to use this content.","examples":["adobe/*","hlxsites/wknd"],"$ref":"#/$defs/emailglob"}},"required":["repository"],"additionalProperties":false}},"required":["allow"],"additionalProperties":false},"admin":{"title":"AdminConfig","type":"object","properties":{"role":{"title":"Role","type":"object","properties":{"author":{"description":"The email glob of the users with author role.","$ref":"#/$defs/emailglob"},"publish":{"description":"The email glob of the users with publish role.","$ref":"#/$defs/emailglob"}},"required":["role"],"additionalProperties":false}},"additionalProperties":false}},"additionalProperties":false}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/helix-admin-support",
3
- "version": "1.6.33",
3
+ "version": "1.6.35",
4
4
  "description": "Helix Admin Support Library",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "@adobe/fetch": "4.0.6",
38
- "@adobe/helix-shared-config": "10.0.1",
38
+ "@adobe/helix-shared-config": "10.0.2",
39
39
  "@adobe/helix-shared-utils": "3.0.0",
40
40
  "@aws-sdk/client-s3": "3.294.0",
41
41
  "@aws-sdk/client-sqs": "3.294.0",
@@ -73,6 +73,20 @@
73
73
  "allow": {
74
74
  "description": "The email glob of the users that are allowed.",
75
75
  "$ref": "#/$defs/emailglob"
76
+ },
77
+ "require": {
78
+ "type": "object",
79
+ "properties": {
80
+ "repository": {
81
+ "description": "The list of owner/repo pointers to projects that are allowed to use this content.",
82
+ "examples": [ "adobe/*", "hlxsites/wknd"],
83
+ "$ref": "#/$defs/emailglob"
84
+ }
85
+ },
86
+ "required": [
87
+ "repository"
88
+ ],
89
+ "additionalProperties": false
76
90
  }
77
91
  },
78
92
  "required": [
package/src/utils.js CHANGED
@@ -9,17 +9,13 @@
9
9
  * OF ANY KIND, either express or implied. See the License for the specific language
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
- import { context as fetchContext, h1, Response } from '@adobe/fetch';
12
+ import { h1NoCache, Response } from '@adobe/fetch';
13
13
  import { cleanupHeaderValue } from '@adobe/helix-shared-utils';
14
14
 
15
- /* c8 ignore next 7 */
16
- export const { fetch } = process.env.HELIX_FETCH_FORCE_HTTP1
17
- ? h1({
18
- userAgent: 'adobe-fetch', // static user-agent for recorded tests
19
- })
20
- : fetchContext({
21
- userAgent: 'adobe-fetch', // static user-agent for recorded tests
22
- });
15
+ // use stateless fetch to avoid hanging processes
16
+ export const { fetch } = h1NoCache({
17
+ userAgent: 'adobe-fetch', // static user-agent for recorded tests
18
+ });
23
19
 
24
20
  /**
25
21
  * Generates an error response
@@ -111,6 +111,12 @@ export interface SiteAccessConfig {
111
111
  * The email glob of the users that are allowed.
112
112
  */
113
113
  allow: string | string[];
114
+ require?: {
115
+ /**
116
+ * The list of owner/repo pointers to projects that are allowed to use this content.
117
+ */
118
+ repository: string | string[];
119
+ };
114
120
  }
115
121
  export interface AdminConfig {
116
122
  role?: Role;