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B,CAAW,CAC9B,CACF,CACF,EAEF,gBAAC,MAAG,KACF,gBAAC,MAAG,CAAC,GAAI,EAAG,SAAU,GACpB,gBAAC,MAAW,eAAgB,CAACqB,GAAW,CAACL,EAC7B,iBAAiB,cACjB,kBAAkB,mBAClB,aAAAI,EACA,cAAa,GACb,SAAUL,EAAA,CAAe,CACvC,CACF,CACF,CAEJ,CACF,CACF,CAEJ,E,qBE5PA,SAvBuB,IACrB,gBAAC,KAAa,CAAC,MAAM,mBACnB,gBAACc,GAAA,EAAmB,IAAC,EACrB,gBAAC,MAAW,MAAM,kBACN,QACE,gBAAC,IAAa,CAAC,GAAItD,EAAA,GAAO,OAAO,MAAM,QACrC,gBAAC,SAAM,CAAC,QAAQ,WAAU,aAAW,CACvC,EAEF,kBAAmB,CACjB,MAAO,4BACP,KAAMuD,EAAA,EAAW,MAAM,WACzB,GACV,gBAAC,YAAK,0MAGN,CACF,EAEA,gBAAC,GAAU,IAAC,CACd,C","sources":["webpack://graylog-web-interface/./src/components/users/UserCreate/UsernameFormGroup.tsx","webpack://graylog-web-interface/./src/components/users/UserCreate/UserCreate.tsx","webpack://graylog-web-interface/./src/components/users/UserCreate/index.ts","webpack://graylog-web-interface/./src/pages/UserCreatePage.tsx"],"sourcesContent":["/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport * as React from 'react';\n\nimport { FormikFormGroup } from 'components/common';\n\nconst UsernameFormGroup = () => (\n \n);\n\nexport default UsernameFormGroup;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport * as React from 'react';\nimport { useState } from 'react';\nimport styled from 'styled-components';\nimport * as Immutable from 'immutable';\nimport { Formik, Form } from 'formik';\nimport { PluginStore } from 'graylog-web-plugin/plugin';\n\nimport AppConfig from 'util/AppConfig';\nimport type { DescriptiveItem } from 'components/common/PaginatedItemOverview';\nimport User from 'logic/users/User';\nimport UsersDomain from 'domainActions/users/UsersDomain';\nimport PaginatedItem from 'components/common/PaginatedItemOverview/PaginatedItem';\nimport RolesSelector from 'components/permissions/RolesSelector';\nimport { Alert, Col, Row, Input } from 'components/bootstrap';\nimport Routes from 'routing/Routes';\nimport { UsersActions } from 'stores/users/UsersStore';\nimport debounceWithPromise from 'views/logic/debounceWithPromise';\nimport { FormSubmit, IfPermitted, NoSearchResult, ReadOnlyFormGroup } from 'components/common';\nimport type { HistoryFunction } from 'routing/useHistory';\nimport useHistory from 'routing/useHistory';\nimport { getPathnameWithoutId } from 'util/URLUtils';\nimport useSendTelemetry from 'logic/telemetry/useSendTelemetry';\nimport useLocation from 'routing/useLocation';\nimport { TELEMETRY_EVENT_TYPE } from 'logic/telemetry/Constants';\n\nimport TimezoneFormGroup from './TimezoneFormGroup';\nimport TimeoutFormGroup from './TimeoutFormGroup';\nimport FirstNameFormGroup from './FirstNameFormGroup';\nimport LastNameFormGroup from './LastNameFormGroup';\nimport EmailFormGroup from './EmailFormGroup';\nimport PasswordFormGroup, { validatePasswords } from './PasswordFormGroup';\nimport UsernameFormGroup from './UsernameFormGroup';\nimport ServiceAccountFormGroup from './ServiceAccountFormGroup';\n\nimport { Headline } from '../../common/Section/SectionComponent';\nimport useIsGlobalTimeoutEnabled from '../../../hooks/useIsGlobalTimeoutEnabled';\nimport { Link } from '../../common/router';\n\nconst GlobalTimeoutMessage = styled(ReadOnlyFormGroup)`\n margin-bottom: 20px;\n\n .read-only-value-col {\n padding-top: 0;\n }\n`;\n\nconst isCloud = AppConfig.isCloud();\n\nconst oktaUserForm = isCloud ? PluginStore.exports('cloud')[0].oktaUserForm : null;\n\nconst _onSubmit = (history: HistoryFunction, formData, roles, setSubmitError) => {\n let data = { ...formData, roles: roles.toJS(), permissions: [] };\n delete data.password_repeat;\n\n if (isCloud && oktaUserForm) {\n const { onCreate } = oktaUserForm;\n data = onCreate(data);\n } else {\n data.username = data.username.trim();\n }\n\n setSubmitError(null);\n\n return UsersDomain.create(data).then(() => {\n history.push(Routes.SYSTEM.USERS.OVERVIEW);\n }, (error) => setSubmitError(error));\n};\n\nconst _validateUsername = async (errors: { [name: string]: string }, username: string) => {\n const newErrors = { ...errors };\n\n try {\n await UsersActions.loadByUsername(username);\n newErrors.username = 'Username is already taken';\n // eslint-disable-next-line no-empty\n } catch (error) {\n }\n\n return newErrors;\n};\n\nconst debounceTimeoutMs = 600;\nconst debouncedValidateUsername = debounceWithPromise(_validateUsername, debounceTimeoutMs);\n\nconst _validate = async (values) => {\n let errors = {};\n\n const { password, password_repeat: passwordRepeat, username } = values;\n\n if (username) {\n errors = await debouncedValidateUsername(errors, username);\n }\n\n if (isCloud && oktaUserForm) {\n const { validations: { password: validateCloudPasswords } } = oktaUserForm;\n\n errors = validateCloudPasswords(errors, password, passwordRepeat);\n } else {\n errors = validatePasswords(errors, password, passwordRepeat);\n }\n\n return errors;\n};\n\ntype RequestError = { additional: { res: { text: string } } };\n\nconst PasswordGroup = () => {\n if (isCloud && oktaUserForm) {\n const { fields: { password: CloudPasswordFormGroup } } = oktaUserForm;\n\n return ;\n }\n\n return ;\n};\n\nconst UserNameGroup = () => {\n if (isCloud && oktaUserForm) {\n const { fields: { username: CloudUserNameFormGroup } } = oktaUserForm;\n\n return CloudUserNameFormGroup && ;\n }\n\n return (\n \n );\n};\n\nconst EmailGroup = () => {\n if (isCloud && oktaUserForm) {\n const { fields: { email: CloudEmailFormGroup } } = oktaUserForm;\n\n return CloudEmailFormGroup && ;\n }\n\n return (\n \n );\n};\n\nconst UserCreate = () => {\n const initialRole = {\n name: 'Reader',\n description: 'Grants basic permissions for every Graylog user (built-in)',\n id: '',\n };\n const [user, setUser] = useState(User.empty().toBuilder().roles(Immutable.Set([initialRole.name])).build());\n const [submitError, setSubmitError] = useState();\n const [selectedRoles, setSelectedRoles] = useState>(Immutable.Set([initialRole]));\n const history = useHistory();\n const { pathname } = useLocation();\n const sendTelemetry = useSendTelemetry();\n const isGlobalTimeoutEnabled = useIsGlobalTimeoutEnabled();\n\n const _onAssignRole = (roles: Immutable.Set) => {\n setSelectedRoles(selectedRoles.union(roles));\n const roleNames = roles.map((r) => r.name);\n\n return Promise.resolve(\n setUser(user.toBuilder().roles(user.roles.union(roleNames)).build()),\n );\n };\n\n const _onUnassignRole = (role: DescriptiveItem) => {\n setSelectedRoles(selectedRoles.remove(role));\n setUser(user.toBuilder().roles(user.roles.remove(role?.name)).build());\n };\n\n const _handleCancel = () => history.push(Routes.SYSTEM.USERS.OVERVIEW);\n const hasValidRole = selectedRoles.size > 0 && selectedRoles.filter((role) => role.name === 'Reader' || role.name === 'Admin');\n\n const showSubmitError = (errors) => {\n if (isCloud && oktaUserForm) {\n const { extractSubmitError } = oktaUserForm;\n\n return extractSubmitError(errors);\n }\n\n return errors?.additional?.res?.text;\n };\n\n const onSubmit = (data) => {\n _onSubmit(history, data, user.roles, setSubmitError);\n\n sendTelemetry(TELEMETRY_EVENT_TYPE.USERS.USER_CREATED, {\n app_pathname: getPathnameWithoutId(pathname),\n app_action_value: 'user-create-form',\n });\n };\n\n return (\n \n \n \n {({ isSubmitting, isValid }) => (\n \n )}\n \n \n
\n );\n};\n\nexport default UserCreate;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport UserCreate from './UserCreate';\n\nexport default UserCreate;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport * as React from 'react';\n\nimport { LinkContainer } from 'components/common/router';\nimport Routes from 'routing/Routes';\nimport DocsHelper from 'util/DocsHelper';\nimport { Button } from 'components/bootstrap';\nimport { PageHeader, DocumentTitle } from 'components/common';\nimport UserCreate from 'components/users/UserCreate';\nimport UsersPageNavigation from 'components/users/navigation/UsersPageNavigation';\n\nconst UserCreatePage = () => (\n \n \n \n \n \n )}\n documentationLink={{\n title: 'Permissions documentation',\n path: DocsHelper.PAGES.USERS_ROLES,\n }}>\n \n Use this page to create new Graylog users. The users and their permissions created here are not limited\n to the web interface but valid and required for the REST APIs of your Graylog server nodes, too.\n \n \n\n \n \n);\n\nexport default UserCreatePage;\n"],"names":["GlobalTimeoutMessage","isCloud","AppConfig","oktaUserForm","_onSubmit","history","formData","roles","setSubmitError","data","onCreate","UsersDomain","Routes","error","_validateUsername","errors","username","newErrors","debouncedValidateUsername","debounceWithPromise","_validate","values","password","passwordRepeat","validateCloudPasswords","PasswordGroup","CloudPasswordFormGroup","PasswordFormGroup","UserNameGroup","CloudUserNameFormGroup","EmailGroup","CloudEmailFormGroup","EmailFormGroup","initialRole","user","setUser","User","submitError","selectedRoles","setSelectedRoles","useHistory","pathname","useLocation","sendTelemetry","useSendTelemetry","isGlobalTimeoutEnabled","useIsGlobalTimeoutEnabled","_onAssignRole","roleNames","r","_onUnassignRole","role","_handleCancel","hasValidRole","showSubmitError","extractSubmitError","onSubmit","isSubmitting","isValid","FirstNameFormGroup","LastNameFormGroup","TimeoutFormGroup","TimezoneFormGroup","ServiceAccountFormGroup","RolesSelector","PaginatedItem","UsersPageNavigation","DocsHelper"],"sourceRoot":""}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy