Skip to content

Implement identity on SimpleUser and UnauthenticatedUser - #3271

Merged
Kludex merged 6 commits into
Kludex:mainfrom
navidnabavi:fix/base-user-identity
Sep 7, 2026
Merged

Kludex merged 6 commits into
Kludex:mainfrom
navidnabavi:fix/base-user-identity

Conversation

@navidnabavi

Copy link
Copy Markdown
Contributor

fix(authentication): implement identity property on SimpleUser and UnauthenticatedUser

BaseUser defined identity as abstract but neither concrete subclass implemented it, causing NotImplementedError at runtime.

  • SimpleUser.identity returns username
  • UnauthenticatedUser.identity returns ""

Summary

BaseUser defines identity as an abstract property (raises NotImplementedError).
Neither SimpleUser nor UnauthenticatedUser implement it.
Discussion

Checklist

  • [ x ] I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
  • [ x ] I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • [ x ] I've updated the documentation accordingly.

navidnabavi and others added 2 commits May 15, 2026 14:03
…authenticatedUser

BaseUser defined identity as abstract but neither concrete subclass
implemented it, causing NotImplementedError at runtime.

- SimpleUser.identity returns username
- UnauthenticatedUser.identity returns ""

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

No issues found across 3 files

Re-trigger cubic

@codspeed

codspeed Bot commented Sep 6, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 242 untouched benchmarks


Comparing navidnabavi:fix/base-user-identity (384fca3) with main (41db6a7)

Open in CodSpeed

@Kludex Kludex changed the title fix(authentication): implement identity property on SimpleUser and Un… Implement identity on SimpleUser and UnauthenticatedUser Sep 7, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 2 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="docs/authentication.md">

<violation number="1">
P2: `BaseUser` defines three abstract properties (`is_authenticated`, `display_name`, and `identity`), all raising `NotImplementedError`, but the new docs text says it "provides two properties" and lists only the first two. Since `identity` was just implemented on the built-in users, a user subclass that follows these docs and omits `identity` will hit `NotImplementedError` at runtime — the exact failure this PR fixes. Restore `.identity` to the list and say "three properties".</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

@Kludex
Kludex merged commit fd662b1 into Kludex:main Sep 7, 2026
11 checks passed
@Kludex

Kludex commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Thanks!

@navidnabavi
navidnabavi deleted the fix/base-user-identity branch September 9, 2026 08:48
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