All Downloads are FREE. Search and download functionalities are using the official Maven repository.

web-interface.assets.325e2d4b-5343.52fd62e6788f7f9a098f.js Maven / Gradle / Ivy

There is a newer version: 6.0.2
Show newest version
"use strict";(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["325e2d4b-5343"],{"13c3YmZ3":(e,t,r)=>{r.d(t,{Z:()=>o});var n=r("Z7aTuO5B"),a=r("DeVaSktS"),l=r("pLLmkYy5"),s=r("F9olzlTR");const i=[{title:"Authentication Services",path:a.ZP.SYSTEM.AUTHENTICATION.BACKENDS.OVERVIEW},{title:"Authenticators",path:a.ZP.SYSTEM.AUTHENTICATION.AUTHENTICATORS.SHOW}],o=()=>n.createElement(s.X2,null,n.createElement(l.Z,{items:i}))},"04jJRAHX":(e,t,r)=>{r.d(t,{Z:()=>i});var n=r("Z7aTuO5B"),a=r("EeAwn/0x"),l=r("DeVaSktS"),s=r("F9olzlTR");const i=e=>{let{activeBackend:t,finishedLoading:r}=e;return n.createElement(s.Si,null,n.createElement(a.J,{to:l.ZP.SYSTEM.AUTHENTICATION.BACKENDS.ACTIVE},n.createElement(s.zx,{disabled:!r||!t},"View active service")),n.createElement(a.J,{to:l.ZP.SYSTEM.AUTHENTICATION.BACKENDS.edit(null==t?void 0:t.id)},n.createElement(s.zx,{disabled:!t||!r,type:"button"},"Edit active service")),n.createElement(a.J,{to:l.ZP.SYSTEM.AUTHENTICATION.BACKENDS.CREATE},n.createElement(s.zx,{bsStyle:"success",type:"button"},"Create service")))}},uY5bz6of:(e,t,r)=>{var n=r("AztyBNMT");const a={fromJson:e=>{let{servers:t,system_user_dn:r,system_user_password:n,transport_security:a,type:l,user_full_name_attribute:s,user_name_attribute:i,user_search_base:o,user_search_pattern:c,user_unique_id_attribute:u,verify_certificates:d}=e;return{servers:t,systemUserDn:r,systemUserPassword:{isSet:n.is_set},transportSecurity:a,type:l,userFullNameAttribute:s,userNameAttribute:i,userSearchBase:o,userSearchPattern:c,userUniqueIdAttribute:u,verifyCertificates:d}},toJson:e=>{let{servers:t,systemUserDn:r,systemUserPassword:n,transportSecurity:a,type:l,userFullNameAttribute:s,userNameAttribute:i,userSearchBase:o,userSearchPattern:c,userUniqueIdAttribute:u,verifyCertificates:d}=e;return{servers:t,system_user_dn:r,system_user_password:{is_set:n.isSet},transport_security:a,type:l,user_full_name_attribute:s,user_name_attribute:i,user_search_base:o,user_search_pattern:c,user_unique_id_attribute:u,verify_certificates:d}}};var l=r("Z7aTuO5B"),s=r("0zTRKSqx"),i=r("vyyTCD48"),o=r("13c3YmZ3"),c=r("4Js8dUPg"),u=r("L040zqI6"),d=r("lcYXG3Mn"),m=r("04jJRAHX");const p=e=>{let{authenticationBackend:t,title:r}=e;const{finishedLoading:n,activeBackend:a}=(0,d.Z)(),i=((e,t)=>{if(e){const t=u.Z.truncateWithEllipses(e.title,30);return l.createElement(l.Fragment,null,"Edit Authentication Service - ",l.createElement("i",null,t))}return t||"Create LDAP Authentication Service"})(t,r);return l.createElement(l.Fragment,null,l.createElement(o.Z,null),l.createElement(s.mr,{title:i,actions:l.createElement(m.Z,{activeBackend:a,finishedLoading:n}),documentationLink:{title:"Authentication documentation",path:c.Z.PAGES.USERS_ROLES}},l.createElement("span",null,"Configure Graylog's authentication services of this Graylog cluster.")))};p.defaultProps={authenticationBackend:void 0,title:void 0};const h=p;var v=r("4af3+9mh"),y=r("KN8gOSc8");const b=function(e,t,r){let n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];const a=(0,i.z$)(),l=()=>v.Z.success("Authentication service was created successfully.","Success"),s=e=>v.Z.error(`Creating authentication service failed with status: ${e}`,"Error");return y.K.create(e).then((e=>e.backend&&t.synchronizeGroups&&a&&n?a.actions.onDirectoryServiceBackendUpdate(!1,t,e.backend.id,r).then(l):(l(),e))).catch((e=>{throw s(e),e}))};var f=r("nHcjWeCO"),E=r("ii0bleBb"),g=r.n(E),S=r("BSHS2nUH"),A=r("YyiN4DLW"),P=r("F9olzlTR"),C=r("oyaholW7"),w=r("DeVaSktS"),k=r("FhE4M+Vx"),N=r("xc00RsLr");const _={activeStepKey:"",backendValidationErrors:void 0,authBackendMeta:{serviceType:"",serviceTitle:""},formValues:{},invalidStepKeys:[],setStepsState:()=>{}},F=l.createContext(_),x=(0,N.ri)("contexts.authentication.directoryServices.backendWizard",(()=>F));var T=r("J6y4/h8P"),R=r("UiXZqrDE");const U="server-configuration",B={title:{required:!0},serverHost:{required:!0},serverPort:{required:!0,min:1,max:65535},description:{},transportSecurity:{},verifyCertificates:{},systemUserDn:{},systemUserPassword:{}},I=T.default.div.withConfig({displayName:"ServerConfigStep__ServerUrl",componentId:"sc-1qxnxjx-0"})(["display:flex;> *{align-self:flex-start;min-height:34px;flex-grow:1;:last-child{flex:0.8;min-width:130px;}}.input-group-addon{display:flex;align-items:center;max-width:fit-content;min-width:fit-content;}"]),D=T.default.div.withConfig({displayName:"ServerConfigStep__ProtocolOptions",componentId:"sc-1qxnxjx-1"})(["display:flex;div + *{margin-left:10px;}"]),O=e=>{let{formRef:t,help:r={},onSubmit:n,onSubmitAll:a,submitAllError:i,validateOnMount:o}=e;const{setStepsState:c,...u}=(0,l.useContext)(x),{backendValidationErrors:d,authBackendMeta:{backendHasPassword:m}}=u,p=(e,t,r,n)=>{const a=t.transportSecurity,l=e.target.value;"tls"===a&&"tls"!==l&&636===t.serverPort&&r("serverPort",389),"tls"!==a&&"tls"===l&&389===t.serverPort&&r("serverPort",636),n(e)};return l.createElement(R.Formik,{initialValues:u.formValues,innerRef:t,initialErrors:d,onSubmit:n,validateOnBlur:!1,validateOnChange:!1,validateOnMount:o},(e=>{let{isSubmitting:t,setFieldValue:n,values:o,validateForm:c}=e;return l.createElement(R.Form,{className:"form form-horizontal"},l.createElement(s.Fe,{help:r.title,label:"Title",name:"title",placeholder:"Title"}),l.createElement(s.Fe,{help:r.description,label:l.createElement(l.Fragment,null,"Description ",l.createElement(s.Sr,null)),type:"textarea",name:"description",placeholder:"Description"}),l.createElement(P.II,{id:"uri-host",label:"Server Address",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"},l.createElement(l.Fragment,null,l.createElement(I,{className:"input-group"},l.createElement(s.jc,{formGroupClassName:"",name:"serverHost",id:"serverHost",error:null==d?void 0:d.serverHost,placeholder:"Hostname",validate:(0,A.OP)(B.serverHost)}),l.createElement("span",{className:"input-group-addon input-group-separator"},":"),l.createElement(s.jc,{formGroupClassName:"",name:"serverPort",id:"serverPort",error:null==d?void 0:d.serverPort,placeholder:"Port",type:"number",validate:(0,A.OP)(B.serverPort)})),l.createElement(D,null,l.createElement(R.Field,{name:"transportSecurity"},(e=>{let{field:{name:t,onChange:r,onBlur:a,value:s}}=e;return l.createElement(l.Fragment,null,l.createElement(P.II,{defaultChecked:"none"===s,formGroupClassName:"",id:t,label:"None",onBlur:a,onChange:e=>p(e,o,n,r),type:"radio",value:"none"}),l.createElement(P.II,{defaultChecked:"tls"===s,formGroupClassName:"",id:t,label:"TLS",onBlur:a,onChange:e=>p(e,o,n,r),type:"radio",value:"tls"}),l.createElement(P.II,{defaultChecked:"start_tls"===s,formGroupClassName:"",id:t,label:"StartTLS",onBlur:a,onChange:e=>p(e,o,n,r),type:"radio",value:"start_tls"}))})),l.createElement(s.jc,{formGroupClassName:"",label:"Verify Certificates",name:"verifyCertificates",id:"verifyCertificates",type:"checkbox"})))),l.createElement(s.Fe,{help:r.systemUserDn,error:null==d?void 0:d.systemUserDn,label:l.createElement(l.Fragment,null,"System User DN ",l.createElement(s.Sr,null)),name:"systemUserDn",validate:(0,A.OP)(B.systemUserDn),placeholder:"System User DN"}),m&&void 0===o.systemUserPassword?l.createElement(P.II,{id:"systemPassword",label:l.createElement(l.Fragment,null,"System Password ",l.createElement(s.Sr,null)),labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"},l.createElement(P.zx,{type:"button",onClick:()=>n("systemUserPassword","")},"Reset Password")):l.createElement(s.Fe,{autoComplete:"authentication-service-password",buttonAfter:m&&void 0!==o.systemUserPassword?l.createElement(P.zx,{type:"button",onClick:()=>n("systemUserPassword",void 0)},"Undo Reset"):void 0,help:r.systemUserPassword,label:l.createElement(l.Fragment,null,"System Password ",l.createElement(s.Sr,null)),name:"systemUserPassword",error:null==d?void 0:d.systemUserPassword,placeholder:"System Password",validate:(0,A.OP)(B.systemUserPassword),type:"password"}),i,l.createElement(P.Si,{className:"pull-right"},l.createElement(P.zx,{disabled:t,onClick:()=>(e=>{e().then((e=>{(0,A.Sy)(e)||a()}))})(c),type:"button"},"Finish & Save Service"),l.createElement(P.zx,{bsStyle:"primary",disabled:t,type:"submit"},"Next: User Synchronization")))}))},z="user-synchronization",Z={defaultRoles:{required:!0},userFullNameAttribute:{required:!0},userNameAttribute:{required:!0},userSearchBase:{required:!0},userSearchPattern:{required:!0},userUniqueIdAttribute:{}},q=e=>{let{help:t={},excludedFields:r={},formRef:n,onSubmit:a,onSubmitAll:i,submitAllError:o,validateOnMount:c,roles:u}=e;const{setStepsState:d,...m}=(0,l.useContext)(x),{backendValidationErrors:p}=m,h=u.map((e=>({label:e.name,value:e.id}))).toArray();return l.createElement(R.Formik,{initialValues:m.formValues,initialErrors:p,innerRef:n,onSubmit:a,validateOnBlur:!1,validateOnChange:!1,validateOnMount:c},(e=>{let{isSubmitting:n,validateForm:a}=e;return l.createElement(R.Form,{className:"form form-horizontal"},l.createElement(s.Fe,{help:t.userSearchBase,label:"Search Base DN",error:null==p?void 0:p.userSearchBase,name:"userSearchBase",placeholder:"Search Base DN",validate:(0,A.OP)(Z.userSearchBase)}),l.createElement(s.Fe,{help:t.userSearchPattern,label:"Search Pattern",name:"userSearchPattern",error:null==p?void 0:p.userSearchPattern,placeholder:"Search Pattern",validate:(0,A.OP)(Z.userSearchPattern)}),l.createElement(s.Fe,{help:t.userNameAttribute,label:"Name Attribute",name:"userNameAttribute",error:null==p?void 0:p.userNameAttribute,placeholder:"Name Attribute",validate:(0,A.OP)(Z.userNameAttribute)}),l.createElement(s.Fe,{help:t.userFullNameAttribute,label:"Full Name Attribute",name:"userFullNameAttribute",placeholder:"Full Name Attribute",error:null==p?void 0:p.userFullNameAttribute,validate:(0,A.OP)(Z.userFullNameAttribute)}),!r.userUniqueIdAttribute&&l.createElement(s.Fe,{help:t.userUniqueIdAttribute,label:"ID Attribute",name:"userUniqueIdAttribute",placeholder:"ID Attribute",error:null==p?void 0:p.userUniqueIdAttribute,validate:(0,A.OP)(Z.userUniqueIdAttribute)}),l.createElement(P.X2,null,l.createElement(P.JX,{sm:9,smOffset:3},l.createElement(P.s_,{bsStyle:"info"},"Changing the static role assignment will only affect new users created via ",m.authBackendMeta.serviceTitle,"! Existing user accounts will be updated on their next login, or if you edit their roles manually."))),l.createElement(R.Field,{name:"defaultRoles",validate:(0,A.OP)(Z.defaultRoles)},(e=>{let{field:{name:r,value:n,onChange:a,onBlur:i},meta:{error:o}}=e;return l.createElement(P.II,{bsStyle:o?"error":void 0,help:t.defaultRoles,error:null!=o?o:null==p?void 0:p.defaultRoles,id:"default-roles-select",label:"Default Roles",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"},l.createElement(s.Ph,{inputProps:{"aria-label":"Search for roles"},multi:!0,onBlur:i,onChange:e=>a({target:{value:e,name:r}}),options:h,placeholder:"Search for roles",value:n}))})),l.createElement(P.X2,null,l.createElement(P.JX,{sm:9,smOffset:3},l.createElement(P.bZ,{bsStyle:"info"},l.createElement(s.JO,{name:"info-circle"})," ","We recommend you test your user login in the sidebar panel to verify your settings."))),o,l.createElement(P.Si,{className:"pull-right"},l.createElement(P.zx,{disabled:n,onClick:()=>(e=>{e().then((e=>{(0,A.Sy)(e)||i()}))})(a),type:"button"},"Finish & Save Identity Service"),l.createElement(P.zx,{bsStyle:"success",disabled:n,type:"submit"},"Next: Group Synchronization")))}))},M="group-synchronization",K=e=>{var t;let{onSubmitAll:r,prepareSubmitPayload:n,formRef:a,submitAllError:o,validateOnMount:c,roles:u,help:d,excludedFields:m}=e;const p=(0,i.z$)(),h=null==p||null===(t=p.components)||void 0===t?void 0:t.GroupSyncForm;return h?l.createElement(h,{formRef:a,help:d,excludedFields:m,onSubmitAll:r,prepareSubmitPayload:n,roles:u,submitAllError:o,validateOnMount:c}):l.createElement(l.Fragment,null,l.createElement(P.X2,null,l.createElement(P.JX,{xs:12},l.createElement(s.VL,{featureName:"group synchronization"}))),l.createElement(P.Si,{className:"pull-right"},l.createElement(P.zx,{bsStyle:"primary",onClick:()=>r(!1)},"Finish & Save Service")))},L=e=>{let{invalidStepKeys:t=[],stepKey:r}=e;return t.includes(r)?l.createElement(l.Fragment,null,l.createElement(s.JO,{name:"exclamation-triangle"})," "):null},V=e=>{let{formRefs:t,handleSubmitAll:r,help:n,excludedFields:a,invalidStepKeys:s,prepareSubmitPayload:i,roles:o,setActiveStepKey:c,submitAllError:u}=e;return[{key:U,title:l.createElement(l.Fragment,null,l.createElement(L,{invalidStepKeys:s,stepKey:U}),"Server Configuration"),component:l.createElement(O,{formRef:t[U],help:n,onSubmit:()=>c(z),onSubmitAll:r,submitAllError:u,validateOnMount:s.includes(U)})},{key:z,title:l.createElement(l.Fragment,null,l.createElement(L,{invalidStepKeys:s,stepKey:z}),"User Synchronization"),component:l.createElement(q,{formRef:t[z],help:n,excludedFields:a,onSubmit:()=>c(M),onSubmitAll:r,roles:o,submitAllError:u,validateOnMount:s.includes(z)})},{key:M,title:l.createElement(l.Fragment,null,l.createElement(L,{invalidStepKeys:s,stepKey:M}),"Group Synchronization (Opt.)"),component:l.createElement(K,{formRef:t[M],help:n,excludedFields:a,onSubmitAll:r,prepareSubmitPayload:i,roles:o,submitAllError:u,validateOnMount:s.includes(M)})}]};var G=r("OhCiqfIr");const j=(0,T.default)(P.bZ).withConfig({displayName:"ConnectionErrors__NotificationContainer",componentId:"sc-s1r6u0-0"})(["margin-top:10px;word-break:break-word;"]),J=T.default.div.withConfig({displayName:"ConnectionErrors__Title",componentId:"sc-s1r6u0-1"})(["font-weight:bold;margin-bottom:5px;"]),H=T.default.ul.withConfig({displayName:"ConnectionErrors__ErrorsList",componentId:"sc-s1r6u0-2"})((e=>{let{theme:t}=e;return`\n  font-family: ${t.fonts.family.monospace};\n  list-style: initial;\n  padding-left: 20px;\n`})),X=e=>{let{errors:t,message:r}=e;return l.createElement(j,{bsStyle:"danger"},l.createElement(J,null,r),l.createElement(H,null,t.map((e=>l.createElement("li",{key:String(e)},String(e))))))};X.propTypes={errors:g().arrayOf(g().string).isRequired,message:g().string},X.defaultProps={message:"There was an error"};const W=X,Y=e=>{let{prepareSubmitPayload:t}=e;const{authBackendMeta:r}=(0,l.useContext)(x),[{loading:n,success:a,message:i,errors:o},c]=(0,l.useState)({loading:!1,success:!1,message:void 0,errors:void 0});return l.createElement(l.Fragment,null,l.createElement("p",null,'Performs a background connection check with the address and credentials defined in the step "Server Configuration".'),l.createElement(P.zx,{onClick:()=>{const e=(e=>{const t={...e};return t.config.user_search_base||(t.config.user_search_base=""),t.config.user_search_pattern||(t.config.user_search_pattern=""),t})(t(void 0));c({loading:!0,message:void 0,errors:void 0,success:!1}),G.Z.testConnection({backend_configuration:e,backend_id:r.backendId}).then((e=>{c({loading:!1,message:null==e?void 0:e.message,success:null==e?void 0:e.success,errors:null==e?void 0:e.errors})})).catch((e=>{var t,r;const n=[null==e?void 0:e.message,null==e||null===(t=e.additional)||void 0===t||null===(r=t.res)||void 0===r?void 0:r.text];c({loading:!1,message:void 0,errors:n,success:!1})}))},type:"button"},n?l.createElement(s.$j,{delay:0,text:"Test Server Connection"}):"Test Server Connection"),a&&l.createElement(j,{bsStyle:"success"},l.createElement("b",null,i)),o&&o.length>=1&&l.createElement(W,{errors:o,message:i}))},Q=e=>{let{prepareSubmitPayload:t}=e;const{authBackendMeta:r}=(0,l.useContext)(x),n={loading:!1,success:!1,testFinished:!1,result:void 0,message:void 0,errors:[]},[{loading:a,testFinished:i,success:o,message:c,errors:u,result:d},m]=(0,l.useState)(n),p=u&&u.length>=1;return l.createElement(l.Fragment,null,l.createElement("p",null,"Verify the settings by loading the entry for the given user name. If you omit the password, no authentication attempt will be made."),l.createElement(R.Formik,{onSubmit:e=>{let{username:a,password:l}=e;return m({...n,loading:!0}),G.Z.testLogin({backend_configuration:t(void 0),user_login:{username:a,password:l},backend_id:r.backendId}).then((e=>{m({loading:!1,testFinished:!0,message:e.message,result:e.result,errors:e.errors,success:e.success})})).catch((e=>{var t,r;const n=[null==e?void 0:e.message,null==e||null===(t=e.additional)||void 0===t||null===(r=t.res)||void 0===r?void 0:r.text];m({loading:!1,success:!1,testFinished:!0,result:void 0,message:void 0,errors:n})}))},initialValues:{password:"",username:""}},l.createElement(R.Form,{className:"form"},l.createElement(P.X2,{className:"no-bm"},l.createElement(P.JX,{sm:6},l.createElement(s.jc,{label:"Username",name:"username",id:"user-login-username",required:!0})),l.createElement(P.JX,{sm:6},l.createElement(s.jc,{label:"Password",name:"password",type:"password",id:"user-login-password",required:!0}))),l.createElement(P.zx,{type:"submit"},a?l.createElement(s.$j,{delay:0,text:"Test User Login"}):"Test User Login"),!p&&i&&l.createElement(j,{bsStyle:o?"success":"danger"},l.createElement("b",null,!(null!=d&&d.user_exists)&&"User does not exist",(null==d?void 0:d.user_exists)&&l.createElement(l.Fragment,null,null!=d&&d.login_success?c:"Login failed")),(null==d?void 0:d.user_exists)&&(null==d?void 0:d.user_details)&&l.createElement("div",null,l.createElement("br",null),l.createElement("table",{className:"table"},l.createElement("thead",null,l.createElement("tr",null,l.createElement("th",null,"User Attribute"),l.createElement("th",null,"Value"))),l.createElement("tbody",null,Object.entries(null==d?void 0:d.user_details).map((e=>{let[t,r]=e;return l.createElement("tr",{key:t},l.createElement("td",null,String(t)),l.createElement("td",null,String(r)))})))))),p&&l.createElement(W,{errors:u,message:c}))))},ee=(0,T.default)(P.eh).withConfig({displayName:"Sidebar__StyledPanelGroup",componentId:"sc-12d40f0-0"})(["&.panel-group .panel{margin-top:0;border-color:",";background-color:",";.panel-heading{background-color:",";}&:not(:first-child){border-top:0;border-top-left-radius:0;border-top-right-radius:0;}&:not(:last-child){border-bottom-left-radius:0;border-bottom-right-radius:0;}}"],(e=>e.theme.colors.input.border),(e=>e.theme.colors.global.contentBackground),(e=>e.theme.colors.table.backgroundAlt)),te=e=>{let{prepareSubmitPayload:t}=e;const[r,n]=(0,l.useState)(U),{setStepsState:a,...s}=(0,l.useContext)(x);return(0,l.useEffect)((()=>{n(s.activeStepKey)}),[s.activeStepKey]),l.createElement(ee,{accordion:!0,activeKey:r,id:"sidebar-server-response",onSelect:n},l.createElement(P.s_,{eventKey:U},l.createElement(P.s_.Heading,null,l.createElement(P.s_.Title,{toggle:!0},"Server Connection Check")),l.createElement(P.s_.Body,{collapsible:!0},l.createElement(Y,{prepareSubmitPayload:t}))),l.createElement(P.s_,{eventKey:z},l.createElement(P.s_.Heading,null,l.createElement(P.s_.Title,{toggle:!0},"User Login Test")),l.createElement(P.s_.Body,{collapsible:!0},l.createElement(Q,{prepareSubmitPayload:t}))))},re={[U]:B,[z]:Z},ne=e=>{var t,r;let{error:n,backendId:a}=e;return l.createElement(P.X2,null,l.createElement(P.JX,{xs:9,xsOffset:3},l.createElement(P.bZ,{bsStyle:"danger",style:{wordBreak:"break-word"}},l.createElement("b",null,"Failed to ",a?"edit":"create"," authentication service"),l.createElement("br",null),(null==n?void 0:n.message)&&l.createElement(l.Fragment,null,n.message,l.createElement("br",null),l.createElement("br",null)),null==n||null===(t=n.additional)||void 0===t||null===(r=t.res)||void 0===r?void 0:r.text)))},ae=(e,t)=>{const r=e=>{if(e)return e};return e?void 0===t?{keep_value:!0}:""===t?{delete_value:!0}:{set_value:r(t)}:r(t)},le=(e,t,r)=>{const n={...re,[M]:{}},a=(0,i.z$)(),l=null==a?void 0:a.validation.GroupSyncValidation;l&&e.synchronizeGroups&&(n[M]=l(e.teamSelectionType));const s=Object.entries(n).map((n=>{let[a,l]=n;return Object.entries(l).some((n=>{let[a,l]=n;return!r[a]&&(!(null==t||!t[a])||!!(0,A.OP)(l)(null==e?void 0:e[a]))}))?a:void 0}));return(0,f.compact)(s)},se=(e,t,r,n,a,l,s)=>{const i=n();if(l(i,{}).length>=1)return Promise.resolve();t(null);const o=a(i),c=()=>r(o,i,e.authBackendMeta.serviceType,s).then((()=>{S.Z.push(w.ZP.SYSTEM.AUTHENTICATION.BACKENDS.OVERVIEW)})).catch((e=>{var r,n;if("object"==typeof(null==e||null===(r=e.additional)||void 0===r||null===(n=r.body)||void 0===n?void 0:n.errors)){const t=(e=>{const t=(0,f.mapValues)(e,(e=>`Server validation error: ${e.join(" ")}`));return(0,f.mapKeys)(t,((e,t)=>(0,f.camelCase)(t)))})(e.additional.body.errors);l(i,t)}else t(e)}));return e.authBackendMeta.backendGroupSyncIsActive&&!i.synchronizeGroups?window.confirm("Do you really want to remove the group synchronization config for this authentication service?")?c():Promise.resolve():c()},ie=e=>{let{initialValues:t,initialStepKey:r,onSubmit:n,authBackendMeta:a,help:o,excludedFields:c}=e;const u=(0,i.z$)(),d=null==u?void 0:u.components.MatchingGroupsProvider,[m,p]=(0,l.useState)(),[h,v]=(0,l.useState)(),[y,b]=(0,l.useState)({activeStepKey:r,authBackendMeta:a,backendValidationErrors:void 0,formValues:t,invalidStepKeys:[]}),f={[U]:(0,l.useRef)(null),[z]:(0,l.useRef)(null),[M]:(0,l.useRef)(null)},E=(0,l.useMemo)((()=>({...y,setStepsState:b})),[y,b]);if((0,l.useEffect)((()=>(e=>{C.Z.loadRolesPaginated({page:1,perPage:0,query:""}).then(e)})(p)),[]),(0,l.useEffect)((()=>{!m||a.backendId||y.formValues.defaultRoles||((e,t,r)=>{var n;const a=null==e||null===(n=e.find((e=>"Reader"===e.name)))||void 0===n?void 0:n.id;a&&r({...t,formValues:{...t.formValues,defaultRoles:a}})})(m.list,y,b)}),[m,a.backendId,y,b]),!m)return l.createElement(s.$j,null);const g=()=>{var e;const t=null===(e=f[y.activeStepKey])||void 0===e?void 0:e.current;return{...y.formValues,...null==t?void 0:t.values}},S=(e,t)=>{const r=le(e,t,c);if(r.length>=1){const n=r.includes(y.activeStepKey)?y.activeStepKey:r[0];b({...y,backendValidationErrors:t,activeStepKey:n,formValues:e,invalidStepKeys:r})}return r},A=((e,t)=>r=>{const n=null!=r?r:t(),{defaultRoles:a="",description:l,serverHost:s,serverPort:i,systemUserDn:o,systemUserPassword:c,title:u,transportSecurity:d,userUniqueIdAttribute:m,userFullNameAttribute:p,userNameAttribute:h,userSearchBase:v,userSearchPattern:y,verifyCertificates:b}=n,{serviceType:f,backendId:E}=e.authBackendMeta;return{title:u,description:l,default_roles:a.split(","),config:{servers:[{host:s,port:i}],system_user_dn:o,system_user_password:ae(E,c),transport_security:d,type:f,user_full_name_attribute:p,user_name_attribute:h,user_search_base:v,user_search_pattern:y,user_unique_id_attribute:m,verify_certificates:b}}})(y,g),P=e=>{const t=g();let r=[...y.invalidStepKeys];r.length>=1&&(r=le(t,y.backendValidationErrors,c)),b({...y,invalidStepKeys:r,formValues:t,activeStepKey:e})},w=V({formRefs:f,help:o,handleSubmitAll:e=>se(y,v,n,g,A,S,e),invalidStepKeys:y.invalidStepKeys,prepareSubmitPayload:A,excludedFields:c,roles:m.list,setActiveStepKey:P,submitAllError:h&&l.createElement(ne,{error:h,backendId:a.backendId})}),N=l.createElement(k.Z,{activeStep:y.activeStepKey,hidePreviousNextButtons:!0,horizontal:!0,justified:!0,onStepChange:P,steps:w},l.createElement(te,{prepareSubmitPayload:A}));return l.createElement(x.Provider,{value:E},d?l.createElement(d,{prepareSubmitPayload:A},N):N)};ie.defaultProps={initialStepKey:U,help:void 0,excludedFields:{}},ie.propTypes={authBackendMeta:g().shape({backendHasPassword:g().bool,backendId:g().string,serviceTitle:g().string.isRequired,serviceType:g().string.isRequired}).isRequired,help:g().object,initialStepKey:g().string,initialValues:g().object.isRequired,excludedFields:g().object};const oe=ie,ce={serviceType:"ldap",serviceTitle:"LDAP"},ue={systemUserDn:l.createElement("span",null,"The username for the initial connection to the LDAP server, e.g. ",l.createElement("code",null,"cn=admin,dc=example,dc=com"),", this might be optional depending on your LDAP server."),systemUserPassword:"The password for the initial connection to the LDAP server.",userSearchBase:l.createElement("span",null,"The base tree to limit the LDAP search query to, e.g. ",l.createElement("code",null,"cn=users,dc=example,dc=com"),"."),userSearchPattern:l.createElement("span",null,"For example ",l.createElement("code",{className:"text-nowrap"},"(&(uid={0})(objectClass=inetOrgPerson))"),"."," ","The string ",l.createElement("code",null,"{0}")," will be replaced by the entered username."),userNameAttribute:l.createElement("span",null,"Which LDAP attribute to use for the username of the user in Graylog, e.g ",l.createElement("code",null,"uid"),".",l.createElement("br",null),"Try to load a test user in the sidebar section ",l.createElement("i",null,"User Login Test"),", if you are unsure which attribute to use."),userFullNameAttribute:l.createElement("span",null,"Which LDAP attribute to use for the full name of a synchronized Graylog user, e.g. ",l.createElement("code",null,"cn"),".",l.createElement("br",null)),userUniqueIdAttribute:l.createElement("span",null,"Which LDAP attribute to use for the ID of a synchronized Graylog user, e.g. ",l.createElement("code",null,"entryUUID"),".",l.createElement("br",null)),defaultRoles:l.createElement("span",null,"The default Graylog roles synchronized user will obtain. All users need the ",l.createElement("code",null,"Reader")," role, to use the Graylog web interface")},de={title:ce.serviceTitle,serverHost:"localhost",serverPort:636,transportSecurity:"tls",userFullNameAttribute:"cn",userNameAttribute:"uid",userUniqueIdAttribute:"entryUUID",verifyCertificates:!0},me=()=>{var e,t;const r=(0,i.z$)(),{help:n={},initialValues:a={}}=null!==(e=null==r||null===(t=r.wizardConfig)||void 0===t?void 0:t.ldap)&&void 0!==e?e:{},o={...ue,...n},c={...de,...a};return l.createElement(s.$4,{title:"Create LDAP Authentication Service"},l.createElement(h,null),l.createElement(oe,{onSubmit:b,help:o,authBackendMeta:ce,initialValues:c}))};var pe=r("VPaD/Np4");const he=e=>{let{title:t,description:r,defaultRoles:n=pe.List(),config:{servers:a=[],systemUserDn:l,transportSecurity:s,userFullNameAttribute:i,userNameAttribute:o,userSearchBase:c,userSearchPattern:u,userUniqueIdAttribute:d,verifyCertificates:m}}=e;return{title:t,description:r,defaultRoles:n.join(),serverHost:a[0].host,serverPort:a[0].port,systemUserDn:l,transportSecurity:s,userFullNameAttribute:i,userNameAttribute:o,userSearchBase:c,userSearchPattern:u,userUniqueIdAttribute:d,verifyCertificates:m}},ve=function(e,t,r,n,a){let l=!(arguments.length>5&&void 0!==arguments[5])||arguments[5];const s=(0,i.z$)(),o=()=>v.Z.success("Authentication service was updated successfully.","Success"),c=e=>v.Z.error(`Updating authentication service failed with status: ${e}`,"Error");return y.K.update(r,{...e,id:r}).then((e=>s&&l?s.actions.onDirectoryServiceBackendUpdate(n,t,r,a).then(o):(o(),e))).catch((e=>{throw c(e),e}))};function ye(){return ye=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t,r;let{authenticationBackend:n,initialStepKey:a}=e;const o=(0,i.z$)(),{help:c={},initialValues:u={}}=null!==(t=null==o||null===(r=o.wizardConfig)||void 0===r?void 0:r.ldap)&&void 0!==t?t:{},d={...ue,...c};let m=he(n);if(o){const{formValues:e,finishedLoading:t}=o.hooks.useInitialGroupSyncValues(n.id,u);if(!t)return l.createElement(s.$j,null);m={...m,...e}}const p={...ce,backendId:n.id,backendHasPassword:n.config.systemUserPassword.isSet,backendGroupSyncIsActive:!!m.synchronizeGroups};return l.createElement(s.$4,{title:"Edit LDAP Authentication Service"},l.createElement(h,{authenticationBackend:n}),l.createElement(oe,ye({},(e=>({initialStepKey:e}))(a),{help:d,authBackendMeta:p,initialValues:m,onSubmit:(e,t,r,a)=>ve(e,t,n.id,!!m.synchronizeGroups,r,a)})))};var fe=r("5sZKlkP8"),Ee=r("EeAwn/0x");const ge=e=>{let{authenticationBackendId:t,stepKey:r}=e;return l.createElement(Ee.J,{to:w.ZP.SYSTEM.AUTHENTICATION.BACKENDS.edit(t,r)},l.createElement(P.zx,{bsStyle:"success",bsSize:"small"},"Edit"))},Se=e=>{let{authenticationBackend:t}=e;const{title:r,description:n,config:{servers:a=[],systemUserDn:i,systemUserPassword:o,transportSecurity:c,verifyCertificates:u}}=t,d=a.map((e=>`${e.host}:${e.port}`)).join(", ");return l.createElement(fe.Z,{title:"Server Configuration",headerActions:l.createElement(ge,{authenticationBackendId:t.id,stepKey:U})},l.createElement(s.mv,{label:"Title",value:r}),l.createElement(s.mv,{label:"Description",value:n}),l.createElement(s.mv,{label:"Server Address",value:d}),l.createElement(s.mv,{label:"System Username",value:i}),l.createElement(s.mv,{label:"System Password",value:null!=o&&o.isSet?"******":null}),l.createElement(s.mv,{label:"Transport Security",value:c}),l.createElement(s.mv,{label:"Verify Certificates",value:u}))},Ae=(e,t)=>e.map((e=>{var r,n;return null!==(r=null===(n=t.find((t=>t.id===e)))||void 0===n?void 0:n.name)&&void 0!==r?r:"Role not found"})).join(", "),Pe=e=>{let{authenticationBackend:t,roles:r,excludedFields:n}=e;const{userSearchBase:a,userSearchPattern:i,userNameAttribute:o,userFullNameAttribute:c,userUniqueIdAttribute:u}=t.config,{defaultRoles:d=pe.List()}=t;return l.createElement(fe.Z,{title:"User Synchronization",headerActions:l.createElement(ge,{authenticationBackendId:t.id,stepKey:z})},l.createElement(s.mv,{label:"Search Base DN",value:a}),l.createElement(s.mv,{label:"Search Pattern",value:i}),l.createElement(s.mv,{label:"Name Attribute",value:o}),l.createElement(s.mv,{label:"Full Name Attribute",value:c}),!n.userUniqueIdAttribute&&l.createElement(s.mv,{label:"ID Attribute",value:u}),l.createElement(s.mv,{label:"Default Roles",value:Ae(d,r)}))};Pe.defaultProps={excludedFields:{}},Pe.propTypes={excludedFields:E.object};const Ce=Pe,we=e=>{let{authenticationBackend:t,roles:r,excludedFields:n}=e;const a=(0,i.z$)(),o=null==a?void 0:a.components.GroupSyncSection;return o?l.createElement(o,{authenticationBackend:t,excludedFields:n,roles:r}):l.createElement(fe.Z,{title:"Group Synchronization",headerActions:l.createElement(ge,{authenticationBackendId:t.id,stepKey:M})},l.createElement(s.VL,{featureName:"group synchronization"}))};we.defaultProps={excludedFields:void 0};const ke=we,Ne=e=>{var t,r;let{authenticationBackend:n,roles:a}=e;const s=(0,i.z$)(),{excludedFields:o={}}=null!==(t=null==s||null===(r=s.wizardConfig)||void 0===r?void 0:r.activeDirectory)&&void 0!==t?t:{},c={...o,userUniqueIdAttribute:!0};return l.createElement(l.Fragment,null,l.createElement(Se,{authenticationBackend:n}),l.createElement(Ce,{authenticationBackend:n,roles:a,excludedFields:c}),l.createElement(ke,{authenticationBackend:n,roles:a,excludedFields:c}))},_e=e=>{var t,r;let{authenticationBackend:n,roles:a}=e;const s=(0,i.z$)(),{excludedFields:o={}}=null!==(t=null==s||null===(r=s.wizardConfig)||void 0===r?void 0:r.ldap)&&void 0!==t?t:{},c={...o};return l.createElement(l.Fragment,null,l.createElement(Se,{authenticationBackend:n}),l.createElement(Ce,{authenticationBackend:n,roles:a,excludedFields:c}),l.createElement(ke,{authenticationBackend:n,roles:a,excludedFields:c}))},Fe=e=>{let{authenticationBackend:t}=e;const{finishedLoading:r,activeBackend:n}=(0,d.Z)(),a=(e=>{if(e){const t=u.Z.truncateWithEllipses(e.title,30);return l.createElement(l.Fragment,null,"Edit Authentication Service - ",l.createElement("i",null,t))}return"Create Active Directory Authentication Service"})(t);return l.createElement(l.Fragment,null,l.createElement(o.Z,null),l.createElement(s.mr,{title:a,actions:l.createElement(m.Z,{activeBackend:n,finishedLoading:r}),documentationLink:{title:"Authentication documentation",path:c.Z.PAGES.USERS_ROLES}},l.createElement("span",null,"Configure Graylog's authentication services of this Graylog cluster.")))};Fe.defaultProps={authenticationBackend:void 0};const xe=Fe,Te={systemUserDn:l.createElement("span",null,"The username for the initial connection to the Active Directory server, e.g. ",l.createElement("code",null,"[email protected]"),".",l.createElement("br",null),"This needs to match the ",l.createElement("code",null,"userPrincipalName")," of that user."),systemUserPassword:"The password for the initial connection to the Active Directory server.",userSearchBase:l.createElement("span",null,"The base tree to limit the Active Directory search query to, e.g. ",l.createElement("code",null,"cn=users,dc=example,dc=com"),"."),userSearchPattern:l.createElement("span",null,"For example ",l.createElement("code",{className:"text-nowrap"},"(&(objectClass=user)(|(sAMAccountName={0})(userPrincipalName={0})))"),"."," ","The string ",l.createElement("code",null,"{0}")," will be replaced by the entered username."),userNameAttribute:l.createElement("span",null,"Which Active Directory attribute to use for the full name of the user in Graylog, e.g. ",l.createElement("code",null,"userPrincipalName"),".",l.createElement("br",null),"Try to load a test user in the sidebar section ",l.createElement("i",null,"User Login Test"),", if you are unsure which attribute to use."),userFullNameAttribute:l.createElement("span",null,"Which Active Directory attribute to use for the full name of a synchronized Graylog user, e.g. ",l.createElement("code",null,"displayName"),".",l.createElement("br",null)),defaultRoles:l.createElement("span",null,"The default Graylog roles synchronized user will obtain. All users need the ",l.createElement("code",null,"Reader")," role, to use the Graylog web interface")},Re={serviceTitle:"Active Directory",serviceType:"active-directory"},Ue={title:Re.serviceTitle,serverHost:"localhost",serverPort:636,transportSecurity:"tls",userSearchPattern:"(&(objectClass=user)(|(sAMAccountName={0})(userPrincipalName={0})))",userFullNameAttribute:"displayName",userNameAttribute:"userPrincipalName",verifyCertificates:!0},Be=()=>{var e,t;const r=(0,i.z$)(),{help:n={},excludedFields:a={},initialValues:o}=null!==(e=null==r||null===(t=r.wizardConfig)||void 0===t?void 0:t.activeDirectory)&&void 0!==e?e:{},c={...Te,...n},u={...Ue,...o},d={...a,userUniqueIdAttribute:!0};return l.createElement(s.$4,{title:"Create Active Directory Authentication Services"},l.createElement(xe,null),l.createElement(oe,{authBackendMeta:Re,help:c,excludedFields:d,initialValues:u,onSubmit:b}))};function Ie(){return Ie=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t,r;let{authenticationBackend:n,initialStepKey:a}=e;const o=(0,i.z$)(),{help:c={},excludedFields:u={},initialValues:d={}}=null!==(t=null==o||null===(r=o.wizardConfig)||void 0===r?void 0:r.activeDirectory)&&void 0!==t?t:{},m={...Te,...c},p={...u,userUniqueIdAttribute:!0};let h=he(n);if(o){const{formValues:e,finishedLoading:t}=o.hooks.useInitialGroupSyncValues(n.id,d);if(!t)return l.createElement(s.$j,null);h={...h,...e}}const v={...Re,backendId:n.id,backendHasPassword:n.config.systemUserPassword.isSet,backendGroupSyncIsActive:!!h.synchronizeGroups};return l.createElement(s.$4,{title:"Edit Active Directory Authentication Service"},l.createElement(xe,{authenticationBackend:n}),l.createElement(oe,Ie({},(e=>({initialStepKey:e}))(a),{authBackendMeta:v,excludedFields:p,help:m,initialValues:h,onSubmit:(e,t,r,a)=>ve(e,t,n.id,!!h.synchronizeGroups,r,a)})))};n.PluginStore.register(new n.PluginManifest({},{"authentication.services":[{name:"ldap",displayName:"LDAP",createComponent:me,editComponent:be,configDetailsComponent:_e,configToJson:a.toJson,configFromJson:a.fromJson},{name:"active-directory",displayName:"Active Directory",createComponent:Be,editComponent:De,configDetailsComponent:Ne,configToJson:a.toJson,configFromJson:a.fromJson}]}))},lcYXG3Mn:(e,t,r)=>{r.d(t,{Z:()=>l});var n=r("Z7aTuO5B"),a=r("OhCiqfIr");const l=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const[r,l]=(0,n.useState)(),[s,i]=(0,n.useState)(!1),o=()=>a.Z.loadActive().then((e=>{i(!0),l(e)}));return(0,n.useEffect)((()=>{o()}),[]),(0,n.useEffect)((()=>{const e=t.map((e=>e.completed.listen(o)));return()=>{e.forEach((e=>e()))}}),[t]),{finishedLoading:s,activeBackend:null==r?void 0:r.backend,backendsTotal:null==r||null===(e=r.context)||void 0===e?void 0:e.backendsTotal}}},pLLmkYy5:(e,t,r)=>{r.d(t,{Z:()=>d});var n=r("Z7aTuO5B"),a=r("J6y4/h8P"),l=r("F9olzlTR"),s=r("EeAwn/0x"),i=r("0zTRKSqx"),o=r("XR6lEGGZ");const c=(0,a.default)(l.Si).withConfig({displayName:"PageNavigation__Container",componentId:"sc-1if5i40-0"})(["margin-bottom:10px;"]),u=(0,a.default)(l.zx).withConfig({displayName:"PageNavigation__StyledButton",componentId:"sc-1if5i40-1"})((e=>{let{theme:t}=e;return(0,a.css)(["font-family:",";font-size:",";&&&&{color:",";:hover,:focus{text-decoration:none;}:hover{","}&.active{color:",";"," :hover,:focus{","}}}"],t.fonts.family.navigation,t.fonts.size.navigation,t.colors.variant.darker.default,(0,o.RF)(t),t.colors.global.textDefault,(0,o.A7)(t),(0,o.A7)(t))}));u.displayName="Button";const d=e=>{let{items:t}=e;return n.createElement(c,null,t.map((e=>{let{path:t,title:r,permissions:a,exactPathMatch:l}=e;return t?n.createElement(i.AE,{permissions:null!=a?a:[],key:t},n.createElement(s.J,{to:t,relativeActive:!l},n.createElement(u,{bsStyle:"link"},n.createElement(o.ZP,null,r)))):null})))}},"5sZKlkP8":(e,t,r)=>{r.d(t,{Z:()=>d,s:()=>o});var n=r("Z7aTuO5B"),a=r("J6y4/h8P"),l=r("8pZttqbT"),s=r("F9olzlTR");const i=a.default.div.withConfig({displayName:"SectionComponent__Header",componentId:"sc-y2eneq-0"})(["display:flex;justify-content:space-between;align-items:flex-start;*:not(:first-child){margin-left:10px;}"]),o=a.default.h2.withConfig({displayName:"SectionComponent__Headline",componentId:"sc-y2eneq-1"})(["margin-bottom:15px;display:inline;"]),c=(0,a.default)(l.Z).withConfig({displayName:"SectionComponent__LoadingSpinner",componentId:"sc-y2eneq-2"})((e=>{let{theme:t}=e;return(0,a.css)(["margin-left:10px;font-size:",";"],t.fonts.size.h3)})),u=e=>{let{children:t,title:r,showLoading:a=!1,headerActions:l,className:u}=e;return n.createElement(s.X2,{className:`content ${u}`},n.createElement(s.JX,{xs:12},n.createElement(i,null,n.createElement(o,null,r,a&&n.createElement(c,{text:"",delay:0})),l),t))};u.defaultProps={className:"",showLoading:!1,headerActions:void 0};const d=u},oyaholW7:(e,t,r)=>{r.d(t,{Z:()=>l});var n=r("BqDoRMwE"),a=r("VHOukFih");const l={load:(0,a.Z)({action:n.p.load,error:(e,t)=>({message:`Loading role with id "${t}" failed with status: ${e}`}),notFoundRedirect:!0}),delete:(0,a.Z)({action:n.p.delete,success:(e,t)=>({message:`Role "${t}" was deleted successfully`}),error:(e,t,r)=>({message:`Deleting role "${r}" failed with status: ${e}`})}),addMembers:(0,a.Z)({action:n.p.addMembers,success:(e,t)=>({message:`Users:"${t.join(", ")}" were assigned successfully`}),error:(e,t,r)=>({message:`Assigning users "${r.join(", ")}" failed with status: ${e}`})}),removeMember:(0,a.Z)({action:n.p.removeMember,success:(e,t)=>({message:`User "${t}" was unassigned successfully`}),error:(e,t,r)=>({message:`Unassign user "${r}" failed with status: ${e}`})}),loadUsersForRole:(0,a.Z)({action:n.p.loadUsersForRole,error:(e,t,r)=>({message:`Loading users for role "${r}" failed with status: ${e}`})}),loadRolesForUser:(0,a.Z)({action:n.p.loadRolesForUser,error:(e,t)=>({message:`Loading roles for user "${t}" failed with status: ${e}`})}),loadRolesPaginated:(0,a.Z)({action:n.p.loadRolesPaginated,error:e=>({message:`Loading roles failed with status: ${e}`})})}},BqDoRMwE:(e,t,r)=>{r.d(t,{p:()=>p});var n=r("JnTtTRmZ"),a=r.n(n),l=r("VPaD/Np4"),s=r("OqsMdpSm"),i=r("rkoyttmq"),o=r("0wQfx7YJ"),c=r("xc00RsLr"),u=r("4sldgQy6");class d{constructor(e,t,r,n,a){this._value={id:e,name:t,description:r,permissions:n,readOnly:a}}get id(){return this._value.id}get name(){return this._value.name}get description(){return this._value.description}get permissions(){return this._value.permissions}get readOnly(){return this._value.readOnly}toBuilder(){const{id:e,name:t,description:r,permissions:n,readOnly:a}=this._value;return new m(l.Map({id:e,name:t,description:r,permissions:n,readOnly:a}))}static create(e,t,r,n,a){return new d(e,t,r,n,a)}toJSON(){const{id:e,name:t,description:r,permissions:n,readOnly:a}=this._value;return{id:e,name:t,description:r,permissions:n,read_only:a}}static fromJSON(e){const{id:t,name:r,description:n,permissions:a,read_only:l}=e;return d.create(t,r,n,a,l)}static builder(){return new m}}class m{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l.Map();this.value=e}id(e){return new m(this.value.set("id",e))}name(e){return new m(this.value.set("name",e))}description(e){return new m(this.value.set("description",e))}permissions(e){return new m(this.value.set("permissions",e))}readOnly(e){return new m(this.value.set("readOnly",e))}build(){const{id:e,name:t,description:r,permissions:n,readOnly:a}=this.value.toObject();return new d(e,t,r,n,a)}}const p=(0,c.ei)("AuthzRoles",(()=>a().createActions({load:{asyncResult:!0},delete:{asyncResult:!0},addMembers:{asyncResult:!0},removeMember:{asyncResult:!0},loadUsersForRole:{asyncResult:!0},loadRolesForUser:{asyncResult:!0},loadRolesPaginated:{asyncResult:!0}})));var h=r("3KQynTtD");const v=e=>{let{count:t,total:r,page:n,per_page:a,query:s,roles:i=[],context:o={users:void 0}}=e;return{list:l.List(i.map((e=>d.fromJSON(e)))),pagination:{query:s,page:n,perPage:a,count:t,total:r},context:o}},y=e=>{let{count:t,total:r,page:n,per_page:a,query:s,users:i}=e;return{list:l.List(i.map((e=>h.Z.fromJSON(e)))),pagination:{page:n,perPage:a,query:s,count:t,total:r}}},b=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];const r=t.map((e=>encodeURIComponent(e)));return e(...r).url};(0,c.dS)("AuthzRoles",(()=>a().createStore({listenables:[p],load(e){const t=(0,o.DC)(b(i.Z.AuthzRolesController.load,[e])),r=(0,s.ZP)("GET",t).then(d.fromJSON);return p.load.promise(r),r},delete(e){const t=(0,o.DC)(b(i.Z.AuthzRolesController.delete,[e])),r=(0,s.ZP)("DELETE",t);return p.delete.promise(r),r},addMembers(e,t){const r=b(i.Z.AuthzRolesController.addMembers,[e]),n=(0,s.ZP)("PUT",(0,o.DC)(r),t.toArray());return p.addMembers.promise(n),n},removeMember(e,t){const r=b(i.Z.AuthzRolesController.removeMember,[e,t]),n=(0,s.ZP)("DELETE",(0,o.DC)(r));return p.removeMember.promise(n),n},loadUsersForRole(e,t,r){let{page:n,perPage:a,query:l}=r;const c=b(i.Z.AuthzRolesController.loadUsersForRole,[e]),d=(0,u.Z)(c,n,a,l),m=(0,s.ZP)("GET",(0,o.DC)(d)).then(y);return p.loadUsersForRole.promise(m),m},loadRolesForUser(e,t){let{page:r,perPage:n,query:a}=t;const l=b(i.Z.AuthzRolesController.loadRolesForUser,[e]),c=(0,u.Z)(l,r,n,a),d=(0,s.ZP)("GET",(0,o.DC)(c)).then(v);return p.loadRolesForUser.promise(d),d},loadRolesPaginated(e){let{page:t,perPage:r,query:n}=e;const a=b(i.Z.AuthzRolesController.list),l=(0,u.Z)(a,t,r,n),c=(0,s.ZP)("GET",(0,o.DC)(l)).then(v);return p.loadRolesPaginated.promise(c),c}})))}}]);
//# sourceMappingURL=325e2d4b-5343.52fd62e6788f7f9a098f.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy