Add dev mode flag for mobile app attestation - #4434
Conversation
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughThis change adds mobile attestation ChangesMobile attestation dev mode
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
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (11)
backend/internal/application/service.gobackend/internal/application/service_test.gobackend/internal/flow/flowexec/constants.gobackend/internal/flow/flowexec/service.gobackend/internal/flow/flowexec/service_test.gobackend/pkg/thunderidengine/providers/model.gobackend/pkg/thunderidengine/providers/model_test.gofrontend/apps/console/src/features/applications/components/edit-application/advanced-settings/AttestationSection.tsxfrontend/apps/console/src/features/applications/components/edit-application/advanced-settings/__tests__/AttestationSection.test.tsxfrontend/apps/console/src/features/applications/models/oauth.tsfrontend/packages/i18n/src/locales/en-US.ts
af04f9c to
3831324
Compare
3831324 to
d38203b
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
We need to add a prompt when user enabling the dev mode and get the confirmation to enable it when doing. |
d38203b to
b0c40e6
Compare
There was a problem hiding this comment.
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
📒 Files selected for processing (14)
api/application.yamlbackend/internal/application/service.gobackend/internal/application/service_test.gobackend/internal/flow/flowexec/constants.gobackend/internal/flow/flowexec/service.gobackend/internal/flow/flowexec/service_test.gobackend/pkg/thunderidengine/providers/model.gobackend/pkg/thunderidengine/providers/model_test.godocs/content/guides/applications/application-settings.mdxdocs/content/key-concepts/authentication/integration-models.mdxfrontend/apps/console/src/features/applications/components/edit-application/advanced-settings/AttestationSection.tsxfrontend/apps/console/src/features/applications/components/edit-application/advanced-settings/DevModeConfirmDialog.tsxfrontend/apps/console/src/features/applications/components/edit-application/advanced-settings/__tests__/AttestationSection.test.tsxfrontend/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
b0c40e6 to
cfb6474
Compare
cfb6474 to
97aec88
Compare
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
97aec88 to
ddeffd4
Compare
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
AttestationConfig.DevMode(devModeon the wire), and a newflowInitiationDevModeflow-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 droppedDevModeon update.UI Preview
Related Issues
Related PRs
Checklist
breaking changelabel added.Security checks
Summary by CodeRabbit
New Features
Documentation
Bug Fixes