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

web-interface.assets.6e61897c-44.472622149827c1587209.js.map Maven / Gradle / Ivy

There is a newer version: 6.0.2
Show newest version
{"version":3,"sources":["webpack:///./src/components/common/Section/SectionGrid.tsx","webpack:///./src/components/common/Section/SectionComponent.tsx","webpack:///./src/components/authentication/AuthenticatorActionLinks.tsx","webpack:///./src/components/authentication/AuthenticatorsEdit/HTTPHeaderAuthConfigSection.tsx","webpack:///./src/components/authentication/AuthenticatorsEdit/index.tsx","webpack:///./src/components/authentication/AuthenticatorsEdit/AuthenticatorsEdit.tsx","webpack:///./src/pages/AuthenticatorsEditPage.tsx","webpack:///./src/components/authentication/AuthenticationOverviewLinks.tsx","webpack:///./src/actions/authentication/HTTPHeaderAuthConfigActions.ts","webpack:///./src/logic/authentication/HTTPHeaderAuthConfig.ts","webpack:///./src/stores/authentication/HTTPHeaderAuthConfigStore.ts","webpack:///./src/domainActions/authentication/HTTPHeaderAuthConfigDomain.tsx"],"names":["SectionGrid","styled","div","$columns","theme","css","breakpoints","max","md","Header","Headline","h2","LoadingSpinner","Spinner","fonts","size","h3","SectionComponent","children","title","showLoading","headerActions","className","xs","text","delay","defaultProps","undefined","AuthenticatorActionLinks","to","Routes","SYSTEM","AUTHENTICATION","AUTHENTICATORS","EDIT","bsStyle","type","HTTPHeaderAuthConfigSection","useState","submitError","setSubmitError","loadedConfig","setLoadedConfig","sectionTitle","useEffect","HTTPHeaderAuthConfigDomain","load","then","onSubmit","data","update","history","push","SHOW","error","additional","res","initialValues","toJSON","isSubmitting","isValid","id","labelClassName","wrapperClassName","label","name","formGroupClassName","required","help","mdOffset","runtimeError","disabled","AuthenticatorsEdit","AuthenticatorsEditPage","subactions","DocumentationLink","page","DocsHelper","PAGES","AuthenticationOverviewLinks","BACKENDS","OVERVIEW","HTTPHeaderAuthConfigActions","singletonActions","Reflux","createActions","asyncResult","HTTPHeaderAuthConfig","usernameHeader","enabled","this","_value","Builder","Immutable","username_header","value","create","set","toObject","singletonStore","createStore","listenables","url","qualifyUrl","ApiRoutes","HTTPHeaderAuthConfigController","promise","fetch","fromJSON","payload","notifyingAction","action","message","success"],"mappings":"2GAAA,oBAkBMA,EAAcC,UAAOC,IAAV,kEAAGD,EAAmC,gBAAGE,EAAH,EAAGA,SAAUC,EAAb,EAAaA,MAAb,OAAyBC,cAAxB,CAAD,kHAE5BF,UAAY,UAGhBC,EAAME,YAAYC,IAAIC,OAK9BR,O,sCC5Bf,sGA8BMS,EAASR,UAAOC,IAAV,2EAAGD,CAAH,8GAUCS,EAAWT,UAAOU,GAAV,6EAAGV,CAAH,wCAKfW,EAAiBX,kBAAOY,KAAV,mFAAGZ,EAAgB,gBAAGG,EAAH,EAAGA,MAAH,OAAeC,cAAd,CAAD,mCAExBD,EAAMU,MAAMC,KAAKC,OAG1BC,EAAmB,SAAC,GAAD,IAAGC,EAAH,EAAGA,SAAUC,EAAb,EAAaA,MAAb,IAAoBC,mBAApB,SAAyCC,EAAzC,EAAyCA,cAAeC,EAAxD,EAAwDA,UAAxD,OACvB,gBAAC,IAAD,CAAKA,UAAS,kBAAaA,IACzB,gBAAC,IAAD,CAAKC,GAAI,IACP,gBAACd,EAAD,KACE,gBAACC,EAAD,KACGS,EACAC,GAAe,gBAACR,EAAD,CAAgBY,KAAK,GAAGC,MAAO,KAEhDJ,GAEFH,KAKPD,EAAiBS,aAAe,CAC9BJ,UAAW,GACXF,aAAa,EACbC,mBAAeM,GAGFV,O,sCCvEf,oEAgCeW,IAVkB,kBAC/B,gBAAC,IAAD,KACE,gBAAC,IAAD,CAAeC,GAAIC,IAAOC,OAAOC,eAAeC,eAAeC,MAC7D,gBAAC,IAAD,CAAQC,QAAQ,UACRC,KAAK,UADb,2B,isCCIN,IA2EeC,EA3EqB,WAAM,QACFC,qBADE,GACjCC,EADiC,KACpBC,EADoB,SAEAF,qBAFA,GAEjCG,EAFiC,KAEnBC,EAFmB,KAGlCC,EAAe,gCAgBrB,OAJAC,qBAAU,WACRC,IAA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,QAAiB,iCACjDH,KAAKK,MAAQA,E,wCAGf,SAAeA,GACb,OAAO,IAAIH,EAAQF,KAAKK,MAAME,IAAI,iBAAkBF,M,qBAGtD,SAAQA,GACN,OAAO,IAAIH,EAAQF,KAAKK,MAAME,IAAI,UAAWF,M,mBAG/C,WAAQ,MAC8BL,KAAKK,MAAMG,WAAvCV,EADF,EACEA,eAAgBC,EADlB,EACkBA,QAExB,OAAO,IAAIF,EAAqBC,EAAgBC,O,QC/EPU,YAC3C,wBACA,kBAAMf,IAAOgB,YAAY,CACvBC,YAAa,CAACnB,GAEdpC,KAHuB,WAIrB,IAAMwD,EAAMC,YAAWC,IAAUC,+BAA+B3D,OAAOwD,KACjEI,EAAUC,YAAM,MAAOL,GAAKvD,KAAKwC,EAAqBqB,UAI5D,OAFA1B,EAA4BpC,KAAK4D,QAAQA,GAElCA,GAGTxD,OAZuB,SAYhB2D,GACL,IAAMP,EAAMC,YAAWC,IAAUC,+BAA+BvD,SAASoD,KACnEI,EAAUC,YAAM,MAAOL,EAAKO,GAAS9D,KAAKwC,EAAqBqB,UAIrE,OAFA1B,EAA4BhC,OAAOwD,QAAQA,GAEpCA,Q,eC1BP5D,EAAOgE,YAAgB,CAC3BC,OAAQ7B,EAA4BpC,KACpCQ,MAAO,SAACA,GAAD,MAAY,CACjB0D,QAAS,iEAAF,OAAmE1D,OAIxEJ,EAAS4D,YAAgB,CAC7BC,OAAQ7B,EAA4BhC,OACpC+D,QAAS,iBAAO,CACdD,QAAS,2DAEX1D,MAAO,SAACA,GAAD,MAAY,CACjB0D,QAAS,kEAAF,OAAoE1D,OAIhE,KACbR,OACAI","file":"6e61897c-44.472622149827c1587209.js","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 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 * as React from 'react';\nimport styled, { css } from 'styled-components';\n\nimport Spinner from 'components/common/Spinner';\nimport { Row, Col } from 'components/graylog';\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 * as React from 'react';\n\nimport Routes from 'routing/Routes';\nimport { LinkContainer } from 'components/graylog/router';\nimport { ButtonToolbar, Button } from 'components/graylog';\n\nconst AuthenticatorActionLinks = () => (\n \n \n \n \n \n);\nexport default AuthenticatorActionLinks;\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, useEffect } from 'react';\nimport { Formik, Form } from 'formik';\n\nimport Routes from 'routing/Routes';\nimport history from 'util/History';\nimport HTTPHeaderAuthConfig from 'logic/authentication/HTTPHeaderAuthConfig';\nimport HTTPHeaderAuthConfigDomain from 'domainActions/authentication/HTTPHeaderAuthConfigDomain';\nimport { Input } from 'components/bootstrap';\nimport { Button, Col, Row, Alert } from 'components/graylog';\nimport { FormikFormGroup, ErrorAlert, Spinner, Icon } from 'components/common';\nimport SectionComponent from 'components/common/Section/SectionComponent';\n\nconst HTTPHeaderAuthConfigSection = () => {\n const [submitError, setSubmitError] = useState();\n const [loadedConfig, setLoadedConfig] = useState();\n const sectionTitle = 'Trusted Header Authentication';\n\n const _onSubmit = (data) => {\n setSubmitError(undefined);\n\n return HTTPHeaderAuthConfigDomain.update(data).then(() => {\n history.push(Routes.SYSTEM.AUTHENTICATION.AUTHENTICATORS.SHOW);\n }).catch((error) => {\n setSubmitError(error.additional?.res?.text);\n });\n };\n\n useEffect(() => {\n HTTPHeaderAuthConfigDomain.load().then(setLoadedConfig);\n }, []);\n\n if (!loadedConfig) {\n return (\n \n \n \n );\n }\n\n return (\n \n

This authenticator enables you to login a user, based on a HTTP header without further interaction.

\n \n {({ isSubmitting, isValid }) => (\n
\n \n \n \n \n \n \n \n Please configure the trusted_proxies setting in the Graylog server configuration file.\n \n \n \n {submitError}\n \n \n
\n \n
\n \n
\n \n )}\n
\n
\n );\n};\n\nexport default HTTPHeaderAuthConfigSection;\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 AuthenticatorsEdit from './AuthenticatorsEdit';\n\nexport default AuthenticatorsEdit;\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 SectionGrid from 'components/common/Section/SectionGrid';\n\nimport HTTPHeaderAuthConfigSection from './HTTPHeaderAuthConfigSection';\n\nconst AuthenticatorsDetails = () => (\n \n \n \n);\n\nexport default AuthenticatorsDetails;\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 React from 'react';\n\nimport AuthenticationOverviewLinks from 'components/authentication/AuthenticationOverviewLinks';\nimport AuthenticatorActionLinks from 'components/authentication/AuthenticatorActionLinks';\nimport AuthenticatorsEdit from 'components/authentication/AuthenticatorsEdit';\nimport { PageHeader, DocumentTitle } from 'components/common';\nimport DocumentationLink from 'components/support/DocumentationLink';\nimport DocsHelper from 'util/DocsHelper';\n\nconst AuthenticatorsEditPage = () => (\n \n }>\n \n Configure the trusted header authentication.\n \n\n \n Learn more in the{' '}\n \n \n\n \n\n \n\n \n \n);\n\nexport default AuthenticatorsEditPage;\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 Routes from 'routing/Routes';\nimport { LinkContainer } from 'components/graylog/router';\nimport { ButtonToolbar, Button } from 'components/graylog';\n\nconst AuthenticationOverviewLinks = () => (\n \n \n \n \n \n \n \n \n);\n\nexport default AuthenticationOverviewLinks;\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';\n\nimport { RefluxActions } from 'stores/StoreTypes';\nimport { singletonActions } from 'views/logic/singleton';\nimport HTTPHeaderAuthConfig, { HTTPHeaderAuthConfigJSON } from 'logic/authentication/HTTPHeaderAuthConfig';\n\nexport type ActionsType = {\n load: () => Promise,\n update: (payload: HTTPHeaderAuthConfigJSON) => Promise,\n};\n\ntype HTTPHeaderAuthConfigActionsType = RefluxActions;\n\nconst HTTPHeaderAuthConfigActions: HTTPHeaderAuthConfigActionsType = singletonActions(\n 'HTTPHeaderAuthConfig',\n () => Reflux.createActions({\n load: { asyncResult: true },\n update: { asyncResult: true },\n }),\n);\n\nexport default HTTPHeaderAuthConfigActions;\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 { $PropertyType } from 'utility-types';\n\ntype InternalState = {\n enabled: boolean,\n usernameHeader: string,\n};\n\nexport type HTTPHeaderAuthConfigJSON = {\n enabled: boolean,\n username_header: string,\n};\n\nexport default class HTTPHeaderAuthConfig {\n _value: InternalState;\n\n constructor(\n usernameHeader: $PropertyType,\n enabled: $PropertyType,\n ) {\n this._value = { usernameHeader, enabled };\n }\n\n get usernameHeader() {\n return this._value.usernameHeader;\n }\n\n get enabled() {\n return this._value.enabled;\n }\n\n toBuilder() {\n const {\n usernameHeader,\n enabled,\n } = this._value;\n\n // eslint-disable-next-line @typescript-eslint/no-use-before-define\n return new Builder(Immutable.Map({ usernameHeader, enabled }));\n }\n\n static create(\n usernameHeader: $PropertyType,\n enabled: $PropertyType,\n ) {\n return new HTTPHeaderAuthConfig(usernameHeader, enabled);\n }\n\n toJSON() {\n const { usernameHeader, enabled } = this._value;\n\n return {\n username_header: usernameHeader,\n enabled,\n };\n }\n\n static fromJSON(value: HTTPHeaderAuthConfigJSON) {\n const { username_header: usernameHeader, enabled } = value;\n\n return HTTPHeaderAuthConfig.create(usernameHeader, enabled);\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 usernameHeader(value: $PropertyType) {\n return new Builder(this.value.set('usernameHeader', value));\n }\n\n enabled(value: $PropertyType) {\n return new Builder(this.value.set('enabled', value));\n }\n\n build() {\n const { usernameHeader, enabled } = this.value.toObject();\n\n return new HTTPHeaderAuthConfig(usernameHeader, enabled);\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';\n\nimport HTTPHeaderAuthConfigActions from 'actions/authentication/HTTPHeaderAuthConfigActions';\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 'views/logic/singleton';\nimport HTTPHeaderAuthConfig, { HTTPHeaderAuthConfigJSON } from 'logic/authentication/HTTPHeaderAuthConfig';\n\nconst HTTPHeaderAuthConfigStore: Store<{}> = singletonStore(\n 'HTTPHeaderAuthConfig',\n () => Reflux.createStore({\n listenables: [HTTPHeaderAuthConfigActions],\n\n load(): Promise {\n const url = qualifyUrl(ApiRoutes.HTTPHeaderAuthConfigController.load().url);\n const promise = fetch('GET', url).then(HTTPHeaderAuthConfig.fromJSON);\n\n HTTPHeaderAuthConfigActions.load.promise(promise);\n\n return promise;\n },\n\n update(payload: HTTPHeaderAuthConfigJSON): Promise {\n const url = qualifyUrl(ApiRoutes.HTTPHeaderAuthConfigController.update().url);\n const promise = fetch('PUT', url, payload).then(HTTPHeaderAuthConfig.fromJSON);\n\n HTTPHeaderAuthConfigActions.update.promise(promise);\n\n return promise;\n },\n }),\n);\n\nexport { HTTPHeaderAuthConfigActions, HTTPHeaderAuthConfigStore };\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 { HTTPHeaderAuthConfigActions } from 'stores/authentication/HTTPHeaderAuthConfigStore';\n\nimport notifyingAction from '../notifyingAction';\n\nconst load = notifyingAction({\n action: HTTPHeaderAuthConfigActions.load,\n error: (error) => ({\n message: `Loading HTTP header authentication config failed with status: ${error}`,\n }),\n});\n\nconst update = notifyingAction({\n action: HTTPHeaderAuthConfigActions.update,\n success: () => ({\n message: 'Successfully updated HTTP header authentication config',\n }),\n error: (error) => ({\n message: `Updating HTTP header authentication config failed with status: ${error}`,\n }),\n});\n\nexport default {\n load,\n update,\n};\n"],"sourceRoot":""}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy