Skip to content

Add dev mode flag for mobile app attestation - #4434

Merged
Malith-19 merged 1 commit into
thunder-id:mainfrom
Malith-19:feat/4432-mobile-attestation-dev-mode
Aug 3, 2026
Merged

Add dev mode flag for mobile app attestation#4434
Malith-19 merged 1 commit into
thunder-id:mainfrom
Malith-19:feat/4432-mobile-attestation-dev-mode

Conversation

@Malith-19

@Malith-19 Malith-19 commented Jul 30, 2026

Copy link
Copy Markdown
Member

Purpose

Mobile type applications validate platform attestation by default, so sample apps and development clients that haven't configured attestation can't try out sign-in flows. This adds a per-application dev mode flag that skips attestation verification when enabled, so it can be turned on for testing without requiring a full attestation setup.

Approach

  • Backend: added AttestationConfig.DevMode (devMode on the wire), and a new flowInitiationDevMode flow-initiation mode. A mobile app with dev mode enabled bypasses the attestation guard entirely, regardless of whether Android/Apple attestation is configured. Also fixed a bug where the Android-credential persist path silently dropped DevMode on update.
  • Console UI: added a "Dev Mode" toggle to the attestation settings card, placed in the card header (right side), matching the enable-toggle placement used elsewhere (e.g. flow sections). A warning banner is shown in the card body while dev mode is enabled, advising it's for testing only.

UI Preview

Screenshot 2026-07-30 at 15 30 11 Screenshot 2026-07-30 at 15 30 24 Screenshot 2026-07-31 at 11 15 08

Related Issues

Related PRs

  • N/A

Checklist

  • Followed the contribution guidelines.
  • Manual test round performed and verified.
  • Documentation provided. (Add links if there are any)
    • Ran Vale and fixed all errors and warnings
  • 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 in WSO2 Secure Coding Guidelines
  • Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.

Summary by CodeRabbit

New Features

  • Added Attestation Dev Mode for mobile applications, allowing authentication flows without platform attestation during development and testing.
  • Added a Console toggle with warning messaging and confirmation before enabling Dev Mode.
  • Added API configuration support with Dev Mode disabled by default.

Documentation

  • Documented Dev Mode configuration, behavior, and production-use warnings.

Bug Fixes

  • Preserved Dev Mode settings when saving and loading application attestation configuration.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This change adds mobile attestation DevMode. The flag persists through backend processing, appears in the Console and API schema, bypasses attestation for direct mobile flows, and includes tests and documentation.

Changes

Mobile attestation dev mode

