fleet/frontend/__mocks__/configMock.ts
Gabriel Hernandez 845b524dcc
add/remove/disable vpp token in Fleet UI (#20127)
relates to #19866

> NOTE: API integration work still needs to be done, which will happen
in another PR.

This adds the ability to add, remove, or disable a VPP token in the
Fleet UI. This includes:

**Vpp integration page with VPP card:**


![image](https://github.com/fleetdm/fleet/assets/1153709/99b1ca9b-8872-447f-a085-b5385a2b7f7e)


![image](https://github.com/fleetdm/fleet/assets/1153709/1cdb80a2-1afe-4739-994c-fe7430449f13)


![image](https://github.com/fleetdm/fleet/assets/1153709/79ec7927-f905-48c4-b1b9-42d4d6b41028)

**VPP setup page with steps to set up VPP:**


![image](https://github.com/fleetdm/fleet/assets/1153709/dec203e4-01d3-4e1d-b493-be3772b72813)

**VPP setup page with VPP info:**


![image](https://github.com/fleetdm/fleet/assets/1153709/afccba29-e97b-4937-8235-4706e39d9333)

**Disable VPP modal:**


![image](https://github.com/fleetdm/fleet/assets/1153709/da4a2db3-7546-4f3b-8ec0-d77ad7bff19f)

**renew Vpp modal:**


![image](https://github.com/fleetdm/fleet/assets/1153709/8224f466-6aae-43bd-a120-3de5f0c90064)

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://fleetdm.com/docs/contributing/committing-changes#changes-files)
for more information.
- [x] Manual QA for all new/changed functionality
2024-07-10 17:05:09 +01:00

191 lines
4.7 KiB
TypeScript

import { IConfig, IMdmConfig } from "interfaces/config";
const DEFAULT_CONFIG_MDM_MOCK: IMdmConfig = {
enable_disk_encryption: false,
windows_enabled_and_configured: true,
apple_bm_default_team: "Apples",
apple_bm_enabled_and_configured: true,
apple_bm_terms_expired: false,
enabled_and_configured: true,
macos_updates: {
minimum_version: "",
deadline: "",
},
macos_settings: {
custom_settings: null,
enable_disk_encryption: false,
},
macos_setup: {
bootstrap_package: "",
enable_end_user_authentication: false,
macos_setup_assistant: null,
enable_release_device_manually: false,
},
macos_migration: {
enable: false,
mode: "",
webhook_url: "",
},
windows_updates: {
deadline_days: null,
grace_period_days: null,
},
end_user_authentication: {
entity_id: "",
issuer_uri: "",
metadata: "",
metadata_url: "",
idp_name: "",
},
};
export const createMockMdmConfig = (
overrides?: Partial<IMdmConfig>
): IMdmConfig => {
return { ...DEFAULT_CONFIG_MDM_MOCK, ...overrides };
};
const DEFAULT_CONFIG_MOCK: IConfig = {
org_info: {
org_name: "fleet",
org_logo_url: "",
org_logo_url_light_background: "",
contact_url: "https://fleetdm.com/company/contact",
},
server_settings: {
server_url: "https://localhost:8080",
live_query_disabled: false,
enable_analytics: true,
deferred_save_host: false,
query_reports_disabled: false,
scripts_disabled: false,
ai_features_disabled: false,
},
smtp_settings: {
enable_smtp: false,
configured: false,
sender_address: "",
server: "",
port: 587,
authentication_type: "authtype_username_password",
user_name: "",
password: "********",
enable_ssl_tls: true,
authentication_method: "authmethod_plain",
domain: "",
verify_ssl_certs: true,
enable_start_tls: true,
},
sso_settings: {
entity_id: "",
issuer_uri: "",
metadata: "",
metadata_url: "",
idp_name: "",
idp_image_url: "",
enable_sso: false,
enable_sso_idp_login: false,
enable_jit_provisioning: false,
enable_jit_role_sync: false,
},
host_expiry_settings: {
host_expiry_enabled: false,
host_expiry_window: 0,
},
activity_expiry_settings: {
activity_expiry_enabled: true,
activity_expiry_window: 90,
},
agent_options: "",
license: {
tier: "free",
expiration: "0001-01-01T00:00:00Z",
device_count: 4,
note: "",
organization: "",
},
webhook_settings: {
host_status_webhook: {
enable_host_status_webhook: true,
destination_url: "https://server.com",
host_percentage: 5,
days_count: 7,
},
failing_policies_webhook: {
enable_failing_policies_webhook: true,
destination_url: "https://server.com",
policy_ids: [1, 2, 3],
host_batch_size: 1000,
},
vulnerabilities_webhook: {
enable_vulnerabilities_webhook: true,
destination_url: "https://server.com",
host_batch_size: 1000,
},
activities_webhook: {
enable_activities_webhook: true,
destination_url: "https://server.com",
},
},
integrations: {
jira: [],
zendesk: [],
google_calendar: [],
},
logging: {
debug: false,
json: false,
result: {
plugin: "filesystem",
config: {
status_log_file:
"/var/folders/xh/bxm1d2615tv3vrg4zrxq540h0000gn/T/osquery_status",
result_log_file:
"/var/folders/xh/bxm1d2615tv3vrg4zrxq540h0000gn/T/osquery_result",
enable_log_rotation: false,
enable_log_compression: false,
},
},
status: {
plugin: "filesystem",
config: {
status_log_file:
"/var/folders/xh/bxm1d2615tv3vrg4zrxq540h0000gn/T/osquery_status",
result_log_file:
"/var/folders/xh/bxm1d2615tv3vrg4zrxq540h0000gn/T/osquery_result",
enable_log_rotation: false,
enable_log_compression: false,
},
},
audit: {
plugin: "",
config: null,
},
},
update_interval: {
osquery_detail: 3600000000000,
osquery_policy: 3600000000000,
},
vulnerabilities: {
cpe_database_url: "",
current_instance_checks: "auto",
cve_feed_prefix_url: "",
databases_path: "",
disable_data_sync: false,
periodicity: 3600000000000,
recent_vulnerability_max_age: 2592000000000000,
},
sandbox_enabled: false,
features: {
enable_host_users: true,
enable_software_inventory: true,
},
fleet_desktop: { transparency_url: "https://fleetdm.com/transparency" },
mdm: createMockMdmConfig(),
};
const createMockConfig = (overrides?: Partial<IConfig>): IConfig => {
return { ...DEFAULT_CONFIG_MOCK, ...overrides };
};
export default createMockConfig;