Skip to content

Show on Home only the apps a member can open - #367

Open
jonathanlaib wants to merge 2 commits into
mainfrom
home-access
Open

jonathanlaib wants to merge 2 commits into
mainfrom
home-access

Conversation

@jonathanlaib

@jonathanlaib jonathanlaib commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #366.

This changes company sign-in, including the scopes requested from Microsoft Entra. Please review that part before merging; it could not be checked against a real Entra tenant.

Problem

Home shows every published app to every member, also to the people an app's group rules keep out. They find the app on Home, open it, and are refused at its sign-in. The management pages cannot do better today: a person's company groups are read only when the person signs in to an app, so the pages that list apps do not know them.

Change

Groups from the company sign-in. A company sign-in to Widefleet keeps the member's groups in a new table, member_groups, per member and organization. They are read with the function app sign-in uses, so both agree on a person's groups: from the claim for OIDC, from Microsoft Graph for Entra, from Cloud Identity for Google Workspace when its scope is configured. Each company sign-in replaces them. A sign-in whose groups cannot be read removes them and still succeeds.

Home, an app's page and its pictures. A published app with group rules is shown to members of one of its groups, and to the people who manage it. An app without group rules is shown to everyone, as before. While a member's groups are unknown, because they have not signed in through company SSO since this change or the directory refused, a published app is shown as before, so nobody loses an app they can open.

Entra. Entra names a person's groups only to a sign-in that may read their profile. A company sign-in through an Entra connection therefore requests User.Read in addition to the saved scopes, as app sign-in already does with the same client. Other providers request what they requested before.

Wording. The switch on an app's Access section says that the people who can use the app find it on Home.

Why groups from the sign-in

Taking a person's groups at sign-in and keeping them until the next one is the usual first step for showing things by company group, and it is what app sign-in does. A directory that sends its users and groups continuously, through SCIM, would give every part of the platform one source and changes within minutes. That is a larger step of its own. The architecture notes record that the stored groups only decide what is listed and never authorize an app.

Consequences to know

  • A change to a person's groups reaches Home with their next company sign-in. The same holds for opening apps today.
  • A tenant that requires admin consent for User.Read and has not granted it for this client would refuse the company sign-in to Widefleet. The same tenant already grants it for app sign-in, which uses this client, so this should not occur where apps are in use.
  • A company sign-in through Entra makes one or more requests to Microsoft Graph, each with a ten-second limit, as app sign-in does.

Not included

  • Sign-ins that reach the provider by email domain instead of the provider's ID keep the saved scopes; with Entra, their groups stay unknown.
  • People who sign in without company SSO have no groups, so restricted apps stay listed for them.

How to check the Entra part

This needs a tenant, an Entra SSO connection and a published app whose allowed groups name one Entra group.

  1. Sign out, then sign in to Widefleet with a company account that is in the group. The sign-in should complete without a new consent prompt. Home lists the app.
  2. Sign in with a company account that is not in the group. Home does not list the app, and its page answers "not found".
  3. In member_groups, both members have a row with their Entra group IDs, also the nested ones.
  4. With the Graph permission withdrawn from the client, or Graph unreachable, the sign-in still completes, the member's row is gone and Home lists the app.
  5. A member of more than 200 groups signs in and still gets a row; Graph pages its answer.

Verification

  • pnpm typecheck, pnpm format:check, pnpm lint
  • pnpm exec vitest run apps/control-plane/tests against local Postgres and object storage, 1,020 tests. New cases: a published app with group rules is listed, has a page and serves its icon and screenshots for a member of the group, not for a member of another group, always for the people who manage it, and for everyone while groups are unknown; a member of 150 groups keeps Home; a company sign-in through a synthetic OIDC provider keeps the groups of its claim, and an empty list for a provider that names none; a sign-in through an Entra connection requests User.Read and an OIDC connection does not.
  • tests/e2e/auth.spec.ts, organization-writes.spec.ts, oidc.spec.ts, self-hosted-sso.spec.ts and domain-join.spec.ts, all 67 tests.
  • Not checked: a sign-in against a real Entra tenant, the Graph request in the control plane, Google Workspace groups, and a member with more groups than one Graph page holds. No interface changed apart from one sentence, so no screenshots.

Documentation: #351 (draft, blocked until a release contains this change).

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge, with the previously reported personal-connector icon issue remaining non-blocking.

Findings

  1. P2 Personal connections lose their icons ▶

Summary

Company sign-in saves a member's groups so Home, app pages and pictures can follow app access rules.

  • Company sign-in saves groups that app listings can use.
  • Home, app pages, and pictures follow each app’s group rules.

No new findings were accepted. The earlier, unnumbered finding about large group lists is fixed: readMemberGroups no longer applies the 100-group limit for app rules.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  SSO["Company sign-in"] --> Lookup["Read company groups"]
  Lookup -->|Success| Save["Save groups per member and organization"]
  Lookup -->|Failure| Clear["Remove saved groups"]
  Save --> Listing["Filter Home, app pages and pictures"]
  Clear --> Unknown["Keep previous listing behavior"]
  Listing --> AppSSO["App sign-in still decides access"]
  Unknown --> AppSSO
Loading

Reviews (3) · Last reviewed commit: "Show an app's pictures to the people who..." · Reviewed by Greptile

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
widefleet-docs 073407d Nov 24 2026, 09:27 AM

Comment on lines +111 to +112
// Pictures of an app follow its listing: they are for the people who can open it.
return record && opens(record, await readMemberGroups(transaction, principal))

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Personal connections lose their icons

readAppIcon now rejects restricted connectors when the member's saved groups do not match. But My connections still lists those connectors, and managing a personal connection deliberately ignores app access groups. Those rows now show the generic fallback instead of the connector's icon.

Preserve icon access for connectors shown in My connections while keeping the new check for published app pictures.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Base automatically changed from access-home to main November 24, 2026 09:20
A company sign-in to Widefleet now keeps the member's groups, read the
way app sign-in reads them. Home and an app's page use them: a published
app with group rules is shown to members of those groups and to the
people who manage it. While a member's groups are unknown, the app is
shown as before.

Entra names groups only to a sign-in that may read the person's profile,
so a company sign-in through Entra requests User.Read, as app sign-in
does.
A member's groups are read without the limit of an app's rules, so a
member of more than a hundred groups keeps Home. Icons and screenshots
follow the listing. The architecture notes say where the groups come
from and that they never authorize an app.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant