@oondemand/oon-core-back 0.4.18 → 0.4.20

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@oondemand/oon-core-back",
3
- "version": "0.4.18",
3
+ "version": "0.4.20",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/oondemand/oon-platform.git",
@@ -220,7 +220,7 @@ function validateAppManifest(input, { coreVersion = corePackage.version } = {})
220
220
  const allowedTopLevel = new Set([
221
221
  "$schema", "schemaVersion", "id", "name", "slug", "appKind",
222
222
  "tenancyModel", "availability", "accessMode", "authorizationMode", "accessPolicy", "deploymentMode",
223
- "modules", "capabilities", "capabilitySettings", "compatibility", "activation", "rbac",
223
+ "modules", "capabilities", "capabilitySettings", "compatibility", "activation", "auth", "rbac",
224
224
  ]);
225
225
  for (const key of Object.keys(input)) {
226
226
  if (!allowedTopLevel.has(key)) addIssue(issues, key, "propriedade não suportada.");
@@ -286,6 +286,18 @@ function validateAppManifest(input, { coreVersion = corePackage.version } = {})
286
286
  validateCapabilitySettings(input.capabilitySettings, input.capabilities, issues);
287
287
  validateCompatibility(input.compatibility, issues, coreVersion);
288
288
  validateActivation(input.activation, issues);
289
+ if (input.auth !== undefined) {
290
+ if (!isPlainObject(input.auth)) {
291
+ addIssue(issues, "auth", "deve ser um objeto.");
292
+ } else {
293
+ for (const key of Object.keys(input.auth)) {
294
+ if (key !== "sessionScope") addIssue(issues, `auth.${key}`, "propriedade não suportada.");
295
+ }
296
+ if (input.auth.sessionScope !== undefined && input.auth.sessionScope !== "ecosystem") {
297
+ addIssue(issues, "auth.sessionScope", "deve ser ecosystem.");
298
+ }
299
+ }
300
+ }
289
301
  validateRbac(input.rbac, issues);
290
302
  if (issues.length) throw new AppManifestError("central.app.json inválido.", issues);
291
303
  return JSON.parse(JSON.stringify(input));
@@ -320,6 +332,7 @@ function appManifestToConfig(manifest, manifestPath) {
320
332
  modules: { ...manifest.modules },
321
333
  capabilities: [...manifest.capabilities],
322
334
  capabilitySettings: JSON.parse(JSON.stringify(manifest.capabilitySettings || {})),
335
+ auth: manifest.auth ? JSON.parse(JSON.stringify(manifest.auth)) : undefined,
323
336
  rbac: manifest.rbac ? JSON.parse(JSON.stringify(manifest.rbac)) : undefined,
324
337
  appManifest: manifest,
325
338
  appManifestPath: manifestPath,