mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 00:49:03 +00:00
Remove viewing enroll secrets on app settings page, add changelog (#4896)
This commit is contained in:
parent
22847b68ea
commit
b834e7d2f5
4 changed files with 3 additions and 47 deletions
|
|
@ -0,0 +1 @@
|
|||
* Global enroll secrets not viewable on the settings page (viewable and modifable on Manage Hosts page and Team Details page only)
|
||||
|
|
@ -11,7 +11,6 @@ import Button from "components/buttons/Button";
|
|||
import Checkbox from "components/forms/fields/Checkbox";
|
||||
// @ts-ignore
|
||||
import Dropdown from "components/forms/fields/Dropdown";
|
||||
import EnrollSecretTable from "components/EnrollSecretTable";
|
||||
// @ts-ignore
|
||||
import InputField from "components/forms/fields/InputField";
|
||||
// @ts-ignore
|
||||
|
|
@ -42,7 +41,6 @@ const baseClass = "app-config-form";
|
|||
|
||||
const AppConfigFormFunctional = ({
|
||||
appConfig,
|
||||
enrollSecret,
|
||||
handleSubmit,
|
||||
}: IAppConfigFormProps): JSX.Element => {
|
||||
// STATE
|
||||
|
|
@ -627,22 +625,6 @@ const AppConfigFormFunctional = ({
|
|||
);
|
||||
};
|
||||
|
||||
const renderOsqueryEnrollmentSecretsSection = () => {
|
||||
return (
|
||||
<div className={`${baseClass}__section`}>
|
||||
<h2>
|
||||
<a id="osquery-enrollment-secrets">Osquery enrollment secrets</a>
|
||||
</h2>
|
||||
<div className={`${baseClass}__inputs`}>
|
||||
<p className={`${baseClass}__enroll-secret-label`}>
|
||||
Manage secrets with <code>fleetctl</code>. Active secrets:
|
||||
</p>
|
||||
<EnrollSecretTable secrets={enrollSecret} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
const renderGlobalAgentOptionsSection = () => {
|
||||
return (
|
||||
<div className={`${baseClass}__section`}>
|
||||
|
|
@ -977,7 +959,6 @@ const AppConfigFormFunctional = ({
|
|||
{renderFleetWebAddressSection()}
|
||||
{renderSAMLSingleSignOnOptionsSection()}
|
||||
{renderSMTPOptionsSection()}
|
||||
{renderOsqueryEnrollmentSecretsSection()}
|
||||
{renderGlobalAgentOptionsSection()}
|
||||
{renderHostStatusWebhookSection()}
|
||||
{renderUsageStatistics()}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
import { IConfigNested } from "interfaces/config";
|
||||
import { IEnrollSecret } from "interfaces/enroll_secret";
|
||||
|
||||
export interface IAppConfigFormProps {
|
||||
appConfig: IConfigNested;
|
||||
enrollSecret: IEnrollSecret[] | undefined;
|
||||
handleSubmit: any;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,17 +5,12 @@ import { AppContext } from "context/app";
|
|||
import { NotificationContext } from "context/notification"; // @ts-ignore
|
||||
import { getConfig } from "redux/nodes/app/actions";
|
||||
|
||||
import enrollSecretsAPI from "services/entities/enroll_secret";
|
||||
import configAPI from "services/entities/config";
|
||||
|
||||
// @ts-ignore
|
||||
import deepDifference from "utilities/deep_difference";
|
||||
import { IConfig, IConfigNested } from "interfaces/config";
|
||||
import { IApiError } from "interfaces/errors";
|
||||
import {
|
||||
IEnrollSecret,
|
||||
IEnrollSecretsResponse,
|
||||
} from "interfaces/enroll_secret";
|
||||
|
||||
// @ts-ignore
|
||||
import AppConfigForm from "components/forms/admin/AppConfigForm";
|
||||
|
|
@ -40,15 +35,6 @@ const AppSettingsPage = (): JSX.Element => {
|
|||
}
|
||||
);
|
||||
|
||||
const { data: globalSecrets } = useQuery<
|
||||
IEnrollSecretsResponse,
|
||||
Error,
|
||||
IEnrollSecret[]
|
||||
>(["global secrets"], () => enrollSecretsAPI.getGlobalEnrollSecrets(), {
|
||||
enabled: true,
|
||||
select: (data: IEnrollSecretsResponse) => data.secrets,
|
||||
});
|
||||
|
||||
const onFormSubmit = useCallback(
|
||||
(formData: IConfigNested) => {
|
||||
const diff = deepDifference(formData, appConfig);
|
||||
|
|
@ -104,8 +90,7 @@ const AppSettingsPage = (): JSX.Element => {
|
|||
return (
|
||||
<div className={`${baseClass} body-wrap`}>
|
||||
<p className={`${baseClass}__page-description`}>
|
||||
Set your organization information, Configure SAML and SMTP, and view
|
||||
host enroll secrets.
|
||||
Set your organization information and configure SAML and SMTP.
|
||||
</p>
|
||||
<div className={`${baseClass}__settings-form`}>
|
||||
<nav>
|
||||
|
|
@ -128,11 +113,6 @@ const AppSettingsPage = (): JSX.Element => {
|
|||
<li>
|
||||
<a onClick={() => scrollInto("smtp")}>SMTP options</a>
|
||||
</li>
|
||||
<li>
|
||||
<a onClick={() => scrollInto("osquery-enrollment-secrets")}>
|
||||
Osquery enrollment secrets
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a onClick={() => scrollInto("agent-options")}>
|
||||
Global agent options
|
||||
|
|
@ -154,11 +134,7 @@ const AppSettingsPage = (): JSX.Element => {
|
|||
</ul>
|
||||
</nav>
|
||||
{!isLoadingConfig && appConfig && (
|
||||
<AppConfigForm
|
||||
appConfig={appConfig}
|
||||
handleSubmit={onFormSubmit}
|
||||
enrollSecret={globalSecrets}
|
||||
/>
|
||||
<AppConfigForm appConfig={appConfig} handleSubmit={onFormSubmit} />
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue