Repository navigation
feat(excel): Service Principal, Each user signs in, national clouds and n8n v2 operations (1.0.0) - #4166
Open
ForeignKeyCN wants to merge 4 commits into
Open
feat(excel): Service Principal, Each user signs in, national clouds and n8n v2 operations (1.0.0)#4166ForeignKeyCN wants to merge 4 commits into
ForeignKeyCN wants to merge 4 commits into
Conversation
… signs in, and n8n v2 operations (1.0.0)
…urn All Matches options
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Brings the Excel plugin in line with Outlook (#4163), Teams (#4164) and OneDrive (#4165), and with n8n's Microsoft Excel 365 node (v2). The plugin's code predated those: login and Graph hosts were hard-coded (
common, global cloud), every tool built its own requests, and IDs and names went into URLs unencoded. So this PR first rebuilds the base, then adds the auth modes and the missing operations.1. Base (no behaviour change for existing workflows)
tools/graph_client.py; the 8 existing tools keep their names, parameters,jsonand text output, and now go through it.Q3'sbroke the request and an LLM-supplied ID orsite_idcould change the request path (e.g.../users/...). SharePoint site IDs keep their commas, as Graph expects.common, as before) and Microsoft Cloud on the OAuth client; scopes are qualified outside the global cloud, the Graph host is stored with the credential, and existing authorizations stay on the global cloud. The refresh still omitsscope(kept from before).success/errorplus each tool's fields), as in the other Microsoft plugins.search_worksheet_datareported wrong cell addresses when the range did not start at A1.2. Auth modes (API Key credential)
Files.ReadWrite.All; each call targets a SharePoint Site ID, the tool's Drive Owner setting (form-only, never chosen by the LLM) or the credential's default drive owner. Saving with a default drive owner opens that OneDrive to check the permission.GET /excel/callback) that never holds the secret; per-user tokens Fernet-encrypted in plugin storage, keyed by a hash ofclient_id | Dify user ID; never in tool output or logs. Same delegated scopes as OAuth (a test keeps them equal). Sign Out of Excel (excel_sign_out).3. n8n v2 parity (new tools carry an
excel_prefix: the new Agent rejects duplicate tool names across plugins)list_workbooks/create_worksheet(existing)excel_delete_workbooklist_worksheets/clear_worksheet_data(existing)excel_get_rows: rows as objects keyed by the header row; used range unless a range is given; Header Row / First Data Row (read_worksheet_datastays for the raw grid)excel_update_rows: match on a key column, change only the given columns, never append, Update All Matches (write_worksheet_datastays for n8n's raw mode)excel_append_rows: objects keyed by header or cell lists; on an empty sheet the keys become the headerexcel_upsert_rows, with Update All Matchesexcel_delete_worksheetexcel_add_table/excel_delete_table/excel_convert_table_to_range/excel_get_table_columns/excel_get_table_rows/excel_append_table_rows/excel_lookup_table(Return All Matches option)excel_list_tablesVersion 0.2.2 → 1.0.0, matching the other Microsoft plugins. README (setup for all three modes, tool table with the n8n mapping, output variables) and PRIVACY updated.
Release Notes
Change Type
Screenshots / Videos
Agent on a self-hosted Dify with Outlook, Teams, OneDrive and Excel, each using Each user signs in:
Testing
pytest). They cover: the Graph context for OAuth / Service Principal / per-user (drive and site resolution, national clouds, unknown-host refusal, Drive Owner rules); URL encoding of IDs, sheet names, ranges and site IDs, including path-climbing attempts; the address parser (sheet names such asSheet1are not cell references); every tool's output variables on success and on a Graph error (a test checks every tool in the provider is covered); append (header on an empty sheet, data not starting at A1, unknown keys), update and upsert (first match vs. all matches, untouched columns, unmatched keys reported or appended), get rows (header row, first data row, blank rows, limit), the table tools and lookup options; OAuth tenant/cloud URLs; per-user validation and the sign-in flow.Checklist
manifest.yaml(0.2.2 → 1.0.0)