scimgateway 4.4.0 → 4.4.1

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/README.md CHANGED
@@ -1199,6 +1199,17 @@ MIT © [Jarle Elshaug](https://www.elshaug.xyz)
1199
1199
 
1200
1200
  ## Change log
1201
1201
 
1202
+ ### v4.4.1
1203
+
1204
+ [Added]
1205
+
1206
+ - scim-stream subscriber using latest api and some additional recovery logic
1207
+ Prerequisite: [SCIM Stream](https://elshaug.xyz/docs/scim-stream) version > v1.0.0
1208
+
1209
+ [Fixed]
1210
+
1211
+ - plugin-loki was missing async await and could cause problems in some stress test use cases
1212
+
1202
1213
  ### v4.4.0
1203
1214
 
1204
1215
  [Added]
@@ -239,7 +239,7 @@ scimgateway.createUser = async (baseEntity, userObj, ctx) => {
239
239
  else throw new Error(`${action} error: missing mandatory userName or externalId`)
240
240
 
241
241
  try {
242
- users.insert(userObj)
242
+ await users.insert(userObj)
243
243
  return null
244
244
  } catch (err) {
245
245
  const newErr = new Error(`${action} error: ${err.message}`)
@@ -262,7 +262,7 @@ scimgateway.deleteUser = async (baseEntity, id, ctx) => {
262
262
  const res = users.find({ id: id })
263
263
  if (res.length !== 1) throw new Error(`${action} error: failed for user id=${id}`)
264
264
  const userObj = res[0]
265
- users.remove(userObj)
265
+ await users.remove(userObj)
266
266
  return null
267
267
  }
268
268
 
@@ -367,7 +367,7 @@ scimgateway.modifyUser = async (baseEntity, id, attrObj, ctx) => {
367
367
  }
368
368
  }
369
369
  }
370
- users.update(userObj) // needed for persistence
370
+ await users.update(userObj) // needed for persistence
371
371
  return null
372
372
  }
373
373
 
@@ -488,7 +488,7 @@ scimgateway.createGroup = async (baseEntity, groupObj, ctx) => {
488
488
  else groupObj.id = groupObj.displayName
489
489
 
490
490
  try {
491
- groups.insert(groupObj)
491
+ await groups.insert(groupObj)
492
492
  return null
493
493
  } catch (err) {
494
494
  const newErr = new Error(`${action} error: ${err.message}`)
@@ -511,7 +511,7 @@ scimgateway.deleteGroup = async (baseEntity, id, ctx) => {
511
511
  const res = groups.find({ id: id })
512
512
  if (res.length !== 1) throw new Error(`${action} error: failed for id=${id}`)
513
513
  const groupObj = res[0]
514
- groups.remove(groupObj)
514
+ await groups.remove(groupObj)
515
515
  return null
516
516
  }
517
517
 
@@ -562,7 +562,7 @@ scimgateway.modifyGroup = async (baseEntity, id, attrObj, ctx) => {
562
562
  groupObj[key] = attrObj[key]
563
563
  }
564
564
 
565
- groups.update(groupObj)
565
+ await groups.update(groupObj)
566
566
 
567
567
  if (usersNotExist.length > 0) throw new Error(`${action} error: failed for id=${groupObj.id} - includes none existing members: ${usersNotExist.toString()}`)
568
568
  return null
@@ -10,4 +10,4 @@
10
10
  // for details see: https://elshaug.xyz/docs/scim-stream
11
11
  //
12
12
  // ================================================================
13
- 'use strict';const a0_0x32b8a6=a0_0x5a6a;(function(_0x3b1964,_0x4ffd0d){const _0xd63a1b=a0_0x5a6a,_0x5ce8bf=_0x3b1964();while(!![]){try{const _0x18473f=parseInt(_0xd63a1b(0x1f2))/0x1*(parseInt(_0xd63a1b(0x23c))/0x2)+-parseInt(_0xd63a1b(0x27c))/0x3*(parseInt(_0xd63a1b(0x20b))/0x4)+parseInt(_0xd63a1b(0x217))/0x5*(parseInt(_0xd63a1b(0x298))/0x6)+parseInt(_0xd63a1b(0x266))/0x7+parseInt(_0xd63a1b(0x240))/0x8*(-parseInt(_0xd63a1b(0x291))/0x9)+parseInt(_0xd63a1b(0x1ea))/0xa*(parseInt(_0xd63a1b(0x277))/0xb)+parseInt(_0xd63a1b(0x28b))/0xc*(-parseInt(_0xd63a1b(0x29d))/0xd);if(_0x18473f===_0x4ffd0d)break;else _0x5ce8bf['push'](_0x5ce8bf['shift']());}catch(_0x2e9599){_0x5ce8bf['push'](_0x5ce8bf['shift']());}}}(a0_0x30b9,0xb550b));function a0_0x5a6a(_0x5c3813,_0xd0cad1){const _0x30b9b9=a0_0x30b9();return a0_0x5a6a=function(_0x5a6acc,_0x43c16c){_0x5a6acc=_0x5a6acc-0x1d6;let _0x1f535=_0x30b9b9[_0x5a6acc];return _0x1f535;},a0_0x5a6a(_0x5c3813,_0xd0cad1);}const nats=require(a0_0x32b8a6(0x215)),ascii127=require('fold-to-ascii'),fs=require('fs'),utils=require(a0_0x32b8a6(0x25b)),path=require(a0_0x32b8a6(0x22b)),crypto=require(a0_0x32b8a6(0x1f6));function a0_0x30b9(){const _0x4859fe=[']\x20error:\x20missing\x20one\x20or\x20more\x20mandatory\x20configurations\x20e.g.\x20stream.baseUrls,\x20stream.certificate.ca,\x20nats.tenant,\x20nats.subject,\x20nats.secret\x20and\x20nats.jwt','1340QtXxnO',',false','\x20done',']\x20client\x20is\x20attempting\x20to\x20reconnect\x20','541104zRwmEW','convertRolesToGroups','deliverNew','\x20handling\x20message:\x20','\x20message:\x20user\x20not\x20deleted\x20because\x20of\x20configuration\x20modifyOnly=true','set','active','Reconnecting','modifyOnly','StringCodec','roles','tenant','includes','\x20error:\x20missing\x20result','getProcessed','\x20(count=','getServer','\x20error:\x20','subject','stringify','\x20=>\x20subscriber\x20stopped','substring','lowercase',']\x20restarting\x20connection','\x20message\x20json\x20parsing\x20error:\x20','operation','toLowerCase','../lib/utils','from','level','request','unsubscribe','body','display',']\x20handling\x20\x22','error','call','typeId','1435182YbsoCS','SCIM\x20Stream\x20-\x20Autogenerated','servers','logger','join','/approles','prototype','\x20createUser()\x20obj=','##doIncrement','originalUrl','uppercase',']\x20subscriber\x20error:\x20configuration\x20scim.usePutSoftSync\x20must\x20be\x20set\x20to\x20true','usePutSoftSync','isArray','forEach','increment','jetstream','9044893AbiSHj','\x20-\x20','waitOnFirstConnect','User','Resources','54yzaYvZ','string','file','Reconnect','utf-8','maxPingOut','onCreate','\x20message:\x20','getuniquevalue','Application','\x20Create\x20User\x20userName=','\x20-\x20please\x20verify\x20stream.connectionUrls,\x20stream.certificate.ca,\x20nats.secret\x20and\x20nats.subject\x20configuration','\x20role\x20removal\x20error:\x20','\x20result=',']\x20connect\x20error:\x20','1068lqUSZU','exports','name','fsExistsSync',']\x20subscriber[','durable','81YOzQTv','Errors','randomUUID','status','length','modifyGroup','password','84RyFUHg','readFileSync','replaceUsrGrp','jwtAuthenticator','debug','92066IIanhl','detail','message','connect','deliverTo','secret','getAppRoles','\x20roles\x20converted\x20to\x20groups\x20message:\x20','ackNone','\x20getUserId()\x20error:\x20',']\x20closed\x20with\x20error:\x20','queue','consumerOpts','\x20Delete\x20User\x20id=','split','\x20group\x20removal\x20error:\x20','subscribe','replaceDomains','queueGroup','activityOperation','write','data','durable_','false','10JXOtwp','DebugEvents','delete','ack','close','info','baseUrls','deleteUserOnLastGroupRoleRemoval','1565rBXdGE','\x20Replace\x20User\x20id=','value','approles','crypto','indexOf','\x20message:\x20user\x20does\x20not\x20exist','gwName','Operations','replace','elementnumber','/Users/','params','normalize','doIncrement','certificate','generateUserPassword','Subscriber','\x20error:\x20more\x20than\x20one\x20user\x20were\x20found}','\x20should\x20have\x20syntax:\x20<collector>.<channel>','description','closed','\x20missing\x20user\x20object\x20in\x20message:\x20','\x20missing\x20mandatory\x20user.userName\x20in\x20message:\x20','approles_','280444BFtEvO',']\x20subscriber\x20error:\x20missing\x20certificate\x20configuration','startsWith',']\x20error:\x20subject\x20','userName','type',']\x20subscriber\x20certificate\x20error:\x20','schemas','/certs/','transports','nats','push','417095ilMnBD','pingInterval','authenticator',']\x20error:\x20','foldReplacing','trim','\x20message:\x20user\x20not\x20created\x20because\x20of\x20configuration\x20modifyOnly=true','getUsers','headers','jwt','pluginName','then','\x20Create\x20userName=','Events','displayName','Disconnect','utf8','\x20=>\x20subscriber\x20not\x20activated','copyObj','_autogenerated.cfg','path','createUser',']\x20client\x20disconnected\x20','toUpperCase','decode','replaceAll','getUsers()\x20getObj=','modifyUser','configDir','\x20Delete\x20User\x20userName=','groups',']\x20connected\x20','true','mkdirSync','Msg-Id','deleteUser'];a0_0x30b9=function(){return _0x4859fe;};return a0_0x30b9();}module[a0_0x32b8a6(0x28c)][a0_0x32b8a6(0x203)]=function(_0x33e808,_0x3e6e69,_0x73c3e0){const _0x4b2276=a0_0x32b8a6,_0x12d9c9=_0x33e808,_0x366236=_0x3e6e69;if(!_0x366236[_0x4b2276(0x201)]||!_0x366236[_0x4b2276(0x201)]['ca']){_0x12d9c9[_0x4b2276(0x269)]['error'](_0x12d9c9['gwName']+'['+_0x12d9c9['pluginName']+_0x4b2276(0x20c));return;}if(!_0x366236[_0x4b2276(0x272)]){_0x12d9c9[_0x4b2276(0x269)][_0x4b2276(0x263)](_0x12d9c9['gwName']+'['+_0x12d9c9[_0x4b2276(0x221)]+_0x4b2276(0x271));return;}let _0x3e0f1f='';for(let _0x4ff6f2=0x0;_0x4ff6f2<_0x12d9c9[_0x4b2276(0x269)][_0x4b2276(0x214)]['length'];_0x4ff6f2++){if(_0x12d9c9[_0x4b2276(0x269)]['transports'][_0x4ff6f2][_0x4b2276(0x28d)]===_0x4b2276(0x27e)){_0x3e0f1f=_0x12d9c9['logger'][_0x4b2276(0x214)][_0x4ff6f2][_0x4b2276(0x25d)];break;}}const _0x5e6ada=''+(_0x3e0f1f===_0x4b2276(0x29c)?'\x0a':''),_0x146b1b={};try{_0x146b1b['ca']=[fs[_0x4b2276(0x299)](_0x12d9c9[_0x4b2276(0x233)]+_0x4b2276(0x213)+_0x366236[_0x4b2276(0x201)]['ca'])];}catch(_0x2525b7){_0x12d9c9[_0x4b2276(0x269)]['error'](_0x12d9c9[_0x4b2276(0x1f9)]+'['+_0x12d9c9['pluginName']+_0x4b2276(0x211)+_0x2525b7['message']);return;}const _0x5b61b0={},_0x3be961=new TextEncoder()['encode'](_0x366236['nats']['secret']),_0xdf6ba8=_0x366236[_0x4b2276(0x215)]['jwt'];_0x5b61b0[_0x4b2276(0x219)]=nats[_0x4b2276(0x29b)](_0xdf6ba8,_0x3be961),_0x5b61b0[_0x4b2276(0x268)]=_0x366236['baseUrls'],_0x5b61b0['tls']=_0x146b1b,_0x5b61b0[_0x4b2276(0x279)]=![],_0x5b61b0['reconnect']=!![],_0x5b61b0['reconnectTimeWait']=0x3e8*0xa,_0x5b61b0['maxReconnectAttempts']=-0x1,_0x5b61b0[_0x4b2276(0x218)]=0x2*0x3c*0x3e8,_0x5b61b0[_0x4b2276(0x281)]=0x5,_0x5b61b0[_0x4b2276(0x29c)]=![];let _0x47aacd;this['connect']=async _0x44949=>{const _0x34611e=_0x4b2276;try{_0x47aacd=await nats[_0x34611e(0x2a0)](_0x5b61b0);}catch(_0xd65432){_0x12d9c9[_0x34611e(0x269)][_0x34611e(0x263)](_0x12d9c9[_0x34611e(0x1f9)]+'['+_0x12d9c9['pluginName']+_0x34611e(0x28f)+_0x44949+_0x34611e(0x28a)+_0xd65432['message']+_0x34611e(0x287)),_0x5b61b0[_0x34611e(0x279)]=!![];try{_0x47aacd=await nats[_0x34611e(0x2a0)](_0x5b61b0);}catch(_0x4b42b4){_0x12d9c9[_0x34611e(0x269)][_0x34611e(0x263)](_0x12d9c9['gwName']+'['+_0x12d9c9[_0x34611e(0x221)]+']\x20subscriber['+_0x44949+_0x34611e(0x28a)+_0x4b42b4[_0x34611e(0x29f)]);return;}}_0x12d9c9['logger'][_0x34611e(0x1ef)](_0x12d9c9[_0x34611e(0x1f9)]+'['+_0x12d9c9['pluginName']+_0x34611e(0x28f)+_0x44949+_0x34611e(0x236)+(_0x5b61b0['tls']['ca']?'tls':'')+'\x20'+_0x47aacd[_0x34611e(0x250)]()),_0x47aacd[_0x34611e(0x207)]()[_0x34611e(0x222)](_0x2ab7f0=>{const _0x273c4c=_0x34611e;_0x2ab7f0&&_0x12d9c9[_0x273c4c(0x269)][_0x273c4c(0x263)](_0x12d9c9[_0x273c4c(0x1f9)]+'['+_0x12d9c9[_0x273c4c(0x221)]+_0x273c4c(0x28f)+_0x44949+_0x273c4c(0x1dc)+_0x2ab7f0[_0x273c4c(0x29f)]);});},this['subscribe']=async(_0x20f2b8,_0x2f89fd)=>{const _0x1044af=_0x4b2276;if(!_0x2f89fd||!_0x366236[_0x1044af(0x1f0)]||!_0x366236[_0x1044af(0x201)]||!_0x366236[_0x1044af(0x201)]['ca']||!_0x366236[_0x1044af(0x215)]||!_0x366236[_0x1044af(0x215)][_0x1044af(0x24b)]||!_0x366236[_0x1044af(0x215)][_0x1044af(0x1d7)]||!_0x366236[_0x1044af(0x215)][_0x1044af(0x220)]){_0x12d9c9[_0x1044af(0x269)]['error'](_0x12d9c9[_0x1044af(0x1f9)]+'['+_0x12d9c9[_0x1044af(0x221)]+_0x1044af(0x28f)+_0x2f89fd+_0x1044af(0x23b));return;}if(_0x2f89fd[_0x1044af(0x1e0)]('.')['length']<0x2){_0x12d9c9[_0x1044af(0x269)][_0x1044af(0x263)](_0x12d9c9['gwName']+'['+_0x12d9c9[_0x1044af(0x221)]+_0x1044af(0x28f)+_0x2f89fd+_0x1044af(0x20e)+_0x2f89fd+_0x1044af(0x205));return;}if(!_0x47aacd){_0x12d9c9[_0x1044af(0x269)][_0x1044af(0x263)](_0x12d9c9['gwName']+'['+_0x12d9c9[_0x1044af(0x221)]+_0x1044af(0x28f)+_0x2f89fd+']\x20error:\x20client\x20have\x20not\x20been\x20initialized');return;}const _0x6f0c58=nats[_0x1044af(0x249)](),_0x121e49=_0x47aacd[_0x1044af(0x276)](),_0x4816ac=nats[_0x1044af(0x1de)](),_0x4659dc=('deliver.'+_0x2f89fd+'.'+_0x12d9c9['pluginName'])[_0x1044af(0x230)]('*','_')[_0x1044af(0x230)]('>','_'),_0x1a13e6=(_0x1044af(0x1e8)+_0x2f89fd+'_'+_0x12d9c9[_0x1044af(0x221)])['replaceAll']('*','_')[_0x1044af(0x230)]('>','_')[_0x1044af(0x230)]('.','_');let _0x29db4c;try{_0x4816ac['stream']=_0x366236[_0x1044af(0x215)][_0x1044af(0x24b)],_0x4816ac[_0x1044af(0x290)](_0x1a13e6),_0x4816ac[_0x1044af(0x1d6)](_0x4659dc),_0x366236[_0x1044af(0x1e4)]&&_0x4816ac[_0x1044af(0x1dd)](_0x366236['queueGroup']),_0x4816ac[_0x1044af(0x242)](),_0x4816ac[_0x1044af(0x1da)](),_0x29db4c=await _0x121e49[_0x1044af(0x1e2)](_0x2f89fd,_0x4816ac);}catch(_0x488100){_0x12d9c9[_0x1044af(0x269)][_0x1044af(0x263)](_0x12d9c9[_0x1044af(0x1f9)]+'['+_0x12d9c9[_0x1044af(0x221)]+_0x1044af(0x28f)+_0x2f89fd+_0x1044af(0x21a)+_0x488100[_0x1044af(0x29f)]+_0x1044af(0x228)+_0x5e6ada);return;}const _0x18b866=async()=>{const _0x17b6c6=_0x1044af;try{for await(const _0x1a900c of _0x29db4c){if(!_0x1a900c[_0x17b6c6(0x21f)]||!_0x1a900c[_0x17b6c6(0x21f)]['get'](_0x17b6c6(0x239))){_0x1a900c[_0x17b6c6(0x1ed)]();continue;}const _0x4883c1=_0x12d9c9[_0x17b6c6(0x1f9)]+'['+_0x12d9c9['pluginName']+_0x17b6c6(0x28f)+_0x1a900c[_0x17b6c6(0x252)]+']['+_0x29db4c[_0x17b6c6(0x24e)]()+']['+(_0x1a900c['headers']?_0x1a900c[_0x17b6c6(0x21f)]['get'](_0x17b6c6(0x239)):'')+']';_0x12d9c9[_0x17b6c6(0x269)]['info'](_0x4883c1+_0x17b6c6(0x243)+_0x6f0c58['decode'](_0x1a900c[_0x17b6c6(0x1e7)])),_0x1a900c[_0x17b6c6(0x1ed)]();let _0xd54535;try{let _0x129556=_0x6f0c58[_0x17b6c6(0x22f)](_0x1a900c[_0x17b6c6(0x1e7)]);if(_0x366236[_0x17b6c6(0x1e3)]&&Array[_0x17b6c6(0x273)](_0x366236[_0x17b6c6(0x1e3)]))for(let _0x55d408=0x0;_0x55d408<_0x366236['replaceDomains'][_0x17b6c6(0x295)];_0x55d408++){const _0x1947ea=_0x366236[_0x17b6c6(0x1e3)][_0x55d408];if(!_0x1947ea['from']||!_0x1947ea[_0x17b6c6(0x25c)]['includes']('.')||!_0x1947ea['to']||!_0x1947ea['to']['includes']('.'))continue;const _0x40a817=new RegExp('@'+_0x1947ea[_0x17b6c6(0x25c)]+'\x22','gi');_0x129556=_0x129556['replace'](_0x40a817,'@'+_0x1947ea['to']+'\x22');}_0xd54535=JSON['parse'](_0x129556);}catch(_0x645527){_0x12d9c9[_0x17b6c6(0x269)][_0x17b6c6(0x263)](_0x4883c1+_0x17b6c6(0x258)+_0x645527[_0x17b6c6(0x29f)]+_0x17b6c6(0x283)+_0x6f0c58[_0x17b6c6(0x22f)](_0x1a900c[_0x17b6c6(0x1e7)])),_0x12d9c9[_0x17b6c6(0x269)][_0x17b6c6(0x29c)](_0x4883c1+'\x20done'+_0x5e6ada);continue;}const _0x5d35a1=_0xd54535['user'];if(!_0x5d35a1){_0x12d9c9[_0x17b6c6(0x269)][_0x17b6c6(0x263)](_0x4883c1+_0x17b6c6(0x208)+JSON[_0x17b6c6(0x253)](_0xd54535)),_0x12d9c9[_0x17b6c6(0x269)][_0x17b6c6(0x29c)](_0x4883c1+_0x17b6c6(0x23e)+_0x5e6ada);continue;}if(!_0x5d35a1[_0x17b6c6(0x20f)]){_0x12d9c9[_0x17b6c6(0x269)][_0x17b6c6(0x263)](_0x4883c1+_0x17b6c6(0x209)+JSON[_0x17b6c6(0x253)](_0xd54535)),_0x12d9c9[_0x17b6c6(0x269)]['debug'](_0x4883c1+_0x17b6c6(0x23e)+_0x5e6ada);continue;}delete _0x5d35a1[_0x17b6c6(0x212)];let _0xad1856;_0x5d35a1['id']&&(_0xad1856=_0x5d35a1['id'],delete _0x5d35a1['id']);let _0x5ef708;_0x5d35a1['onCreate']&&(_0x5ef708=utils[_0x17b6c6(0x229)](_0x5d35a1[_0x17b6c6(0x282)]),delete _0x5d35a1[_0x17b6c6(0x282)]);await _0x12b589(_0x5d35a1);const _0x37e300=_0x5d35a1['userName'];let _0x21961e,_0x4fcee7;try{_0x21961e=await _0x4f8251(_0x17b6c6(0x20f),_0x37e300);}catch(_0x7295fa){_0x12d9c9[_0x17b6c6(0x269)][_0x17b6c6(0x263)](_0x4883c1+_0x17b6c6(0x1db)+_0x7295fa[_0x17b6c6(0x29f)]),_0x12d9c9[_0x17b6c6(0x269)]['debug'](_0x4883c1+'\x20done'+_0x5e6ada);continue;}if(_0x366236[_0x17b6c6(0x241)]){let _0x597804=![];if(_0xd54535[_0x17b6c6(0x1fa)]&&Array['isArray'](_0xd54535[_0x17b6c6(0x1fa)]))for(let _0x54c697=0x0;_0x54c697<_0xd54535['Operations'][_0x17b6c6(0x295)];_0x54c697++){const _0x1b947a=_0xd54535[_0x17b6c6(0x1fa)][_0x54c697];_0x1b947a[_0x17b6c6(0x22b)][_0x17b6c6(0x20d)]('roles')&&(_0x1b947a[_0x17b6c6(0x22b)]=_0x17b6c6(0x235),Array[_0x17b6c6(0x273)](_0x1b947a[_0x17b6c6(0x1f4)])?(_0x1b947a[_0x17b6c6(0x1f4)][0x0]['id']=_0x1b947a[_0x17b6c6(0x1f4)][0x0][_0x17b6c6(0x1f4)],_0x1b947a['value'][0x0][_0x17b6c6(0x261)]=_0x1b947a['value'][0x0]['type']+_0x17b6c6(0x278)+_0x1b947a[_0x17b6c6(0x1f4)][0x0][_0x17b6c6(0x1f4)],delete _0x1b947a[_0x17b6c6(0x1f4)][0x0][_0x17b6c6(0x1f4)],delete _0x1b947a[_0x17b6c6(0x1f4)][0x0]['type']):_0x1b947a[_0x17b6c6(0x1f4)]=[{'id':_0x1b947a[_0x17b6c6(0x1f4)],'display':_0x1b947a[_0x17b6c6(0x1f4)]}],delete _0x1b947a[_0x17b6c6(0x265)],_0x597804=!![]);}if(_0x5d35a1[_0x17b6c6(0x24a)]&&Array['isArray'](_0x5d35a1[_0x17b6c6(0x24a)])&&_0x5d35a1['roles'][_0x17b6c6(0x295)]>0x0){if(!_0x5d35a1[_0x17b6c6(0x235)])_0x5d35a1[_0x17b6c6(0x235)]=[];if(!Array[_0x17b6c6(0x273)](_0x5d35a1['groups']))_0x5d35a1['groups']=[];for(let _0x4fc821=0x0;_0x4fc821<_0x5d35a1[_0x17b6c6(0x24a)][_0x17b6c6(0x295)];_0x4fc821++){const _0x4af965={},_0x27c9e6=_0x5d35a1['roles'][_0x4fc821];_0x4af965['value']=_0x27c9e6[_0x17b6c6(0x1f4)],_0x4af965['display']=_0x27c9e6[_0x17b6c6(0x210)]+_0x17b6c6(0x278)+_0x27c9e6[_0x17b6c6(0x261)],_0x5d35a1[_0x17b6c6(0x235)]['push'](_0x4af965);}delete _0x5d35a1[_0x17b6c6(0x24a)],_0x597804=!![];}if(_0x597804)_0x12d9c9[_0x17b6c6(0x269)][_0x17b6c6(0x29c)](_0x4883c1+_0x17b6c6(0x1d9)+JSON['stringify'](_0xd54535));}if(_0x366236[_0x17b6c6(0x1f1)]&&_0xd54535[_0x17b6c6(0x1e5)]===_0x17b6c6(0x232)){if(_0x5d35a1[_0x17b6c6(0x235)]&&Array['isArray'](_0x5d35a1[_0x17b6c6(0x235)])&&_0x5d35a1[_0x17b6c6(0x235)][_0x17b6c6(0x295)]===0x0){if(_0x5d35a1[_0x17b6c6(0x24a)]&&Array['isArray'](_0x5d35a1[_0x17b6c6(0x24a)])&&_0x5d35a1['roles'][_0x17b6c6(0x295)]===0x0){if(_0xd54535[_0x17b6c6(0x1fa)]&&Array[_0x17b6c6(0x273)](_0xd54535['Operations'])&&_0xd54535[_0x17b6c6(0x1fa)][_0x17b6c6(0x295)]>0x0)for(let _0x43fa08=0x0;_0x43fa08<_0xd54535[_0x17b6c6(0x1fa)][_0x17b6c6(0x295)];_0x43fa08++){const _0xe1fe33=_0xd54535[_0x17b6c6(0x1fa)][_0x43fa08];if(_0xe1fe33['op']==='remove'){if(_0xe1fe33[_0x17b6c6(0x22b)]){if(_0xe1fe33[_0x17b6c6(0x22b)][_0x17b6c6(0x20d)](_0x17b6c6(0x24a))&&_0xe1fe33[_0x17b6c6(0x265)])_0xd54535['activityOperation']='deleteUser';else _0xe1fe33['path']===_0x17b6c6(0x235)&&(_0xd54535[_0x17b6c6(0x1e5)]=_0x17b6c6(0x23a));}}}}}}if(!_0x21961e){if(_0xd54535['activityOperation']==='deleteUser'){_0x12d9c9[_0x17b6c6(0x269)]['debug'](_0x4883c1+_0x17b6c6(0x234)+_0x37e300+_0x17b6c6(0x1f8)),_0x12d9c9[_0x17b6c6(0x269)][_0x17b6c6(0x29c)](_0x4883c1+_0x17b6c6(0x23e)+_0x5e6ada);continue;}if(_0x366236['modifyOnly']&&_0x366236[_0x17b6c6(0x248)]===!![]){_0x12d9c9[_0x17b6c6(0x269)][_0x17b6c6(0x29c)](_0x4883c1+_0x17b6c6(0x223)+_0x37e300+_0x17b6c6(0x21d)),_0x12d9c9['logger']['debug'](_0x4883c1+'\x20done'+_0x5e6ada);continue;}if(Object[_0x17b6c6(0x26c)]['hasOwnProperty'][_0x17b6c6(0x264)](_0x5d35a1,_0x17b6c6(0x246))){if(typeof _0x5d35a1['active']===_0x17b6c6(0x27d)){const _0x387f88=_0x5d35a1[_0x17b6c6(0x246)][_0x17b6c6(0x25a)]();if(_0x387f88===_0x17b6c6(0x237))_0x5d35a1[_0x17b6c6(0x246)]=!![];else{if(_0x387f88===_0x17b6c6(0x1e9))_0x5d35a1[_0x17b6c6(0x246)]=![];}}if(_0x5d35a1['active']===![]){_0x12d9c9[_0x17b6c6(0x269)][_0x17b6c6(0x29c)](_0x4883c1+_0x17b6c6(0x223)+_0x37e300+'\x20message:\x20user\x20not\x20created\x20because\x20of\x20active=false'),_0x12d9c9['logger'][_0x17b6c6(0x29c)](_0x4883c1+_0x17b6c6(0x23e)+_0x5e6ada);continue;}}_0x12d9c9[_0x17b6c6(0x269)]['debug'](_0x4883c1+_0x17b6c6(0x286)+_0x37e300);const _0x57af0a=utils[_0x17b6c6(0x229)](_0x5d35a1);try{delete _0x57af0a['groups'];!_0x57af0a[_0x17b6c6(0x297)]&&_0x366236[_0x17b6c6(0x202)]&&_0x366236[_0x17b6c6(0x202)]===!![]&&(_0x57af0a[_0x17b6c6(0x297)]=utils['createRandomPassword'](0xf));if(_0x5ef708||_0xad1856){if(_0x5ef708)for(const _0xaf96a in _0x5ef708){_0x57af0a[_0xaf96a]=_0x5ef708[_0xaf96a];}if(_0xad1856)_0x57af0a['id']=_0xad1856;await _0x12b589(_0x57af0a);}await _0x12d9c9[_0x17b6c6(0x22c)](_0x20f2b8,_0x57af0a),_0x5d35a1[_0x17b6c6(0x235)]&&Array[_0x17b6c6(0x273)](_0x5d35a1[_0x17b6c6(0x235)])&&_0x5d35a1[_0x17b6c6(0x235)][_0x17b6c6(0x295)]>0x0&&(_0x4fcee7=await _0x4f8251(_0x17b6c6(0x20f),_0x37e300));}catch(_0xf1d647){_0x12d9c9[_0x17b6c6(0x269)][_0x17b6c6(0x263)](_0x4883c1+_0x17b6c6(0x26d)+JSON[_0x17b6c6(0x253)](_0x57af0a)+_0x17b6c6(0x251)+_0xf1d647['message']+'}'),_0x12d9c9[_0x17b6c6(0x269)]['debug'](_0x4883c1+_0x17b6c6(0x23e)+_0x5e6ada);continue;}}if(_0x21961e||_0x4fcee7){if(_0xd54535[_0x17b6c6(0x1e5)]===_0x17b6c6(0x23a)){if(_0x366236[_0x17b6c6(0x248)]&&_0x366236['modifyOnly']===!![]){_0x12d9c9[_0x17b6c6(0x269)][_0x17b6c6(0x29c)](_0x4883c1+_0x17b6c6(0x1df)+_0x21961e+_0x17b6c6(0x244)),_0x12d9c9[_0x17b6c6(0x269)][_0x17b6c6(0x29c)](_0x4883c1+'\x20done'+_0x5e6ada);continue;}_0x12d9c9[_0x17b6c6(0x269)][_0x17b6c6(0x29c)](_0x4883c1+_0x17b6c6(0x1df)+_0x21961e);try{await _0x12d9c9[_0x17b6c6(0x23a)](_0x20f2b8,_0x21961e);}catch(_0x54cf47){_0x12d9c9[_0x17b6c6(0x269)][_0x17b6c6(0x263)](_0x4883c1+_0x17b6c6(0x1df)+_0x21961e+_0x17b6c6(0x251)+_0x54cf47[_0x17b6c6(0x29f)]+'}'),_0x12d9c9[_0x17b6c6(0x269)][_0x17b6c6(0x29c)](_0x4883c1+'\x20done'+_0x5e6ada);continue;}}else{if(_0x4fcee7)_0x21961e=_0x4fcee7;_0x12d9c9['logger'][_0x17b6c6(0x29c)](_0x4883c1+_0x17b6c6(0x1f3)+_0x21961e);const _0x3dac42={};_0x3dac42[_0x17b6c6(0x245)]=()=>{},_0x3dac42[_0x17b6c6(0x26f)]=_0x20f2b8?'/'+_0x20f2b8+'/Users/'+_0x21961e:_0x17b6c6(0x1fd)+_0x21961e,_0x3dac42[_0x17b6c6(0x1fe)]={},_0x3dac42['params']['id']=_0x21961e,_0x3dac42[_0x17b6c6(0x25e)]={},_0x3dac42[_0x17b6c6(0x25e)][_0x17b6c6(0x260)]=_0x5d35a1;try{await _0x12d9c9[_0x17b6c6(0x29a)](_0x3dac42);}catch(_0x24cf9e){_0x12d9c9[_0x17b6c6(0x269)]['debug'](_0x4883c1+_0x17b6c6(0x1f3)+_0x21961e+_0x17b6c6(0x251)+_0x24cf9e[_0x17b6c6(0x29f)]),_0x12d9c9[_0x17b6c6(0x269)][_0x17b6c6(0x29c)](_0x4883c1+'\x20done'+_0x5e6ada);continue;}if(_0x3dac42[_0x17b6c6(0x294)]&&_0x3dac42[_0x17b6c6(0x294)]!==0xc8){if(_0x3dac42[_0x17b6c6(0x260)]){if(_0x3dac42[_0x17b6c6(0x260)][_0x17b6c6(0x29e)]){let _0x56021f=_0x3dac42[_0x17b6c6(0x260)][_0x17b6c6(0x29e)];_0x56021f=_0x56021f['replace'](_0x12d9c9[_0x17b6c6(0x1f9)]+'['+_0x12d9c9[_0x17b6c6(0x221)]+']',''+_0x4883c1),_0x12d9c9['logger'][_0x17b6c6(0x263)](''+_0x56021f);}else{if(_0x3dac42['body']['Errors']&&Array[_0x17b6c6(0x273)](_0x3dac42[_0x17b6c6(0x260)][_0x17b6c6(0x292)])&&_0x3dac42[_0x17b6c6(0x260)][_0x17b6c6(0x292)][_0x17b6c6(0x295)]>0x0){let _0xfc2c23=_0x3dac42['body']['Errors'][0x0][_0x17b6c6(0x206)];_0xfc2c23=_0xfc2c23[_0x17b6c6(0x1fb)](_0x12d9c9[_0x17b6c6(0x1f9)]+'['+_0x12d9c9['pluginName']+']',''+_0x4883c1),_0x12d9c9[_0x17b6c6(0x269)][_0x17b6c6(0x263)](''+_0xfc2c23);}}}}if(_0x366236[_0x17b6c6(0x272)]){const [_0x412a15,_0x487caf]=_0x12d9c9['convertedScim20']({'Operations':_0xd54535[_0x17b6c6(0x1fa)]});if(_0x487caf){_0x12d9c9[_0x17b6c6(0x269)][_0x17b6c6(0x263)](_0x4883c1+_0x17b6c6(0x1f3)+_0x21961e+'\x20convertedScim20\x20error:\x20'+_0x487caf[_0x17b6c6(0x29f)]),_0x12d9c9[_0x17b6c6(0x269)][_0x17b6c6(0x29c)](_0x4883c1+_0x17b6c6(0x23e)+_0x5e6ada);continue;}const _0x1d04ce=[];if(_0x412a15[_0x17b6c6(0x24a)]&&Array[_0x17b6c6(0x273)](_0x412a15[_0x17b6c6(0x24a)]))for(let _0x1b73ab=0x0;_0x1b73ab<_0x412a15[_0x17b6c6(0x24a)]['length'];_0x1b73ab++){_0x412a15['roles'][_0x1b73ab][_0x17b6c6(0x259)]&&_0x412a15[_0x17b6c6(0x24a)][_0x1b73ab]['operation']===_0x17b6c6(0x1ec)&&_0x1d04ce['push'](_0x412a15[_0x17b6c6(0x24a)][_0x1b73ab]);}if(_0x1d04ce[_0x17b6c6(0x295)]>0x0)try{await _0x12d9c9[_0x17b6c6(0x232)](_0x20f2b8,_0x21961e,{'roles':_0x1d04ce});}catch(_0x389ec7){_0x12d9c9[_0x17b6c6(0x269)][_0x17b6c6(0x263)](_0x4883c1+_0x17b6c6(0x1f3)+_0x21961e+_0x17b6c6(0x288)+_0x389ec7['message']);}const _0x34f67b=[];if(_0x412a15['groups']&&Array[_0x17b6c6(0x273)](_0x412a15[_0x17b6c6(0x235)]))for(let _0x20c76e=0x0;_0x20c76e<_0x412a15[_0x17b6c6(0x235)][_0x17b6c6(0x295)];_0x20c76e++){_0x412a15[_0x17b6c6(0x235)][_0x20c76e][_0x17b6c6(0x259)]&&_0x412a15[_0x17b6c6(0x235)][_0x20c76e][_0x17b6c6(0x259)]===_0x17b6c6(0x1ec)&&_0x34f67b[_0x17b6c6(0x216)](_0x412a15[_0x17b6c6(0x235)][_0x20c76e]);}if(_0x34f67b[_0x17b6c6(0x295)]>0x0)for(let _0x43bb6e=0x0;_0x43bb6e<_0x34f67b[_0x17b6c6(0x295)];_0x43bb6e++){try{await _0x12d9c9[_0x17b6c6(0x296)](_0x20f2b8,_0x34f67b[_0x43bb6e]['id'],{'members':[{'operation':'delete','value':_0x21961e}]});}catch(_0x55df15){_0x12d9c9[_0x17b6c6(0x269)]['error'](_0x4883c1+'\x20Replace\x20User\x20id='+_0x21961e+_0x17b6c6(0x1e1)+_0x55df15[_0x17b6c6(0x29f)]);}}}}}_0x12d9c9[_0x17b6c6(0x269)][_0x17b6c6(0x29c)](_0x4883c1+_0x17b6c6(0x23e)+_0x5e6ada);}}catch(_0x489146){_0x12d9c9[_0x17b6c6(0x269)]['error'](_0x12d9c9[_0x17b6c6(0x1f9)]+'['+_0x12d9c9[_0x17b6c6(0x221)]+_0x17b6c6(0x28f)+_0x2f89fd+']\x20subscriber\x20stopped\x20error:\x20'+_0x489146[_0x17b6c6(0x29f)]);return;}try{_0x12d9c9[_0x17b6c6(0x269)][_0x17b6c6(0x1ef)](_0x12d9c9['gwName']+'['+_0x12d9c9[_0x17b6c6(0x221)]+']\x20subscriber['+_0x2f89fd+']\x20restarting\x20subscriber'),_0x47aacd['Status']()===nats['CLOSED']&&(_0x12d9c9[_0x17b6c6(0x269)][_0x17b6c6(0x29c)](_0x12d9c9['gwName']+'['+_0x12d9c9[_0x17b6c6(0x221)]+_0x17b6c6(0x28f)+_0x2f89fd+_0x17b6c6(0x257)),await this[_0x17b6c6(0x2a0)]()),_0x29db4c=await _0x121e49[_0x17b6c6(0x1e2)](_0x2f89fd,_0x4816ac),_0x18b866();}catch(_0x1ad63f){_0x12d9c9[_0x17b6c6(0x269)][_0x17b6c6(0x263)](_0x12d9c9[_0x17b6c6(0x1f9)]+'['+_0x12d9c9[_0x17b6c6(0x221)]+']\x20subscriber['+_0x2f89fd+_0x17b6c6(0x21a)+_0x1ad63f[_0x17b6c6(0x29f)]+_0x17b6c6(0x254)+_0x5e6ada);}};_0x18b866();const _0x499b78=async()=>{const _0x2e5421=_0x1044af;let _0x25e7dd=0x0;for await(const _0x5166ec of _0x47aacd[_0x2e5421(0x294)]()){switch(_0x5166ec[_0x2e5421(0x210)]){case nats[_0x2e5421(0x224)][_0x2e5421(0x226)]:_0x12d9c9['logger'][_0x2e5421(0x263)](_0x12d9c9[_0x2e5421(0x1f9)]+'['+_0x12d9c9[_0x2e5421(0x221)]+_0x2e5421(0x28f)+_0x2f89fd+_0x2e5421(0x22d)+_0x5166ec[_0x2e5421(0x1e7)]),_0x25e7dd=0x0;break;case nats[_0x2e5421(0x224)][_0x2e5421(0x27f)]:_0x12d9c9[_0x2e5421(0x269)][_0x2e5421(0x1ef)](_0x12d9c9[_0x2e5421(0x1f9)]+'['+_0x12d9c9[_0x2e5421(0x221)]+_0x2e5421(0x28f)+_0x2f89fd+']\x20client\x20reconnected\x20'+_0x5166ec['data']);try{await _0x29db4c['consumerInfo']();}catch(_0x347aa0){_0x29db4c[_0x2e5421(0x25f)]();}break;case nats['DebugEvents'][_0x2e5421(0x247)]:_0x25e7dd+=0x1;_0x25e7dd%0x1e===0x0&&_0x12d9c9[_0x2e5421(0x269)][_0x2e5421(0x29c)](_0x12d9c9[_0x2e5421(0x1f9)]+'['+_0x12d9c9[_0x2e5421(0x221)]+']\x20subscriber['+_0x2f89fd+_0x2e5421(0x23f)+_0x5166ec['data']+_0x2e5421(0x24f)+_0x25e7dd+')');break;case nats[_0x2e5421(0x1eb)]['StaleConnection']:_0x12d9c9[_0x2e5421(0x269)]['debug'](_0x12d9c9[_0x2e5421(0x1f9)]+'['+_0x12d9c9[_0x2e5421(0x221)]+_0x2e5421(0x28f)+_0x2f89fd+']\x20client\x20has\x20a\x20stale\x20connection\x20'+_0x5166ec['data']);break;}}};_0x499b78();};const _0x4f8251=async(_0x15323a,_0x28fd72)=>{const _0x556b73=_0x4b2276,_0xe430d9={'attribute':_0x15323a,'operator':'eq','value':_0x28fd72,'rawFilter':undefined,'startIndex':undefined,'count':undefined},_0x546ecd=[_0x15323a];if(_0x15323a!=='id')_0x546ecd[_0x556b73(0x216)]('id');try{const _0x176bfe=await _0x12d9c9[_0x556b73(0x21e)](_0x73c3e0,_0xe430d9,_0x546ecd);if(!_0x176bfe||!_0x176bfe[_0x556b73(0x27b)]||!Array['isArray'](_0x176bfe['Resources']))throw new Error(_0x556b73(0x231)+JSON[_0x556b73(0x253)](_0xe430d9)+_0x556b73(0x24d));if(_0x176bfe[_0x556b73(0x27b)][_0x556b73(0x295)]===0x0)return null;else{if(_0x176bfe['Resources']['length']>0x2)throw new Error(_0x556b73(0x231)+JSON[_0x556b73(0x253)](_0xe430d9)+_0x556b73(0x204));else{const _0x28767b=_0x176bfe[_0x556b73(0x27b)][0x0];if(!_0x28767b['id'])throw new Error(_0x556b73(0x231)+JSON[_0x556b73(0x253)](_0xe430d9)+_0x556b73(0x289)+JSON[_0x556b73(0x253)](_0x28767b)+'\x20error:\x20missing\x20id}');return decodeURIComponent(_0x28767b['id']);}}}catch(_0x96f4a3){throw new Error(_0x556b73(0x231)+JSON['stringify'](_0xe430d9)+'\x20error:\x20'+_0x96f4a3[_0x556b73(0x29f)]+'}');}},_0x3abd0d=_0x5243f4=>{const _0x3fabc0=_0x4b2276;if(!_0x5243f4||typeof _0x5243f4!==_0x3fabc0(0x27d))return[null,null];_0x5243f4=_0x5243f4['trim']();const _0x514559=_0x5243f4[_0x3fabc0(0x1f7)]('(');if(_0x514559<0x1)return[null,null];if(_0x5243f4[_0x3fabc0(0x255)](_0x5243f4[_0x3fabc0(0x295)]-0x1)!==')')return[null,null];if(_0x4c7899(_0x5243f4,'(')!==_0x4c7899(_0x5243f4,')'))return[null,null];const _0x3a20b4=_0x5243f4[_0x3fabc0(0x255)](0x0,_0x514559),_0x3b9e54=_0x5243f4[_0x3fabc0(0x255)](_0x514559+0x1,_0x5243f4[_0x3fabc0(0x295)]-0x1);let _0x17376d=[];const _0x2ded7f=_0x3b9e54['split'](',');let _0x3895dd='';for(let _0xae2398=0x0;_0xae2398<_0x2ded7f[_0x3fabc0(0x295)];_0xae2398++){const _0x3a6889=_0x3895dd?_0x3895dd+','+_0x2ded7f[_0xae2398]:_0x2ded7f[_0xae2398],_0x4da2a0=_0x4c7899(_0x3a6889,'('),_0x2deff5=_0x4c7899(_0x3a6889,')');if(_0x4da2a0===_0x2deff5)_0x17376d['push'](_0x53aef0(_0x3a6889,'\x22')),_0x3895dd='';else{if(_0x3895dd)_0x3895dd+=','+_0x2ded7f[_0xae2398];else _0x3895dd+=_0x2ded7f[_0xae2398];}}if(_0x17376d[_0x3fabc0(0x295)]===0x0)_0x17376d=null;return[_0x3a20b4,_0x17376d];};function _0x4c7899(_0x17da87,_0x5e133c){let _0x3333bb=0x0;for(let _0x263064=0x0;_0x263064<_0x17da87['length'];_0x263064++){_0x17da87['charAt'](_0x263064)===_0x5e133c&&(_0x3333bb+=0x1);}return _0x3333bb;}const _0x53aef0=(_0x13172f,_0x4c6fe0)=>{const _0x5acdb2=_0x4b2276;if(typeof _0x13172f!==_0x5acdb2(0x27d)||typeof _0x4c6fe0!==_0x5acdb2(0x27d))return _0x13172f;if(_0x13172f[_0x5acdb2(0x295)]===0x1)return _0x13172f;if(_0x4c6fe0[_0x5acdb2(0x295)]!==0x1)return _0x13172f;return _0x13172f=_0x13172f[_0x5acdb2(0x21c)](),_0x13172f[_0x5acdb2(0x255)](0x0,0x1)===_0x4c6fe0&&(_0x13172f=_0x13172f[_0x5acdb2(0x255)](0x1)),_0x13172f[_0x5acdb2(0x255)](_0x13172f['length']-0x1)===_0x4c6fe0&&(_0x13172f=_0x13172f[_0x5acdb2(0x255)](0x0,_0x13172f['length']-0x1)),_0x13172f;},_0x3f50c4=async(_0x393d9e,_0x3bd66f,_0x334be4)=>{const _0x175101=_0x4b2276;if(!_0x393d9e||!_0x3bd66f||!_0x334be4)return null;const [_0x25f9cd,_0x408bf1]=_0x3abd0d(_0x334be4);if(!_0x25f9cd||!_0x408bf1){const _0x2f521c=_0x334be4[_0x175101(0x1e0)]('(');if(_0x2f521c['length']>0x1){const _0x4074cc=[_0x175101(0x256),_0x175101(0x270),'firstn',_0x175101(0x1fc),_0x175101(0x26a),'replace','normalize',_0x175101(0x275),_0x175101(0x284)],_0x4dc70c=_0x2f521c[0x0][_0x175101(0x25a)]();if(_0x4074cc[_0x175101(0x24c)](_0x4dc70c))return null;}return _0x334be4;}for(let _0x2b87ad=0x0;_0x2b87ad<_0x408bf1[_0x175101(0x295)];_0x2b87ad++){if(_0x408bf1[_0x2b87ad][_0x175101(0x255)](0x0,0x1)==='['){const _0x20ec2d=_0x408bf1[_0x2b87ad][_0x175101(0x1f7)](']');if(_0x20ec2d<0x0)return null;const _0x7720de=_0x408bf1[_0x2b87ad][_0x175101(0x255)](0x1,_0x20ec2d),_0x335b9b=_0x7720de[_0x175101(0x1e0)]('.');let _0x576e82;for(let _0x193764=0x0;_0x193764<_0x335b9b[_0x175101(0x295)];_0x193764++){if(_0x193764===0x0)_0x576e82=_0x393d9e[_0x335b9b[_0x193764]];else{if(!_0x576e82)return null;_0x576e82=_0x576e82[_0x335b9b[_0x193764]];}}if(!_0x576e82)return null;_0x408bf1[_0x2b87ad]=_0x576e82;}}for(let _0x496e03=0x0;_0x496e03<_0x408bf1[_0x175101(0x295)];_0x496e03++){const [_0x84f90e]=_0x3abd0d(_0x408bf1[_0x496e03]);_0x84f90e&&(_0x408bf1[_0x496e03]=await _0x3f50c4(_0x393d9e,_0x3bd66f,_0x408bf1[_0x496e03]));}if(_0x408bf1[0x0]===null)return null;switch(_0x25f9cd[_0x175101(0x25a)]()){case'lowercase':{if(_0x408bf1[_0x175101(0x295)]!==0x1)return null;const [_0x17d605]=_0x3abd0d(_0x408bf1[0x0]);if(_0x17d605)_0x408bf1[0x0]=await _0x3f50c4(_0x393d9e,_0x3bd66f,_0x17d605);if(_0x408bf1[0x0]===null)return null;return _0x408bf1[0x0]['toLowerCase']();}case _0x175101(0x270):{if(_0x408bf1[_0x175101(0x295)]!==0x1)return null;const [_0x1e3357]=_0x3abd0d(_0x408bf1[0x0]);if(_0x1e3357)_0x408bf1[0x0]=await _0x3f50c4(_0x393d9e,_0x3bd66f,_0x1e3357);if(_0x408bf1[0x0]===null)return null;return _0x408bf1[0x0][_0x175101(0x22e)]();}case'firstn':{if(_0x408bf1[_0x175101(0x295)]!==0x2)return null;const [_0x5b2216]=_0x3abd0d(_0x408bf1[0x0]);if(_0x5b2216)_0x408bf1[0x0]=await _0x3f50c4(_0x393d9e,_0x3bd66f,_0x5b2216);if(_0x408bf1[0x0]===null)return null;if(isNaN(_0x408bf1[0x1]))return null;return _0x408bf1[0x0][_0x175101(0x255)](0x0,_0x408bf1[0x1]);}case _0x175101(0x1fc):{const [_0x5d6f05]=_0x3abd0d(_0x408bf1[0x0]);if(_0x408bf1[_0x175101(0x295)]<0x2)return null;if(_0x5d6f05)_0x408bf1[0x0]=await _0x3f50c4(_0x393d9e,_0x3bd66f,_0x5d6f05);if(_0x408bf1[0x0]===null)return null;const _0xbf5c6c=_0x408bf1[0x1];if(isNaN(_0xbf5c6c))return null;let _0x22d39e;if(_0x408bf1[_0x175101(0x295)]===0x3)_0x22d39e=_0x408bf1[0x0][_0x175101(0x1e0)](_0x408bf1[0x2]);else _0x22d39e=_0x22d39e=_0x408bf1[0x0]['split']('\x20');if(_0xbf5c6c<=_0x22d39e[_0x175101(0x295)])return _0x22d39e[_0xbf5c6c-0x1];else return'';}case _0x175101(0x1fb):{const [_0x1b51fa]=_0x3abd0d(_0x408bf1[0x0]);if(_0x1b51fa)_0x408bf1[0x0]=await _0x3f50c4(_0x393d9e,_0x3bd66f,_0x1b51fa);if(_0x408bf1[0x0]===null)return null;if(_0x408bf1['length']!==0x3)return null;return _0x408bf1[0x0][_0x175101(0x230)](_0x408bf1[0x1],_0x408bf1[0x2]);}case _0x175101(0x1ff):{if(_0x408bf1[_0x175101(0x295)]!==0x1)return null;const [_0x36bd7f]=_0x3abd0d(_0x408bf1[0x0]);if(_0x36bd7f)_0x408bf1[0x0]=await _0x3f50c4(_0x393d9e,_0x3bd66f,_0x36bd7f);if(_0x408bf1[0x0]===null)return null;return ascii127[_0x175101(0x21b)](_0x408bf1[0x0]);}case'join':{let _0x99dfea='';for(let _0x4a2fbb=0x0;_0x4a2fbb<_0x408bf1[_0x175101(0x295)];_0x4a2fbb++){const [_0x1f0e22]=_0x3abd0d(_0x408bf1[_0x4a2fbb]);if(_0x1f0e22)_0x408bf1[_0x4a2fbb]=await _0x3f50c4(_0x393d9e,_0x3bd66f,_0x1f0e22);if(_0x408bf1[_0x4a2fbb]===null)return null;_0x99dfea+=_0x408bf1[_0x4a2fbb];}return _0x99dfea;}case _0x175101(0x275):{if(_0x408bf1['length']>0x2)return null;const [_0x14cceb]=_0x3abd0d(_0x408bf1[0x0]);if(_0x14cceb)_0x408bf1[0x0]=await _0x3f50c4(_0x393d9e,_0x3bd66f,_0x14cceb);if(_0x408bf1[0x0]===null)return null;const _0x2a4caa=parseInt(_0x408bf1[0x0]);if(isNaN(_0x2a4caa))return null;let _0x44bd04=_0x175101(0x26e);_0x44bd04+=','+_0x408bf1[0x0];if(_0x408bf1['length']===0x2&&_0x408bf1[0x1][_0x175101(0x25a)]()===_0x175101(0x237))_0x44bd04+=',true';else _0x44bd04+=_0x175101(0x23d);return _0x44bd04+='##',_0x44bd04;}case'getuniquevalue':{if(_0x408bf1[_0x175101(0x295)]!==0x1)return null;const [_0x3a922d]=_0x3abd0d(_0x408bf1[0x0]);if(_0x3a922d)_0x408bf1[0x0]=await _0x3f50c4(_0x393d9e,_0x3bd66f,_0x3a922d);if(_0x408bf1[0x0]===null)return null;let _0x537552,_0x132734=![],_0x4b11a6='';const _0x3a8a28=_0x408bf1[0x0][_0x175101(0x1e0)]('##');if(_0x3a8a28['length']>0x2)for(let _0x4a18a7=0x0;_0x4a18a7<_0x3a8a28[_0x175101(0x295)];_0x4a18a7++){if(_0x3a8a28[_0x4a18a7][_0x175101(0x20d)](_0x175101(0x200))){const _0x1f5d27=_0x3a8a28[_0x4a18a7]['split'](',');if(_0x1f5d27[_0x175101(0x295)]<0x2)return null;const _0x35bb18=parseInt(_0x1f5d27[0x1]);if(isNaN(_0x35bb18))return null;_0x4b11a6='##'+_0x3a8a28[_0x4a18a7]+'##',_0x537552=_0x1f5d27[0x1],_0x1f5d27[_0x175101(0x295)]>0x2&&(_0x132734=_0x1f5d27[0x2][_0x175101(0x25a)]()==='true');}}let _0x4c5e4c,_0x57fbbc=0x0,_0x56b852=0x0;if(_0x537552){_0x56b852=_0x537552['length'],_0x57fbbc=0xa;for(let _0x947799=0x1;_0x947799<_0x56b852;_0x947799++){_0x57fbbc*=0xa;}_0x57fbbc-=0x1,_0x4c5e4c=parseInt(_0x537552);if(isNaN(_0x4c5e4c))return null;_0x4c5e4c-=0x1;}else _0x4c5e4c=0x0;do{_0x4c5e4c+=0x1;let _0x4be14d=_0x408bf1[0x0];if(_0x537552!==undefined&&_0x4b11a6){let _0x16010a=_0x4c5e4c['toString']();while(_0x16010a[_0x175101(0x295)]<_0x56b852){_0x16010a='0'+_0x16010a;}_0x132734?_0x4be14d=_0x4be14d[_0x175101(0x1fb)](_0x4b11a6,_0x16010a):(_0x4be14d=_0x4be14d[_0x175101(0x1fb)](_0x4b11a6,''),_0x132734=!![],_0x4c5e4c-=0x1);}try{const _0x321965=await _0x4f8251(_0x3bd66f,_0x4be14d);if(!_0x321965)return _0x4be14d;}catch(_0x376b62){return _0x12d9c9[_0x175101(0x269)][_0x175101(0x263)](_0x12d9c9[_0x175101(0x1f9)]+'['+_0x12d9c9[_0x175101(0x221)]+']\x20'+_0x25f9cd+'\x20getUserId()\x20error:\x20'+_0x376b62['message']),null;}}while(_0x4c5e4c<_0x57fbbc);return null;}default:}return null;},_0x12b589=async _0x1a999e=>{const _0x3c59a7=_0x4b2276;for(const _0xf12635 in _0x1a999e){const _0x1f602e=_0x1a999e[_0xf12635],[_0xc9970c,_0x27c379]=_0x3abd0d(_0x1f602e);if(_0xc9970c){const _0x65808b=''+_0xf12635,_0x435f58=_0xc9970c+'('+_0x27c379[_0x3c59a7(0x26a)](',')+')',_0x10f829=await _0x3f50c4(_0x1a999e,_0x65808b,_0x435f58);if(_0x10f829===null)delete _0x1a999e[_0xf12635];else _0x1a999e[_0xf12635]=_0x10f829;}for(const _0x325912 in _0x1f602e){const _0x314e0e=_0x1f602e[_0x325912],[_0x175320,_0xed77f]=_0x3abd0d(_0x314e0e);if(_0x175320){const _0x9f0f03=_0xf12635+'.'+_0x325912,_0x1af5ae=_0x175320+'('+_0xed77f['join'](',')+')',_0x213556=await _0x3f50c4(_0x1a999e,_0x9f0f03,_0x1af5ae);if(_0x213556===null)delete _0x1f602e[_0x325912];else _0x1f602e[_0x325912]=_0x213556;}}}return _0x1a999e;};},module[a0_0x32b8a6(0x28c)][a0_0x32b8a6(0x1d8)]=async(_0x3366eb,_0x17469d,_0x3576aa,_0xcd491d)=>{const _0x698b36=a0_0x32b8a6,_0x253423=_0x698b36(0x1d8),_0x4feb47=_0x3366eb;_0x4feb47['logger'][_0x698b36(0x29c)](_0x4feb47[_0x698b36(0x1f9)]+'['+_0x4feb47[_0x698b36(0x221)]+_0x698b36(0x262)+_0x253423+'\x22');try{if(!fs['existsSync'](_0x4feb47[_0x698b36(0x233)]+'/approles'))fs[_0x698b36(0x238)](_0x4feb47[_0x698b36(0x233)]+_0x698b36(0x26b));}catch(_0x2c655f){}const _0x1f9f8c=path[_0x698b36(0x26a)](''+_0x4feb47[_0x698b36(0x233)],_0x698b36(0x1f5),_0x698b36(0x20a)+_0x4feb47[_0x698b36(0x221)]+_0x698b36(0x22a)),_0x8ba98b={};utils[_0x698b36(0x28e)](_0x1f9f8c)&&fs[_0x698b36(0x299)](_0x1f9f8c,_0x698b36(0x280))['split'](/\r?\n/)[_0x698b36(0x274)](_0x484219=>{const _0x3fca66=_0x698b36,_0x958902=_0x484219[_0x3fca66(0x1e0)]('\x20');_0x958902['length']===0x2&&(_0x8ba98b[_0x958902[0x0]]=_0x958902[0x1]);});const _0x2e99dc=fs['createWriteStream'](_0x1f9f8c,{'flags':'w','encoding':_0x698b36(0x227),'mode':0x1b6,'autoClose':!![]}),_0x212490=[],_0x122c4c=await _0x4feb47['getGroups'](_0x17469d,{'attribute':undefined,'operator':undefined,'value':undefined},['id',_0x698b36(0x225)]);return _0x122c4c['Resources'][_0x698b36(0x274)](_0x3f515d=>{const _0x38a98c=_0x698b36;if(_0x3f515d['id']){let _0x59e326=crypto[_0x38a98c(0x293)]();if(_0x8ba98b[_0x3f515d['id']])_0x59e326=_0x8ba98b[_0x3f515d['id']];const _0x1950ea={'allowedMemberTypes':[_0x38a98c(0x27a)],'description':_0x38a98c(0x267),'displayName':_0x3f515d[_0x38a98c(0x225)]||_0x3f515d['id'],'id':_0x59e326,'isEnabled':!![],'lang':null,'origin':_0x38a98c(0x285),'value':decodeURIComponent(_0x3f515d['id'])};_0x212490[_0x38a98c(0x216)](_0x1950ea),_0x2e99dc[_0x38a98c(0x1e6)](_0x3f515d['id']+'\x20'+_0x59e326+'\x0a');}}),_0x2e99dc[_0x698b36(0x1ee)](),_0x4feb47[_0x698b36(0x269)]['debug'](_0x4feb47[_0x698b36(0x1f9)]+'['+_0x4feb47[_0x698b36(0x221)]+']\x20approle\x20uuid\x20file\x20created:\x20'+_0x1f9f8c),{'Resources':[{'appRoles':_0x212490}]};};
13
+ 'use strict';const a0_0x2b18c7=a0_0x485a;(function(_0x2cad0c,_0x1253e6){const _0x297f57=a0_0x485a,_0x4e5f53=_0x2cad0c();while(!![]){try{const _0x2b7bff=-parseInt(_0x297f57(0x1fa))/0x1*(parseInt(_0x297f57(0x1a0))/0x2)+-parseInt(_0x297f57(0x1e5))/0x3+parseInt(_0x297f57(0x218))/0x4*(parseInt(_0x297f57(0x1ba))/0x5)+parseInt(_0x297f57(0x20b))/0x6*(-parseInt(_0x297f57(0x20e))/0x7)+-parseInt(_0x297f57(0x1e0))/0x8+-parseInt(_0x297f57(0x21a))/0x9*(-parseInt(_0x297f57(0x201))/0xa)+parseInt(_0x297f57(0x234))/0xb;if(_0x2b7bff===_0x1253e6)break;else _0x4e5f53['push'](_0x4e5f53['shift']());}catch(_0x7dfb68){_0x4e5f53['push'](_0x4e5f53['shift']());}}}(a0_0x3831,0x9362f));function a0_0x485a(_0x1421bf,_0x20f3d6){const _0x3831c4=a0_0x3831();return a0_0x485a=function(_0x485a10,_0x15f8d4){_0x485a10=_0x485a10-0x180;let _0x42de61=_0x3831c4[_0x485a10];return _0x42de61;},a0_0x485a(_0x1421bf,_0x20f3d6);}function a0_0x3831(){const _0x201a67=['password','configDir','readFileSync','Error','getuniquevalue','\x20message:\x20user\x20does\x20not\x20exist','level','decode','delete','\x20roles\x20converted\x20to\x20groups\x20message:\x20','subscribe','Disconnect','AckPolicy','headers','isArray','waitOnFirstConnect','description','maxPingOut','data','value',']\x20connected\x20','connect','\x20missing\x20mandatory\x20user.userName\x20in\x20message:\x20','getServer','pingInterval','Reconnecting','maxReconnectAttempts','\x20Delete\x20User\x20id=','\x20should\x20have\x20syntax:\x20<collector>.<channel>','\x20convertedScim20\x20error:\x20','Msg-Id','replace','toLowerCase','drain','\x20missing\x20user\x20object\x20in\x20message:\x20','User','consumerInfo','roles',']\x20error:\x20client\x20have\x20not\x20been\x20initialized','join','substring','1003396hqFtib','getUsers()\x20getObj=',']\x20subscriber[','existsSync','subject','length','activityOperation','userName','write','getGroups','fsExistsSync','authenticator','trim','ConsumerNotFound','\x20Create\x20userName=','replaceAll','StringCodec',']\x20error:\x20subject\x20','modifyUser','\x20error:\x20missing\x20result','deleteUser','Resources','string','true','createWriteStream','filter_subject','5bECcui','\x20done','doIncrement',']\x20subscriber\x20error:\x20missing\x20certificate\x20configuration','Operations','startsWith','display','\x20-\x20','transports',']\x20handling\x20\x22',']\x20client\x20consumer\x20reinitiated\x20because\x20of\x20','Errors','originalUrl',']\x20closed\x20with\x20error:\x20','\x20createUser()\x20obj=','jetstream','push',']\x20client\x20disconnected\x20','hasOwnProperty','add','lowercase','\x20message:\x20user\x20not\x20created\x20because\x20of\x20active=false','utf8','operation','active','certificate','prototype','config','consumers','\x20-\x20will\x20do\x20auto\x20connect\x20when\x20available\x20-\x20however,\x20please\x20verify\x20stream\x20configuration','\x20Delete\x20User\x20userName=','approles_','\x20error:\x20more\x20than\x20one\x20user\x20were\x20found}','convertedScim20','mkdirSync',']\x20subscriber\x20certificate\x20error:\x20','body','SCIM\x20Stream\x20-\x20Autogenerated','8528152vcNqUV','onCreate','debug','New','pluginName','2972889qzDvCr','consume','../lib/utils','Events','SIGTERM','\x20message\x20json\x20parsing\x20error:\x20','typeId',']\x20error:\x20','close','durable_','get','\x20count=','toUpperCase','getAppRoles','crypto','\x20handling\x20message:\x20','baseUrls',']\x20approle\x20uuid\x20file\x20created:\x20','message','status','approles','1VKNZdL',']\x20client\x20consumer\x20error:\x20','set','ConsumerEvents','\x20Create\x20User\x20userName=','request','normalize','1215310qpusXu','then','\x20error:\x20missing\x20id}','type','split',']\x20connect\x20error:\x20','displayName','logger','replaceDomains','update','95838hWwfEp',']\x20client\x20has\x20a\x20stale\x20connection\x20','\x20Replace\x20User\x20id=','91ddtLAo',']\x20subscriber\x20stopped\x20error:\x20','stringify','\x20error:\x20','increment','detail','Explicit','copyObj','params','\x20-\x20will\x20do\x20auto\x20reconnect\x20when\x20connection\x20becomes\x20available','3071256mPrlbu','parse','18RythPR','Reconnect','toString','path','info','SIGINT','forEach','groups','ack','gwName','createRandomPassword','createUser','firstn','exports','from','\x20result=','jwtAuthenticator',']\x20client\x20is\x20attempting\x20to\x20reconnect\x20','jwt','tenant','utf-8','DebugEvents','generateUserPassword','nats','modifyOnly','unsubscribe','25950628vrgSNu','\x20getUserId()\x20error:\x20','fold-to-ascii','error','foldReplacing','\x20(count=','\x20message:\x20user\x20not\x20deleted\x20because\x20of\x20configuration\x20modifyOnly=true','queueGroup','Application','includes','closed','secret','reconnect','indexOf','tls','_info'];a0_0x3831=function(){return _0x201a67;};return a0_0x3831();}const nats=require('nats'),ascii127=require(a0_0x2b18c7(0x236)),fs=require('fs'),utils=require(a0_0x2b18c7(0x1e7)),path=require(a0_0x2b18c7(0x21d)),crypto=require(a0_0x2b18c7(0x1f3));module[a0_0x2b18c7(0x227)]['Subscriber']=function(_0x4fd2f0,_0x27c986,_0x5f2569,_0x5675f0){const _0x11841c=a0_0x2b18c7,_0x270119=_0x4fd2f0,_0x179084=_0x27c986,_0x5c87b4=_0x5f2569,_0x4f1028=_0x5675f0;if(!_0x179084[_0x11841c(0x1d3)]||!_0x179084[_0x11841c(0x1d3)]['ca']){_0x270119[_0x11841c(0x208)][_0x11841c(0x237)](_0x270119[_0x11841c(0x223)]+'['+_0x270119[_0x11841c(0x1e4)]+_0x11841c(0x1bd));return;}if(!_0x179084['usePutSoftSync']){_0x270119[_0x11841c(0x208)][_0x11841c(0x237)](_0x270119[_0x11841c(0x223)]+'['+_0x270119[_0x11841c(0x1e4)]+']\x20subscriber\x20error:\x20configuration\x20scim.usePutSoftSync\x20must\x20be\x20set\x20to\x20true');return;}let _0x291f12='';for(let _0x39b89f=0x0;_0x39b89f<_0x270119[_0x11841c(0x208)][_0x11841c(0x1c2)]['length'];_0x39b89f++){if(_0x270119[_0x11841c(0x208)][_0x11841c(0x1c2)][_0x39b89f]['name']==='file'){_0x291f12=_0x270119[_0x11841c(0x208)][_0x11841c(0x1c2)][_0x39b89f][_0x11841c(0x24a)];break;}}const _0x24597f=''+(_0x291f12===_0x11841c(0x1e2)?'\x0a':''),_0x212b3b={};try{_0x212b3b['ca']=[fs[_0x11841c(0x246)](_0x270119[_0x11841c(0x245)]+'/certs/'+_0x179084[_0x11841c(0x1d3)]['ca'])];}catch(_0x15bcd0){_0x270119[_0x11841c(0x208)]['error'](_0x270119[_0x11841c(0x223)]+'['+_0x270119[_0x11841c(0x1e4)]+_0x11841c(0x1dd)+_0x15bcd0[_0x11841c(0x1f7)]);return;}const _0x43687d={},_0x574f21=new TextEncoder()['encode'](_0x179084[_0x11841c(0x231)][_0x11841c(0x23f)]),_0x1abc7b=_0x179084[_0x11841c(0x231)][_0x11841c(0x22c)];_0x43687d[_0x11841c(0x1ab)]=nats[_0x11841c(0x22a)](_0x1abc7b,_0x574f21),_0x43687d['servers']=_0x179084[_0x11841c(0x1f5)],_0x43687d[_0x11841c(0x242)]=_0x212b3b,_0x43687d[_0x11841c(0x186)]=![],_0x43687d[_0x11841c(0x240)]=!![],_0x43687d['reconnectTimeWait']=0x3e8*0xa,_0x43687d[_0x11841c(0x191)]=-0x1,_0x43687d[_0x11841c(0x18f)]=0x2*0x3c*0x3e8,_0x43687d[_0x11841c(0x188)]=0x5,_0x43687d[_0x11841c(0x1e2)]=![];let _0x455a85;this[_0x11841c(0x18c)]=async()=>{const _0x2081ea=_0x11841c;try{_0x455a85=await nats['connect'](_0x43687d);}catch(_0x37d009){_0x270119[_0x2081ea(0x208)][_0x2081ea(0x237)](_0x270119['gwName']+'['+_0x270119[_0x2081ea(0x1e4)]+_0x2081ea(0x1a2)+_0x5c87b4+']['+_0x4f1028+_0x2081ea(0x206)+_0x37d009[_0x2081ea(0x1f7)]+_0x2081ea(0x1d7)),_0x43687d[_0x2081ea(0x186)]=!![];try{_0x455a85=await nats['connect'](_0x43687d);}catch(_0x2a8b5e){_0x270119[_0x2081ea(0x208)][_0x2081ea(0x237)](_0x270119[_0x2081ea(0x223)]+'['+_0x270119[_0x2081ea(0x1e4)]+_0x2081ea(0x1a2)+_0x5c87b4+']['+_0x4f1028+_0x2081ea(0x206)+_0x2a8b5e[_0x2081ea(0x1f7)]);return;}}_0x270119[_0x2081ea(0x208)][_0x2081ea(0x21e)](_0x270119[_0x2081ea(0x223)]+'['+_0x270119[_0x2081ea(0x1e4)]+_0x2081ea(0x1a2)+_0x5c87b4+']['+_0x4f1028+_0x2081ea(0x18b)+(_0x43687d[_0x2081ea(0x242)]['ca']?_0x2081ea(0x242):'')+'\x20'+_0x455a85[_0x2081ea(0x18e)]()),_0x455a85[_0x2081ea(0x23e)]()[_0x2081ea(0x202)](_0x53b501=>{const _0x672ca5=_0x2081ea;_0x53b501&&_0x270119['logger']['error'](_0x270119[_0x672ca5(0x223)]+'['+_0x270119['pluginName']+_0x672ca5(0x1a2)+_0x5c87b4+']['+_0x4f1028+_0x672ca5(0x1c7)+_0x53b501[_0x672ca5(0x1f7)]);});},this[_0x11841c(0x181)]=async()=>{const _0x2927e1=_0x11841c;if(!_0x4f1028||!_0x179084[_0x2927e1(0x1f5)]||!_0x179084[_0x2927e1(0x1d3)]||!_0x179084[_0x2927e1(0x1d3)]['ca']||!_0x179084[_0x2927e1(0x231)]||!_0x179084[_0x2927e1(0x231)][_0x2927e1(0x22d)]||!_0x179084[_0x2927e1(0x231)]['secret']||!_0x179084[_0x2927e1(0x231)][_0x2927e1(0x22c)]){_0x270119[_0x2927e1(0x208)][_0x2927e1(0x237)](_0x270119[_0x2927e1(0x223)]+'['+_0x270119['pluginName']+_0x2927e1(0x1a2)+_0x5c87b4+']['+_0x4f1028+']\x20error:\x20missing\x20one\x20or\x20more\x20mandatory\x20configurations\x20e.g.\x20stream.baseUrls,\x20stream.certificate.ca,\x20nats.tenant,\x20nats.subject,\x20nats.secret\x20and\x20nats.jwt');return;}if(_0x4f1028[_0x2927e1(0x205)]('.')[_0x2927e1(0x1a5)]<0x2){_0x270119[_0x2927e1(0x208)][_0x2927e1(0x237)](_0x270119[_0x2927e1(0x223)]+'['+_0x270119[_0x2927e1(0x1e4)]+_0x2927e1(0x1a2)+_0x5c87b4+']['+_0x4f1028+_0x2927e1(0x1b1)+_0x4f1028+_0x2927e1(0x193));return;}if(_0x4f1028['includes'](',')){_0x270119[_0x2927e1(0x208)][_0x2927e1(0x237)](_0x270119[_0x2927e1(0x223)]+'['+_0x270119[_0x2927e1(0x1e4)]+_0x2927e1(0x1a2)+_0x5c87b4+']['+_0x4f1028+']\x20error:\x20subject\x20not\x20allowing\x20comma\x20separated\x20multiples');return;}if(!_0x455a85){_0x270119[_0x2927e1(0x208)][_0x2927e1(0x237)](_0x270119[_0x2927e1(0x223)]+'['+_0x270119['pluginName']+_0x2927e1(0x1a2)+_0x5c87b4+']['+_0x4f1028+_0x2927e1(0x19d));return;}const _0x293d39=async(_0xe21f07,_0x5ac980)=>{const _0x147f04=_0x2927e1;try{_0x270119[_0x147f04(0x208)][_0x147f04(0x21e)](_0xe21f07+_0x147f04(0x1f4)+_0x5ac980);let _0x5bc74a;try{if(_0x179084[_0x147f04(0x209)]&&Array[_0x147f04(0x185)](_0x179084[_0x147f04(0x209)]))for(let _0x245965=0x0;_0x245965<_0x179084[_0x147f04(0x209)]['length'];_0x245965++){const _0x5bb326=_0x179084[_0x147f04(0x209)][_0x245965];if(!_0x5bb326['from']||!_0x5bb326[_0x147f04(0x228)]['includes']('.')||!_0x5bb326['to']||!_0x5bb326['to'][_0x147f04(0x23d)]('.'))continue;const _0x5c2518=new RegExp('@'+_0x5bb326[_0x147f04(0x228)]+'\x22','gi');_0x5ac980=_0x5ac980['replace'](_0x5c2518,'@'+_0x5bb326['to']+'\x22');}_0x5bc74a=JSON[_0x147f04(0x219)](_0x5ac980);}catch(_0x3cd727){_0x270119[_0x147f04(0x208)][_0x147f04(0x237)](_0xe21f07+_0x147f04(0x1ea)+_0x3cd727['message']+'\x20message:\x20'+_0x5ac980),_0x270119['logger'][_0x147f04(0x1e2)](_0xe21f07+_0x147f04(0x1bb)+_0x24597f);return;}const _0x574d46=_0x5bc74a['user'];if(!_0x574d46){_0x270119['logger'][_0x147f04(0x237)](_0xe21f07+_0x147f04(0x199)+JSON[_0x147f04(0x210)](_0x5bc74a)),_0x270119[_0x147f04(0x208)]['debug'](_0xe21f07+_0x147f04(0x1bb)+_0x24597f);return;}if(!_0x574d46[_0x147f04(0x1a7)]){_0x270119[_0x147f04(0x208)][_0x147f04(0x237)](_0xe21f07+_0x147f04(0x18d)+JSON[_0x147f04(0x210)](_0x5bc74a)),_0x270119[_0x147f04(0x208)][_0x147f04(0x1e2)](_0xe21f07+_0x147f04(0x1bb)+_0x24597f);return;}delete _0x574d46['schemas'];let _0x18ea73;_0x574d46['id']&&(_0x18ea73=_0x574d46['id'],delete _0x574d46['id']);let _0xdf6232;_0x574d46[_0x147f04(0x1e1)]&&(_0xdf6232=utils[_0x147f04(0x215)](_0x574d46[_0x147f04(0x1e1)]),delete _0x574d46[_0x147f04(0x1e1)]);await _0x513d67(_0x574d46);const _0x542a8e=_0x574d46['userName'];let _0x2a4ebd,_0x26b857;try{_0x2a4ebd=await _0x140a47(_0x147f04(0x1a7),_0x542a8e);}catch(_0x507442){_0x270119[_0x147f04(0x208)]['error'](_0xe21f07+_0x147f04(0x235)+_0x507442[_0x147f04(0x1f7)]),_0x270119[_0x147f04(0x208)]['debug'](_0xe21f07+_0x147f04(0x1bb)+_0x24597f);return;}if(_0x179084['convertRolesToGroups']){let _0x823192=![];if(_0x5bc74a[_0x147f04(0x1be)]&&Array[_0x147f04(0x185)](_0x5bc74a[_0x147f04(0x1be)]))for(let _0x45c670=0x0;_0x45c670<_0x5bc74a['Operations']['length'];_0x45c670++){const _0x1fadb1=_0x5bc74a['Operations'][_0x45c670];_0x1fadb1[_0x147f04(0x21d)][_0x147f04(0x1bf)]('roles')&&(_0x1fadb1['path']=_0x147f04(0x221),Array[_0x147f04(0x185)](_0x1fadb1[_0x147f04(0x18a)])?(_0x1fadb1[_0x147f04(0x18a)][0x0]['id']=_0x1fadb1[_0x147f04(0x18a)][0x0][_0x147f04(0x18a)],_0x1fadb1['value'][0x0][_0x147f04(0x1c0)]=_0x1fadb1[_0x147f04(0x18a)][0x0][_0x147f04(0x204)]+_0x147f04(0x1c1)+_0x1fadb1['value'][0x0][_0x147f04(0x18a)],delete _0x1fadb1['value'][0x0]['value'],delete _0x1fadb1[_0x147f04(0x18a)][0x0][_0x147f04(0x204)]):_0x1fadb1['value']=[{'id':_0x1fadb1['value'],'display':_0x1fadb1['value']}],delete _0x1fadb1[_0x147f04(0x1eb)],_0x823192=!![]);}if(_0x574d46[_0x147f04(0x19c)]&&Array[_0x147f04(0x185)](_0x574d46[_0x147f04(0x19c)])&&_0x574d46[_0x147f04(0x19c)][_0x147f04(0x1a5)]>0x0){if(!_0x574d46['groups'])_0x574d46[_0x147f04(0x221)]=[];if(!Array[_0x147f04(0x185)](_0x574d46[_0x147f04(0x221)]))_0x574d46['groups']=[];for(let _0x580f59=0x0;_0x580f59<_0x574d46['roles'][_0x147f04(0x1a5)];_0x580f59++){const _0x4f2e22={},_0x47a1f8=_0x574d46[_0x147f04(0x19c)][_0x580f59];_0x4f2e22['value']=_0x47a1f8[_0x147f04(0x18a)],_0x4f2e22[_0x147f04(0x1c0)]=_0x47a1f8[_0x147f04(0x204)]+_0x147f04(0x1c1)+_0x47a1f8[_0x147f04(0x1c0)],_0x574d46[_0x147f04(0x221)][_0x147f04(0x1ca)](_0x4f2e22);}delete _0x574d46['roles'],_0x823192=!![];}if(_0x823192)_0x270119[_0x147f04(0x208)][_0x147f04(0x1e2)](_0xe21f07+_0x147f04(0x180)+JSON[_0x147f04(0x210)](_0x5bc74a));}if(_0x179084['deleteUserOnLastGroupRoleRemoval']&&_0x5bc74a['activityOperation']===_0x147f04(0x1b2)){if(_0x574d46[_0x147f04(0x221)]&&Array[_0x147f04(0x185)](_0x574d46[_0x147f04(0x221)])&&_0x574d46['groups']['length']===0x0){if(_0x574d46['roles']&&Array[_0x147f04(0x185)](_0x574d46['roles'])&&_0x574d46[_0x147f04(0x19c)]['length']===0x0){if(_0x5bc74a[_0x147f04(0x1be)]&&Array['isArray'](_0x5bc74a[_0x147f04(0x1be)])&&_0x5bc74a['Operations'][_0x147f04(0x1a5)]>0x0)for(let _0x130f59=0x0;_0x130f59<_0x5bc74a[_0x147f04(0x1be)][_0x147f04(0x1a5)];_0x130f59++){const _0x1169d6=_0x5bc74a[_0x147f04(0x1be)][_0x130f59];if(_0x1169d6['op']==='remove'){if(_0x1169d6[_0x147f04(0x21d)]){if(_0x1169d6[_0x147f04(0x21d)][_0x147f04(0x1bf)]('roles')&&_0x1169d6['typeId'])_0x5bc74a[_0x147f04(0x1a6)]=_0x147f04(0x1b4);else _0x1169d6[_0x147f04(0x21d)]==='groups'&&(_0x5bc74a[_0x147f04(0x1a6)]=_0x147f04(0x1b4));}}}}}}if(!_0x2a4ebd){if(_0x5bc74a['activityOperation']===_0x147f04(0x1b4)){_0x270119['logger'][_0x147f04(0x1e2)](_0xe21f07+_0x147f04(0x1d8)+_0x542a8e+_0x147f04(0x249)),_0x270119[_0x147f04(0x208)][_0x147f04(0x1e2)](_0xe21f07+'\x20done'+_0x24597f);return;}if(_0x179084['modifyOnly']&&_0x179084[_0x147f04(0x232)]===!![]){_0x270119[_0x147f04(0x208)]['debug'](_0xe21f07+'\x20Create\x20userName='+_0x542a8e+'\x20message:\x20user\x20not\x20created\x20because\x20of\x20configuration\x20modifyOnly=true'),_0x270119[_0x147f04(0x208)][_0x147f04(0x1e2)](_0xe21f07+'\x20done'+_0x24597f);return;}if(Object[_0x147f04(0x1d4)][_0x147f04(0x1cc)]['call'](_0x574d46,'active')){if(typeof _0x574d46[_0x147f04(0x1d2)]===_0x147f04(0x1b6)){const _0x1b788f=_0x574d46[_0x147f04(0x1d2)][_0x147f04(0x197)]();if(_0x1b788f===_0x147f04(0x1b7))_0x574d46[_0x147f04(0x1d2)]=!![];else{if(_0x1b788f==='false')_0x574d46['active']=![];}}if(_0x574d46[_0x147f04(0x1d2)]===![]){_0x270119[_0x147f04(0x208)][_0x147f04(0x1e2)](_0xe21f07+_0x147f04(0x1ae)+_0x542a8e+_0x147f04(0x1cf)),_0x270119[_0x147f04(0x208)][_0x147f04(0x1e2)](_0xe21f07+_0x147f04(0x1bb)+_0x24597f);return;}}_0x270119[_0x147f04(0x208)][_0x147f04(0x1e2)](_0xe21f07+_0x147f04(0x1fe)+_0x542a8e);const _0x16f6ff=utils[_0x147f04(0x215)](_0x574d46);try{delete _0x16f6ff[_0x147f04(0x221)];!_0x16f6ff['password']&&_0x179084['generateUserPassword']&&_0x179084[_0x147f04(0x230)]===!![]&&(_0x16f6ff[_0x147f04(0x244)]=utils[_0x147f04(0x224)](0xf));if(_0xdf6232||_0x18ea73){if(_0xdf6232)for(const _0x49d686 in _0xdf6232){_0x16f6ff[_0x49d686]=_0xdf6232[_0x49d686];}if(_0x18ea73)_0x16f6ff['id']=_0x18ea73;await _0x513d67(_0x16f6ff);}await _0x270119[_0x147f04(0x225)](_0x5c87b4,_0x16f6ff),_0x574d46['groups']&&Array[_0x147f04(0x185)](_0x574d46['groups'])&&_0x574d46[_0x147f04(0x221)]['length']>0x0&&(_0x26b857=await _0x140a47(_0x147f04(0x1a7),_0x542a8e));}catch(_0x54880d){_0x270119[_0x147f04(0x208)][_0x147f04(0x237)](_0xe21f07+_0x147f04(0x1c8)+JSON[_0x147f04(0x210)](_0x16f6ff)+_0x147f04(0x211)+_0x54880d['message']+'}'),_0x270119[_0x147f04(0x208)][_0x147f04(0x1e2)](_0xe21f07+'\x20done'+_0x24597f);return;}}if(_0x2a4ebd||_0x26b857){if(_0x5bc74a[_0x147f04(0x1a6)]===_0x147f04(0x1b4)){if(_0x179084['modifyOnly']&&_0x179084[_0x147f04(0x232)]===!![]){_0x270119[_0x147f04(0x208)]['debug'](_0xe21f07+'\x20Delete\x20User\x20id='+_0x2a4ebd+_0x147f04(0x23a)),_0x270119[_0x147f04(0x208)][_0x147f04(0x1e2)](_0xe21f07+_0x147f04(0x1bb)+_0x24597f);return;}_0x270119[_0x147f04(0x208)][_0x147f04(0x1e2)](_0xe21f07+'\x20Delete\x20User\x20id='+_0x2a4ebd);try{await _0x270119[_0x147f04(0x1b4)](_0x5c87b4,_0x2a4ebd);}catch(_0x11f6b7){_0x270119[_0x147f04(0x208)][_0x147f04(0x237)](_0xe21f07+_0x147f04(0x192)+_0x2a4ebd+_0x147f04(0x211)+_0x11f6b7[_0x147f04(0x1f7)]+'}'),_0x270119[_0x147f04(0x208)][_0x147f04(0x1e2)](_0xe21f07+_0x147f04(0x1bb)+_0x24597f);return;}}else{if(_0x26b857)_0x2a4ebd=_0x26b857;_0x270119['logger']['debug'](_0xe21f07+'\x20Replace\x20User\x20id='+_0x2a4ebd);const _0x155353={};_0x155353[_0x147f04(0x1fc)]=()=>{},_0x155353[_0x147f04(0x1c6)]=_0x5c87b4?'/'+_0x5c87b4+'/Users/'+_0x2a4ebd:'/Users/'+_0x2a4ebd,_0x155353[_0x147f04(0x216)]={},_0x155353['params']['id']=_0x2a4ebd,_0x155353['request']={},_0x155353[_0x147f04(0x1ff)][_0x147f04(0x1de)]=_0x574d46;try{await _0x270119['replaceUsrGrp'](_0x155353);}catch(_0x441364){_0x270119['logger'][_0x147f04(0x1e2)](_0xe21f07+_0x147f04(0x20d)+_0x2a4ebd+_0x147f04(0x211)+_0x441364[_0x147f04(0x1f7)]),_0x270119[_0x147f04(0x208)][_0x147f04(0x1e2)](_0xe21f07+_0x147f04(0x1bb)+_0x24597f);return;}if(_0x155353['status']&&_0x155353[_0x147f04(0x1f8)]!==0xc8){if(_0x155353[_0x147f04(0x1de)]){if(_0x155353[_0x147f04(0x1de)][_0x147f04(0x213)]){let _0x685ba=_0x155353[_0x147f04(0x1de)]['detail'];_0x685ba=_0x685ba['replace'](_0x270119[_0x147f04(0x223)]+'['+_0x270119[_0x147f04(0x1e4)]+']',''+_0xe21f07),_0x270119[_0x147f04(0x208)][_0x147f04(0x237)](''+_0x685ba);}else{if(_0x155353['body'][_0x147f04(0x1c5)]&&Array[_0x147f04(0x185)](_0x155353[_0x147f04(0x1de)][_0x147f04(0x1c5)])&&_0x155353[_0x147f04(0x1de)][_0x147f04(0x1c5)][_0x147f04(0x1a5)]>0x0){let _0x3c6f28=_0x155353[_0x147f04(0x1de)][_0x147f04(0x1c5)][0x0][_0x147f04(0x187)];_0x3c6f28=_0x3c6f28[_0x147f04(0x196)](_0x270119[_0x147f04(0x223)]+'['+_0x270119[_0x147f04(0x1e4)]+']',''+_0xe21f07),_0x270119['logger'][_0x147f04(0x237)](''+_0x3c6f28);}}}}if(_0x179084['usePutSoftSync']){const [_0x270184,_0x1d7bc6]=_0x270119[_0x147f04(0x1db)]({'Operations':_0x5bc74a[_0x147f04(0x1be)]});if(_0x1d7bc6){_0x270119[_0x147f04(0x208)][_0x147f04(0x237)](_0xe21f07+_0x147f04(0x20d)+_0x2a4ebd+_0x147f04(0x194)+_0x1d7bc6[_0x147f04(0x1f7)]),_0x270119[_0x147f04(0x208)][_0x147f04(0x1e2)](_0xe21f07+'\x20done'+_0x24597f);return;}const _0x26e295=[];if(_0x270184['roles']&&Array[_0x147f04(0x185)](_0x270184[_0x147f04(0x19c)]))for(let _0x2e7106=0x0;_0x2e7106<_0x270184['roles'][_0x147f04(0x1a5)];_0x2e7106++){_0x270184[_0x147f04(0x19c)][_0x2e7106]['operation']&&_0x270184[_0x147f04(0x19c)][_0x2e7106]['operation']===_0x147f04(0x24c)&&_0x26e295[_0x147f04(0x1ca)](_0x270184['roles'][_0x2e7106]);}if(_0x26e295[_0x147f04(0x1a5)]>0x0)try{await _0x270119[_0x147f04(0x1b2)](_0x5c87b4,_0x2a4ebd,{'roles':_0x26e295});}catch(_0x2d1973){_0x270119[_0x147f04(0x208)][_0x147f04(0x237)](_0xe21f07+_0x147f04(0x20d)+_0x2a4ebd+'\x20role\x20removal\x20error:\x20'+_0x2d1973[_0x147f04(0x1f7)]);}const _0x5aafd1=[];if(_0x270184[_0x147f04(0x221)]&&Array['isArray'](_0x270184[_0x147f04(0x221)]))for(let _0x1e3447=0x0;_0x1e3447<_0x270184['groups'][_0x147f04(0x1a5)];_0x1e3447++){_0x270184[_0x147f04(0x221)][_0x1e3447][_0x147f04(0x1d1)]&&_0x270184['groups'][_0x1e3447][_0x147f04(0x1d1)]===_0x147f04(0x24c)&&_0x5aafd1['push'](_0x270184['groups'][_0x1e3447]);}if(_0x5aafd1[_0x147f04(0x1a5)]>0x0)for(let _0x2f99fc=0x0;_0x2f99fc<_0x5aafd1[_0x147f04(0x1a5)];_0x2f99fc++){try{await _0x270119['modifyGroup'](_0x5c87b4,_0x5aafd1[_0x2f99fc]['id'],{'members':[{'operation':_0x147f04(0x24c),'value':_0x2a4ebd}]});}catch(_0x5a601c){_0x270119['logger'][_0x147f04(0x237)](_0xe21f07+_0x147f04(0x20d)+_0x2a4ebd+'\x20group\x20removal\x20error:\x20'+_0x5a601c[_0x147f04(0x1f7)]);}}}}}_0x270119[_0x147f04(0x208)][_0x147f04(0x1e2)](_0xe21f07+'\x20done'+_0x24597f);}catch(_0x18ab6d){_0x270119[_0x147f04(0x208)][_0x147f04(0x237)](_0x270119['gwName']+'['+_0x270119[_0x147f04(0x1e4)]+_0x147f04(0x1a2)+_0x5c87b4+']['+_0x4f1028+_0x147f04(0x1ec)+_0x18ab6d['message']+'\x20=>\x20subscriber\x20not\x20activated'+_0x24597f);}},_0x5269bc=nats[_0x2927e1(0x1b0)](),_0x43dcbc=_0x455a85[_0x2927e1(0x1c9)](),_0x2514a5=(_0x2927e1(0x1ee)+_0x270119['pluginName']+'_'+_0x5c87b4)['replaceAll']('*','#')[_0x2927e1(0x1af)]('>','##')[_0x2927e1(0x1af)]('.','_');let _0x54faee;const _0x3390f5=async()=>{const _0x4c9e3f=_0x2927e1;try{const _0x45e5e2=''+_0x179084[_0x4c9e3f(0x231)][_0x4c9e3f(0x22d)],_0x182983=await _0x455a85['jetstreamManager'](),_0x15db67=async()=>{const _0x29a41b=_0x4c9e3f;let _0x5d5dbe;try{_0x5d5dbe=await _0x43dcbc[_0x29a41b(0x1d6)][_0x29a41b(0x1ef)](_0x45e5e2,_0x2514a5);}catch(_0x48a505){await _0x182983[_0x29a41b(0x1d6)][_0x29a41b(0x1cd)](_0x45e5e2,{'durable_name':_0x2514a5,'ack_policy':nats[_0x29a41b(0x183)][_0x29a41b(0x214)],'deliver_policy':nats['DeliverPolicy'][_0x29a41b(0x1e3)],'deliver_group':_0x179084?.[_0x29a41b(0x231)]?.[_0x29a41b(0x23b)]||null,'filter_subject':_0x4f1028}),_0x5d5dbe=await _0x43dcbc['consumers'][_0x29a41b(0x1ef)](_0x45e5e2,_0x2514a5);}(_0x4f1028!==_0x5d5dbe?.[_0x29a41b(0x243)]?.[_0x29a41b(0x1d5)]?.[_0x29a41b(0x1b9)]||_0x179084?.['nats']?.[_0x29a41b(0x23b)]!==_0x5d5dbe?.[_0x29a41b(0x243)]?.[_0x29a41b(0x1d5)]?.['deliver_group'])&&(await _0x182983['consumers'][_0x29a41b(0x20a)](_0x45e5e2,_0x2514a5,{'deliver_group':_0x179084?.[_0x29a41b(0x231)]?.[_0x29a41b(0x23b)]||null,'filter_subject':_0x4f1028}),_0x5d5dbe=await _0x43dcbc[_0x29a41b(0x1d6)]['get'](_0x45e5e2,_0x2514a5)),_0x54faee=await _0x5d5dbe[_0x29a41b(0x1e6)]({'max_messages':0x64});};await _0x15db67();const _0x2ff8e4=async()=>{const _0x33d7f7=_0x4c9e3f;for await(const _0x2f240e of await _0x54faee[_0x33d7f7(0x1f8)]()){switch(_0x2f240e[_0x33d7f7(0x204)]){case nats[_0x33d7f7(0x1fd)][_0x33d7f7(0x1ad)]:if(_0x2f240e['data']===0x1)_0x270119['logger'][_0x33d7f7(0x21e)](_0x270119[_0x33d7f7(0x223)]+'['+_0x270119[_0x33d7f7(0x1e4)]+_0x33d7f7(0x1a2)+_0x5c87b4+']['+_0x4f1028+_0x33d7f7(0x1c4)+_0x2f240e[_0x33d7f7(0x204)]),_0x15db67();else _0x2f240e[_0x33d7f7(0x189)]%0xa===0x0&&_0x270119[_0x33d7f7(0x208)][_0x33d7f7(0x237)](_0x270119[_0x33d7f7(0x223)]+'['+_0x270119['pluginName']+_0x33d7f7(0x1a2)+_0x5c87b4+']['+_0x4f1028+_0x33d7f7(0x1fb)+_0x2f240e[_0x33d7f7(0x204)]+_0x33d7f7(0x1f0)+_0x2f240e[_0x33d7f7(0x189)]);break;}}};_0x2ff8e4();for await(const _0x3c1892 of _0x54faee){if(!_0x3c1892[_0x4c9e3f(0x184)]||!_0x3c1892[_0x4c9e3f(0x184)][_0x4c9e3f(0x1ef)](_0x4c9e3f(0x195))){_0x3c1892[_0x4c9e3f(0x222)]();continue;}const _0x447307=_0x270119[_0x4c9e3f(0x223)]+'['+_0x270119['pluginName']+_0x4c9e3f(0x1a2)+_0x5c87b4+']['+_0x3c1892[_0x4c9e3f(0x1a4)]+']['+_0x54faee['getProcessed']()+']['+(_0x3c1892[_0x4c9e3f(0x184)]?_0x3c1892[_0x4c9e3f(0x184)][_0x4c9e3f(0x1ef)](_0x4c9e3f(0x195)):'')+']',_0x45593d=_0x5269bc[_0x4c9e3f(0x24b)](_0x3c1892['data']);await _0x293d39(_0x447307,_0x45593d),_0x3c1892[_0x4c9e3f(0x222)]();}}catch(_0x29e7d4){_0x270119[_0x4c9e3f(0x208)]['error'](_0x270119[_0x4c9e3f(0x223)]+'['+_0x270119[_0x4c9e3f(0x1e4)]+_0x4c9e3f(0x1a2)+_0x5c87b4+']['+_0x4f1028+_0x4c9e3f(0x20f)+_0x29e7d4[_0x4c9e3f(0x1f7)]);}};_0x3390f5();const _0x20ee35=async()=>{const _0x4d3003=_0x2927e1;let _0x4df74b=0x0;for await(const _0x2e159b of _0x455a85[_0x4d3003(0x1f8)]()){switch(_0x2e159b[_0x4d3003(0x204)]){case nats[_0x4d3003(0x1e8)][_0x4d3003(0x182)]:_0x270119[_0x4d3003(0x208)][_0x4d3003(0x237)](_0x270119[_0x4d3003(0x223)]+'['+_0x270119[_0x4d3003(0x1e4)]+']\x20subscriber['+_0x5c87b4+']['+_0x4f1028+_0x4d3003(0x1cb)+_0x2e159b[_0x4d3003(0x189)]+_0x4d3003(0x217)),_0x4df74b=0x0;break;case nats[_0x4d3003(0x1e8)][_0x4d3003(0x21b)]:_0x270119[_0x4d3003(0x208)][_0x4d3003(0x21e)](_0x270119[_0x4d3003(0x223)]+'['+_0x270119[_0x4d3003(0x1e4)]+_0x4d3003(0x1a2)+_0x5c87b4+']['+_0x4f1028+']\x20client\x20reconnected\x20'+_0x2e159b[_0x4d3003(0x189)]);try{if(_0x54faee[_0x4d3003(0x19b)])await _0x54faee[_0x4d3003(0x19b)]();}catch(_0x310a44){if(_0x54faee[_0x4d3003(0x233)])_0x54faee[_0x4d3003(0x233)]();}break;case nats[_0x4d3003(0x1e8)][_0x4d3003(0x247)]:_0x270119[_0x4d3003(0x208)][_0x4d3003(0x237)](_0x270119['gwName']+'['+_0x270119[_0x4d3003(0x1e4)]+_0x4d3003(0x1a2)+_0x5c87b4+']['+_0x4f1028+']\x20client\x20error\x20'+_0x2e159b[_0x4d3003(0x189)]);break;case nats[_0x4d3003(0x22f)][_0x4d3003(0x190)]:_0x4df74b+=0x1;_0x4df74b%0x1e===0x0&&_0x270119[_0x4d3003(0x208)][_0x4d3003(0x1e2)](_0x270119[_0x4d3003(0x223)]+'['+_0x270119[_0x4d3003(0x1e4)]+']\x20subscriber['+_0x5c87b4+']['+_0x4f1028+_0x4d3003(0x22b)+_0x2e159b['data']+_0x4d3003(0x239)+_0x4df74b+')');break;case nats[_0x4d3003(0x22f)]['StaleConnection']:_0x270119[_0x4d3003(0x208)][_0x4d3003(0x1e2)](_0x270119['gwName']+'['+_0x270119[_0x4d3003(0x1e4)]+_0x4d3003(0x1a2)+_0x5c87b4+']['+_0x4f1028+_0x4d3003(0x20c)+_0x2e159b[_0x4d3003(0x189)]);break;}}};_0x20ee35(),process['on'](_0x2927e1(0x1e9),async()=>{const _0x4c96b4=_0x2927e1;_0x455a85&&await _0x455a85[_0x4c96b4(0x198)]();}),process['on'](_0x2927e1(0x21f),async()=>{const _0x16a9c5=_0x2927e1;_0x455a85&&await _0x455a85[_0x16a9c5(0x198)]();});};const _0x140a47=async(_0x43b9d0,_0x2adec8)=>{const _0x5df30d=_0x11841c,_0x1f39cb={'attribute':_0x43b9d0,'operator':'eq','value':_0x2adec8,'rawFilter':undefined,'startIndex':undefined,'count':undefined},_0x88216f=[_0x43b9d0];if(_0x43b9d0!=='id')_0x88216f[_0x5df30d(0x1ca)]('id');try{const _0x392cba=await _0x270119['getUsers'](_0x5c87b4,_0x1f39cb,_0x88216f);if(!_0x392cba||!_0x392cba[_0x5df30d(0x1b5)]||!Array[_0x5df30d(0x185)](_0x392cba[_0x5df30d(0x1b5)]))throw new Error(_0x5df30d(0x1a1)+JSON[_0x5df30d(0x210)](_0x1f39cb)+_0x5df30d(0x1b3));if(_0x392cba['Resources']['length']===0x0)return null;else{if(_0x392cba[_0x5df30d(0x1b5)][_0x5df30d(0x1a5)]>0x2)throw new Error(_0x5df30d(0x1a1)+JSON[_0x5df30d(0x210)](_0x1f39cb)+_0x5df30d(0x1da));else{const _0x133e9d=_0x392cba[_0x5df30d(0x1b5)][0x0];if(!_0x133e9d['id'])throw new Error(_0x5df30d(0x1a1)+JSON[_0x5df30d(0x210)](_0x1f39cb)+_0x5df30d(0x229)+JSON[_0x5df30d(0x210)](_0x133e9d)+_0x5df30d(0x203));return decodeURIComponent(_0x133e9d['id']);}}}catch(_0x16c0d8){throw new Error('getUsers()\x20getObj='+JSON[_0x5df30d(0x210)](_0x1f39cb)+_0x5df30d(0x211)+_0x16c0d8['message']+'}');}},_0x3dc666=_0x1b9b0f=>{const _0x2be6b3=_0x11841c;if(!_0x1b9b0f||typeof _0x1b9b0f!==_0x2be6b3(0x1b6))return[null,null];_0x1b9b0f=_0x1b9b0f[_0x2be6b3(0x1ac)]();const _0x14ac72=_0x1b9b0f[_0x2be6b3(0x241)]('(');if(_0x14ac72<0x1)return[null,null];if(_0x1b9b0f[_0x2be6b3(0x19f)](_0x1b9b0f[_0x2be6b3(0x1a5)]-0x1)!==')')return[null,null];if(_0x2dc145(_0x1b9b0f,'(')!==_0x2dc145(_0x1b9b0f,')'))return[null,null];const _0x415daf=_0x1b9b0f[_0x2be6b3(0x19f)](0x0,_0x14ac72),_0x31fa6e=_0x1b9b0f[_0x2be6b3(0x19f)](_0x14ac72+0x1,_0x1b9b0f['length']-0x1);let _0x384111=[];const _0x2ca6e5=_0x31fa6e['split'](',');let _0x54a963='';for(let _0xd47ed9=0x0;_0xd47ed9<_0x2ca6e5[_0x2be6b3(0x1a5)];_0xd47ed9++){const _0x4c8670=_0x54a963?_0x54a963+','+_0x2ca6e5[_0xd47ed9]:_0x2ca6e5[_0xd47ed9],_0x431edf=_0x2dc145(_0x4c8670,'('),_0xf7eba=_0x2dc145(_0x4c8670,')');if(_0x431edf===_0xf7eba)_0x384111[_0x2be6b3(0x1ca)](_0x496c04(_0x4c8670,'\x22')),_0x54a963='';else{if(_0x54a963)_0x54a963+=','+_0x2ca6e5[_0xd47ed9];else _0x54a963+=_0x2ca6e5[_0xd47ed9];}}if(_0x384111[_0x2be6b3(0x1a5)]===0x0)_0x384111=null;return[_0x415daf,_0x384111];};function _0x2dc145(_0x1dbe35,_0x37381f){const _0x276db9=_0x11841c;let _0x596259=0x0;for(let _0x4cea34=0x0;_0x4cea34<_0x1dbe35[_0x276db9(0x1a5)];_0x4cea34++){_0x1dbe35['charAt'](_0x4cea34)===_0x37381f&&(_0x596259+=0x1);}return _0x596259;}const _0x496c04=(_0x288c5c,_0x12c3b5)=>{const _0x319a84=_0x11841c;if(typeof _0x288c5c!==_0x319a84(0x1b6)||typeof _0x12c3b5!==_0x319a84(0x1b6))return _0x288c5c;if(_0x288c5c[_0x319a84(0x1a5)]===0x1)return _0x288c5c;if(_0x12c3b5['length']!==0x1)return _0x288c5c;return _0x288c5c=_0x288c5c[_0x319a84(0x1ac)](),_0x288c5c[_0x319a84(0x19f)](0x0,0x1)===_0x12c3b5&&(_0x288c5c=_0x288c5c[_0x319a84(0x19f)](0x1)),_0x288c5c['substring'](_0x288c5c[_0x319a84(0x1a5)]-0x1)===_0x12c3b5&&(_0x288c5c=_0x288c5c['substring'](0x0,_0x288c5c[_0x319a84(0x1a5)]-0x1)),_0x288c5c;},_0x1769e8=async(_0x164954,_0x4f7ba7,_0x31d7da)=>{const _0x51f466=_0x11841c;if(!_0x164954||!_0x4f7ba7||!_0x31d7da)return null;const [_0x23dc63,_0x379b1b]=_0x3dc666(_0x31d7da);if(!_0x23dc63||!_0x379b1b){const _0x238335=_0x31d7da[_0x51f466(0x205)]('(');if(_0x238335[_0x51f466(0x1a5)]>0x1){const _0x528c7d=[_0x51f466(0x1ce),'uppercase',_0x51f466(0x226),'elementnumber',_0x51f466(0x19e),'replace',_0x51f466(0x200),_0x51f466(0x212),'getuniquevalue'],_0x5da65a=_0x238335[0x0]['toLowerCase']();if(_0x528c7d['includes'](_0x5da65a))return null;}return _0x31d7da;}for(let _0xde8306=0x0;_0xde8306<_0x379b1b[_0x51f466(0x1a5)];_0xde8306++){if(_0x379b1b[_0xde8306][_0x51f466(0x19f)](0x0,0x1)==='['){const _0x131d13=_0x379b1b[_0xde8306][_0x51f466(0x241)](']');if(_0x131d13<0x0)return null;const _0xa82ee2=_0x379b1b[_0xde8306][_0x51f466(0x19f)](0x1,_0x131d13),_0x4d80fc=_0xa82ee2[_0x51f466(0x205)]('.');let _0x3ff463;for(let _0x37933a=0x0;_0x37933a<_0x4d80fc[_0x51f466(0x1a5)];_0x37933a++){if(_0x37933a===0x0)_0x3ff463=_0x164954[_0x4d80fc[_0x37933a]];else{if(!_0x3ff463)return null;_0x3ff463=_0x3ff463[_0x4d80fc[_0x37933a]];}}if(!_0x3ff463)return null;_0x379b1b[_0xde8306]=_0x3ff463;}}for(let _0x5642ed=0x0;_0x5642ed<_0x379b1b[_0x51f466(0x1a5)];_0x5642ed++){const [_0x151f19]=_0x3dc666(_0x379b1b[_0x5642ed]);_0x151f19&&(_0x379b1b[_0x5642ed]=await _0x1769e8(_0x164954,_0x4f7ba7,_0x379b1b[_0x5642ed]));}if(_0x379b1b[0x0]===null)return null;switch(_0x23dc63[_0x51f466(0x197)]()){case'lowercase':{if(_0x379b1b[_0x51f466(0x1a5)]!==0x1)return null;const [_0x2b0c42]=_0x3dc666(_0x379b1b[0x0]);if(_0x2b0c42)_0x379b1b[0x0]=await _0x1769e8(_0x164954,_0x4f7ba7,_0x2b0c42);if(_0x379b1b[0x0]===null)return null;return _0x379b1b[0x0][_0x51f466(0x197)]();}case'uppercase':{if(_0x379b1b['length']!==0x1)return null;const [_0x12ce82]=_0x3dc666(_0x379b1b[0x0]);if(_0x12ce82)_0x379b1b[0x0]=await _0x1769e8(_0x164954,_0x4f7ba7,_0x12ce82);if(_0x379b1b[0x0]===null)return null;return _0x379b1b[0x0][_0x51f466(0x1f1)]();}case _0x51f466(0x226):{if(_0x379b1b[_0x51f466(0x1a5)]!==0x2)return null;const [_0x106c94]=_0x3dc666(_0x379b1b[0x0]);if(_0x106c94)_0x379b1b[0x0]=await _0x1769e8(_0x164954,_0x4f7ba7,_0x106c94);if(_0x379b1b[0x0]===null)return null;if(isNaN(_0x379b1b[0x1]))return null;return _0x379b1b[0x0][_0x51f466(0x19f)](0x0,_0x379b1b[0x1]);}case'elementnumber':{const [_0x8e99ec]=_0x3dc666(_0x379b1b[0x0]);if(_0x379b1b[_0x51f466(0x1a5)]<0x2)return null;if(_0x8e99ec)_0x379b1b[0x0]=await _0x1769e8(_0x164954,_0x4f7ba7,_0x8e99ec);if(_0x379b1b[0x0]===null)return null;const _0x46e453=_0x379b1b[0x1];if(isNaN(_0x46e453))return null;let _0x1accea;if(_0x379b1b[_0x51f466(0x1a5)]===0x3)_0x1accea=_0x379b1b[0x0]['split'](_0x379b1b[0x2]);else _0x1accea=_0x1accea=_0x379b1b[0x0][_0x51f466(0x205)]('\x20');if(_0x46e453<=_0x1accea[_0x51f466(0x1a5)])return _0x1accea[_0x46e453-0x1];else return'';}case _0x51f466(0x196):{const [_0x158479]=_0x3dc666(_0x379b1b[0x0]);if(_0x158479)_0x379b1b[0x0]=await _0x1769e8(_0x164954,_0x4f7ba7,_0x158479);if(_0x379b1b[0x0]===null)return null;if(_0x379b1b['length']!==0x3)return null;return _0x379b1b[0x0][_0x51f466(0x1af)](_0x379b1b[0x1],_0x379b1b[0x2]);}case _0x51f466(0x200):{if(_0x379b1b['length']!==0x1)return null;const [_0x167062]=_0x3dc666(_0x379b1b[0x0]);if(_0x167062)_0x379b1b[0x0]=await _0x1769e8(_0x164954,_0x4f7ba7,_0x167062);if(_0x379b1b[0x0]===null)return null;return ascii127[_0x51f466(0x238)](_0x379b1b[0x0]);}case'join':{let _0x3c79f3='';for(let _0x5687b7=0x0;_0x5687b7<_0x379b1b[_0x51f466(0x1a5)];_0x5687b7++){const [_0x9aaeb]=_0x3dc666(_0x379b1b[_0x5687b7]);if(_0x9aaeb)_0x379b1b[_0x5687b7]=await _0x1769e8(_0x164954,_0x4f7ba7,_0x9aaeb);if(_0x379b1b[_0x5687b7]===null)return null;_0x3c79f3+=_0x379b1b[_0x5687b7];}return _0x3c79f3;}case _0x51f466(0x212):{if(_0x379b1b[_0x51f466(0x1a5)]>0x2)return null;const [_0x496a66]=_0x3dc666(_0x379b1b[0x0]);if(_0x496a66)_0x379b1b[0x0]=await _0x1769e8(_0x164954,_0x4f7ba7,_0x496a66);if(_0x379b1b[0x0]===null)return null;const _0xf347f4=parseInt(_0x379b1b[0x0]);if(isNaN(_0xf347f4))return null;let _0x2cfcb5='##doIncrement';_0x2cfcb5+=','+_0x379b1b[0x0];if(_0x379b1b[_0x51f466(0x1a5)]===0x2&&_0x379b1b[0x1][_0x51f466(0x197)]()===_0x51f466(0x1b7))_0x2cfcb5+=',true';else _0x2cfcb5+=',false';return _0x2cfcb5+='##',_0x2cfcb5;}case _0x51f466(0x248):{if(_0x379b1b[_0x51f466(0x1a5)]!==0x1)return null;const [_0x216ebd]=_0x3dc666(_0x379b1b[0x0]);if(_0x216ebd)_0x379b1b[0x0]=await _0x1769e8(_0x164954,_0x4f7ba7,_0x216ebd);if(_0x379b1b[0x0]===null)return null;let _0x5766ee,_0xf19c74=![],_0x215a87='';const _0x3fb752=_0x379b1b[0x0][_0x51f466(0x205)]('##');if(_0x3fb752[_0x51f466(0x1a5)]>0x2)for(let _0x3f7fe8=0x0;_0x3f7fe8<_0x3fb752[_0x51f466(0x1a5)];_0x3f7fe8++){if(_0x3fb752[_0x3f7fe8][_0x51f466(0x1bf)](_0x51f466(0x1bc))){const _0x3af7dd=_0x3fb752[_0x3f7fe8][_0x51f466(0x205)](',');if(_0x3af7dd[_0x51f466(0x1a5)]<0x2)return null;const _0x335ea6=parseInt(_0x3af7dd[0x1]);if(isNaN(_0x335ea6))return null;_0x215a87='##'+_0x3fb752[_0x3f7fe8]+'##',_0x5766ee=_0x3af7dd[0x1],_0x3af7dd[_0x51f466(0x1a5)]>0x2&&(_0xf19c74=_0x3af7dd[0x2][_0x51f466(0x197)]()===_0x51f466(0x1b7));}}let _0x9a4a95,_0x5cf87e=0x0,_0x192ce8=0x0;if(_0x5766ee){_0x192ce8=_0x5766ee['length'],_0x5cf87e=0xa;for(let _0x2aaafd=0x1;_0x2aaafd<_0x192ce8;_0x2aaafd++){_0x5cf87e*=0xa;}_0x5cf87e-=0x1,_0x9a4a95=parseInt(_0x5766ee);if(isNaN(_0x9a4a95))return null;_0x9a4a95-=0x1;}else _0x9a4a95=0x0;do{_0x9a4a95+=0x1;let _0x54b5ec=_0x379b1b[0x0];if(_0x5766ee!==undefined&&_0x215a87){let _0x1ce28d=_0x9a4a95[_0x51f466(0x21c)]();while(_0x1ce28d['length']<_0x192ce8){_0x1ce28d='0'+_0x1ce28d;}_0xf19c74?_0x54b5ec=_0x54b5ec[_0x51f466(0x196)](_0x215a87,_0x1ce28d):(_0x54b5ec=_0x54b5ec[_0x51f466(0x196)](_0x215a87,''),_0xf19c74=!![],_0x9a4a95-=0x1);}try{const _0x1254da=await _0x140a47(_0x4f7ba7,_0x54b5ec);if(!_0x1254da)return _0x54b5ec;}catch(_0x245a0b){return _0x270119[_0x51f466(0x208)][_0x51f466(0x237)](_0x270119[_0x51f466(0x223)]+'['+_0x270119[_0x51f466(0x1e4)]+']\x20'+_0x23dc63+_0x51f466(0x235)+_0x245a0b[_0x51f466(0x1f7)]),null;}}while(_0x9a4a95<_0x5cf87e);return null;}default:}return null;},_0x513d67=async _0x5ca414=>{const _0xb822c2=_0x11841c;for(const _0x3ce37c in _0x5ca414){const _0x39d781=_0x5ca414[_0x3ce37c],[_0x3fb779,_0x366843]=_0x3dc666(_0x39d781);if(_0x3fb779){const _0x584059=''+_0x3ce37c,_0x180a68=_0x3fb779+'('+_0x366843[_0xb822c2(0x19e)](',')+')',_0x37f905=await _0x1769e8(_0x5ca414,_0x584059,_0x180a68);if(_0x37f905===null)delete _0x5ca414[_0x3ce37c];else _0x5ca414[_0x3ce37c]=_0x37f905;}for(const _0x12604f in _0x39d781){const _0x4c0a9c=_0x39d781[_0x12604f],[_0x1e85d1,_0x471518]=_0x3dc666(_0x4c0a9c);if(_0x1e85d1){const _0x2e2f91=_0x3ce37c+'.'+_0x12604f,_0x1d6808=_0x1e85d1+'('+_0x471518[_0xb822c2(0x19e)](',')+')',_0x5a9dec=await _0x1769e8(_0x5ca414,_0x2e2f91,_0x1d6808);if(_0x5a9dec===null)delete _0x39d781[_0x12604f];else _0x39d781[_0x12604f]=_0x5a9dec;}}}return _0x5ca414;};},module[a0_0x2b18c7(0x227)][a0_0x2b18c7(0x1f2)]=async(_0x428e7e,_0x2258be,_0x1f978f,_0x73189b)=>{const _0x229578=a0_0x2b18c7,_0x1bbdec=_0x229578(0x1f2),_0x4ec794=_0x428e7e;_0x4ec794[_0x229578(0x208)][_0x229578(0x1e2)](_0x4ec794[_0x229578(0x223)]+'['+_0x4ec794[_0x229578(0x1e4)]+_0x229578(0x1c3)+_0x1bbdec+'\x22');try{if(!fs[_0x229578(0x1a3)](_0x4ec794[_0x229578(0x245)]+'/approles'))fs[_0x229578(0x1dc)](_0x4ec794[_0x229578(0x245)]+'/approles');}catch(_0x59b984){}const _0x27d13c=path['join'](''+_0x4ec794[_0x229578(0x245)],_0x229578(0x1f9),_0x229578(0x1d9)+_0x4ec794[_0x229578(0x1e4)]+'_autogenerated.cfg'),_0x5c1ed4={};utils[_0x229578(0x1aa)](_0x27d13c)&&fs[_0x229578(0x246)](_0x27d13c,_0x229578(0x22e))[_0x229578(0x205)](/\r?\n/)[_0x229578(0x220)](_0x3a5724=>{const _0x46a032=_0x229578,_0x3a03c4=_0x3a5724[_0x46a032(0x205)]('\x20');_0x3a03c4[_0x46a032(0x1a5)]===0x2&&(_0x5c1ed4[_0x3a03c4[0x0]]=_0x3a03c4[0x1]);});const _0x5bda79=fs[_0x229578(0x1b8)](_0x27d13c,{'flags':'w','encoding':_0x229578(0x1d0),'mode':0x1b6,'autoClose':!![]}),_0x4e1daf=[],_0x3967b0=await _0x4ec794[_0x229578(0x1a9)](_0x2258be,{'attribute':undefined,'operator':undefined,'value':undefined},['id',_0x229578(0x207)]);return _0x3967b0[_0x229578(0x1b5)][_0x229578(0x220)](_0x2193fb=>{const _0x25b375=_0x229578;if(_0x2193fb['id']){let _0x1619a0=crypto['randomUUID']();if(_0x5c1ed4[_0x2193fb['id']])_0x1619a0=_0x5c1ed4[_0x2193fb['id']];const _0x366137={'allowedMemberTypes':[_0x25b375(0x19a)],'description':_0x25b375(0x1df),'displayName':_0x2193fb[_0x25b375(0x207)]||_0x2193fb['id'],'id':_0x1619a0,'isEnabled':!![],'lang':null,'origin':_0x25b375(0x23c),'value':decodeURIComponent(_0x2193fb['id'])};_0x4e1daf[_0x25b375(0x1ca)](_0x366137),_0x5bda79[_0x25b375(0x1a8)](_0x2193fb['id']+'\x20'+_0x1619a0+'\x0a');}}),_0x5bda79[_0x229578(0x1ed)](),_0x4ec794[_0x229578(0x208)][_0x229578(0x1e2)](_0x4ec794[_0x229578(0x223)]+'['+_0x4ec794[_0x229578(0x1e4)]+_0x229578(0x1f6)+_0x27d13c),{'Resources':[{'appRoles':_0x4e1daf}]};};
@@ -1781,7 +1781,7 @@ const ScimGateway = function () {
1781
1781
  }) // delete
1782
1782
 
1783
1783
  // ==========================================
1784
- // GET Application Roles from on groups
1784
+ // GET Application Roles based on groups
1785
1785
  // ==========================================
1786
1786
  //
1787
1787
  // GET = /AppRoles
@@ -1862,16 +1862,16 @@ const ScimGateway = function () {
1862
1862
  cfgSub.baseUrls = config.stream.baseUrls
1863
1863
  cfgSub.certificate = config.stream.certificate
1864
1864
  cfgSub.usePutSoftSync = config.scim.usePutSoftSync
1865
- const sub = new Subscriber(this, cfgSub, baseEntity)
1865
+ const sub = new Subscriber(this, cfgSub, baseEntity, subject)
1866
1866
  if (!sub || !sub.connect) {
1867
- logger.error(`${gwName}[${pluginName}] subscriber[${subject}] not started, initialization failed`)
1867
+ logger.error(`${gwName}[${pluginName}] subscriber[${baseEntity}][${subject}] not started, initialization failed`)
1868
1868
  return
1869
1869
  }
1870
1870
  try {
1871
- await sub.connect(subject)
1872
- sub.subscribe(baseEntity, subject)
1871
+ await sub.connect()
1872
+ sub.subscribe()
1873
1873
  } catch (err) {
1874
- logger.error(`${gwName}[${pluginName}] subscriber nats.tenant=${cfgSub.nats.tenant} connect error: ${err.message}`)
1874
+ logger.error(`${gwName}[${pluginName}] subscriber[${baseEntity}][${subject}] nats.tenant=${cfgSub.nats.tenant} connect error: ${err.message}`)
1875
1875
  }
1876
1876
  }
1877
1877
  if (config.stream.subscriber.entity && Object.keys(config.stream.subscriber.entity.length > 0)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "scimgateway",
3
- "version": "4.4.0",
3
+ "version": "4.4.1",
4
4
  "description": "Using SCIM protocol as a gateway for user provisioning to other endpoints",
5
5
  "author": "Jarle Elshaug <jarle.elshaug@gmail.com> (https://elshaug.xyz)",
6
6
  "homepage": "https://elshaug.xyz",