Skip to content

Add Microsoft 365 profile coverage to FlightCheck (Graph beta) - #492

Open
Vincent Wong (wongvincent) wants to merge 17 commits into
microsoft:mainfrom
wongvincent:users/vincentwong/entra-attribute-check
Open

Vincent Wong (wongvincent) wants to merge 17 commits into
microsoft:mainfrom
wongvincent:users/vincentwong/entra-attribute-check

Conversation

@wongvincent

@wongvincent Vincent Wong (wongvincent) commented Nov 10, 2026 •

Copy link
Copy Markdown

Description

Adds AUTH-PROFILE-001 to check availability of a subset of Microsoft 365 People Profile attributes that assist with ESS personalization.

Properties checked: display name, UPN, email, job title, employment type, department, company name, office location, workplace country, employee ID, company code and cost center.

How it works

  • Lists up to 100 Member user IDs through Graph v1.0 /users, then reads beta /users/{id}/profile in read-only batches of 20. Capped scans are labelled as samples.
  • Uses existing User.Read.All for tenant scans. Permission-only failures fall back to /beta/me/profile with User.Read, labelled Own profile only.
  • Applies one 30-second data-read budget across enumeration, batches, retries and DNS; authentication is excluded.
  • Produces non-blocking warnings below 95% coverage or when coverage is unverified. Errors/timeouts discard partial results. Reports contain counts and availability states, not profile values or user IDs.

Other changes

  • Extracts bounded HTTP/retries/DNS into graph_transport.py and adds consent-aware Graph scopes and account/tenant validation.
  • Integrates full, authentication, checkpoint, profile and declarative-agent runs; adds a standalone JSON CLI.
  • Separates warning guidance from manual verification and fixes targeted rerun commands.
  • Adds a spec with property/source mappings and public ODS, Entra and profile-ingestion references.

Testing

Regression coverage includes profile availability, consent/fallback, identity checks, batching/retries, deadlines/DNS cleanup and reporting. Tests and lint passed; live API probes exercised own-profile and tenant reads.

Vincent Wong and others added 2 commits November 10, 2026 09:10
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f1fdfd99-7cc6-4fba-b752-bd00cebe442b
Check the signed-in profile with User.Read when tenant access is unavailable, clearly distinguish own-profile availability from tenant coverage, and preserve other Graph checks and the shared read budget.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f1fdfd99-7cc6-4fba-b752-bd00cebe442b
@wongvincent
Vincent Wong (wongvincent) marked this pull request as ready for review November 11, 2026 00:03
@wongvincent

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree company="Microsoft"

if limit <= 0 or time_budget <= 0:
raise ValueError("Collection limit and time budget must be positive.")
with self._bounded_errors(time_budget):
return asyncio.run(self._bounded_collection(path, params, limit, time_budget))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The 30-second limit can still be exceeded when DNS is slow. asyncio.run() waits for the DNS lookup to finish even after the request is cancelled. Please make both tenant and own-profile reads return when the deadline expires.

Vincent Wong and others added 4 commits November 13, 2026 10:19
Isolate bounded Graph DNS lookups in cancellable helper processes so tenant and own-profile reads do not wait for blocked resolver threads during shutdown. Verify the signed-in account and token tenant before profile reads, and cover deadline cleanup and tenant mismatches with regressions.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f1fdfd99-7cc6-4fba-b752-bd00cebe442b
Resolve the shared registry test conflict by retaining both Entra coverage parity tests and the upstream standalone FlightCheck report test. Preserve upstream setup, telemetry and report-path changes alongside the profile coverage, DNS deadline and tenant identity fixes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f1fdfd99-7cc6-4fba-b752-bd00cebe442b
Preserve upstream constructor-provided Graph scopes and person-search support while retaining explicit sign-in scope overrides and consent-aware authentication. Add regressions covering constructor defaults and explicit overrides for silent and interactive sign-in.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f1fdfd99-7cc6-4fba-b752-bd00cebe442b
Use constructor-only Graph scopes, consolidate bounded HTTP and cancellable DNS behind one transport, and supply identity-bound self-profile clients from CLI/DA setup instead of the generic runner. Preserve existing permission, retry, deadline and report behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f1fdfd99-7cc6-4fba-b752-bd00cebe442b
Replace Entra-only coverage with public Graph beta rich-profile reads. Check identity and employment fields plus standard profile sections across at most 100 Member users, batch up to 20 reads, preserve the 30-second budget and own-profile fallback, and mark source conflicts or omissions unverified instead of empty.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f1fdfd99-7cc6-4fba-b752-bd00cebe442b
@wongvincent Vincent Wong (wongvincent) changed the title Add bounded Entra profile coverage to FlightCheck Add Microsoft 365 profile coverage to FlightCheck (Graph beta) Nov 17, 2026
Vincent Wong and others added 10 commits November 17, 2026 16:06
Describe supported profile data sources and availability checks directly, without internal retrieval-investigation wording.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: f1fdfd99-7cc6-4fba-b752-bd00cebe442b
Share retry scheduling, isolate batch validation, and remove unused profile selection plumbing. Compare colleague collections independent of order while preserving genuine conflicts.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f1fdfd99-7cc6-4fba-b752-bd00cebe442b
Keep beta endpoint and API-version labels while removing the production-support disclaimer from reports and documentation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f1fdfd99-7cc6-4fba-b752-bd00cebe442b
Remove unsupported and Graph-only checks, count only work-anniversary dates, and document shared properties and separate-resource exclusions in the spec.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f1fdfd99-7cc6-4fba-b752-bd00cebe442b
Require a real relationship identity instead of counting labels as profile data. Preserve authentication and malformed-response errors when another batch request is forbidden. Add regression coverage and clarify the beta URL constant name.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f1fdfd99-7cc6-4fba-b752-bd00cebe442b
Avoid competing request timeouts converting operation cancellation into retries. Isolate TLS initialization from DNS timing assertions while preserving cancellation and worker cleanup checks.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f1fdfd99-7cc6-4fba-b752-bd00cebe442b
Use public ODS, Entra and Graph contracts. Remove separate given-name, surname, relationship, date and enrichment checks; require actual primary/work email data and ignore unselected properties.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f1fdfd99-7cc6-4fba-b752-bd00cebe442b
State that the approved twelve checks cover a subset of Microsoft 365 People Profile, and link ODS attributes, Entra attributes and profile data-source guidance.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f1fdfd99-7cc6-4fba-b752-bd00cebe442b
Describe the current expandable property subset and ingestion guidance without obsolete comparisons or exclusion lists. Count any nonblank email address regardless of its type.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f1fdfd99-7cc6-4fba-b752-bd00cebe442b
Keep the scope description focused on ESS personalization. Distinguish v1.0 user-ID enumeration from beta profile reads.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: f1fdfd99-7cc6-4fba-b752-bd00cebe442b
@is-goutham

Copy link
Copy Markdown
Contributor

One thing to fix before merging: the legacy Dataverse-backed full/authentication path still calls graph.authenticate() without the preferred username, but the new profile check validates the Graph account against --preferred-username.

With two accounts cached in the same tenant, Graph can silently pick account B when account A was requested. The profile check then reports an account-mismatch error and fails the run, even though A has valid cached credentials.

Please pass the requested account into Graph authentication on this path as well, keeping the identity check in place. A regression test with two cached accounts and the requested account second would cover this.

Relevant code:

runner.authenticated_account = (
getattr(args, "preferred_username", None) or getattr(graph, "signed_in_username", None)
)
runner.self_profile_graph = partial(authenticate_self_profile, tenant_id, runner.authenticated_account)

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.

2 participants