web-interface.assets.1255d548-2378.7792b4e7b39cf93c02aa.js Maven / Gradle / Ivy
(()=>{(self.webpackChunkgraylog_web_interface=self.webpackChunkgraylog_web_interface||[]).push([["1255d548-2378"],{s1byLS3P:(Y,x,r)=>{"use strict";r.d(x,{Z:()=>p});var v=r("Z7aTuO5B"),_=r("d4kzUuQm"),F=r("SfPIQIJE"),g=r("uZqmR+ju");const e=[{title:"Authentication Services",path:_.ZP.SYSTEM.AUTHENTICATION.BACKENDS.OVERVIEW},{title:"Authenticators",path:_.ZP.SYSTEM.AUTHENTICATION.AUTHENTICATORS.SHOW}],p=()=>v.createElement(g.Row,null,v.createElement(F.Z,{items:e}))},ezgdc3VG:(Y,x,r)=>{"use strict";r.d(x,{Z:()=>n});var v=r("Z7aTuO5B"),_=r("ty2gyrHp"),F=r("d4kzUuQm"),g=r("uZqmR+ju");const n=({activeBackend:p,finishedLoading:R})=>v.createElement(g.ButtonToolbar,null,v.createElement(_.J,{to:F.ZP.SYSTEM.AUTHENTICATION.BACKENDS.ACTIVE},v.createElement(g.Button,{disabled:!R||!p},"View active service")),v.createElement(_.J,{to:F.ZP.SYSTEM.AUTHENTICATION.BACKENDS.edit(p==null?void 0:p.id)},v.createElement(g.Button,{disabled:!p||!R,type:"button"},"Edit active service")),v.createElement(_.J,{to:F.ZP.SYSTEM.AUTHENTICATION.BACKENDS.CREATE},v.createElement(g.Button,{bsStyle:"success",type:"button"},"Create service")))},UHXfBu6b:(Y,x,r)=>{"use strict";var v=r("QL8i6bcz");const g={fromJson:({servers:t,system_user_dn:s,system_user_password:l,transport_security:i,type:c,email_attributes:h,user_full_name_attribute:E,user_name_attribute:y,user_search_base:d,user_search_pattern:S,user_unique_id_attribute:C,verify_certificates:k})=>({servers:t,systemUserDn:s,systemUserPassword:{isSet:l.is_set},transportSecurity:i,type:c,emailAttributes:h,userFullNameAttribute:E,userNameAttribute:y,userSearchBase:d,userSearchPattern:S,userUniqueIdAttribute:C,verifyCertificates:k}),toJson:({servers:t,systemUserDn:s,systemUserPassword:l,transportSecurity:i,type:c,emailAttributes:h,userFullNameAttribute:E,userNameAttribute:y,userSearchBase:d,userSearchPattern:S,userUniqueIdAttribute:C,verifyCertificates:k})=>({servers:t,system_user_dn:s,system_user_password:{is_set:l.isSet},transport_security:i,type:c,email_attributes:h,user_full_name_attribute:E,user_name_attribute:y,user_search_base:d,user_search_pattern:S,user_unique_id_attribute:C,verify_certificates:k})};var e=r("Z7aTuO5B"),n=r("/GOzvPf6"),p=r("aRgBSN1I"),R=r("s1byLS3P"),D=r("E+CaPsQD"),U=r("TJOheZRu"),A=r("WPUkC7Fx"),f=r("ezgdc3VG");const O=(t,s)=>{if(t){const l=U.Z.truncateWithEllipses(t.title,30);return e.createElement(e.Fragment,null,"Edit Authentication Service - ",e.createElement("i",null,l))}return s||"Create LDAP Authentication Service"},M=({authenticationBackend:t,title:s})=>{const{finishedLoading:l,activeBackend:i}=(0,A.Z)(),c=O(t,s);return e.createElement(e.Fragment,null,e.createElement(R.Z,null),e.createElement(n.mr,{title:c,actions:e.createElement(f.Z,{activeBackend:i,finishedLoading:l}),documentationLink:{title:"Authentication documentation",path:D.Z.PAGES.USERS_ROLES}},e.createElement("span",null,"Configure Graylog's authentication services of this Graylog cluster.")))};M.defaultProps={authenticationBackend:void 0,title:void 0};const m=M;var B=r("jAGDuYSC"),b=r("vtWR08zs");const o=(t,s,l,i=!0)=>{const c=(0,p.z$)(),h=()=>B.Z.success("Authentication service was created successfully.","Success"),E=y=>B.Z.error(`Creating authentication service failed with status: ${y}`,"Error");return b.K.create(t).then(y=>y.backend&&s.synchronizeGroups&&c&&i?c.actions.onDirectoryServiceBackendUpdate(!1,s,y.backend.id,l).then(h):(h(),y)).catch(y=>{throw E(y),y})};var a=r("X8pjX0rJ"),u=r.n(a),P=r("WoBpjwwo"),N=r.n(P),L=r("FMrsY19w"),W=r.n(L),ie=r("7FTHePOw"),xe=r.n(ie),Re=r("ii0bleBb"),Q=r.n(Re),H=r("S6FuRS7B"),I=r("uZqmR+ju"),Ge=r("Lu0NTOJv"),Ue=r("d4kzUuQm"),We=r("1e+nFvZs"),$e=r("/7OuCFNo"),Ve=r("IA3Ku5lS");const He={activeStepKey:"",backendValidationErrors:void 0,authBackendMeta:{serviceType:"",serviceTitle:""},formValues:{},invalidStepKeys:[],setStepsState:()=>{}},Je=e.createContext(He),ce=(0,Ve.ri)("contexts.authentication.directoryServices.backendWizard",()=>Je);var le=r("J6y4/h8P"),ee=r("UiXZqrDE"),ue=r("MdYBRjRJ"),he=r("8OvTct/Z"),Ee=r("0t7Ye+61"),de=r("v4GbOr/o");const q="server-configuration",me={title:{required:!0},serverHost:{required:!0},serverPort:{required:!0,min:1,max:65535},description:{},transportSecurity:{},verifyCertificates:{},systemUserDn:{},systemUserPassword:{}},je=le.default.div`
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;
}
`,Ye=le.default.div`
display: flex;
div + * {
margin-left: 10px;
}
`,Qe=({formRef:t,help:s={},onSubmit:l,onSubmitAll:i,submitAllError:c,validateOnMount:h})=>{const{setStepsState:E,...y}=(0,e.useContext)(ce),{backendValidationErrors:d,authBackendMeta:{backendHasPassword:S}}=y,{pathname:C}=(0,Ee.Z)(),k=(0,he.Z)(),T=(Z,K,z,$)=>{const J=K.transportSecurity,G=Z.target.value,V=389,j=636;J==="tls"&&G!=="tls"&&K.serverPort===j&&z("serverPort",V),J!=="tls"&&G==="tls"&&K.serverPort===V&&z("serverPort",j),$(Z)},w=Z=>{k(de.A.AUTHENTICATION.DIRECTORY_SERVER_CONFIG_SAVE_CLICKED,{app_pathname:(0,ue.av)(C),app_section:"directory-service",app_action_value:"server-configuration-save"}),Z().then(K=>{(0,H.Sy)(K)||i()})};return e.createElement(ee.Formik,{initialValues:y.formValues,innerRef:t,initialErrors:d,onSubmit:l,validateOnBlur:!1,validateOnChange:!1,validateOnMount:h},({isSubmitting:Z,setFieldValue:K,values:z,validateForm:$})=>e.createElement(ee.Form,{className:"form form-horizontal"},e.createElement(n.Fe,{help:s.title,label:"Title",name:"title",placeholder:"Title"}),e.createElement(n.Fe,{help:s.description,label:e.createElement(e.Fragment,null,"Description ",e.createElement(n.Sr,null)),type:"textarea",name:"description",placeholder:"Description"}),e.createElement(I.Input,{id:"uri-host",label:"Server Address",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"},e.createElement(e.Fragment,null,e.createElement(je,{className:"input-group"},e.createElement(n.jc,{formGroupClassName:"",name:"serverHost",id:"serverHost",error:d==null?void 0:d.serverHost,placeholder:"Hostname",validate:(0,H.OP)(me.serverHost)}),e.createElement("span",{className:"input-group-addon input-group-separator"},":"),e.createElement(n.jc,{formGroupClassName:"",name:"serverPort",id:"serverPort",error:d==null?void 0:d.serverPort,placeholder:"Port",type:"number",validate:(0,H.OP)(me.serverPort)})),e.createElement(Ye,null,e.createElement(ee.Field,{name:"transportSecurity"},({field:{name:J,onChange:G,onBlur:V,value:j}})=>e.createElement(e.Fragment,null,e.createElement(I.Input,{defaultChecked:j==="none",formGroupClassName:"",id:J,label:"None",onBlur:V,onChange:X=>T(X,z,K,G),type:"radio",value:"none"}),e.createElement(I.Input,{defaultChecked:j==="tls",formGroupClassName:"",id:J,label:"TLS",onBlur:V,onChange:X=>T(X,z,K,G),type:"radio",value:"tls"}),e.createElement(I.Input,{defaultChecked:j==="start_tls",formGroupClassName:"",id:J,label:"StartTLS",onBlur:V,onChange:X=>T(X,z,K,G),type:"radio",value:"start_tls"}))),e.createElement(n.jc,{formGroupClassName:"",label:"Verify Certificates",name:"verifyCertificates",id:"verifyCertificates",type:"checkbox"})))),e.createElement(n.Fe,{help:s.systemUserDn,error:d==null?void 0:d.systemUserDn,label:e.createElement(e.Fragment,null,"System User DN ",e.createElement(n.Sr,null)),name:"systemUserDn",validate:(0,H.OP)(me.systemUserDn),placeholder:"System User DN"}),S&&z.systemUserPassword===void 0?e.createElement(I.Input,{id:"systemPassword",label:e.createElement(e.Fragment,null,"System Password ",e.createElement(n.Sr,null)),labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"},e.createElement(I.Button,{type:"button",onClick:()=>K("systemUserPassword","")},"Reset Password")):e.createElement(n.Fe,{autoComplete:"authentication-service-password",buttonAfter:S&&z.systemUserPassword!==void 0?e.createElement(I.Button,{type:"button",onClick:()=>K("systemUserPassword",void 0)},"Undo Reset"):void 0,help:s.systemUserPassword,label:e.createElement(e.Fragment,null,"System Password ",e.createElement(n.Sr,null)),name:"systemUserPassword",error:d==null?void 0:d.systemUserPassword,placeholder:"System Password",validate:(0,H.OP)(me.systemUserPassword),type:"password"}),c,e.createElement(I.ButtonToolbar,{className:"pull-right"},e.createElement(I.Button,{disabled:Z,onClick:()=>w($),type:"button"},"Finish & Save Service"),e.createElement(I.Button,{bsStyle:"primary",disabled:Z,onClick:()=>{k(de.A.AUTHENTICATION.DIRECTORY_NEXT_USER_SYNC_CLICKED,{app_pathname:(0,ue.av)(C),app_section:"directory-service",app_action_value:"usersync-button"})},type:"submit"},"Next: User Synchronization"))))},te="user-synchronization",se={defaultRoles:{required:!0},userFullNameAttribute:{required:!0},userNameAttribute:{required:!0},emailAttributes:{},userSearchBase:{required:!0},userSearchPattern:{required:!0},userUniqueIdAttribute:{}},Xe=(0,le.default)(n.QA)`
margin: auto 15px;
`,qe=({help:t={},excludedFields:s={},formRef:l,onSubmit:i,onSubmitAll:c,submitAllError:h,validateOnMount:E,roles:y})=>{const{setStepsState:d,...S}=(0,e.useContext)(ce),{backendValidationErrors:C}=S,k=y.map(z=>({label:z.name,value:z.id})).toArray(),{pathname:T}=(0,Ee.Z)(),w=(0,he.Z)(),Z=z=>{w(de.A.AUTHENTICATION.DIRECTORY_USER_SYNC_SAVE_CLICKED,{app_pathname:(0,ue.av)(T),app_section:"directory-service",app_action_value:"usersync-save"}),z().then($=>{(0,H.Sy)($)||c()})},K=z=>({...z,...!s.emailAttributes&&{emailAttributes:z.emailAttributes||[]}});return e.createElement(ee.Formik,{initialValues:K(S.formValues),initialErrors:C,innerRef:l,onSubmit:i,validateOnBlur:!1,validateOnChange:!1,validateOnMount:E},({isSubmitting:z,validateForm:$})=>e.createElement(ee.Form,{className:"form form-horizontal"},e.createElement(n.Fe,{help:t.userSearchBase,label:"Search Base DN",error:C==null?void 0:C.userSearchBase,name:"userSearchBase",placeholder:"Search Base DN",validate:(0,H.OP)(se.userSearchBase)}),e.createElement(n.Fe,{help:t.userSearchPattern,label:"Search Pattern",name:"userSearchPattern",error:C==null?void 0:C.userSearchPattern,placeholder:"Search Pattern",validate:(0,H.OP)(se.userSearchPattern)}),e.createElement(n.Fe,{help:t.userNameAttribute,label:"Name Attribute",name:"userNameAttribute",error:C==null?void 0:C.userNameAttribute,placeholder:"Name Attribute",validate:(0,H.OP)(se.userNameAttribute)}),!s.emailAttributes&&e.createElement(ee.Field,{name:"emailAttributes",validate:(0,H.OP)(se.emailAttributes)},({field:{name:J,value:G,onChange:V},meta:{error:j}})=>e.createElement(I.Input,{bsStyle:j?"error":void 0,help:t.emailAttributes,error:j!=null?j:C==null?void 0:C.emailAttributes,id:"email-attributes-input",label:"Email Attributes",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"},e.createElement(Xe,{id:"userEmailAttributes",placeholder:"Email Attributes",name:J,values:G,isClearable:!0,onChange:V}))),e.createElement(n.Fe,{help:t.userFullNameAttribute,label:"Full Name Attribute",name:"userFullNameAttribute",placeholder:"Full Name Attribute",error:C==null?void 0:C.userFullNameAttribute,validate:(0,H.OP)(se.userFullNameAttribute)}),!s.userUniqueIdAttribute&&e.createElement(n.Fe,{help:t.userUniqueIdAttribute,label:"ID Attribute",name:"userUniqueIdAttribute",placeholder:"ID Attribute",error:C==null?void 0:C.userUniqueIdAttribute,validate:(0,H.OP)(se.userUniqueIdAttribute)}),e.createElement(I.Row,null,e.createElement(I.Col,{sm:9,smOffset:3},e.createElement(I.Panel,{bsStyle:"info"},"Changing the static role assignment will only affect new users created via ",S.authBackendMeta.serviceTitle,"! Existing user accounts will be updated on their next login, or if you edit their roles manually."))),e.createElement(ee.Field,{name:"defaultRoles",validate:(0,H.OP)(se.defaultRoles)},({field:{name:J,value:G,onChange:V,onBlur:j},meta:{error:X}})=>e.createElement(I.Input,{bsStyle:X?"error":void 0,help:t.defaultRoles,error:X!=null?X:C==null?void 0:C.defaultRoles,id:"default-roles-select",label:"Default Roles",labelClassName:"col-sm-3",wrapperClassName:"col-sm-9"},e.createElement(n.Ph,{inputProps:{"aria-label":"Search for roles"},multi:!0,onBlur:j,onChange:pe=>V({target:{value:pe,name:J}}),options:k,placeholder:"Search for roles",value:G}))),e.createElement(I.Row,null,e.createElement(I.Col,{sm:9,smOffset:3},e.createElement(I.Alert,{bsStyle:"info"},"We recommend you test your user login in the sidebar panel to verify your settings."))),h,e.createElement(I.ButtonToolbar,{className:"pull-right"},e.createElement(I.Button,{disabled:z,onClick:()=>Z($),type:"button"},"Finish & Save Identity Service"),e.createElement(I.Button,{bsStyle:"success",disabled:z,onClick:()=>{w(de.A.AUTHENTICATION.DIRECTORY_NEXT_GROUP_SYNC_CLICKED,{app_pathname:(0,ue.av)(T),app_section:"directory-service",app_action_value:"groupsync-button"})},type:"submit"},"Next: Group Synchronization"))))},ne="group-synchronization",et=({onSubmitAll:t,prepareSubmitPayload:s,formRef:l,submitAllError:i,validateOnMount:c,roles:h,help:E,excludedFields:y})=>{var d;const{pathname:S}=(0,Ee.Z)(),C=(0,he.Z)(),k=(0,p.z$)(),T=(d=k==null?void 0:k.components)==null?void 0:d.GroupSyncForm;return T?e.createElement(T,{formRef:l,help:E,excludedFields:y,onSubmitAll:t,prepareSubmitPayload:s,roles:h,submitAllError:i,validateOnMount:c}):e.createElement(e.Fragment,null,e.createElement(I.Row,null,e.createElement(I.Col,{xs:12},e.createElement(n.VL,{featureName:"group synchronization"}))),e.createElement(I.ButtonToolbar,{className:"pull-right"},e.createElement(I.Button,{bsStyle:"primary",onClick:()=>{C(de.A.AUTHENTICATION.DIRECTORY_GROUP_SYNC_SAVE_CLICKED,{app_pathname:(0,ue.av)(S),app_section:"directory-service",app_action_value:"groupsync-save"}),t(!1)}},"Finish & Save Service")))},ge=({invalidStepKeys:t=[],stepKey:s})=>t.includes(s)?e.createElement(e.Fragment,null,e.createElement(n.JO,{name:"exclamation-triangle"})," "):null,tt=({formRefs:t,handleSubmitAll:s,help:l,excludedFields:i,invalidStepKeys:c,prepareSubmitPayload:h,roles:E,setActiveStepKey:y,submitAllError:d})=>[{key:q,title:e.createElement(e.Fragment,null,e.createElement(ge,{invalidStepKeys:c,stepKey:q}),"Server Configuration"),component:e.createElement(Qe,{formRef:t[q],help:l,onSubmit:()=>y(te),onSubmitAll:s,submitAllError:d,validateOnMount:c.includes(q)})},{key:te,title:e.createElement(e.Fragment,null,e.createElement(ge,{invalidStepKeys:c,stepKey:te}),"User Synchronization"),component:e.createElement(qe,{formRef:t[te],help:l,excludedFields:i,onSubmit:()=>y(ne),onSubmitAll:s,roles:E,submitAllError:d,validateOnMount:c.includes(te)})},{key:ne,title:e.createElement(e.Fragment,null,e.createElement(ge,{invalidStepKeys:c,stepKey:ne}),"Group Synchronization (Opt.)"),component:e.createElement(et,{formRef:t[ne],help:l,excludedFields:i,onSubmitAll:s,prepareSubmitPayload:h,roles:E,submitAllError:d,validateOnMount:c.includes(ne)})}];var _e=r("kbpndUm2");const fe=(0,le.default)(I.Alert)`
margin-top: 10px;
word-break: break-word;
`,Ft=le.default.div`
font-weight: bold;
margin-bottom: 5px;
`,nt=le.default.ul(({theme:t})=>`
font-family: ${t.fonts.family.monospace};
list-style: initial;
padding-left: 20px;
`),ye=({errors:t,message:s})=>e.createElement(fe,{bsStyle:"danger",title:s},e.createElement(nt,null,t.map(l=>e.createElement("li",{key:String(l)},String(l)))));ye.propTypes={errors:Q().arrayOf(Q().string).isRequired,message:Q().string},ye.defaultProps={message:"There was an error"};const De=ye,rt=t=>{const s={...t};return s.config.user_search_base||(s.config.user_search_base=""),s.config.user_search_pattern||(s.config.user_search_pattern=""),s},at=({prepareSubmitPayload:t})=>{const{authBackendMeta:s}=(0,e.useContext)(ce),[{loading:l,success:i,message:c,errors:h},E]=(0,e.useState)({loading:!1,success:!1,message:void 0,errors:void 0}),y=()=>{const d=rt(t(void 0));E({loading:!0,message:void 0,errors:void 0,success:!1}),_e.Z.testConnection({backend_configuration:d,backend_id:s.backendId}).then(S=>{E({loading:!1,message:S==null?void 0:S.message,success:S==null?void 0:S.success,errors:S==null?void 0:S.errors})}).catch(S=>{var C,k;const T=[S==null?void 0:S.message,(k=(C=S==null?void 0:S.additional)==null?void 0:C.res)==null?void 0:k.text];E({loading:!1,message:void 0,errors:T,success:!1})})};return e.createElement(e.Fragment,null,e.createElement("p",null,'Performs a background connection check with the address and credentials defined in the step "Server Configuration".'),e.createElement(I.Button,{onClick:y,type:"button"},l?e.createElement(n.$j,{delay:0,text:"Test Server Connection"}):"Test Server Connection"),i&&e.createElement(fe,{bsStyle:"success"},e.createElement("b",null,c)),h&&h.length>=1&&e.createElement(De,{errors:h,message:c}))},st=({prepareSubmitPayload:t})=>{const{authBackendMeta:s}=(0,e.useContext)(ce),l={loading:!1,success:!1,testFinished:!1,result:void 0,message:void 0,errors:[]},[{loading:i,testFinished:c,success:h,message:E,errors:y,result:d},S]=(0,e.useState)(l),C=y&&y.length>=1,k=({username:T,password:w})=>(S({...l,loading:!0}),_e.Z.testLogin({backend_configuration:t(void 0),user_login:{username:T,password:w},backend_id:s.backendId}).then(Z=>{S({loading:!1,testFinished:!0,message:Z.message,result:Z.result,errors:Z.errors,success:Z.success})}).catch(Z=>{var K,z;const $=[Z==null?void 0:Z.message,(z=(K=Z==null?void 0:Z.additional)==null?void 0:K.res)==null?void 0:z.text];S({loading:!1,success:!1,testFinished:!0,result:void 0,message:void 0,errors:$})}));return e.createElement(e.Fragment,null,e.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."),e.createElement(ee.Formik,{onSubmit:k,initialValues:{password:"",username:""}},e.createElement(ee.Form,{className:"form"},e.createElement(I.Row,{className:"no-bm"},e.createElement(I.Col,{sm:6},e.createElement(n.jc,{label:"Username",name:"username",id:"user-login-username",required:!0})),e.createElement(I.Col,{sm:6},e.createElement(n.jc,{label:"Password",name:"password",type:"password",id:"user-login-password",required:!0}))),e.createElement(I.Button,{type:"submit"},i?e.createElement(n.$j,{delay:0,text:"Test User Login"}):"Test User Login"),!C&&c&&e.createElement(fe,{bsStyle:h?"success":"danger"},e.createElement("b",null,!(d!=null&&d.user_exists)&&"User does not exist",(d==null?void 0:d.user_exists)&&e.createElement(e.Fragment,null,d!=null&&d.login_success?E:"Login failed")),(d==null?void 0:d.user_exists)&&(d==null?void 0:d.user_details)&&e.createElement("div",null,e.createElement("br",null),e.createElement("table",{className:"table"},e.createElement("thead",null,e.createElement("tr",null,e.createElement("th",null,"User Attribute"),e.createElement("th",null,"Value"))),e.createElement("tbody",null,Object.entries(d==null?void 0:d.user_details).map(([T,w])=>e.createElement("tr",{key:T},e.createElement("td",null,String(T)),e.createElement("td",null,String(w)))))))),C&&e.createElement(De,{errors:y,message:E}))))},ot=(0,le.default)(I.PanelGroup)`
&.panel-group .panel {
margin-top: 0;
border-color: ${t=>t.theme.colors.input.border};
background-color: ${t=>t.theme.colors.global.contentBackground};
.panel-heading {
background-color: ${t=>t.theme.colors.table.backgroundAlt};
}
&: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;
}
}
`,lt=({prepareSubmitPayload:t})=>{const[s,l]=(0,e.useState)(q),{setStepsState:i,...c}=(0,e.useContext)(ce);return(0,e.useEffect)(()=>{l(c.activeStepKey)},[c.activeStepKey]),e.createElement(ot,{accordion:!0,activeKey:s,id:"sidebar-server-response",onSelect:l},e.createElement(I.Panel,{eventKey:q},e.createElement(I.Panel.Heading,null,e.createElement(I.Panel.Title,{toggle:!0},"Server Connection Check")),e.createElement(I.Panel.Body,{collapsible:!0},e.createElement(at,{prepareSubmitPayload:t}))),e.createElement(I.Panel,{eventKey:te},e.createElement(I.Panel.Heading,null,e.createElement(I.Panel.Title,{toggle:!0},"User Login Test")),e.createElement(I.Panel.Body,{collapsible:!0},e.createElement(st,{prepareSubmitPayload:t}))))},it={[q]:me,[te]:se},ct=({error:t,backendId:s})=>{var l,i;return e.createElement(I.Row,null,e.createElement(I.Col,{xs:9,xsOffset:3},e.createElement(I.Alert,{bsStyle:"danger",style:{wordBreak:"break-word"},title:`Failed to ${s?"edit":"create"} authentication service`},(t==null?void 0:t.message)&&e.createElement(e.Fragment,null,t.message,e.createElement("br",null),e.createElement("br",null)),(i=(l=t==null?void 0:t.additional)==null?void 0:l.res)==null?void 0:i.text)))},ut=t=>{const s=xe()(t,l=>`Server validation error: ${l.join(" ")}`);return W()(s,(l,i)=>N()(i))},dt=(t,s)=>{const l=i=>{if(i)return i};return t?s===void 0?{keep_value:!0}:s===""?{delete_value:!0}:{set_value:l(s)}:l(s)},mt=(t,s)=>l=>{const i=l!=null?l:s(),{defaultRoles:c="",description:h,serverHost:E,serverPort:y,systemUserDn:d,systemUserPassword:S,title:C,transportSecurity:k,userUniqueIdAttribute:T,userFullNameAttribute:w,userNameAttribute:Z,emailAttributes:K,userSearchBase:z,userSearchPattern:$,verifyCertificates:J}=i,{serviceType:G,backendId:V}=t.authBackendMeta;return{title:C,description:h,default_roles:c.split(","),config:{servers:[{host:E,port:y}],system_user_dn:d,system_user_password:dt(V,S),transport_security:k,type:G,email_attributes:K,user_full_name_attribute:w,user_name_attribute:Z,user_search_base:z,user_search_pattern:$,user_unique_id_attribute:T,verify_certificates:J}}},Oe=(t,s,l)=>{const i={...it,[ne]:{}},c=(0,p.z$)(),h=c==null?void 0:c.validation.GroupSyncValidation;h&&t.synchronizeGroups&&(i[ne]=h(t.teamSelectionType));const E=Object.entries(i).map(([y,d])=>Object.entries(d).some(([C,k])=>l[C]?!1:s!=null&&s[C]?!0:!!(0,H.OP)(k)(t==null?void 0:t[C]))?y:void 0);return u()(E)},vt=(t,s,l,i,c,h,E,y)=>{const d=i();if(h(d,{}).length>=1)return Promise.resolve();s(null);const C=c(d),k=()=>l(C,d,t.authBackendMeta.serviceType,E).then(()=>{y.push(Ue.ZP.SYSTEM.AUTHENTICATION.BACKENDS.OVERVIEW)}).catch(T=>{var w,Z;if(typeof((Z=(w=T==null?void 0:T.additional)==null?void 0:w.body)==null?void 0:Z.errors)=="object"){const K=ut(T.additional.body.errors);h(d,K)}else s(T)});return t.authBackendMeta.backendGroupSyncIsActive&&!d.synchronizeGroups?window.confirm("Do you really want to remove the group synchronization config for this authentication service?")?k():Promise.resolve():k()},pt=(t,s,l)=>{var i;const c=(i=t==null?void 0:t.find(h=>h.name==="Reader"))==null?void 0:i.id;c&&l({...s,formValues:{...s.formValues,defaultRoles:c}})},ht=t=>{const s={page:1,perPage:0,query:""};Ge.Z.loadRolesPaginated(s).then(t)},Se=({initialValues:t,initialStepKey:s,onSubmit:l,authBackendMeta:i,help:c,excludedFields:h})=>{const E=(0,p.z$)(),y=E==null?void 0:E.components.MatchingGroupsProvider,[d,S]=(0,e.useState)(),[C,k]=(0,e.useState)(),[T,w]=(0,e.useState)({activeStepKey:s,authBackendMeta:i,backendValidationErrors:void 0,formValues:t,invalidStepKeys:[]}),Z=(0,$e.Z)(),K={[q]:(0,e.useRef)(null),[te]:(0,e.useRef)(null),[ne]:(0,e.useRef)(null)},z=(0,e.useMemo)(()=>({...T,setStepsState:w}),[T,w]);if((0,e.useEffect)(()=>ht(S),[]),(0,e.useEffect)(()=>{d&&!i.backendId&&!T.formValues.defaultRoles&&pt(d.list,T,w)},[d,i.backendId,T,w]),!d)return e.createElement(n.$j,null);const $=()=>{var re;const oe=(re=K[T.activeStepKey])==null?void 0:re.current;return{...T.formValues,...oe==null?void 0:oe.values}},J=(re,oe)=>{const ae=Oe(re,oe,h);if(ae.length>=1){const Dt=ae.includes(T.activeStepKey)?T.activeStepKey:ae[0];w({...T,backendValidationErrors:oe,activeStepKey:Dt,formValues:re,invalidStepKeys:ae})}return ae},G=mt(T,$),V=re=>{const oe=$();let ae=[...T.invalidStepKeys];ae.length>=1&&(ae=Oe(oe,T.backendValidationErrors,h)),w({...T,invalidStepKeys:ae,formValues:oe,activeStepKey:re})},X=tt({formRefs:K,help:c,handleSubmitAll:re=>vt(T,k,l,$,G,J,re,Z),invalidStepKeys:T.invalidStepKeys,prepareSubmitPayload:G,excludedFields:h,roles:d.list,setActiveStepKey:V,submitAllError:C&&e.createElement(ct,{error:C,backendId:i.backendId})}),pe=e.createElement(We.Z,{activeStep:T.activeStepKey,hidePreviousNextButtons:!0,horizontal:!0,justified:!0,onStepChange:V,steps:X},e.createElement(lt,{prepareSubmitPayload:G}));return e.createElement(ce.Provider,{value:z},y?e.createElement(y,{prepareSubmitPayload:G},pe):pe)};Se.defaultProps={initialStepKey:q,help:void 0,excludedFields:{}},Se.propTypes={authBackendMeta:Q().shape({backendHasPassword:Q().bool,backendId:Q().string,serviceTitle:Q().string.isRequired,serviceType:Q().string.isRequired}).isRequired,help:Q().object,initialStepKey:Q().string,initialValues:Q().object.isRequired,excludedFields:Q().object};const ve=Se,Ae={serviceType:"ldap",serviceTitle:"LDAP"},Ne={systemUserDn:e.createElement("span",null,"The username for the initial connection to the LDAP server, e.g. ",e.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:e.createElement("span",null,"The base tree to limit the LDAP search query to, e.g. ",e.createElement("code",null,"cn=users,dc=example,dc=com"),"."),userSearchPattern:e.createElement("span",null,"For example ",e.createElement("code",{className:"text-nowrap"},"(&(uid={0})(objectClass=inetOrgPerson))"),"."," ","The string ",e.createElement("code",null,"{0}")," will be replaced by the entered username."),userNameAttribute:e.createElement("span",null,"Which LDAP attribute to use for the username of the user in Graylog, e.g ",e.createElement("code",null,"uid"),".",e.createElement("br",null),"Try to load a test user in the sidebar section ",e.createElement("i",null,"User Login Test"),", if you are unsure which attribute to use."),userFullNameAttribute:e.createElement("span",null,"Which LDAP attribute to use for the full name of a synchronized Graylog user, e.g. ",e.createElement("code",null,"cn"),".",e.createElement("br",null)),userUniqueIdAttribute:e.createElement("span",null,"Which LDAP attribute to use for the ID of a synchronized Graylog user, e.g. ",e.createElement("code",null,"entryUUID"),".",e.createElement("br",null)),defaultRoles:e.createElement("span",null,"The default Graylog roles synchronized user will obtain. All users need the ",e.createElement("code",null,"Reader")," role, to use the Graylog web interface"),emailAttributes:e.createElement("span",null,"Which LDAP attribute to use for the user's email address, e.g. ",e.createElement("code",null,"mail"),".",e.createElement("br",null),"You can specify multiple attributes, type ",e.createElement("kbd",null,"Tab")," or ",e.createElement("kbd",null,"Enter")," to accept your value.")},Et={title:Ae.serviceTitle,serverHost:"localhost",serverPort:636,transportSecurity:"tls",userFullNameAttribute:"cn",emailAttributes:["mail","rfc822Mailbox"],userNameAttribute:"uid",userUniqueIdAttribute:"entryUUID",verifyCertificates:!0},gt=()=>{var t,s;const l=(0,p.z$)(),{help:i={},initialValues:c={}}=(s=(t=l==null?void 0:l.wizardConfig)==null?void 0:t.ldap)!=null?s:{},h={...Ne,...i},E={...Et,...c};return e.createElement(n.$4,{title:"Create LDAP Authentication Service"},e.createElement(m,null),e.createElement(ve,{onSubmit:o,help:h,authBackendMeta:Ae,initialValues:E}))};var Ie=r("VPaD/Np4");const Be=({title:t,description:s,defaultRoles:l=Ie.List(),config:{servers:i=[],systemUserDn:c,transportSecurity:h,emailAttributes:E,userFullNameAttribute:y,userNameAttribute:d,userSearchBase:S,userSearchPattern:C,userUniqueIdAttribute:k,verifyCertificates:T}})=>({title:t,description:s,defaultRoles:l.join(),serverHost:i[0].host,serverPort:i[0].port,systemUserDn:c,transportSecurity:h,userFullNameAttribute:y,emailAttributes:E,userNameAttribute:d,userSearchBase:S,userSearchPattern:C,userUniqueIdAttribute:k,verifyCertificates:T}),Le=(t,s,l,i,c,h=!0)=>{const E=(0,p.z$)(),y=()=>B.Z.success("Authentication service was updated successfully.","Success"),d=S=>B.Z.error(`Updating authentication service failed with status: ${S}`,"Error");return b.K.update(l,{...t,id:l}).then(S=>E&&h?E.actions.onDirectoryServiceBackendUpdate(i,s,l,c).then(y):(y(),S)).catch(S=>{throw d(S),S})},ft=t=>({initialStepKey:t}),yt=({authenticationBackend:t,initialStepKey:s})=>{var l,i;const c=(0,p.z$)(),{help:h={},initialValues:E={}}=(i=(l=c==null?void 0:c.wizardConfig)==null?void 0:l.ldap)!=null?i:{},y={...Ne,...h};let d=Be(t);if(c){const{formValues:k,finishedLoading:T}=c.hooks.useInitialGroupSyncValues(t.id,E);if(!T)return e.createElement(n.$j,null);d={...d,...k}}const S={...Ae,backendId:t.id,backendHasPassword:t.config.systemUserPassword.isSet,backendGroupSyncIsActive:!!d.synchronizeGroups},C=(k,T,w,Z)=>Le(k,T,t.id,!!d.synchronizeGroups,w,Z);return e.createElement(n.$4,{title:"Edit LDAP Authentication Service"},e.createElement(m,{authenticationBackend:t}),e.createElement(ve,{...ft(s),help:y,authBackendMeta:S,initialValues:d,onSubmit:C}))};var be=r("QBkUz07U"),St=r("ty2gyrHp");const Pe=({authenticationBackendId:t,stepKey:s})=>e.createElement(St.J,{to:Ue.ZP.SYSTEM.AUTHENTICATION.BACKENDS.edit(t,s)},e.createElement(I.Button,{bsStyle:"success",bsSize:"small"},"Edit")),Fe=({authenticationBackend:t})=>{const{title:s,description:l,config:{servers:i=[],systemUserDn:c,systemUserPassword:h,transportSecurity:E,verifyCertificates:y}}=t,d=i.map(S=>`${S.host}:${S.port}`).join(", ");return e.createElement(be.Z,{title:"Server Configuration",headerActions:e.createElement(Pe,{authenticationBackendId:t.id,stepKey:q})},e.createElement(n.mv,{label:"Title",value:s}),e.createElement(n.mv,{label:"Description",value:l}),e.createElement(n.mv,{label:"Server Address",value:d}),e.createElement(n.mv,{label:"System Username",value:c}),e.createElement(n.mv,{label:"System Password",value:h!=null&&h.isSet?"******":null}),e.createElement(n.mv,{label:"Transport Security",value:E}),e.createElement(n.mv,{label:"Verify Certificates",value:y}))},At=(t,s)=>t.map(i=>{var c,h;return(h=(c=s.find(E=>E.id===i))==null?void 0:c.name)!=null?h:"Role not found"}).join(", "),Ce=({authenticationBackend:t,roles:s,excludedFields:l})=>{const{userSearchBase:i,userSearchPattern:c,userNameAttribute:h,userFullNameAttribute:E,userUniqueIdAttribute:y,emailAttributes:d}=t.config,{defaultRoles:S=Ie.List()}=t;return e.createElement(be.Z,{title:"User Synchronization",headerActions:e.createElement(Pe,{authenticationBackendId:t.id,stepKey:te})},e.createElement(n.mv,{label:"Search Base DN",value:i}),e.createElement(n.mv,{label:"Search Pattern",value:c}),e.createElement(n.mv,{label:"Name Attribute",value:h}),e.createElement(n.mv,{label:"Full Name Attribute",value:E}),!l.emailAttributes&&e.createElement(n.mv,{label:"Email Attribute",value:d.join(",")}),!l.userUniqueIdAttribute&&e.createElement(n.mv,{label:"ID Attribute",value:y}),e.createElement(n.mv,{label:"Default Roles",value:At(S,s)}))};Ce.defaultProps={excludedFields:{}},Ce.propTypes={excludedFields:Re.object};const ke=Ce,Ze=({authenticationBackend:t,roles:s,excludedFields:l})=>{const i=(0,p.z$)(),c=i==null?void 0:i.components.GroupSyncSection;return c?e.createElement(c,{authenticationBackend:t,excludedFields:l,roles:s}):e.createElement(be.Z,{title:"Group Synchronization",headerActions:e.createElement(Pe,{authenticationBackendId:t.id,stepKey:ne})},e.createElement(n.VL,{featureName:"group synchronization"}))};Ze.defaultProps={excludedFields:void 0};const ze=Ze,bt=({authenticationBackend:t,roles:s})=>{var l,i;const c=(0,p.z$)(),{excludedFields:h={}}=(i=(l=c==null?void 0:c.wizardConfig)==null?void 0:l.activeDirectory)!=null?i:{},E={...h,userUniqueIdAttribute:!0,emailAttributes:!0};return e.createElement(e.Fragment,null,e.createElement(Fe,{authenticationBackend:t}),e.createElement(ke,{authenticationBackend:t,roles:s,excludedFields:E}),e.createElement(ze,{authenticationBackend:t,roles:s,excludedFields:E}))},Pt=({authenticationBackend:t,roles:s})=>{var l,i;const c=(0,p.z$)(),{excludedFields:h={}}=(i=(l=c==null?void 0:c.wizardConfig)==null?void 0:l.ldap)!=null?i:{},E={...h};return e.createElement(e.Fragment,null,e.createElement(Fe,{authenticationBackend:t}),e.createElement(ke,{authenticationBackend:t,roles:s,excludedFields:E}),e.createElement(ze,{authenticationBackend:t,roles:s,excludedFields:E}))},Ct=t=>{if(t){const s=U.Z.truncateWithEllipses(t.title,30);return e.createElement(e.Fragment,null,"Edit Authentication Service - ",e.createElement("i",null,s))}return"Create Active Directory Authentication Service"},we=({authenticationBackend:t})=>{const{finishedLoading:s,activeBackend:l}=(0,A.Z)(),i=Ct(t);return e.createElement(e.Fragment,null,e.createElement(R.Z,null),e.createElement(n.mr,{title:i,actions:e.createElement(f.Z,{activeBackend:l,finishedLoading:s}),documentationLink:{title:"Authentication documentation",path:D.Z.PAGES.USERS_ROLES}},e.createElement("span",null,"Configure Graylog's authentication services of this Graylog cluster.")))};we.defaultProps={authenticationBackend:void 0};const Me=we,Ke={systemUserDn:e.createElement("span",null,"The username for the initial connection to the Active Directory server, e.g. ",e.createElement("code",null,"[email protected]"),".",e.createElement("br",null),"This needs to match the ",e.createElement("code",null,"userPrincipalName")," of that user."),systemUserPassword:"The password for the initial connection to the Active Directory server.",userSearchBase:e.createElement("span",null,"The base tree to limit the Active Directory search query to, e.g. ",e.createElement("code",null,"cn=users,dc=example,dc=com"),"."),userSearchPattern:e.createElement("span",null,"For example ",e.createElement("code",{className:"text-nowrap"},"(&(objectClass=user)(|(sAMAccountName={0})(userPrincipalName={0})))"),"."," ","The string ",e.createElement("code",null,"{0}")," will be replaced by the entered username."),userNameAttribute:e.createElement("span",null,"Which Active Directory attribute to use for the full name of the user in Graylog, e.g. ",e.createElement("code",null,"userPrincipalName"),".",e.createElement("br",null),"Try to load a test user in the sidebar section ",e.createElement("i",null,"User Login Test"),", if you are unsure which attribute to use."),userFullNameAttribute:e.createElement("span",null,"Which Active Directory attribute to use for the full name of a synchronized Graylog user, e.g. ",e.createElement("code",null,"displayName"),".",e.createElement("br",null)),defaultRoles:e.createElement("span",null,"The default Graylog roles synchronized user will obtain. All users need the ",e.createElement("code",null,"Reader")," role, to use the Graylog web interface")},Te={serviceTitle:"Active Directory",serviceType:"active-directory"},Tt={title:Te.serviceTitle,serverHost:"localhost",serverPort:636,transportSecurity:"tls",userSearchPattern:"(&(objectClass=user)(|(sAMAccountName={0})(userPrincipalName={0})))",userFullNameAttribute:"displayName",userNameAttribute:"userPrincipalName",verifyCertificates:!0},Rt=()=>{var t,s;const l=(0,p.z$)(),{help:i={},excludedFields:c={},initialValues:h}=(s=(t=l==null?void 0:l.wizardConfig)==null?void 0:t.activeDirectory)!=null?s:{},E={...Ke,...i},y={...Tt,...h},d={...c,userUniqueIdAttribute:!0,emailAttributes:!0};return e.createElement(n.$4,{title:"Create Active Directory Authentication Services"},e.createElement(Me,null),e.createElement(ve,{authBackendMeta:Te,help:E,excludedFields:d,initialValues:y,onSubmit:o}))},Ut=t=>({initialStepKey:t}),_t=({authenticationBackend:t,initialStepKey:s})=>{var l,i;const c=(0,p.z$)(),{help:h={},excludedFields:E={},initialValues:y={}}=(i=(l=c==null?void 0:c.wizardConfig)==null?void 0:l.activeDirectory)!=null?i:{},d={...Ke,...h},S={...E,userUniqueIdAttribute:!0,emailAttributes:!0};let C=Be(t);if(c){const{formValues:w,finishedLoading:Z}=c.hooks.useInitialGroupSyncValues(t.id,y);if(!Z)return e.createElement(n.$j,null);C={...C,...w}}const k={...Te,backendId:t.id,backendHasPassword:t.config.systemUserPassword.isSet,backendGroupSyncIsActive:!!C.synchronizeGroups},T=(w,Z,K,z)=>Le(w,Z,t.id,!!C.synchronizeGroups,K,z);return e.createElement(n.$4,{title:"Edit Active Directory Authentication Service"},e.createElement(Me,{authenticationBackend:t}),e.createElement(ve,{...Ut(s),authBackendMeta:k,excludedFields:S,help:d,initialValues:C,onSubmit:T}))};v.G.register(new v.h({},{"authentication.services":[{name:"ldap",displayName:"LDAP",createComponent:gt,editComponent:yt,configDetailsComponent:Pt,configToJson:g.toJson,configFromJson:g.fromJson},{name:"active-directory",displayName:"Active Directory",createComponent:Rt,editComponent:_t,configDetailsComponent:bt,configToJson:g.toJson,configFromJson:g.fromJson}]}))},WPUkC7Fx:(Y,x,r)=>{"use strict";r.d(x,{Z:()=>g});var v=r("Z7aTuO5B"),_=r("kbpndUm2");const g=(e=[])=>{var n;const[p,R]=(0,v.useState)(),[D,U]=(0,v.useState)(!1),A=()=>_.Z.loadActive().then(f=>{U(!0),R(f)});return(0,v.useEffect)(()=>{A()},[]),(0,v.useEffect)(()=>{const f=e.map(O=>O.completed.listen(A));return()=>{f.forEach(O=>O())}},[e]),{finishedLoading:D,activeBackend:p==null?void 0:p.backend,backendsTotal:(n=p==null?void 0:p.context)==null?void 0:n.backendsTotal}}},SfPIQIJE:(Y,x,r)=>{"use strict";r.d(x,{Z:()=>U});var v=r("Z7aTuO5B"),_=r("J6y4/h8P"),F=r("uZqmR+ju"),g=r("ty2gyrHp"),e=r("/GOzvPf6"),n=r("NV1/EHMi");const p=(0,_.default)(F.ButtonToolbar)`
margin-bottom: 10px;
`,R=(0,_.default)(F.Button)(({theme:A})=>(0,_.css)`
font-family: ${A.fonts.family.navigation};
font-size: ${A.fonts.size.navigation};
&&&& {
color: ${A.colors.variant.darker.default};
&:hover,
&:focus {
text-decoration: none;
}
> div {
&:hover,
&:focus {
color: ${A.colors.variant.darker.default};
}
}
&:hover {
${(0,n.RF)(A)}
}
&.active {
color: ${A.colors.global.textDefault};
${(0,n.A7)(A)}
&:hover,
&:focus {
${(0,n.A7)(A)}
}
}
}
`);R.displayName="Button";const U=({items:A})=>v.createElement(p,null,A.map(({path:f,title:O,permissions:M,exactPathMatch:m})=>f?v.createElement(e.AE,{permissions:M!=null?M:[],key:f},v.createElement(g.J,{to:f,relativeActive:!m},v.createElement(R,{bsStyle:"link"},v.createElement(n.ZP,null,O)))):null))},kbpndUm2:(Y,x,r)=>{"use strict";r.d(x,{Z:()=>M});var v=r("vtWR08zs"),_=r("lDGobrly");const F=(0,_.Z)({action:v.K.create,success:m=>({message:`Authentication service "${m.title} was created successfully`}),error:(m,B)=>({message:`Creating authentication service "${B.title}" failed with status: ${m}`})}),g=(0,_.Z)({action:v.K.load,error:(m,B)=>({message:`Loading authentication service with id "${B}" failed with status: ${m}`}),notFoundRedirect:!0}),e=(0,_.Z)({action:v.K.loadActive,error:m=>({message:`Loading active authentication service failed with status: ${m}`})}),n=(0,_.Z)({action:v.K.update,success:(m,B)=>({message:`Authentication service "${B.title}" was updated successfully`}),error:(m,B,b)=>({message:`Updating authentication service "${b.title}" failed with status: ${m}`})}),p=(0,_.Z)({action:v.K.delete,success:(m,B)=>({message:`Authentication service "${B} was deleted successfully`}),error:(m,B,b)=>({message:`Deleting authentication service "${b}" failed with status: ${m}`})}),R=(0,_.Z)({action:v.K.testConnection,error:m=>({message:`Connection test failed with status: ${m}`})}),D=(0,_.Z)({action:v.K.testLogin,error:m=>({message:`Login test failed with status: ${m}`})}),U=(0,_.Z)({action:v.K.setActiveBackend,success:(m,B)=>({message:`Authentication service "${B} was ${m?"activated":"deactivated"} successfully`}),error:(m,B,b)=>({message:`Activating authentication service "${b}" failed with status: ${m}`})}),A=(0,_.Z)({action:v.K.loadBackendsPaginated,error:m=>({message:`Loading authentication services failed with status: ${m}`})}),f=(0,_.Z)({action:v.K.loadUsersPaginated,error:(m,B)=>({message:`Loading synchronized users for authentication service with id "${m}" failed with status: ${B}`})}),O=(0,_.Z)({action:v.K.loadActiveBackendType,error:m=>({message:`Loading active authentication service type failed with status: ${m}`})}),M={create:F,update:n,load:g,loadActive:e,delete:p,testConnection:R,testLogin:D,setActiveBackend:U,loadBackendsPaginated:A,loadUsersPaginated:f,loadActiveBackendType:O}},Lu0NTOJv:(Y,x,r)=>{"use strict";r.d(x,{Z:()=>U});var v=r("KOKBnITH"),_=r("lDGobrly");const F=(0,_.Z)({action:v.p.load,error:(A,f)=>({message:`Loading role with id "${f}" failed with status: ${A}`}),notFoundRedirect:!0}),g=(0,_.Z)({action:v.p.delete,success:(A,f)=>({message:`Role "${f}" was deleted successfully`}),error:(A,f,O)=>({message:`Deleting role "${O}" failed with status: ${A}`})}),e=(0,_.Z)({action:v.p.addMembers,success:(A,f)=>({message:`Users:"${f.join(", ")}" were assigned successfully`}),error:(A,f,O)=>({message:`Assigning users "${O.join(", ")}" failed with status: ${A}`})}),n=(0,_.Z)({action:v.p.removeMember,success:(A,f)=>({message:`User "${f}" was unassigned successfully`}),error:(A,f,O)=>({message:`Unassign user "${O}" failed with status: ${A}`})}),p=(0,_.Z)({action:v.p.loadUsersForRole,error:(A,f,O)=>({message:`Loading users for role "${O}" failed with status: ${A}`})}),R=(0,_.Z)({action:v.p.loadRolesForUser,error:(A,f)=>({message:`Loading roles for user "${f}" failed with status: ${A}`})}),D=(0,_.Z)({action:v.p.loadRolesPaginated,error:A=>({message:`Loading roles failed with status: ${A}`})}),U={load:F,delete:g,addMembers:e,removeMember:n,loadUsersForRole:p,loadRolesForUser:R,loadRolesPaginated:D}},"nmSm+aR9":(Y,x,r)=>{"use strict";r.d(x,{Z:()=>F});var v=r("VPaD/Np4"),_=r.n(v);class F{constructor(n,p,R,D,U,A,f,O,M,m,B,b,o,a,u){this._value={id:n,username:p,fullName:R,email:D,roles:U,readOnly:A,external:f,sessionActive:O,clientAddress:M,lastActivity:m,enabled:B,authServiceId:b,authServiceUid:o,authServiceEnabled:a,accountStatus:u}}get id(){return this._value.id}get username(){return this._value.username}get name(){return this._value.username}get fullName(){return this._value.fullName}get description(){return this._value.fullName}get email(){return this._value.email}get roles(){return this._value.roles}get readOnly(){return this._value.readOnly}get external(){return this._value.external}get sessionActive(){return this._value.sessionActive}get clientAddress(){return this._value.clientAddress}get lastActivity(){return this._value.lastActivity}get enabled(){return this._value.enabled}get authServiceId(){return this._value.authServiceId}get authServiceUid(){return this._value.authServiceUid}get authServiceEnabled(){return this._value.authServiceEnabled}get accountStatus(){return this._value.accountStatus}toBuilder(){const{id:n,username:p,fullName:R,email:D,roles:U,readOnly:A,external:f,sessionActive:O,clientAddress:M,lastActivity:m,enabled:B,authServiceId:b,authServiceUid:o,authServiceEnabled:a,accountStatus:u}=this._value;return new g(v.Map({id:n,username:p,fullName:R,email:D,roles:U,readOnly:A,external:f,sessionActive:O,clientAddress:M,lastActivity:m,enabled:B,authServiceId:b,authServiceUid:o,authServiceEnabled:a,accountStatus:u}))}static create(n,p,R,D,U,A,f,O,M,m,B,b,o,a,u){return new F(n,p,R,D,U,A,f,O,M,m,B,b,o,a,u)}toJSON(){const{id:n,username:p,fullName:R,email:D,roles:U,readOnly:A,external:f,sessionActive:O,clientAddress:M,lastActivity:m,enabled:B,authServiceId:b,authServiceUid:o,authServiceEnabled:a,accountStatus:u}=this._value;return{id:n,username:p,full_name:R,email:D,roles:U.toArray(),read_only:A,external_user:f,session_active:O,client_address:M,last_activity:m,enabled:B,auth_service_id:b,auth_service_uid:o,auth_service_enabled:a,account_status:u}}static fromJSON(n){const{id:p,username:R,full_name:D,email:U,roles:A,read_only:f,external_user:O,session_active:M,client_address:m,last_activity:B,enabled:b,auth_service_id:o,auth_service_uid:a,auth_service_enabled:u,account_status:P}=n;return F.create(p,R,D,U,v.Set(A),f!=null?f:!1,O!=null?O:!1,M!=null?M:!1,m,B,b,o,a,u,P)}static builder(){return new g}}class g{constructor(n=v.Map()){this.value=n}id(n){return new g(this.value.set("id",n))}username(n){return new g(this.value.set("username",n))}fullName(n){return new g(this.value.set("fullName",n))}email(n){return new g(this.value.set("email",n))}roles(n){return new g(this.value.set("roles",n))}readOnly(n){return new g(this.value.set("readOnly",n))}external(n){return new g(this.value.set("external",n))}sessionActive(n){return new g(this.value.set("sessionActive",n))}clientAddress(n){return new g(this.value.set("clientAddress",n))}lastActivity(n){return new g(this.value.set("lastActivity",n))}enabled(n){return new g(this.value.set("enabled",n))}authServiceId(n){return new g(this.value.set("authServiceId",n))}authServiceUid(n){return new g(this.value.set("authServiceUid",n))}authServiceEnabled(n){return new g(this.value.set("authServiceEnabled",n))}accountStatus(n){return new g(this.value.set("accountStatus",n))}build(){const{id:n,username:p,fullName:R,email:D,roles:U,readOnly:A,external:f,sessionActive:O,clientAddress:M,lastActivity:m,enabled:B,authServiceId:b,authServiceUid:o,authServiceEnabled:a,accountStatus:u}=this.value.toObject();return new F(n,p,R,D,U,A,f,O,M,m,B,b,o,a,u)}}},vtWR08zs:(Y,x,r)=>{"use strict";r.d(x,{K:()=>m});var v=r("JnTtTRmZ"),_=r.n(v),F=r("VPaD/Np4"),g=r("aRgBSN1I");const e=b=>{const o=(0,g.ih)(b.type,!0);return o&&typeof o.configFromJson=="function"?o.configFromJson(b):b},n=b=>{const o=(0,g.ih)(b.type,!0);return o&&typeof o.configToJson=="function"?o.configToJson(b):b};class p{constructor(o,a,u,P,N){this._value={id:o,title:a,description:u,defaultRoles:P,config:N}}get id(){return this._value.id}get title(){return this._value.title}get description(){return this._value.description}get defaultRoles(){return this._value.defaultRoles}get config(){return this._value.config}toBuilder(){const{id:o,title:a,description:u,defaultRoles:P,config:N}=this._value;return new R(F.Map({id:o,title:a,description:u,defaultRoles:P,config:N}))}toJSON(){const{id:o,title:a,description:u,defaultRoles:P=F.List(),config:N}=this._value,L=n(N);return{id:o,title:a,description:u,default_roles:P.toJS(),config:L}}static fromJSON(o){const{id:a,title:u,description:P,default_roles:N,config:L}=o,W=e(L);return new p(a,u,P,F.List(N),W)}static builder(){return new R}}class R{constructor(o=F.Map()){this.value=o}id(o){return new R(this.value.set("id",o))}title(o){return new R(this.value.set("title",o))}description(o){return new R(this.value.set("description",o))}defaultRoles(o){return new R(this.value.set("defaultRoles",o))}config(o){return new R(this.value.set("config",o))}build(){const{id:o,title:a,description:u,defaultRoles:P,config:N}=this.value.toObject();return new p(o,a,u,P,N)}}var D=r("MdYBRjRJ"),U=r("eFxcQyPT"),A=r("IA3Ku5lS"),f=r("gyRmhZSW"),O=r("U1Iufsob"),M=r("nmSm+aR9");const m=(0,A.ei)("Authentication",()=>_().createActions({create:{asyncResult:!0},delete:{asyncResult:!0},load:{asyncResult:!0},loadActive:{asyncResult:!0},loadBackendsPaginated:{asyncResult:!0},loadUsersPaginated:{asyncResult:!0},loadActiveBackendType:{asyncResult:!0},setActiveBackend:{asyncResult:!0},testConnection:{asyncResult:!0},testLogin:{asyncResult:!0},update:{asyncResult:!0}})),B=(0,A.dS)("Authentication",()=>_().createStore({listenables:[m],getInitialState(){return{authenticators:null}},create(b){const o=(0,D.DC)(O.Z.AuthenticationController.create().url),a=(0,U.ZP)("POST",o,b).then(u=>u?{backend:p.fromJSON(u.backend)}:null);return m.create.promise(a),a},load(b){const o=(0,D.DC)(O.Z.AuthenticationController.load(encodeURIComponent(b)).url),a=(0,U.ZP)("GET",o).then(u=>u?{backend:p.fromJSON(u.backend)}:null);return m.load.promise(a),a},loadActive(){const b=(0,D.DC)(O.Z.AuthenticationController.loadActive().url),o=(0,U.ZP)("GET",b).then(a=>a?{backend:a.backend?p.fromJSON(a.backend):null,context:{backendsTotal:a.context.backends_total}}:null);return m.loadActive.promise(o),o},update(b,o){const a=(0,D.DC)(O.Z.AuthenticationController.update(b).url),u=(0,U.ZP)("PUT",a,o).then(P=>P?{backend:p.fromJSON(P.backend)}:null);return m.update.promise(u),u},delete(b){const o=(0,D.DC)(O.Z.AuthenticationController.delete(b).url),a=(0,U.ZP)("DELETE",o);return m.delete.promise(a),a},testConnection(b){const o=(0,D.DC)(O.Z.AuthenticationController.testConnection().url),a=(0,U.ZP)("POST",o,b);return m.testConnection.promise(a),a},testLogin(b){const o=(0,D.DC)(O.Z.AuthenticationController.testLogin().url),a=(0,U.ZP)("POST",o,b);return m.testLogin.promise(a),a},setActiveBackend(b){const o=(0,D.DC)(O.Z.AuthenticationController.updateConfiguration().url),a=(0,U.ZP)("POST",o,{active_backend:b});return m.setActiveBackend.promise(a),a},loadBackendsPaginated({page:b,perPage:o,query:a}){const u=(0,f.Z)(O.Z.AuthenticationController.servicesPaginated().url,b,o,a),P=(0,U.ZP)("GET",(0,D.DC)(u)).then(N=>({context:{activeBackend:N.context.active_backend},list:F.List(N.backends.map(L=>p.fromJSON(L))),pagination:{page:N.page,perPage:N.per_page,query:N.query,count:N.count,total:N.total}}));return m.loadBackendsPaginated.promise(P),P},loadUsersPaginated(b,{page:o,perPage:a,query:u}){const P=(0,f.Z)(O.Z.AuthenticationController.loadUsersPaginated(b).url,o,a,u),N=(0,U.ZP)("GET",(0,D.DC)(P)).then(L=>({list:F.List(L.users.map(W=>M.Z.fromJSON(W))),pagination:{page:L.page,perPage:L.per_page,query:L.query,count:L.count,total:L.total},adminUser:void 0}));return m.loadUsersPaginated.promise(N),N},loadActiveBackendType(){const b=(0,D.DC)(O.Z.AuthenticationController.loadActiveBackendType().url),o=new U.Ib("GET",b).build().then(a=>a.json()).then(a=>a.backend);return m.loadActiveBackendType.promise(o),o}}))},KOKBnITH:(Y,x,r)=>{"use strict";r.d(x,{p:()=>f});var v=r("JnTtTRmZ"),_=r.n(v),F=r("VPaD/Np4"),g=r("eFxcQyPT"),e=r("U1Iufsob"),n=r("MdYBRjRJ"),p=r("IA3Ku5lS"),R=r("gyRmhZSW");class D{constructor(a,u,P,N,L){this._value={id:a,name:u,description:P,permissions:N,readOnly:L}}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:a,name:u,description:P,permissions:N,readOnly:L}=this._value;return new U(F.Map({id:a,name:u,description:P,permissions:N,readOnly:L}))}static create(a,u,P,N,L){return new D(a,u,P,N,L)}toJSON(){const{id:a,name:u,description:P,permissions:N,readOnly:L}=this._value;return{id:a,name:u,description:P,permissions:N,read_only:L}}static fromJSON(a){const{id:u,name:P,description:N,permissions:L,read_only:W}=a;return D.create(u,P,N,L,W)}static builder(){return new U}}class U{constructor(a=F.Map()){this.value=a}id(a){return new U(this.value.set("id",a))}name(a){return new U(this.value.set("name",a))}description(a){return new U(this.value.set("description",a))}permissions(a){return new U(this.value.set("permissions",a))}readOnly(a){return new U(this.value.set("readOnly",a))}build(){const{id:a,name:u,description:P,permissions:N,readOnly:L}=this.value.toObject();return new D(a,u,P,N,L)}}const f=(0,p.ei)("AuthzRoles",()=>_().createActions({load:{asyncResult:!0},delete:{asyncResult:!0},addMembers:{asyncResult:!0},removeMember:{asyncResult:!0},loadUsersForRole:{asyncResult:!0},loadRolesForUser:{asyncResult:!0},loadRolesPaginated:{asyncResult:!0}}));var O=r("nmSm+aR9");const M=({count:o,total:a,page:u,per_page:P,query:N,roles:L=[],context:W={users:void 0}})=>({list:F.List(L.map(ie=>D.fromJSON(ie))),pagination:{query:N,page:u,perPage:P,count:o,total:a},context:W}),m=({count:o,total:a,page:u,per_page:P,query:N,users:L})=>({list:F.List(L.map(W=>O.Z.fromJSON(W))),pagination:{page:u,perPage:P,query:N,count:o,total:a}}),B=(o,a=[])=>{const u=a.map(P=>encodeURIComponent(P));return o(...u).url},b=(0,p.dS)("AuthzRoles",()=>_().createStore({listenables:[f],load(o){const a=(0,n.DC)(B(e.Z.AuthzRolesController.load,[o])),u=(0,g.ZP)("GET",a).then(D.fromJSON);return f.load.promise(u),u},delete(o){const a=(0,n.DC)(B(e.Z.AuthzRolesController.delete,[o])),u=(0,g.ZP)("DELETE",a);return f.delete.promise(u),u},addMembers(o,a){const u=B(e.Z.AuthzRolesController.addMembers,[o]),P=(0,g.ZP)("PUT",(0,n.DC)(u),a.toArray());return f.addMembers.promise(P),P},removeMember(o,a){const u=B(e.Z.AuthzRolesController.removeMember,[o,a]),P=(0,g.ZP)("DELETE",(0,n.DC)(u));return f.removeMember.promise(P),P},loadUsersForRole(o,a,{page:u,perPage:P,query:N}){const L=B(e.Z.AuthzRolesController.loadUsersForRole,[o]),W=(0,R.Z)(L,u,P,N),ie=(0,g.ZP)("GET",(0,n.DC)(W)).then(m);return f.loadUsersForRole.promise(ie),ie},loadRolesForUser(o,{page:a,perPage:u,query:P}){const N=B(e.Z.AuthzRolesController.loadRolesForUser,[o]),L=(0,R.Z)(N,a,u,P),W=(0,g.ZP)("GET",(0,n.DC)(L)).then(M);return f.loadRolesForUser.promise(W),W},loadRolesPaginated({page:o,perPage:a,query:u}){const P=B(e.Z.AuthzRolesController.list),N=(0,R.Z)(P,o,a,u),L=(0,g.ZP)("GET",(0,n.DC)(N)).then(M);return f.loadRolesPaginated.promise(L),L}}))},aRgBSN1I:(Y,x,r)=>{"use strict";r.d(x,{Re:()=>g,ih:()=>_,z$:()=>F});var v=r("QL8i6bcz");const _=(e,n=!1)=>{const R=(v.G.exports("authentication.services")||[]).find(D=>D.name===e);if(!R&&n)throw new Error(`Authentication service with type "${e}" not found.`);return R},F=()=>{const e=v.G.exports("authentication.enterprise.directoryServices.groupSync");return e==null?void 0:e[0]},g=()=>{const e=v.G.exports("authentication.enterprise");return e==null?void 0:e[0]}},FMrsY19w:(Y,x,r)=>{var v=r("mKCr8FEe"),_=r("i91DFamr"),F=r("JF7TaIvC");function g(e,n){var p={};return n=F(n,3),_(e,function(R,D,U){v(p,n(R,D,U),R)}),p}Y.exports=g}}]);})();
//# sourceMappingURL=1255d548-2378.7792b4e7b39cf93c02aa.js.map
© 2015 - 2024 Weber Informatics LLC | Privacy Policy