Skip to content

Make the user object a dynamic claim set - #30

Merged
brionmario merged 1 commit into
thunder-id:mainfrom
brionmario:user-claim-set
Aug 24, 2026
Merged

Make the user object a dynamic claim set#30
brionmario merged 1 commit into
thunder-id:mainfrom
brionmario:user-claim-set

Conversation

@brionmario

@brionmario brionmario commented Aug 24, 2026

Copy link
Copy Markdown
Member

Purpose

The iOS and Android SDKs stopped exposing profilePicture and isNewUser on User in 1.0.2, and the platform bridges here still read them, so the plugin no longer compiles once the native dependencies are bumped:

e: ThunderIDMethodHandler.kt:214:34 Unresolved reference 'profilePicture'.
e: ThunderIDMethodHandler.kt:214:70 Unresolved reference 'isNewUser'.

Underneath the compile error is the reason the native SDKs changed: claims are configured per deployment, so a bridge that names the fields it forwards silently drops every other attribute a tenant configures. encodeUser was forwarding six keys, which is why a Flutter app could not read a mobile number or any other configured claim even before this bump.

This carries the native dependency bump to 1.0.2 as well, since the two only make sense together. It supersedes #29, which held the bump on its own and could not build without this fix.

Approach

Both bridges now send the claim set as it arrived rather than picking fields out of it. Kotlin returns user.claims directly. Swift returns user.claims with nested AnyCodable values unwrapped into the types the platform channel codec can encode.

Dart User mirrors the native shape and the JavaScript SDK's KnownUser: it holds the claims, operator [] reads any of them, and sub, username, email, displayName, givenName and familyName are getters that read the claim of the same name and nothing else. No fallback chains, no composed values. profileClaims returns the claims with reservedClaims removed, that set holding only protocol claims: sub, iss, aud, exp, iat, nbf, jti, azp, nonce, typ, at_hash, c_hash, sid, scope, client_id, acr, amr and auth_time.

Picture resolution stays in the presentation layer where it already lived, with picture now first in the list of claim keys UserAvatar checks, and UserObject reading the same claim.

android/build.gradle, thunderid_flutter.podspec and Package.swift move to 1.0.2 in the same commit. The bridge changes compile against 1.0.0 as well, so the ordering of the two halves does not matter for bisecting.

Related Issues

Related PRs

Checklist

  • Followed the contribution guidelines.
  • Manual test round performed and verified. Quickstart built for Android against both v1.0.0 and v1.0.2, and for the iOS simulator against ThunderID 1.0.2. flutter analyze clean and all tests passing on the bumped dependencies.
  • Documentation provided. (Add links if there are any)
  • Tests provided. (Add links if there are any)
    • Unit Tests
    • Integration Tests
  • Breaking changes. (Fill if applicable)
    • Breaking changes section filled.
    • breaking change label added.

Security checks

  • Followed secure coding standards.
  • Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.

@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 386f6826-f367-41af-8bd1-f0b59852480f


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

The native SDKs no longer expose profilePicture or isNewUser on User, so the
bridges stop compiling once the native dependencies move to 1.0.2. Claims are
configured per deployment, so both bridges now send the claim set as it arrived
instead of picking fields out of it, and the Dart User carries those claims,
exposes them by key and keeps the well known ones as getters, matching the
native SDKs.

The native dependency bump comes with it, since the two only make sense
together.

Signed-off-by: Brion <info@brionmario.com>
@brionmario brionmario changed the title Carry the whole claim set across the platform channel Make the user object a dynamic claim set Aug 24, 2026
@brionmario
brionmario merged commit f95c995 into thunder-id:main Aug 24, 2026
8 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.

2 participants