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

web-interface.assets.b6fe2bb5-4354.572ebc8fe71521fc26c9.js.map Maven / Gradle / Ivy

{"version":3,"file":"b6fe2bb5-4354.572ebc8fe71521fc26c9.js","mappings":"4LAmCA,QAAeA,EAAf,G,kHCLMC,EAASC,EAAAA,QAAAA,IAAAA,WAAH,mEAAGA,CAAH,8GAUCC,EAAWD,EAAAA,QAAAA,GAAAA,WAAH,qEAAGA,CAAH,wCAKfE,GAAiBF,EAAAA,EAAAA,SAAOG,EAAAA,GAAV,sFAAGH,EAAgB,gBAAGI,EAAH,EAAGA,MAAH,OAAeC,EAAAA,EAAAA,KAAd,CAAD,mCAExBD,EAAME,MAAMC,KAAKC,OAG1BC,EAAmB,SAAC,GAAD,IAAGC,EAAH,EAAGA,SAAUC,EAAb,EAAaA,MAAb,IAAoBC,YAAAA,OAApB,SAAyCC,EAAzC,EAAyCA,cAAeC,EAAxD,EAAwDA,UAAxD,OACvB,gBAAC,KAAD,CAAKA,UAAS,kBAAaA,IACzB,gBAAC,KAAD,CAAKC,GAAI,IACP,gBAAChB,EAAD,KACE,gBAACE,EAAD,KACGU,EACAC,GAAe,gBAACV,EAAD,CAAgBc,KAAK,GAAGC,MAAO,KAEhDJ,GAEFH,KAKPD,EAAiBS,aAAe,CAC9BJ,UAAW,GACXF,aAAa,EACbC,mBAAeM,GAGjB,W,0DC3CA,QAVoBnB,EAAAA,QAAAA,IAAAA,WAAH,uDAAGA,EAAmC,gBAAGoB,EAAH,EAAGA,SAAUhB,EAAb,EAAaA,MAAb,OAAyBC,EAAAA,EAAAA,KAAxB,CAAD,kHAE5Be,MAAAA,EAAAA,EAAY,UAGhBhB,EAAMiB,YAAYC,IAAIC,Q,wECwD7C,SACEC,MA5DWC,EAAAA,EAAAA,GAAgB,CAC3BC,OAAQC,EAAAA,EAAAA,KACRC,MAAO,SAACA,EAAOC,GAAR,MAAoB,CACzBC,QAAS,yBAAF,OAA2BD,EAA3B,iCAA0DD,KA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AAA,IAAWH,IAI3C,OAFA1D,EAAAA,aAAAA,QAAuC+D,GAEhCA,GAGTlD,iBAvCuB,SAuCNX,EAAgBK,EAvCV,GAuC2F,IAA7D8B,EAA6D,EAA7DA,KAAMW,EAAuD,EAAvDA,QAAST,EAA8C,EAA9CA,MAC5D4B,EAASf,EAAaU,EAAAA,EAAAA,qBAAAA,iBAAiD,CAAC5D,IACxEwD,GAAMU,EAAAA,EAAAA,GAAcD,EAAQ9B,EAAMW,EAAST,GAE3CwB,GAAUC,EAAAA,EAAAA,IAAM,OAAOH,EAAAA,EAAAA,IAAWH,IACrCO,KAAKhB,GAIR,OAFAjD,EAAAA,iBAAAA,QAA2C+D,GAEpCA,GAGTjD,iBAnDuB,SAmDNF,EAnDM,GAmD2E,IAA7DyB,EAA6D,EAA7DA,KAAMW,EAAuD,EAAvDA,QAAST,EAA8C,EAA9CA,MAC5C4B,EAASf,EAAaU,EAAAA,EAAAA,qBAAAA,iBAAiD,CAAClD,IACxE8C,GAAMU,EAAAA,EAAAA,GAAcD,EAAQ9B,EAAMW,EAAST,GAE3CwB,GAAUC,EAAAA,EAAAA,IAAM,OAAOH,EAAAA,EAAAA,IAAWH,IACrCO,KAAK/B,GAIR,OAFAlC,EAAAA,iBAAAA,QAA2C+D,GAEpCA,GAGThD,mBA/DuB,YA+D2D,IAA7DsB,EAA6D,EAA7DA,KAAMW,EAAuD,EAAvDA,QAAST,EAA8C,EAA9CA,MAC5B4B,EAASf,EAAaU,EAAAA,EAAAA,qBAAAA,MACtBJ,GAAMU,EAAAA,EAAAA,GAAcD,EAAQ9B,EAAMW,EAAST,GAE3CwB,GAAUC,EAAAA,EAAAA,IAAM,OAAOH,EAAAA,EAAAA,IAAWH,IACrCO,KAAK/B,GAIR,OAFAlC,EAAAA,mBAAAA,QAA6C+D,GAEtCA","sources":["webpack://graylog-web-interface/./src/components/common/PaginatedItemOverview/index.tsx","webpack://graylog-web-interface/./src/components/common/Section/SectionComponent.tsx","webpack://graylog-web-interface/./src/components/common/Section/SectionGrid.tsx","webpack://graylog-web-interface/./src/domainActions/roles/AuthzRolesDomain.ts","webpack://graylog-web-interface/./src/logic/roles/Role.ts","webpack://graylog-web-interface/./src/actions/roles/AuthzRolesActions.ts","webpack://graylog-web-interface/./src/stores/roles/AuthzRolesStore.ts"],"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 type {\n  PaginatedListType,\n  DescriptiveItem,\n  ResultsWrapperComponentProps,\n  OverrideItemComponentProps,\n} from './PaginatedItemOverview';\nimport PaginatedItemOverview, {\n  DEFAULT_PAGINATION,\n} from './PaginatedItemOverview';\n\nexport type {\n  PaginatedListType,\n  DescriptiveItem,\n  ResultsWrapperComponentProps,\n  OverrideItemComponentProps,\n};\n\nexport { DEFAULT_PAGINATION };\n\nexport default PaginatedItemOverview;\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 styled, { css } from 'styled-components';\n\nimport Spinner from 'components/common/Spinner';\nimport { Row, Col } from 'components/bootstrap';\n\ntype Props = {\n  children: React.ReactNode,\n  title: string,\n  showLoading?: boolean,\n  headerActions?: React.ReactElement,\n  className?: string,\n};\n\nconst Header = styled.div`\n  display: flex;\n  justify-content: space-between;\n  align-items: flex-start;\n\n  *:not(:first-child) {\n    margin-left: 10px;\n  }\n`;\n\nexport const Headline = styled.h2`\n  margin-bottom: 15px;\n  display: inline;\n`;\n\nconst LoadingSpinner = styled(Spinner)(({ theme }) => css`\n  margin-left: 10px;\n  font-size: ${theme.fonts.size.h3};\n`);\n\nconst SectionComponent = ({ children, title, showLoading = false, headerActions, className }: Props) => (\n  \n    \n      
\n \n {title}\n {showLoading && }\n \n {headerActions}\n
\n {children}\n \n
\n);\n\nSectionComponent.defaultProps = {\n className: '',\n showLoading: false,\n headerActions: undefined,\n};\n\nexport default SectionComponent;\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 styled, { css } from 'styled-components';\n\nconst SectionGrid = styled.div<{ $columns?: string } >(({ $columns, theme }) => css`\n display: grid;\n grid-template-columns: ${$columns ?? '1fr 1fr'};\n grid-column-gap: 40px;\n\n @media (max-width: ${theme.breakpoints.max.md}) {\n grid-template-columns: 1fr;\n }\n`);\n\nexport default SectionGrid;\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 { AuthzRolesActions } from 'stores/roles/AuthzRolesStore';\n\nimport notifyingAction from '../notifyingAction';\n\nconst load = notifyingAction({\n action: AuthzRolesActions.load,\n error: (error, roleId) => ({\n message: `Loading role with id \"${roleId}\" failed with status: ${error}`,\n }),\n notFoundRedirect: true,\n});\n\nconst deleteAction = notifyingAction({\n action: AuthzRolesActions.delete,\n success: (roleId, roleName) => ({\n message: `Role \"${roleName}\" was deleted successfully`,\n }),\n error: (error, roleId, roleName) => ({\n message: `Deleting role \"${roleName}\" failed with status: ${error}`,\n }),\n});\n\nconst addMembers = notifyingAction({\n action: AuthzRolesActions.addMembers,\n success: (roleId, usernames) => ({\n message: `Users:\"${usernames.join(', ')}\" were assigned successfully`,\n }),\n error: (error, roleId, usernames) => ({\n message: `Assigning users \"${usernames.join(', ')}\" failed with status: ${error}`,\n }),\n});\n\nconst removeMember = notifyingAction({\n action: AuthzRolesActions.removeMember,\n success: (roleId, username) => ({\n message: `User \"${username}\" was unassigned successfully`,\n }),\n error: (error, roleId, username) => ({\n message: `Unassign user \"${username}\" failed with status: ${error}`,\n }),\n});\n\nconst loadUsersForRole = notifyingAction({\n action: AuthzRolesActions.loadUsersForRole,\n error: (error, username, roleName) => ({\n message: `Loading users for role \"${roleName}\" failed with status: ${error}`,\n }),\n});\n\nconst loadRolesForUser = notifyingAction({\n action: AuthzRolesActions.loadRolesForUser,\n error: (error, username) => ({\n message: `Loading roles for user \"${username}\" failed with status: ${error}`,\n }),\n});\n\nconst loadRolesPaginated = notifyingAction({\n action: AuthzRolesActions.loadRolesPaginated,\n error: (error) => ({\n message: `Loading roles failed with status: ${error}`,\n }),\n});\n\nexport default {\n load,\n delete: deleteAction,\n addMembers,\n removeMember,\n loadUsersForRole,\n loadRolesForUser,\n loadRolesPaginated,\n};\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 Immutable from 'immutable';\nimport type { $PropertyType } from 'utility-types';\n\ntype InternalState = {\n id: string,\n name: string,\n description: string,\n permissions: Immutable.Set,\n readOnly: boolean,\n};\n\nexport type RoleJSON = {\n id: string,\n name: string,\n description: string,\n permissions: Immutable.Set,\n read_only: boolean,\n};\n\nexport default class Role {\n _value: InternalState;\n\n constructor(\n id: $PropertyType,\n name: $PropertyType,\n description: $PropertyType,\n permissions: $PropertyType,\n readOnly: $PropertyType,\n ) {\n this._value = {\n id,\n name,\n description,\n permissions,\n readOnly,\n };\n }\n\n get id() {\n return this._value.id;\n }\n\n get name() {\n return this._value.name;\n }\n\n get description() {\n return this._value.description;\n }\n\n get permissions() {\n return this._value.permissions;\n }\n\n get readOnly() {\n return this._value.readOnly;\n }\n\n toBuilder() {\n const {\n id,\n name,\n description,\n permissions,\n readOnly,\n } = this._value;\n\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return new Builder(Immutable.Map({\n id,\n name,\n description,\n permissions,\n readOnly,\n }));\n }\n\n static create(\n id: $PropertyType,\n name: $PropertyType,\n description: $PropertyType,\n permissions: $PropertyType,\n readOnly: $PropertyType,\n ) {\n return new Role(\n id,\n name,\n description,\n permissions,\n readOnly,\n );\n }\n\n toJSON() {\n const {\n id,\n name,\n description,\n permissions,\n readOnly,\n } = this._value;\n\n return {\n id,\n name,\n description,\n permissions,\n read_only: readOnly,\n };\n }\n\n static fromJSON(value: RoleJSON) {\n const {\n id,\n name,\n description,\n permissions,\n read_only: readOnly,\n } = value;\n\n return Role.create(\n id,\n name,\n description,\n permissions,\n readOnly,\n );\n }\n\n static builder(): Builder {\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return new Builder();\n }\n}\n\ntype BuilderState = Immutable.Map;\n\nclass Builder {\n value: BuilderState;\n\n constructor(value: BuilderState = Immutable.Map()) {\n this.value = value;\n }\n\n id(value: $PropertyType) {\n return new Builder(this.value.set('id', value));\n }\n\n name(value: $PropertyType) {\n return new Builder(this.value.set('name', value));\n }\n\n description(value: $PropertyType) {\n return new Builder(this.value.set('description', value));\n }\n\n permissions(value: $PropertyType) {\n return new Builder(this.value.set('permissions', value));\n }\n\n readOnly(value: $PropertyType) {\n return new Builder(this.value.set('readOnly', value));\n }\n\n build() {\n const {\n id,\n name,\n description,\n permissions,\n readOnly,\n } = this.value.toObject();\n\n return new Role(\n id,\n name,\n description,\n permissions,\n readOnly,\n );\n }\n}\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 Reflux from 'reflux';\nimport type * as Immutable from 'immutable';\n\nimport type Role from 'logic/roles/Role';\nimport type UserOverview from 'logic/users/UserOverview';\nimport { singletonActions } from 'logic/singleton';\nimport type { PaginatedList, Pagination } from 'stores/PaginationTypes';\n\nexport type UserContext = {\n id: string,\n username: string,\n};\n\nexport type RoleContext = {\n users: { [key: string]: UserContext[] },\n};\n\nexport type PaginatedRoles = PaginatedList & {\n context: RoleContext,\n};\nexport type PaginatedUsers = PaginatedList;\n\nexport type ActionsType = {\n load: (roleId: string) => Promise,\n delete: (roleId: string, roleName: string) => Promise,\n addMembers: (roleId: string, usernames: Immutable.Set) => Promise,\n removeMember: (roleId: string, username: string) => Promise,\n loadUsersForRole: (roleId: string, roleName: string, pagination: Pagination) => Promise,\n loadRolesForUser: (username: string, pagination: Pagination) => Promise,\n loadRolesPaginated: (pagination: Pagination) => Promise,\n};\n\nconst AuthzRolesActions = singletonActions(\n 'AuthzRoles',\n () => Reflux.createActions({\n load: { asyncResult: true },\n delete: { asyncResult: true },\n addMembers: { asyncResult: true },\n removeMember: { asyncResult: true },\n loadUsersForRole: { asyncResult: true },\n loadRolesForUser: { asyncResult: true },\n loadRolesPaginated: { asyncResult: true },\n }),\n);\n\nexport default AuthzRolesActions;\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 Reflux from 'reflux';\nimport * as Immutable from 'immutable';\nimport type { $PropertyType } from 'utility-types';\n\nimport type { PaginatedUsersResponse } from 'stores/users/UsersStore';\nimport type { Store } from 'stores/StoreTypes';\nimport fetch from 'logic/rest/FetchProvider';\nimport ApiRoutes from 'routing/ApiRoutes';\nimport { qualifyUrl } from 'util/URLUtils';\nimport { singletonStore } from 'logic/singleton';\nimport PaginationURL from 'util/PaginationURL';\nimport Role from 'logic/roles/Role';\nimport type { RoleJSON } from 'logic/roles/Role';\nimport type { PaginatedRoles, PaginatedUsers, RoleContext } from 'actions/roles/AuthzRolesActions';\nimport AuthzRolesActions from 'actions/roles/AuthzRolesActions';\nimport UserOverview from 'logic/users/UserOverview';\nimport type { PaginatedListJSON, Pagination } from 'stores/PaginationTypes';\n\nexport type PaginatedRolesResponse = PaginatedListJSON & {\n roles: Array,\n context?: RoleContext,\n};\n\nconst _responseToPaginatedList = ({ count, total, page, per_page, query, roles = [], context = { users: undefined } }: PaginatedRolesResponse) => ({\n list: Immutable.List(roles.map((r) => Role.fromJSON(r))),\n pagination: {\n query,\n page,\n perPage: per_page,\n count,\n total,\n },\n context,\n});\n\nconst _responseToPaginatedUserList = ({ count, total, page, per_page, query, users }: PaginatedUsersResponse) => ({\n list: Immutable.List(users.map((u) => UserOverview.fromJSON(u))),\n pagination: {\n page,\n perPage: per_page,\n query,\n count,\n total,\n },\n});\n\nconst encodeApiUrl = (apiRoute: (...args: Array) => { url: string }, uriParams: Array = []): string => {\n const encodedUriParams = uriParams.map((param) => encodeURIComponent(param));\n\n return apiRoute(...encodedUriParams).url;\n};\n\nconst AuthzRolesStore: Store<{}> = singletonStore(\n 'AuthzRoles',\n () => Reflux.createStore({\n listenables: [AuthzRolesActions],\n\n load(roleId: $PropertyType): Promise {\n const url = qualifyUrl(encodeApiUrl(ApiRoutes.AuthzRolesController.load, [roleId]));\n const promise = fetch('GET', url).then(Role.fromJSON);\n\n AuthzRolesActions.load.promise(promise);\n\n return promise;\n },\n\n delete(roleId: string): Promise {\n const url = qualifyUrl(encodeApiUrl(ApiRoutes.AuthzRolesController.delete, [roleId]));\n const promise = fetch('DELETE', url);\n\n AuthzRolesActions.delete.promise(promise);\n\n return promise;\n },\n\n addMembers(roleId: string, usernames: Immutable.Set): Promise {\n const url = encodeApiUrl(ApiRoutes.AuthzRolesController.addMembers, [roleId]);\n const promise = fetch('PUT', qualifyUrl(url), usernames.toArray());\n\n AuthzRolesActions.addMembers.promise(promise);\n\n return promise;\n },\n\n removeMember(roleId: string, username: string): Promise {\n const url = encodeApiUrl(ApiRoutes.AuthzRolesController.removeMember, [roleId, username]);\n const promise = fetch('DELETE', qualifyUrl(url));\n\n AuthzRolesActions.removeMember.promise(promise);\n\n return promise;\n },\n\n loadUsersForRole(roleId: string, roleName: string, { page, perPage, query }: Pagination): Promise {\n const apiUrl = encodeApiUrl(ApiRoutes.AuthzRolesController.loadUsersForRole, [roleId]);\n const url = PaginationURL(apiUrl, page, perPage, query);\n\n const promise = fetch('GET', qualifyUrl(url))\n .then(_responseToPaginatedUserList);\n\n AuthzRolesActions.loadUsersForRole.promise(promise);\n\n return promise;\n },\n\n loadRolesForUser(username: string, { page, perPage, query }: Pagination): Promise {\n const apiUrl = encodeApiUrl(ApiRoutes.AuthzRolesController.loadRolesForUser, [username]);\n const url = PaginationURL(apiUrl, page, perPage, query);\n\n const promise = fetch('GET', qualifyUrl(url))\n .then(_responseToPaginatedList);\n\n AuthzRolesActions.loadRolesForUser.promise(promise);\n\n return promise;\n },\n\n loadRolesPaginated({ page, perPage, query }: Pagination): Promise {\n const apiUrl = encodeApiUrl(ApiRoutes.AuthzRolesController.list);\n const url = PaginationURL(apiUrl, page, perPage, query);\n\n const promise = fetch('GET', qualifyUrl(url))\n .then(_responseToPaginatedList);\n\n AuthzRolesActions.loadRolesPaginated.promise(promise);\n\n return promise;\n },\n }),\n);\n\nexport { AuthzRolesActions, AuthzRolesStore };\n"],"names":["PaginatedItemOverview","Header","styled","Headline","LoadingSpinner","Spinner","theme","css","fonts","size","h3","SectionComponent","children","title","showLoading","headerActions","className","xs","text","delay","defaultProps","undefined","$columns","breakpoints","max","md","load","notifyingAction","action","AuthzRolesActions","error","roleId","message","notFoundRedirect","delete","success","roleName","addMembers","usernames","join","removeMember","username","loadUsersForRole","loadRolesForUser","loadRolesPaginated","Role","id","name","description","permissions","readOnly","this","_value","Builder","Immutable","read_only","value","create","set","toObject","singletonActions","Reflux","asyncResult","_responseToPaginatedList","count","total","page","per_page","query","roles","context","users","list","map","r","fromJSON","pagination","perPage","_responseToPaginatedUserList","u","UserOverview","encodeApiUrl","apiRoute","uriParams","encodedUriParams","param","encodeURIComponent","url","singletonStore","listenables","qualifyUrl","ApiRoutes","promise","fetch","then","toArray","apiUrl","PaginationURL"],"sourceRoot":""}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy