platform/policy/policy-providers
Classes
Section titled “Classes”LinuxJsonPolicyProvider
Section titled “LinuxJsonPolicyProvider”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.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new LinuxJsonPolicyProvider(
io,directory):LinuxJsonPolicyProvider
Defined in: app/src/platform/policy/policy-providers.ts:258
Parameters
Section titled “Parameters”System access.
directory
Section titled “directory”string
Policy directory, such as /etc/astela/policies.
Returns
Section titled “Returns”Properties
Section titled “Properties”
readonlyname:"linux-json"='linux-json'
Defined in: app/src/platform/policy/policy-providers.ts:250
Name for diagnostics, such as windows-registry.
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”load()
Section titled “load()”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.
Returns
Section titled “Returns”Promise<PolicyReadResult>
Implementation of
Section titled “Implementation of”MacManagedPreferencesPolicyProvider
Section titled “MacManagedPreferencesPolicyProvider”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.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new MacManagedPreferencesPolicyProvider(
io,bundleId,userName):MacManagedPreferencesPolicyProvider
Defined in: app/src/platform/policy/policy-providers.ts:169
Parameters
Section titled “Parameters”System access.
bundleId
Section titled “bundleId”string
The app’s bundle ID.
userName
Section titled “userName”string
Name of the current user, for user-level profiles.
Returns
Section titled “Returns”MacManagedPreferencesPolicyProvider
Properties
Section titled “Properties”
readonlyname:"macos-managed-preferences"='macos-managed-preferences'
Defined in: app/src/platform/policy/policy-providers.ts:159
Name for diagnostics, such as windows-registry.
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”load()
Section titled “load()”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.
Returns
Section titled “Returns”Promise<PolicyReadResult>
Implementation of
Section titled “Implementation of”WindowsRegistryPolicyProvider
Section titled “WindowsRegistryPolicyProvider”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.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new WindowsRegistryPolicyProvider(
io,root):WindowsRegistryPolicyProvider
Defined in: app/src/platform/policy/policy-providers.ts:93
Parameters
Section titled “Parameters”System access.
string
Policy key below the hive, such as SOFTWARE\Policies\Astela.
Returns
Section titled “Returns”Properties
Section titled “Properties”
readonlyname:"windows-registry"='windows-registry'
Defined in: app/src/platform/policy/policy-providers.ts:85
Name for diagnostics, such as windows-registry.
Implementation of
Section titled “Implementation of”Methods
Section titled “Methods”load()
Section titled “load()”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.
Returns
Section titled “Returns”Promise<PolicyReadResult>
Implementation of
Section titled “Implementation of”Interfaces
Section titled “Interfaces”PolicyIo
Section titled “PolicyIo”Defined in: app/src/platform/policy/policy-providers.ts:25
System access used by the policy providers; replaced by fakes in tests.
Methods
Section titled “Methods”listDir()
Section titled “listDir()”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.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string[] | undefined
readFile()
Section titled “readFile()”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.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Uint8Array<ArrayBufferLike> | undefined
remove()
Section titled “remove()”remove(
path):void
Defined in: app/src/platform/policy/policy-providers.ts:35
Deletes a file if it exists.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
runAsync()
Section titled “runAsync()”runAsync(
command,args):Promise<RunResult>
Defined in: app/src/platform/policy/policy-providers.ts:27
Runs a program without blocking. Never rejects.
Parameters
Section titled “Parameters”command
Section titled “command”string
readonly string[]
Returns
Section titled “Returns”Promise<RunResult>
tempFile()
Section titled “tempFile()”tempFile(
name):string
Defined in: app/src/platform/policy/policy-providers.ts:33
Returns a path for a temporary file.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”string
RunResult
Section titled “RunResult”Defined in: app/src/platform/policy/policy-providers.ts:19
The outcome of a program that a policy provider ran.
Properties
Section titled “Properties”status
Section titled “status”
readonlystatus:number|null
Defined in: app/src/platform/policy/policy-providers.ts:20
stdout
Section titled “stdout”
readonlystdout:string
Defined in: app/src/platform/policy/policy-providers.ts:21
Variables
Section titled “Variables”nodePolicyIo
Section titled “nodePolicyIo”
constnodePolicyIo:PolicyIo
Defined in: app/src/platform/policy/policy-providers.ts:39
PolicyIo backed by Node.js.