BlueGit

ict rusty-teams

fix(session): a .All scope grants the plain scope

A tab whose Graph token carries Files.ReadWrite.All rejected uploads
asking for Files.ReadWrite with "not granted".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

metis Daniel Däschle · pushed by metis

Authored 2026-10-08 · 7 weeks ago

Hash
595d83e1a7a1dca6ef7a414b381f7d511edcbbeb
Parent
6fca2b98
1 file changed +4 −2
crates/session/assets/fetch.js +4 −2
@@ -3,8 +3,10 @@
3 3 const wanted = (base + '/' + scope).toLowerCase();
4 4 const fresh = (expires) => expires > Date.now() + marginMs;
5 5 const normalize = (value) => value.toLowerCase().replace(/\/\/+(?=[^/]*$)/, '/');
6 const grants = (scopes) => scopes.some(s => normalize(s) === wanted
7 || (base === 'https://graph.microsoft.com' && s.toLowerCase() === scope.toLowerCase()));
6 const short = scope.toLowerCase();
7 const covers = (value, name) => value === name || value === name + '.all';
8 const grants = (scopes) => scopes.some(s => covers(normalize(s), wanted)
9 || (base === 'https://graph.microsoft.com' && covers(s.toLowerCase(), short)));
8 10 const entries = [];
9 11 let activeHome = null;
10 12 for (let index = 0; index < localStorage.length; index++) {
@@ -3,8 +3,10 @@
3 const wanted = (base + '/' + scope).toLowerCase();
3 const wanted = (base + '/' + scope).toLowerCase();
4 const fresh = (expires) => expires > Date.now() + marginMs;
4 const fresh = (expires) => expires > Date.now() + marginMs;
5 const normalize = (value) => value.toLowerCase().replace(/\/\/+(?=[^/]*$)/, '/');
5 const normalize = (value) => value.toLowerCase().replace(/\/\/+(?=[^/]*$)/, '/');
6 const grants = (scopes) => scopes.some(s => normalize(s) === wanted
6 const short = scope.toLowerCase();
7 || (base === 'https://graph.microsoft.com' && s.toLowerCase() === scope.toLowerCase()));
7 const covers = (value, name) => value === name || value === name + '.all';
8 const grants = (scopes) => scopes.some(s => covers(normalize(s), wanted)
9 || (base === 'https://graph.microsoft.com' && covers(s.toLowerCase(), short)));
8 const entries = [];
10 const entries = [];
9 let activeHome = null;
11 let activeHome = null;
10 for (let index = 0; index < localStorage.length; index++) {
12 for (let index = 0; index < localStorage.length; index++) {