????

Your IP : 3.22.242.214


Current Path : C:/inetpub/vhost/dbadm.gdtsolutions.vn/web/js/
Upload File :
Current File : C:/inetpub/vhost/dbadm.gdtsolutions.vn/web/js/core-authentication-a79298fda8d6ac61d20e.js

/*! For license information please see ../license.txt */
"use strict";(self.webpackChunk_cloudbeaver_product_default=self.webpackChunk_cloudbeaver_product_default||[]).push([[70639],{60700:(e,s,t)=>{t.r(s),t.d(s,{AuthConfigurationParametersResource:()=>l});var a=t(1118),r=t(5576),i=t(40813),n=t(57985),o=t(85213),c=t(72755),d=t(98076),u=t(19462),h=t(83336);let l=class AuthConfigurationParametersResource extends i.nG{constructor(e,s,t){super(),this.graphQLService=e,this.sessionDataResource=s,this.sessionDataResource.outdateResource(this),t.require(this,c.y.admin)}async loader(e){if((0,n.l)(e))throw new Error("Aliases not supported by this resource.");const s=[];return await o.F.forEachAsync(e,(async e=>{const{parameters:t}=await this.graphQLService.sdk.getAuthProviderConfigurationParameters({providerId:e});s.push(t)})),this.set(o.F.toList(e),s),this.data}validateKey(e){return"string"==typeof e}};l=(0,a.Cg)([(0,r._)(),(0,a.Sn)("design:paramtypes",[h.GraphQLService,d.SessionDataResource,u.SessionPermissionsResource])],l)},90781:(e,s,t)=>{t.r(s),t.d(s,{AuthInfoService:()=>h});var a=t(1118),r=t(5576),i=t(23525),n=t(45274),o=t(43974),c=t(35721),d=t(6332),u=t(11130);let h=class AuthInfoService{get userInfo(){return this.userInfoResource.data}constructor(e,s,t){this.userInfoResource=e,this.authProvidersResource=s,this.windowsService=t}login(e,s){return new i.C((async()=>await this.userInfoResource.login(e,s))).then((t=>this.federatedAuthentication(e,s,t)))}federatedAuthentication(e,s,{redirectLink:t,authId:a,authStatus:r}){let n=null,d=e;if(s.configurationId){const t=this.authProvidersResource.getConfiguration(e,s.configurationId);t&&(d=t.id)}return t&&(d=(0,c.u)(),n=this.windowsService.open(d,{url:t,target:d,width:600,height:700}),n&&n.focus()),new i.C((()=>a&&r===o.TDe.InProgress?this.userInfoResource.finishFederatedAuthentication(a,s.linkUser):i.C.resolve(this.userInfoResource.data)),(()=>{n&&this.windowsService.close(n)}))}};h=(0,a.Cg)([(0,r._)(),(0,a.Sn)("design:paramtypes",[u.UserInfoResource,d.AuthProvidersResource,n.WindowsService])],h)},80839:(e,s,t)=>{t.r(s),t.d(s,{AuthRolesResource:()=>d});var a=t(1118),r=t(5576),i=t(20839),n=t(72755),o=t(19462),c=t(83336);let d=class AuthRolesResource extends i.V{constructor(e,s){super((()=>[])),this.graphQLService=e,s.require(this,n.y.admin).outdateResource(this)}async loader(){const{roles:e}=await this.graphQLService.sdk.getAuthRoles();return e}};d=(0,a.Cg)([(0,r._)(),(0,a.Sn)("design:paramtypes",[c.GraphQLService,o.SessionPermissionsResource])],d)},31946:(e,s,t)=>{t.d(s,{N:()=>a});const a=(0,t(44745).M)("user-info")},31777:(e,s,t)=>{t.r(s),t.d(s,{LocaleService:()=>o});var a=t(1118),r=t(82103),i=t(5576),n=t(34227);let o=class LocaleService extends r.j{constructor(e){super(),this.localizationService=e}register(){this.localizationService.addProvider(this.provider.bind(this))}load(){}async provider(e){switch(e){case"ru":return(await Promise.all([t.e(92436),t.e(55489)]).then(t.bind(t,44903))).default;case"it":return(await Promise.all([t.e(32756),t.e(12156)]).then(t.bind(t,51351))).default;case"zh":return(await Promise.all([t.e(52041),t.e(89775)]).then(t.bind(t,85036))).default;case"fr":return(await Promise.all([t.e(29671),t.e(45917)]).then(t.bind(t,1986))).default;default:return(await Promise.all([t.e(41114),t.e(68298)]).then(t.bind(t,92157))).default}}};o=(0,a.Cg)([(0,i._)(),(0,a.Sn)("design:paramtypes",[n.LocalizationService])],o)},92870:(e,s,t)=>{t.r(s),t.d(s,{PasswordPolicyService:()=>l});var a=t(1118),r=t(94866),i=t(5576),n=t(34227),o=t(40601);const c=8,d=0,u=0,h=!1;let l=class PasswordPolicyService{get config(){return{minLength:this.serverConfigResource.data?.passwordPolicyConfiguration?.minLength||c,minNumberCount:this.serverConfigResource.data?.passwordPolicyConfiguration?.minNumberCount||d,minSymbolCount:this.serverConfigResource.data?.passwordPolicyConfiguration?.minSymbolCount||u,requireMixedCase:this.serverConfigResource.data?.passwordPolicyConfiguration?.requireMixedCase||h}}constructor(e,s){this.serverConfigResource=e,this.localizationService=s,(0,r.Gn)(this,{config:r.EW})}validatePassword(e){const s=e.trim();return s.length<this.config.minLength?{isValid:!1,errorMessage:this.localizationService.translate("core_authentication_password_policy_min_length",void 0,{min:this.config.minLength})}:!this.config.requireMixedCase||/\p{Ll}/u.test(s)&&/\p{Lu}/u.test(s)?(s.match(/\d/g)||[]).length<this.config.minNumberCount?{isValid:!1,errorMessage:this.localizationService.translate("core_authentication_password_policy_min_digits",void 0,{min:this.config.minNumberCount})}:(s.match(/[!@#$%^&*(),.?":{}|<>]/g)||[]).length<this.config.minSymbolCount?{isValid:!1,errorMessage:this.localizationService.translate("core_authentication_password_policy_min_special_characters",void 0,{min:this.config.minSymbolCount})}:{isValid:!0,errorMessage:null}:{isValid:!1,errorMessage:this.localizationService.translate("core_authentication_password_policy_upper_lower_case")}}};l=(0,a.Cg)([(0,i._)(),(0,a.Sn)("design:paramtypes",[o.ServerConfigResource,n.LocalizationService])],l)},85842:(e,s,t)=>{t.r(s),t.d(s,{TeamMetaParametersResource:()=>c});var a=t(1118),r=t(5576),i=t(20839),n=t(77220),o=t(83336);let c=class TeamMetaParametersResource extends i.V{constructor(e,s){super((()=>[])),this.graphQLService=e,this.sync(s,(()=>{}),(()=>{}))}async loader(){const{parameters:e}=await this.graphQLService.sdk.getTeamMetaParameters();return e}};c=(0,a.Cg)([(0,r._)(),(0,a.Sn)("design:paramtypes",[o.GraphQLService,n.SessionResource])],c)},56749:(e,s,t)=>{t.r(s),t.d(s,{TeamRolesResource:()=>u,USER_TEAM_ROLE_SUPERVISOR:()=>d});var a=t(1118),r=t(5576),i=t(20839),n=t(72755),o=t(19462),c=t(83336);const d="Supervisor";let u=class TeamRolesResource extends i.V{constructor(e,s){super((()=>[])),this.graphQLService=e,s.require(this,n.y.admin).outdateResource(this)}async assignTeamRoleToUser(e,s,t){const{result:a}=await this.graphQLService.sdk.updateUserTeamRole({userId:e,teamId:s,teamRole:t??void 0});return a}async loader(){const{roles:e}=await this.graphQLService.sdk.getTeamRoles();return e}};u=(0,a.Cg)([(0,r._)(),(0,a.Sn)("design:paramtypes",[c.GraphQLService,o.SessionPermissionsResource])],u)},48888:(e,s,t)=>{t.r(s),t.d(s,{TeamsManagerService:()=>n});var a=t(1118),r=t(5576),i=t(47666);let n=class TeamsManagerService{constructor(e){this.teams=e}};n=(0,a.Cg)([(0,r._)(),(0,a.Sn)("design:paramtypes",[i.TeamsResource])],n)},47666:(e,s,t)=>{t.r(s),t.d(s,{TeamsResource:()=>l,compareTeams:()=>compareTeams});var a=t(1118),r=t(5576),i=t(40813),n=t(85213),o=t(57985),c=t(7278),d=t(83336),u=t(38387);const h=Symbol("new-team");let l=class TeamsResource extends i.nG{constructor(e){super(),this.graphQLService=e}async createTeam({teamId:e,teamPermissions:s,teamName:t,description:a,metaParameters:r}){const i={...(await this.graphQLService.sdk.createTeam({teamId:e,teamName:t,description:a,...this.getDefaultIncludes(),...this.getIncludesMap(e)})).team,[h]:!0,timestamp:Date.now()};return this.set(i.teamId,i),await this.setMetaParameters(i.teamId,r),await this.setSubjectPermissions(i.teamId,s),this.get(e)}async updateTeam({teamId:e,teamPermissions:s,teamName:t,description:a,metaParameters:r}){const{team:i}=await this.graphQLService.sdk.updateTeam({teamId:e,teamName:t,description:a,...this.getDefaultIncludes(),...this.getIncludesMap(e)});return this.set(i.teamId,i),await this.setMetaParameters(i.teamId,r),await this.setSubjectPermissions(i.teamId,s),this.markOutdated(i.teamId),this.get(e)}async deleteTeam(e,s){return await n.F.forEachAsync(e,(async e=>{await this.graphQLService.sdk.deleteTeam({teamId:e,force:s?.force??!1}),this.delete(e)})),this.data}async loadGrantedUsers(e){const{team:s}=await this.graphQLService.sdk.getTeamGrantedUsers({teamId:e});return s[0].grantedUsersInfo.map((e=>({userId:e.userId,teamRole:e.teamRole??null})))}async getSubjectConnectionAccess(e){const{grantInfo:s}=await this.graphQLService.sdk.getSubjectConnectionAccess({subjectId:e});return s}async setSubjectPermissions(e,s){const t=this.get(e);if(t&&(0,u.x)(t.teamPermissions,s))return;const{permissions:a}=await this.graphQLService.sdk.setSubjectPermissions({subjectId:e,permissions:s});t?t.teamPermissions=a.map((e=>e.id)):await this.loader(e,[])}async setMetaParameters(e,s){await this.graphQLService.sdk.saveTeamMetaParameters({teamId:e,parameters:s})}async loader(e,s){const t=this.aliases.isAlias(e,i.fZ),a=[];await n.F.forEachAsync(e,(async e=>{let t;(0,o.l)(e)||(t=e);const{teams:r}=await this.graphQLService.sdk.getTeamsList({teamId:t,...this.getDefaultIncludes(),...this.getIncludesMap(t,s)});a.push(...r)}));const r=(0,c.OU)(a.map((e=>e.teamId)));return t?this.replace(r,a):this.set(r,a),this.data}cleanNewFlags(){for(const e of this.data.values())e[h]=!1}dataSet(e,s){const t=this.dataGet(e);super.dataSet(e,{...t,...s})}getDefaultIncludes(){return{includeMetaParameters:!1}}validateKey(e){return"string"==typeof e}};function isNewTeam(e){return e[h]}function compareTeams(e,s){return isNewTeam(e)&&isNewTeam(s)?s.timestamp-e.timestamp:isNewTeam(s)?1:isNewTeam(e)?-1:e.teamId.localeCompare(s.teamId)}l=(0,a.Cg)([(0,r._)(),(0,a.Sn)("design:paramtypes",[d.GraphQLService])],l)},18101:(e,s,t)=>{t.r(s),t.d(s,{UserConfigurationBootstrap:()=>o});var a=t(1118),r=t(82103),i=t(5576),n=t(11130);let o=class UserConfigurationBootstrap extends r.j{constructor(e){super(),this.userInfoResource=e}async load(){await this.userInfoResource.load()}};o=(0,a.Cg)([(0,i._)(),(0,a.Sn)("design:paramtypes",[n.UserInfoResource])],o)},50966:(e,s,t)=>{t.r(s),t.d(s,{UserDataService:()=>d});var a=t(1118),r=t(94866),i=t(5576),n=t(1513),o=t(58178),c=t(11130);let d=class UserDataService{constructor(e,s){this.userInfoResource=e,this.storageService=s,this.userData=new Map,(0,r.Gn)(this,{userData:r.sH}),this.tempData=new o.d(this.userData),this.storageService.registerSettings("user_data",this.userData,(()=>new Map))}getUserData(e,s,t){const a=this.userInfoResource.getId();this.tempData.has(a)||this.tempData.set(a,(0,r.sH)({}));const i=this.tempData.get(a);return e in i&&!1!==t?.(i[e])||(i[e]=(0,r.sH)(s())),i[e]}};d=(0,a.Cg)([(0,i._)(),(0,a.Sn)("design:paramtypes",[c.UserInfoResource,n.StorageService])],d)},16956:(e,s,t)=>{t.r(s),t.d(s,{UserMetaParametersResource:()=>u});var a=t(1118),r=t(5576),i=t(86764),n=t(20839),o=t(77220),c=t(83336),d=t(11130);let u=class UserMetaParametersResource extends n.V{constructor(e,s,t){super((()=>[])),this.graphQLService=e,this.sync(s,(()=>{}),(()=>{})),this.preloadResource(t,(()=>{})).before(i.a.interrupter((()=>null===t.data)))}async add(e){const{parameter:s}=await this.graphQLService.sdk.setUserMetaParameter(e);return this.data.push(s),this.dataUpdate(),s}async delete(e){await this.graphQLService.sdk.deleteUserMetaParameter({id:e});const s=this.data.findIndex((s=>s.id===e));s>-1&&this.data.splice(s,1),this.dataUpdate()}async loader(){const{properties:e}=await this.graphQLService.sdk.getUserProfileProperties();return e}};u=(0,a.Cg)([(0,r._)(),(0,a.Sn)("design:paramtypes",[c.GraphQLService,o.SessionResource,d.UserInfoResource])],u)},84816:(e,s,t)=>{t.r(s),t.d(s,{UsersResource:()=>y,UsersResourceFilterKey:()=>w,UsersResourceNewUsers:()=>I,compareUsers:()=>compareUsers,isLocalUser:()=>isLocalUser,isNewUser:()=>isNewUser});var a=t(1118),r=t(5576),i=t(94652),n=t(40813),o=t(7278),c=t(85213),d=t(57985),u=t(41075),h=t(72755),l=t(40601),m=t(19462),p=t(83336),g=t(68164),v=t(90781),S=t(56826);const f=Symbol("new-user"),w=(0,i.g_)("@users-resource/filter",((e,s)=>({userId:e,enabledState:s}))),I=(0,i.El)("@users-resource/new-users");let y=class UsersResource extends n.nG{constructor(e,s,t,a,r){super(),this.graphQLService=e,this.serverConfigResource=s,this.authProviderService=t,this.authInfoService=a,r.require(this,h.y.admin).outdateResource(this),this.aliases.add(w,(e=>(0,o.OU)(this.entries.filter((([s,t])=>s.toLowerCase().includes((e.options.userId??"").toLowerCase())&&(void 0===e.options.enabledState||t.enabled===e.options.enabledState))).map((([e])=>e))))),this.aliases.add(I,(()=>{const e=this.entries.filter((e=>isNewUser(e[1]))).sort(((e,s)=>compareUsers(e[1],s[1]))).map((([e])=>e));return(0,o.OU)(e)}))}getEmptyUser(){return{userId:"",grantedTeams:[],grantedConnections:[],configurationParameters:{},metaParameters:{},origins:[{type:g.T,displayName:"Local"}],linkedAuthProviders:[g.T],enabled:!0,authRole:this.serverConfigResource.data?.defaultAuthRole??void 0}}async loadConnections(e){const{grantedConnections:s}=await this.graphQLService.sdk.getUserGrantedConnections({userId:e});return s}async addConnectionsAccess(e,s,t){await this.graphQLService.sdk.addConnectionsAccess({projectId:e,connectionIds:t,subjects:[s]})}async deleteConnectionsAccess(e,s,t){await this.graphQLService.sdk.deleteConnectionsAccess({projectId:e,connectionIds:t,subjects:[s]})}async setMetaParameters(e,s){await this.graphQLService.sdk.saveUserMetaParameters({userId:e,parameters:s})}async create({userId:e,authRole:s}){const{user:t}=await this.graphQLService.sdk.createUser({userId:e,authRole:s,enabled:!1,...this.getDefaultIncludes(),...this.getIncludesMap(e)}),a=t;return a[f]=!0,this.set(t.userId,a),this.get(t.userId)}cleanNewFlags(){for(const e of this.data.values())e[f]=!1}async grantTeam(e,s,t){await this.graphQLService.sdk.grantUserTeam({userId:e,teamId:s}),t||await this.refresh(e)}async revokeTeam(e,s,t){await this.graphQLService.sdk.revokeUserTeam({userId:e,teamId:s}),t||await this.refresh(e)}async enableUser(e,s,t){await this.graphQLService.sdk.enableUser({userId:e,enabled:s});const a=this.get(e);a&&(a.enabled=s),t||this.markOutdated(e)}async setAuthRole(e,s,t){await this.performUpdate(e,void 0,(async()=>{await this.graphQLService.sdk.setUserAuthRole({userId:e,authRole:s});const t=this.get(e);t&&(t.authRole=s),this.onDataOutdated.execute(e)})),t||this.markOutdated(e)}async updateCredentials(e,s){const t=await this.authProviderService.processCredentials(g.T,s);await this.graphQLService.sdk.setUserCredentials({providerId:g.T,userId:e,credentials:t.credentials})}async deleteCredentials(e,s){await this.graphQLService.sdk.deleteUserCredentials({userId:e,providerId:s}),await this.refresh(e)}async delete(e){await c.F.forEachAsync(e,(async e=>{if(this.isActiveUser(e))throw new Error("You can't delete current logged user");await this.graphQLService.sdk.deleteUser({userId:e}),super.delete(e)}))}isActiveUser(e){return this.authInfoService.userInfo?.userId===e}async loader(e,s){if(this.aliases.isAlias(e,n.fZ))throw new Error("Loading all users is prohibited");const t=[];await c.F.forEachAsync(e,(async a=>{let r;if((0,d.l)(a)||(r=a),void 0!==r){const{user:e}=await this.graphQLService.sdk.getAdminUserInfo({userId:r,...this.getDefaultIncludes(),...this.getIncludesMap(r,s)});t.push(e)}else{const a=this.aliases.isAlias(e,u.uL)||this.aliases.isAlias(e,u.cS),i=this.aliases.isAlias(e,w);let n,o,c=u.A2,d=u.yg;a&&(c=a.options.offset,d=a.options.limit),i&&(n=i.options.userId,o=i.options.enabledState);const{users:h}=await this.graphQLService.sdk.getUsersList({page:{offset:c,limit:d},filter:{userIdMask:n,enabledState:o},...this.getDefaultIncludes(),...this.getIncludesMap(r,s)});t.push(...h),this.offsetPagination.setPageEnd((0,u.cS)(c,h.length).setTarget(i),h.length===d)}}));const a=(0,o.OU)(t.map((e=>e.userId)));return this.set(a,t),this.data}getDefaultIncludes(){return{customIncludeOriginDetails:!1,includeMetaParameters:!1}}dataSet(e,s){const t=this.data.get(e);super.dataSet(e,{...t,...s})}validateKey(e){return"string"==typeof e}};function isLocalUser(e){return e.origins.some((e=>e.type===g.T))}function isNewUser(e){return f in e&&!0===e[f]}function compareUsers(e,s){return e.userId.localeCompare(s.userId)}y=(0,a.Cg)([(0,r._)(),(0,a.Sn)("design:paramtypes",[p.GraphQLService,l.ServerConfigResource,S.AuthProviderService,v.AuthInfoService,m.SessionPermissionsResource])],y)}}]);