Skip to content

platform/policy/policy-providers

Defined in: app/src/platform/policy/policy-providers.ts:249

Reads JSON files from <dir>/managed (mandatory) and <dir>/recommended. Files are applied in alphabetical order; a later file overrides an earlier one.

new LinuxJsonPolicyProvider(io, directory): LinuxJsonPolicyProvider

Defined in: app/src/platform/policy/policy-providers.ts:258

PolicyIo

System access.

string

Policy directory, such as /etc/astela/policies.

LinuxJsonPolicyProvider

readonly name: "linux-json" = 'linux-json'

Defined in: app/src/platform/policy/policy-providers.ts:250

Name for diagnostics, such as windows-registry.

PolicyProvider.name

load(): Promise<PolicyReadResult>

Defined in: app/src/platform/policy/policy-providers.ts:263

Reads all policy values without blocking the caller. Must not reject; problems are returned as errors.

Promise<PolicyReadResult>

PolicyProvider.load


Defined in: app/src/platform/policy/policy-providers.ts:158

Reads managed preferences that configuration profiles (MDM) install for the bundle ID. Values in these files are enforced, so they are mandatory policies.

new MacManagedPreferencesPolicyProvider(io, bundleId, userName): MacManagedPreferencesPolicyProvider

Defined in: app/src/platform/policy/policy-providers.ts:169

PolicyIo

System access.

string

The app’s bundle ID.

string

Name of the current user, for user-level profiles.

MacManagedPreferencesPolicyProvider

readonly name: "macos-managed-preferences" = 'macos-managed-preferences'

Defined in: app/src/platform/policy/policy-providers.ts:159

Name for diagnostics, such as windows-registry.

PolicyProvider.name

load(): Promise<PolicyReadResult>

Defined in: app/src/platform/policy/policy-providers.ts:179

Converts both files at the same time. The parser of property lists loads with the first file, so other systems never load it.

Promise<PolicyReadResult>

PolicyProvider.load


Defined in: app/src/platform/policy/policy-providers.ts:84

Reads policies from HKLM and HKCU with reg export, which needs no native module. The export is UTF-16LE, so non-ASCII values survive.

new WindowsRegistryPolicyProvider(io, root): WindowsRegistryPolicyProvider

Defined in: app/src/platform/policy/policy-providers.ts:93

PolicyIo

System access.

string

Policy key below the hive, such as SOFTWARE\Policies\Astela.

WindowsRegistryPolicyProvider

readonly name: "windows-registry" = 'windows-registry'

Defined in: app/src/platform/policy/policy-providers.ts:85

Name for diagnostics, such as windows-registry.

PolicyProvider.name

load(): Promise<PolicyReadResult>

Defined in: app/src/platform/policy/policy-providers.ts:102

Exports both hives at the same time instead of one after the other. The parser of registry exports loads with the first read, so other systems never load it.

Promise<PolicyReadResult>

PolicyProvider.load

Defined in: app/src/platform/policy/policy-providers.ts:25

System access used by the policy providers; replaced by fakes in tests.

listDir(path): string[] | undefined

Defined in: app/src/platform/policy/policy-providers.ts:31

Lists a directory, or returns undefined if it does not exist.

string

string[] | undefined

readFile(path): Uint8Array<ArrayBufferLike> | undefined

Defined in: app/src/platform/policy/policy-providers.ts:29

Reads a file, or returns undefined if it does not exist.

string

Uint8Array<ArrayBufferLike> | undefined

remove(path): void

Defined in: app/src/platform/policy/policy-providers.ts:35

Deletes a file if it exists.

string

void

runAsync(command, args): Promise<RunResult>

Defined in: app/src/platform/policy/policy-providers.ts:27

Runs a program without blocking. Never rejects.

string

readonly string[]

Promise<RunResult>

tempFile(name): string

Defined in: app/src/platform/policy/policy-providers.ts:33

Returns a path for a temporary file.

string

string


Defined in: app/src/platform/policy/policy-providers.ts:19

The outcome of a program that a policy provider ran.

readonly status: number | null

Defined in: app/src/platform/policy/policy-providers.ts:20

readonly stdout: string

Defined in: app/src/platform/policy/policy-providers.ts:21

const nodePolicyIo: PolicyIo

Defined in: app/src/platform/policy/policy-providers.ts:39

PolicyIo backed by Node.js.