From feac41b8cc607a2491068b481caf132bfae33b76 Mon Sep 17 00:00:00 2001 From: Josef Zweck Date: Mon, 6 Jan 2025 20:53:35 +0100 Subject: [PATCH 1/8] Create onedrive.markdown --- source/_integrations/onedrive.markdown | 38 ++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 source/_integrations/onedrive.markdown diff --git a/source/_integrations/onedrive.markdown b/source/_integrations/onedrive.markdown new file mode 100644 index 000000000000..82cc321af1ef --- /dev/null +++ b/source/_integrations/onedrive.markdown @@ -0,0 +1,38 @@ +--- +title: OneDrive +description: Instructions on how to setup OneDrive to be used with backups. +ha_release: 2025.2 +ha_category: + - Backup +ha_iot_class: Cloud Polling +ha_config_flow: true +ha_domain: onedrive +ha_codeowners: + - '@zweckj' +ha_integration_type: service +--- + +This integration allows you to use [OneDrive](https://www.microsoft.com/en-us/microsoft-365/onedrive/online-cloud-storage) for use with Home Assistant Backups. +Backups will be created in the `App Folder` of your OneDrive, the integration does have no access to any other parts of your OneDrive except its own folder. + +{% include integrations/config_flow.md %} + +## Getting application credentials + +{% note %} +You will need an Azure tenant with an active Azure subscription to create your own client credentials. +{% endnote %} + +This integration comes with a predefined set of [application credentials](https://www.home-assistant.io/integrations/application_credentials/) through Home assistant account linking. +Everything is done in the user context, so nobody will every have access to your data except you. However, because you want to your own credentials this is possible, +follow [this guide](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app?tabs=certificate) to create your own client ID and secret + +## Known Limitations + +- Only personal OneDrives are supported a the moment + +## Removing the integration + +This integration follows standard integration removal. No extra steps are required. + +{% include integrations/remove_device_service.md %} From 25faeeecf82a4e6df00a9fad2437d1c554eb94d1 Mon Sep 17 00:00:00 2001 From: Josef Zweck Date: Mon, 6 Jan 2025 21:06:17 +0100 Subject: [PATCH 2/8] Fix typos and improve clarity in documentation --- source/_integrations/onedrive.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/_integrations/onedrive.markdown b/source/_integrations/onedrive.markdown index 82cc321af1ef..73c9793df71a 100644 --- a/source/_integrations/onedrive.markdown +++ b/source/_integrations/onedrive.markdown @@ -23,9 +23,9 @@ Backups will be created in the `App Folder` of your OneDrive, the integration do You will need an Azure tenant with an active Azure subscription to create your own client credentials. {% endnote %} -This integration comes with a predefined set of [application credentials](https://www.home-assistant.io/integrations/application_credentials/) through Home assistant account linking. -Everything is done in the user context, so nobody will every have access to your data except you. However, because you want to your own credentials this is possible, -follow [this guide](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app?tabs=certificate) to create your own client ID and secret +This integration comes with a predefined set of [application credentials](https://www.home-assistant.io/integrations/application_credentials/) through Home Assistant account linking. +Everything is done in the user context, so nobody will ever have access to your data except you. However, if you want to use your own credentials, +follow [this guide](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app?tabs=certificate) to create your own client ID and secret. ## Known Limitations From 05f1cc270260171b53dc77758fb2971ecf1b90eb Mon Sep 17 00:00:00 2001 From: Josef Zweck Date: Mon, 6 Jan 2025 21:48:15 +0100 Subject: [PATCH 3/8] Fix typos and improve clarity in documentation --- source/_integrations/onedrive.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/_integrations/onedrive.markdown b/source/_integrations/onedrive.markdown index 73c9793df71a..806061341750 100644 --- a/source/_integrations/onedrive.markdown +++ b/source/_integrations/onedrive.markdown @@ -13,7 +13,7 @@ ha_integration_type: service --- This integration allows you to use [OneDrive](https://www.microsoft.com/en-us/microsoft-365/onedrive/online-cloud-storage) for use with Home Assistant Backups. -Backups will be created in the `App Folder` of your OneDrive, the integration does have no access to any other parts of your OneDrive except its own folder. +Backups will be created in the `App Folder` of your OneDrive. The integration only has access to a application specific folder in this folder and cannot access any other parts of your OneDrive. {% include integrations/config_flow.md %} @@ -29,7 +29,7 @@ follow [this guide](https://learn.microsoft.com/en-us/entra/identity-platform/qu ## Known Limitations -- Only personal OneDrives are supported a the moment +- Only personal OneDrives are supported at the moment ## Removing the integration From cb7b3c95ce56721e5d989cdf0d5c686afd4a3fc0 Mon Sep 17 00:00:00 2001 From: Josef Zweck Date: Mon, 6 Jan 2025 21:49:52 +0100 Subject: [PATCH 4/8] Add newline in OneDrive integration markdown --- source/_integrations/onedrive.markdown | 1 + 1 file changed, 1 insertion(+) diff --git a/source/_integrations/onedrive.markdown b/source/_integrations/onedrive.markdown index 806061341750..dfd44bf29e9b 100644 --- a/source/_integrations/onedrive.markdown +++ b/source/_integrations/onedrive.markdown @@ -13,6 +13,7 @@ ha_integration_type: service --- This integration allows you to use [OneDrive](https://www.microsoft.com/en-us/microsoft-365/onedrive/online-cloud-storage) for use with Home Assistant Backups. + Backups will be created in the `App Folder` of your OneDrive. The integration only has access to a application specific folder in this folder and cannot access any other parts of your OneDrive. {% include integrations/config_flow.md %} From ed34313a75d09cc111ee9fd291692a56281e7b63 Mon Sep 17 00:00:00 2001 From: Josef Zweck Date: Tue, 7 Jan 2025 09:15:26 +0100 Subject: [PATCH 5/8] Update OneDrive integration documentation --- source/_integrations/onedrive.markdown | 28 +++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/source/_integrations/onedrive.markdown b/source/_integrations/onedrive.markdown index dfd44bf29e9b..f03c7a6336a4 100644 --- a/source/_integrations/onedrive.markdown +++ b/source/_integrations/onedrive.markdown @@ -14,20 +14,38 @@ ha_integration_type: service This integration allows you to use [OneDrive](https://www.microsoft.com/en-us/microsoft-365/onedrive/online-cloud-storage) for use with Home Assistant Backups. -Backups will be created in the `App Folder` of your OneDrive. The integration only has access to a application specific folder in this folder and cannot access any other parts of your OneDrive. +Backups will be created in a folder called `home-assistant\backups` in the `App Folder` of your OneDrive. +The integration only has access to a application specific `home-assistant` folder in the `App Folder` and cannot access any other parts of your OneDrive. {% include integrations/config_flow.md %} +{% configuration_basic %} +Client ID: + description: "Application Id of the app registration to be used with the integration. Uses Home Assistant provided by default." +Client secret: + description: "Application secret for the app registration. Uses Home Assistant provided by default." + +{% endconfiguration_basic %} + +{% include integrations/option_flow.md %} + +## Requested permissions by the integration + +The integration will request the following permissions on your OneDrive for the integration to work: + +- `Files.ReadWrite.AppFolder`: Grants the application to read and write in its own, app-specific folder inside your OneDrive +- `offline_access`: Grants the application to refresh its authentication token without requiring your manual intervention +- `openid`: Grants the application to read basic information, e.g. if you have a OneDrive ## Getting application credentials +This integration comes with a predefined set of [application credentials](https://www.home-assistant.io/integrations/application_credentials/) through Home Assistant account linking. +Everything is done in a delegated user context, so nobody will ever have access to your data except you. However, if you want to use your own credentials, +follow [this guide](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app?tabs=certificate) to create your own client ID and secret. + {% note %} You will need an Azure tenant with an active Azure subscription to create your own client credentials. {% endnote %} -This integration comes with a predefined set of [application credentials](https://www.home-assistant.io/integrations/application_credentials/) through Home Assistant account linking. -Everything is done in the user context, so nobody will ever have access to your data except you. However, if you want to use your own credentials, -follow [this guide](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app?tabs=certificate) to create your own client ID and secret. - ## Known Limitations - Only personal OneDrives are supported at the moment From e1c8f83aae9669ba0efa4ec855052ca952ae3a45 Mon Sep 17 00:00:00 2001 From: Josef Zweck Date: Tue, 7 Jan 2025 09:16:09 +0100 Subject: [PATCH 6/8] Fix grammar in OneDrive integration permissions --- source/_integrations/onedrive.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/_integrations/onedrive.markdown b/source/_integrations/onedrive.markdown index f03c7a6336a4..a87541175c4b 100644 --- a/source/_integrations/onedrive.markdown +++ b/source/_integrations/onedrive.markdown @@ -32,9 +32,9 @@ Client secret: The integration will request the following permissions on your OneDrive for the integration to work: -- `Files.ReadWrite.AppFolder`: Grants the application to read and write in its own, app-specific folder inside your OneDrive -- `offline_access`: Grants the application to refresh its authentication token without requiring your manual intervention -- `openid`: Grants the application to read basic information, e.g. if you have a OneDrive +- `Files.ReadWrite.AppFolder`: Grants the application permission to read and write in its own, app-specific folder inside your OneDrive +- `offline_access`: Grants the application permission to refresh its authentication token without requiring your manual intervention +- `openid`: Grants the application permission to read basic information, e.g. if you have a OneDrive ## Getting application credentials From e261b1c67cd1bdaca8867440e02313edc2454a06 Mon Sep 17 00:00:00 2001 From: c0ffeeca7 <38767475+c0ffeeca7@users.noreply.github.com> Date: Thu, 9 Jan 2025 14:39:03 +0100 Subject: [PATCH 7/8] tweaks Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- source/_integrations/onedrive.markdown | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/_integrations/onedrive.markdown b/source/_integrations/onedrive.markdown index a87541175c4b..58630569f82c 100644 --- a/source/_integrations/onedrive.markdown +++ b/source/_integrations/onedrive.markdown @@ -10,12 +10,15 @@ ha_domain: onedrive ha_codeowners: - '@zweckj' ha_integration_type: service +related: + - docs: /common-tasks/general/#backups + title: Backups --- -This integration allows you to use [OneDrive](https://www.microsoft.com/en-us/microsoft-365/onedrive/online-cloud-storage) for use with Home Assistant Backups. +This integration allows you to use [OneDrive](https://www.microsoft.com/en-us/microsoft-365/onedrive/online-cloud-storage) for use with [Home Assistant Backups](/common-tasks/general/#backups). Backups will be created in a folder called `home-assistant\backups` in the `App Folder` of your OneDrive. -The integration only has access to a application specific `home-assistant` folder in the `App Folder` and cannot access any other parts of your OneDrive. +The integration only has access to an application specific `home-assistant` folder in the `App Folder` and cannot access any other parts of your OneDrive. {% include integrations/config_flow.md %} {% configuration_basic %} From 3813b48a5306f9cd9b6e56e204e4140a15e2121d Mon Sep 17 00:00:00 2001 From: Josef Zweck Date: Fri, 10 Jan 2025 09:08:29 +0100 Subject: [PATCH 8/8] Update OneDrive integration documentation --- source/_integrations/onedrive.markdown | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/_integrations/onedrive.markdown b/source/_integrations/onedrive.markdown index 58630569f82c..182f82fb5866 100644 --- a/source/_integrations/onedrive.markdown +++ b/source/_integrations/onedrive.markdown @@ -17,7 +17,8 @@ related: This integration allows you to use [OneDrive](https://www.microsoft.com/en-us/microsoft-365/onedrive/online-cloud-storage) for use with [Home Assistant Backups](/common-tasks/general/#backups). -Backups will be created in a folder called `home-assistant\backups` in the `App Folder` of your OneDrive. +Backups will be created in a folder called `home-assistant\backups_` in the `App Folder` of your OneDrive. +`id` is part of your Home Assistant instance's unique id to allow backups from multiple instances to the same OneDrive. The integration only has access to an application specific `home-assistant` folder in the `App Folder` and cannot access any other parts of your OneDrive. {% include integrations/config_flow.md %} @@ -42,8 +43,8 @@ The integration will request the following permissions on your OneDrive for the ## Getting application credentials This integration comes with a predefined set of [application credentials](https://www.home-assistant.io/integrations/application_credentials/) through Home Assistant account linking. -Everything is done in a delegated user context, so nobody will ever have access to your data except you. However, if you want to use your own credentials, -follow [this guide](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app?tabs=certificate) to create your own client ID and secret. +Nobody will ever have access to your data except you, as the app does not have permission to do anything on its own. It only works with a signed in user (it only has `delegated` not `application permissions`). +However, if you want to use your own credentials, follow [this guide](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app?tabs=certificate) to create your own client ID and secret. {% note %} You will need an Azure tenant with an active Azure subscription to create your own client credentials.