From 378bf5571b09eb59e5fab4e7698216a433fc295a Mon Sep 17 00:00:00 2001 From: Mike Stone Date: Fri, 20 Jan 2017 20:16:00 -0500 Subject: [PATCH] connect new host enrollment (#1072) --- .../packs/EditPackForm/EditPackForm.tests.jsx | 2 +- .../hosts/AddHostModal/AddHostModal.jsx | 25 ++++++------------- frontend/kolide/index.js | 9 +++++++ .../hosts/ManageHostsPage/ManageHostsPage.jsx | 25 ++++++++++++++++--- .../ManageHostsPage/ManageHostsPage.tests.jsx | 1 + package.json | 1 + server/service/endpoint_appconfig.go | 2 ++ 7 files changed, 44 insertions(+), 21 deletions(-) diff --git a/frontend/components/forms/packs/EditPackForm/EditPackForm.tests.jsx b/frontend/components/forms/packs/EditPackForm/EditPackForm.tests.jsx index 8b1adf88a0..7776a04a06 100644 --- a/frontend/components/forms/packs/EditPackForm/EditPackForm.tests.jsx +++ b/frontend/components/forms/packs/EditPackForm/EditPackForm.tests.jsx @@ -7,7 +7,7 @@ import EditPackForm from 'components/forms/packs/EditPackForm'; import { fillInFormInput } from 'test/helpers'; import { packStub } from 'test/stubs'; -describe.only('EditPackForm - component', () => { +describe('EditPackForm - component', () => { afterEach(restoreSpies); describe('form fields', () => { diff --git a/frontend/components/hosts/AddHostModal/AddHostModal.jsx b/frontend/components/hosts/AddHostModal/AddHostModal.jsx index 7cd467b7fb..5ce6e8d8ee 100644 --- a/frontend/components/hosts/AddHostModal/AddHostModal.jsx +++ b/frontend/components/hosts/AddHostModal/AddHostModal.jsx @@ -12,16 +12,15 @@ const baseClass = 'add-host-modal'; class AddHostModal extends Component { static propTypes = { dispatch: PropTypes.func, + onFetchCertificate: PropTypes.func, onReturnToApp: PropTypes.func, + osqueryEnrollSecret: PropTypes.string, }; constructor (props) { super(props); - this.state = { - revealSecret: false, - secretText: '1234567890', - }; + this.state = { revealSecret: false }; } onCopySecret = (elementClass) => { @@ -39,14 +38,6 @@ class AddHostModal extends Component { }; } - onDownloadCertificate = (evt) => { - evt.preventDefault(); - - console.log('Download the Certificate'); - - return false; - } - toggleSecret = (evt) => { const { revealSecret } = this.state; evt.preventDefault(); @@ -56,9 +47,9 @@ class AddHostModal extends Component { } render () { - const { onCopySecret, onDownloadCertificate, toggleSecret } = this; + const { onCopySecret, toggleSecret } = this; const { revealSecret } = this.state; - const { onReturnToApp } = this.props; + const { onFetchCertificate, onReturnToApp, osqueryEnrollSecret } = this.props; return (
@@ -80,10 +71,10 @@ class AddHostModal extends Component {

Download Osquery Package and Certificate

Osquery requires the same TLS certificate that Kolide is using in order to authenticate. You can fetch the certificate below:

- +

  • @@ -98,7 +89,7 @@ class AddHostModal extends Component { inputWrapperClass={`${baseClass}__secret-input`} name="osqueryd-secret" type={revealSecret ? 'text' : 'password'} - value={this.state.secretText} + value={osqueryEnrollSecret} />