Skip to content

Expose token entity/job info through BfabricUser#485

Merged
leoschwarz merged 3 commits intomainfrom
worktree-user-token-info
Apr 15, 2026
Merged

Expose token entity/job info through BfabricUser#485
leoschwarz merged 3 commits intomainfrom
worktree-user-token-info

Conversation

@leoschwarz
Copy link
Copy Markdown
Member

@leoschwarz leoschwarz commented Apr 15, 2026

  • Adds entity_class, entity_id, job_id, and application_id as optional fields on SessionData and read-only properties on BfabricUser
  • Middleware now populates these from TokenData during token validation, so app code can use user.entity_class and user.entity_id directly
  • Previously this context was lost after token validation and only accessible via the on_success hook

When B-Fabric launches a webapp via token, TokenData contains rich
context (entity_class, entity_id, job_id, application_id) that was
previously lost after token validation. This makes the info accessible
directly via BfabricUser properties, removing the need to use the
on_success hook to capture it.

- Add optional token context fields to SessionData
- Populate them from TokenData in middleware _handle_landing()
- Add corresponding properties on BfabricUser
- Add unit tests and BDD scenarios for the new fields
These fields are always present when created from a token, so there's
no reason to make them optional. This is a breaking change for any code
constructing SessionData without them.
@leoschwarz leoschwarz merged commit bc4a348 into main Apr 15, 2026
4 checks passed
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