Layer / File(s) Summary
Attestation configuration and persistence
api/application.yaml, backend/pkg/thunderidengine/providers/model.go, backend/internal/application/service.go, backend/**/*_test.go
The API schema adds an independent devMode flag. Backend sanitization and credential reconstruction preserve the flag.
Dev mode flow initiation bypass
backend/internal/flow/flowexec/*, docs/content/guides/applications/application-settings.mdx, docs/content/key-concepts/authentication/integration-models.mdx
Mobile clients with DevMode use a dedicated initiation mode that accepts direct flows without flow-secret or attestation verification. Documentation describes the configuration and behavior.
Console dev mode configuration
frontend/apps/console/src/features/applications/components/edit-application/advanced-settings/*, frontend/packages/i18n/src/locales/en-US.ts
The Console adds a confirmed DevMode switch, warning state, localized text, emitted configuration, and component tests.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Console
  participant ApplicationAPI
  participant flowexec
  participant MobileApp
  Console->>ApplicationAPI: save attestation.devMode
  ApplicationAPI-->>MobileApp: persist DevMode configuration
  MobileApp->>flowexec: initiate flow without attestation token
  flowexec->>MobileApp: resolve DevMode initiation mode
  flowexec-->>MobileApp: allow direct flow initiation
Loading

Possibly related PRs

Suggested reviewers: brionmario, donomalvindula, jeradrutnam, thiva-k

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding a development mode flag for mobile app attestation.
Description check ✅ Passed The description covers the purpose, implementation, UI changes, related issue, testing, security checks, and screenshots; unchecked optional items do not make it incomplete.
Linked Issues check ✅ Passed The changes satisfy issue #4432 by adding per-application configuration, preserving the disabled default, and bypassing mobile attestation when DevMode is enabled.
Out of Scope Changes check ✅ Passed The backend, API, Console, documentation, tests, and credential-preservation fix all directly support the mobile attestation DevMode objective.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@backend/pkg/thunderidengine/providers/model.go`:
- Line 651: Update docs/content/apis.mdx to document AttestationConfig.devMode,
including its wire/configuration name, disabled-by-default behavior, mobile-only
scope, and update semantics. Update
docs/content/guides/mobile-app-attestation.mdx or the relevant existing guide to
explain that enabled dev mode bypasses flow-secret and platform-attestation
checks for mobile applications, with a clear testing-only warning.
- Line 651: Update the jsonschema description on the DevMode field in the model
definition to state that it bypasses flow-secret and platform-attestation checks
only during direct flow initiation, rather than broadly skipping attestation for
the application; preserve the existing default and testing/development guidance.

In `@frontend/apps/console/src/features/applications/models/oauth.ts`:
- Around line 511-526: Update the AttestationConfig type to use an exclusive
union for platform configuration: allow Android or Apple attestation, but not
both, while retaining devMode as a common field. Include an empty variant so
dev-only configurations remain valid, and preserve the existing
AndroidAttestationConfig and AppleAttestationConfig symbols.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2df864a7-e886-480f-aa12-dde1262e8fca

📥 Commits

Reviewing files that changed from the base of the PR and between 48689c2 and af04f9c.

📒 Files selected for processing (11)
  • backend/internal/application/service.go
  • backend/internal/application/service_test.go
  • backend/internal/flow/flowexec/constants.go
  • backend/internal/flow/flowexec/service.go
  • backend/internal/flow/flowexec/service_test.go
  • backend/pkg/thunderidengine/providers/model.go
  • backend/pkg/thunderidengine/providers/model_test.go
  • frontend/apps/console/src/features/applications/components/edit-application/advanced-settings/AttestationSection.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/advanced-settings/__tests__/AttestationSection.test.tsx
  • frontend/apps/console/src/features/applications/models/oauth.ts
  • frontend/packages/i18n/src/locales/en-US.ts

Comment thread backend/pkg/thunderidengine/providers/model.go Outdated
Comment thread frontend/apps/console/src/features/applications/models/oauth.ts Outdated
@Malith-19
Malith-19 force-pushed the feat/4432-mobile-attestation-dev-mode branch from af04f9c to 3831324 Compare July 30, 2026 10:10
@Malith-19 Malith-19 added the trigger-pr-builder Add when the PR is ready for CI; starts the PR Builder for this and all later pushes label Jul 30, 2026
@Malith-19
Malith-19 force-pushed the feat/4432-mobile-attestation-dev-mode branch from 3831324 to d38203b Compare July 30, 2026 11:09
@codecov

codecov Bot commented Jul 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.82540% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...plication/advanced-settings/AttestationSection.tsx 94.28% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Malith-19

Copy link
Copy Markdown
Member Author

We need to add a prompt when user enabling the dev mode and get the confirmation to enable it when doing.

@Malith-19
Malith-19 force-pushed the feat/4432-mobile-attestation-dev-mode branch from d38203b to b0c40e6 Compare July 31, 2026 05:34

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/content/guides/applications/application-settings.mdx`:
- Around line 194-197: Update the Dev Mode description to explicitly state that
it bypasses both Flow Secret and attestation checks only when a Mobile
application initiates a flow directly. Keep the existing configuration
instructions and warning, but clarify this scope so it does not imply
verification is removed for all application operations.

In
`@frontend/apps/console/src/features/applications/components/edit-application/advanced-settings/AttestationSection.tsx`:
- Around line 226-231: The emit flow in AttestationSection must persist Dev Mode
transitions even when Apple configuration is incomplete. Update the early-return
branch handling partially filled Apple fields to preserve the last valid
platform configuration while applying and emitting the current dev value, and
ensure both enabling and disabling transitions are covered by tests.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: fbcb2993-cc0f-4cd4-936f-8775a49152ec

📥 Commits

Reviewing files that changed from the base of the PR and between d38203b and b0c40e6.

📒 Files selected for processing (14)
  • api/application.yaml
  • backend/internal/application/service.go
  • backend/internal/application/service_test.go
  • backend/internal/flow/flowexec/constants.go
  • backend/internal/flow/flowexec/service.go
  • backend/internal/flow/flowexec/service_test.go
  • backend/pkg/thunderidengine/providers/model.go
  • backend/pkg/thunderidengine/providers/model_test.go
  • docs/content/guides/applications/application-settings.mdx
  • docs/content/key-concepts/authentication/integration-models.mdx
  • frontend/apps/console/src/features/applications/components/edit-application/advanced-settings/AttestationSection.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/advanced-settings/DevModeConfirmDialog.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/advanced-settings/__tests__/AttestationSection.test.tsx
  • frontend/apps/console/src/features/applications/components/edit-application/advanced-settings/__tests__/DevModeConfirmDialog.test.tsx
🚧 Files skipped from review as they are similar to previous changes (9)
  • docs/content/key-concepts/authentication/integration-models.mdx
  • backend/pkg/thunderidengine/providers/model.go
  • backend/internal/application/service.go
  • backend/internal/application/service_test.go
  • backend/internal/flow/flowexec/service.go
  • api/application.yaml
  • backend/internal/flow/flowexec/constants.go
  • backend/pkg/thunderidengine/providers/model_test.go
  • backend/internal/flow/flowexec/service_test.go

Comment thread docs/content/guides/applications/application-settings.mdx Outdated
@Malith-19
Malith-19 force-pushed the feat/4432-mobile-attestation-dev-mode branch from b0c40e6 to cfb6474 Compare July 31, 2026 05:49
ThaminduDilshan
ThaminduDilshan previously approved these changes Aug 3, 2026
@ThaminduDilshan
ThaminduDilshan added this pull request to the merge queue Aug 3, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 3, 2026
@Malith-19
Malith-19 added this pull request to the merge queue Aug 3, 2026
@Malith-19
Malith-19 force-pushed the feat/4432-mobile-attestation-dev-mode branch from cfb6474 to 97aec88 Compare August 3, 2026 05:15
@Malith-19
Malith-19 removed this pull request from the merge queue due to a manual request Aug 3, 2026
Mobile apps can now enable dev mode to skip attestation
verification, so sample and development clients can try out
sign-in flows without a configured platform attestation. Disabled
by default. Adds a matching toggle in the Console attestation
settings, placed in the card header like other enable toggles,
with a warning banner shown while it is on and a confirmation
dialog before it can be turned on. Documents the new flag in the
platform attestation and integration model guides, and in the
OpenAPI spec.

Fixes a bug where toggling dev mode while an Apple attestation
config was left incomplete would silently drop the change instead
of preserving the last valid platform config.

Refs thunder-id#4432
@Malith-19
Malith-19 added this pull request to the merge queue Aug 3, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 3, 2026
@Malith-19
Malith-19 added this pull request to the merge queue Aug 3, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Aug 3, 2026
@Malith-19
Malith-19 added this pull request to the merge queue Aug 3, 2026
Merged via the queue into thunder-id:main with commit 67a193c Aug 3, 2026
27 checks passed
@coderabbitai coderabbitai Bot mentioned this pull request Aug 18, 2026
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

trigger-pr-builder Add when the PR is ready for CI; starts the PR Builder for this and all later pushes Type/Improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add dev mode flag for mobile applications to bypass attestation

2 participants