Skip to content

Commit

Permalink
feat: track DCv2 setting definitions (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
pl4nty authored Feb 17, 2024
1 parent 3be5102 commit fba3857
Show file tree
Hide file tree
Showing 13,542 changed files with 1,105,404 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
22 changes: 22 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/python
{
"name": "Python 3",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/python:1-3.12-bullseye"

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "pip3 install --user -r requirements.txt",

// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
3 changes: 3 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
AZURE_TENANT_ID=
AZURE_CLIENT_ID=
AZURE_CLIENT_SECRET=
31 changes: 31 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Refresh data

on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *" # daily

jobs:
main:
runs-on: ubuntu-latest
permissions:
id-token: write # Graph auth
contents: write # committing
steps:
- uses: actions/[email protected]
# azure-identity doesn't support GitHub WIF
- uses: azure/login@v1
with:
tenant-id: ${{ vars.AZURE_TENANT_ID }}
client-id: ${{ vars.AZURE_CLIENT_ID }}
allow-no-subscriptions: true
- uses: actions/[email protected]
with:
python-version: 3.12
cache: pip
- run: pip install -r requirements.txt
- run: python main.py
- uses: EndBug/[email protected]
with:
default_author: github_actions
message: 'chore: refresh data'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
37 changes: 37 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from dotenv import load_dotenv
load_dotenv()

import asyncio
import json
import os
from pathlib import Path

from azure.identity.aio import DefaultAzureCredential
from msgraph_beta import GraphServiceClient
from kiota_abstractions.native_response_handler import NativeResponseHandler
from kiota_http.middleware.options import ResponseHandlerOption

from msgraph_beta.generated.device_management.configuration_settings.configuration_settings_request_builder import ConfigurationSettingsRequestBuilder

client = GraphServiceClient(DefaultAzureCredential(), ['https://graph.microsoft.com/.default'])

async def main():
output = 'settings'

query_params = ConfigurationSettingsRequestBuilder.ConfigurationSettingsRequestBuilderGetQueryParameters(
top=10
)
request_config = ConfigurationSettingsRequestBuilder.ConfigurationSettingsRequestBuilderGetRequestConfiguration(
options=[ResponseHandlerOption(NativeResponseHandler())],
# query_parameters=query_params
)
settings = await client.device_management.configuration_settings.get(request_configuration=request_config)

os.makedirs(output, exist_ok=True)
for setting in settings.json()['value']:
setting.pop('version')
path = Path(output, setting['id']).with_suffix('.json')
with open(path, 'w', encoding='utf-8') as f:
json.dump(setting, f, ensure_ascii=False, indent=4)

asyncio.run(main())
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
msgraph-beta-sdk
python-dotenv
45 changes: 45 additions & 0 deletions settings/.globalpreferences_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"@odata.type": "#microsoft.graph.deviceManagementConfigurationSettingGroupCollectionDefinition",
"accessTypes": "none",
"keywords": [
"Global Preferences"
],
"infoUrls": [],
"occurrence": null,
"baseUri": "",
"offsetUri": ".GlobalPreferences",
"rootDefinitionId": ".globalpreferences_.globalpreferences",
"categoryId": "1829cdc1-1bed-4058-9aba-9b778cd3d955",
"settingUsage": "configuration",
"uxBehavior": "default",
"visibility": "settingsCatalog,template",
"id": ".globalpreferences_.globalpreferences",
"description": "Synthetic Top Level Setting Group Collection",
"helpText": null,
"name": ".GlobalPreferences",
"displayName": "Top Level Setting Group Collection",
"childIds": [
".globalpreferences_multiplesessionenabled",
".globalpreferences_com.apple.autologout.autologoutdelay"
],
"maximumCount": 1,
"minimumCount": 0,
"applicability": {
"description": null,
"platform": "macOS",
"deviceMode": "none",
"technologies": "mdm,appleRemoteManagement"
},
"referredSettingInformationList": [],
"dependentOn": [],
"dependedOnBy": [
{
"dependedOnBy": ".globalpreferences_multiplesessionenabled",
"required": false
},
{
"dependedOnBy": ".globalpreferences_com.apple.autologout.autologoutdelay",
"required": false
}
]
}
45 changes: 45 additions & 0 deletions settings/.globalpreferences_com.apple.autologout.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"@odata.type": "#microsoft.graph.deviceManagementConfigurationSimpleSettingDefinition",
"accessTypes": "none",
"keywords": [
"Global Preferences"
],
"infoUrls": [],
"occurrence": null,
"baseUri": "",
"offsetUri": "com.apple.autologout.AutoLogOutDelay",
"rootDefinitionId": ".globalpreferences_.globalpreferences",
"categoryId": "1829cdc1-1bed-4058-9aba-9b778cd3d955",
"settingUsage": "configuration",
"uxBehavior": "default",
"visibility": "settingsCatalog,template",
"id": ".globalpreferences_com.apple.autologout.autologoutdelay",
"description": "The autologout delay, in seconds. A value of 0 means autologout is off. In some cases, this delay may be restricted to values between 5 minutes and 24 hours.",
"helpText": null,
"name": "com.apple.autologout.AutoLogOutDelay",
"displayName": "Auto Log Out Delay",
"applicability": {
"description": null,
"platform": "macOS",
"deviceMode": "none",
"technologies": "mdm,appleRemoteManagement"
},
"referredSettingInformationList": [],
"valueDefinition": {
"@odata.type": "#microsoft.graph.deviceManagementConfigurationIntegerSettingValueDefinition",
"maximumValue": 2147483647,
"minimumValue": 0
},
"defaultValue": {
"@odata.type": "#microsoft.graph.deviceManagementConfigurationIntegerSettingValue",
"settingValueTemplateReference": null,
"value": 0
},
"dependentOn": [
{
"dependentOn": ".globalpreferences_.globalpreferences",
"parentSettingId": ".globalpreferences_.globalpreferences"
}
],
"dependedOnBy": []
}
69 changes: 69 additions & 0 deletions settings/.globalpreferences_multiplesessionenabled.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"@odata.type": "#microsoft.graph.deviceManagementConfigurationChoiceSettingDefinition",
"accessTypes": "none",
"keywords": [
"Global Preferences"
],
"infoUrls": [],
"occurrence": null,
"baseUri": "",
"offsetUri": "MultipleSessionEnabled",
"rootDefinitionId": ".globalpreferences_.globalpreferences",
"categoryId": "1829cdc1-1bed-4058-9aba-9b778cd3d955",
"settingUsage": "configuration",
"uxBehavior": "toggle",
"visibility": "settingsCatalog,template",
"id": ".globalpreferences_multiplesessionenabled",
"description": "If false, disables fast user switching.",
"helpText": null,
"name": "MultipleSessionEnabled",
"displayName": "Multiple Session Enabled",
"defaultOptionId": ".globalpreferences_multiplesessionenabled_true",
"applicability": {
"description": null,
"platform": "macOS",
"deviceMode": "none",
"technologies": "mdm,appleRemoteManagement"
},
"referredSettingInformationList": [],
"options": [
{
"itemId": ".globalpreferences_multiplesessionenabled_false",
"description": null,
"helpText": null,
"name": "Disabled",
"displayName": "False",
"optionValue": {
"@odata.type": "#microsoft.graph.deviceManagementConfigurationStringSettingValue",
"settingValueTemplateReference": null,
"value": "false"
},
"dependentOn": [
{
"dependentOn": ".globalpreferences_.globalpreferences",
"parentSettingId": ".globalpreferences_.globalpreferences"
}
],
"dependedOnBy": []
},
{
"itemId": ".globalpreferences_multiplesessionenabled_true",
"description": null,
"helpText": null,
"name": "Enabled",
"displayName": "True",
"optionValue": {
"@odata.type": "#microsoft.graph.deviceManagementConfigurationStringSettingValue",
"settingValueTemplateReference": null,
"value": "true"
},
"dependentOn": [
{
"dependentOn": ".globalpreferences_.globalpreferences",
"parentSettingId": ".globalpreferences_.globalpreferences"
}
],
"dependedOnBy": []
}
]
}
72 changes: 72 additions & 0 deletions settings/3~policy~microsoft_edge_targetblankimpliesnoopener.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"@odata.type": "#microsoft.graph.deviceManagementConfigurationChoiceSettingDefinition",
"accessTypes": "none",
"keywords": [
"TargetBlankImpliesNoOpener",
"Do not set window.opener for links targeting _blank",
"\\Microsoft Edge",
"Microsoft Edge"
],
"infoUrls": [],
"baseUri": "./User/Vendor/MSFT/Policy",
"offsetUri": "/Config/microsoft_edgev88.0.705.23~Policy~microsoft_edge/TargetBlankImpliesNoOpener",
"rootDefinitionId": "3~policy~microsoft_edge_targetblankimpliesnoopener",
"categoryId": "a25a7a02-4bac-411b-9d02-10cb3297cb17",
"settingUsage": "configuration",
"uxBehavior": "toggle",
"visibility": "settingsCatalog,template",
"id": "3~policy~microsoft_edge_targetblankimpliesnoopener",
"description": "If you enable this policy or leave it unset, the window.opener property is set to null unless the anchor specifies rel=\"opener\".\r\n\r\nIf you disable this policy, popups that target _blank are permitted to access (via JavaScript) the page that requested to open the popup.\r\n\r\nThis policy will be obsoleted in Microsoft Edge version 95.",
"helpText": "",
"name": "TargetBlankImpliesNoOpener",
"displayName": "Do not set window.opener for links targeting _blank (User)",
"defaultOptionId": "3~policy~microsoft_edge_targetblankimpliesnoopener_0",
"applicability": {
"@odata.type": "#microsoft.graph.deviceManagementConfigurationWindowsSettingApplicability",
"description": null,
"platform": "windows10",
"deviceMode": "none",
"technologies": "mdm",
"configurationServiceProviderVersion": "5.0",
"maximumSupportedVersion": null,
"minimumSupportedVersion": null,
"windowsSkus": [],
"requiresAzureAd": false,
"requiredAzureAdTrustType": "none"
},
"occurrence": {
"minDeviceOccurrence": 1,
"maxDeviceOccurrence": 1
},
"referredSettingInformationList": [],
"options": [
{
"itemId": "3~policy~microsoft_edge_targetblankimpliesnoopener_0",
"description": null,
"helpText": null,
"name": "Disabled",
"displayName": "Disabled",
"optionValue": {
"@odata.type": "#microsoft.graph.deviceManagementConfigurationIntegerSettingValue",
"settingValueTemplateReference": null,
"value": 0
},
"dependentOn": [],
"dependedOnBy": []
},
{
"itemId": "3~policy~microsoft_edge_targetblankimpliesnoopener_1",
"description": null,
"helpText": null,
"name": "Enabled",
"displayName": "Enabled",
"optionValue": {
"@odata.type": "#microsoft.graph.deviceManagementConfigurationIntegerSettingValue",
"settingValueTemplateReference": null,
"value": 1
},
"dependentOn": [],
"dependedOnBy": []
}
]
}
Loading

0 comments on commit fba3857

Please sign in to comment.