opengate-js 12.9.0 → 12.9.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.
@@ -441,6 +441,43 @@ export default class Organizations extends BaseProvision {
441
441
  return this;
442
442
  }
443
443
 
444
+ /**
445
+ * Sets the auth security configuration
446
+ * @param {object} auth
447
+ * @return {Organizations}
448
+ */
449
+ withAuth(auth) {
450
+ if (!auth || !auth.type)
451
+ throw new Error('Auth cannot be empty and must have type at least');
452
+
453
+ if (!this._security) {
454
+ this._security = {}
455
+ }
456
+
457
+ this._security.auth = auth
458
+ }
459
+
460
+ /**
461
+ * Sets the password poliicy configuration
462
+ * @param {object} withPasswordPolicy
463
+ * @return {Organizations}
464
+ */
465
+ withPasswordPolicy(passPolicy) {
466
+ if (!passPolicy)
467
+ throw new Error('Password policy cannot be empty');
468
+
469
+
470
+ if (!this._security) {
471
+ this._security = {}
472
+ }
473
+
474
+ this._security.policies = {
475
+ password: {
476
+ checkStrength: !!passPolicy.checkStrength,
477
+ expirationPeriod: passPolicy.expirationPeriod || 0
478
+ }
479
+ }
480
+ }
444
481
 
445
482
  _composeElement() {
446
483
  if (this._name === undefined || this._langCode === undefined || this._countryCode === undefined)
@@ -475,6 +512,10 @@ export default class Organizations extends BaseProvision {
475
512
  updateData.organization.mapDefault = _mapDefault;
476
513
  }
477
514
 
515
+ if (this._security) {
516
+ updateData.organization.security = this._security
517
+ }
518
+
478
519
  return updateData;
479
520
  }
480
521
 
package/docs/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opengate-js",
3
- "version": "12.9.0",
3
+ "version": "12.9.2",
4
4
  "description": "",
5
5
  "main": "dist/opengate-api-npm.js",
6
6
  "repository": {
@@ -7469,6 +7469,12 @@ window.esdocSearchIndex = [
7469
7469
  "src/organizations/Organizations.js~Organizations#constructor",
7470
7470
  "method"
7471
7471
  ],
7472
+ [
7473
+ "src/organizations/organizations.js~organizations#withauth",
7474
+ "class/src/organizations/Organizations.js~Organizations.html#instance-method-withAuth",
7475
+ "src/organizations/Organizations.js~Organizations#withAuth",
7476
+ "method"
7477
+ ],
7472
7478
  [
7473
7479
  "src/organizations/organizations.js~organizations#withcountrycode",
7474
7480
  "class/src/organizations/Organizations.js~Organizations.html#instance-method-withCountryCode",
@@ -7511,6 +7517,12 @@ window.esdocSearchIndex = [
7511
7517
  "src/organizations/Organizations.js~Organizations#withOnlyAssignedDomainCertificates",
7512
7518
  "method"
7513
7519
  ],
7520
+ [
7521
+ "src/organizations/organizations.js~organizations#withpasswordpolicy",
7522
+ "class/src/organizations/Organizations.js~Organizations.html#instance-method-withPasswordPolicy",
7523
+ "src/organizations/Organizations.js~Organizations#withPasswordPolicy",
7524
+ "method"
7525
+ ],
7514
7526
  [
7515
7527
  "src/organizations/organizations.js~organizations#withplan",
7516
7528
  "class/src/organizations/Organizations.js~Organizations.html#instance-method-withPlan",