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.
package/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": {
@@ -160,6 +160,43 @@ export default class Organizations extends BaseProvision {
160
160
  return this;
161
161
  }
162
162
 
163
+ /**
164
+ * Sets the auth security configuration
165
+ * @param {object} auth
166
+ * @return {Organizations}
167
+ */
168
+ withAuth(auth) {
169
+ if (!auth || !auth.type)
170
+ throw new Error('Auth cannot be empty and must have type at least');
171
+
172
+ if (!this._security) {
173
+ this._security = {}
174
+ }
175
+
176
+ this._security.auth = auth
177
+ }
178
+
179
+ /**
180
+ * Sets the password poliicy configuration
181
+ * @param {object} withPasswordPolicy
182
+ * @return {Organizations}
183
+ */
184
+ withPasswordPolicy(passPolicy) {
185
+ if (!passPolicy)
186
+ throw new Error('Password policy cannot be empty');
187
+
188
+
189
+ if (!this._security) {
190
+ this._security = {}
191
+ }
192
+
193
+ this._security.policies = {
194
+ password: {
195
+ checkStrength: !!passPolicy.checkStrength,
196
+ expirationPeriod: passPolicy.expirationPeriod || 0
197
+ }
198
+ }
199
+ }
163
200
 
164
201
  _composeElement() {
165
202
  if (this._name === undefined || this._langCode === undefined || this._countryCode === undefined)
@@ -194,6 +231,10 @@ export default class Organizations extends BaseProvision {
194
231
  updateData.organization.mapDefault = _mapDefault;
195
232
  }
196
233
 
234
+ if (this._security) {
235
+ updateData.organization.security = this._security
236
+ }
237
+
197
238
  return updateData;
198
239
  }
199
240
 
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"mappings":"","sources":["opengate-api-bower.js"],"file":"opengate-api-bower-12.9.0.js","sourceRoot":".."}