mattermost-mobile-upstream/.gitignore
Felipe Martin 9ccfa0ebe9
Some checks are pending
ci / lint-typecheck (push) Waiting to run
ci / detox-lint-typecheck (push) Waiting to run
ci / test (push) Waiting to run
[MM-70605][MM-70607] Scope pre-auth secret storage per server (#10149)
* [MM-70605][MM-70607] Scope pre-auth secret storage per server

The pre-auth secret was written with react-native-keychain's generic-password
API using the `server` option, which those calls do not read. Every server
therefore resolved to one shared entry, and a falsy secret argument deleted it,
so ordinary operations such as building a client, refreshing the token header or
removing another server discarded the stored value.

Key the entry per server instead. On Android the alias namespace is shared with
internet credentials, so the service is prefixed to keep it away from the
session token; iOS uses the bare server URL, which is what the native reader in
Gekidou already queries. The account value is renamed to `preauth_secret` on
both sides. Writing the token no longer touches the secret: removal is explicit,
via removePreauthSecret.

A one-time migration adopts the previously shared entry when a single server
makes ownership unambiguous, and discards it otherwise. It only deletes the old
entry once the new one is confirmed stored, and defers when no server is active.

Also forward the secret through the login screen to SSO, and fix loginOptions to
count only enabled providers so the single-provider redirect works. Relands the
`.enabled` filter from #9585 by @pltnm239.

Edit Server now updates the live client's headers rather than invalidating the
session, and validates with the candidate secret so a value the server rejects
cannot be saved.

* [MM-70605] Harden preauth secret flows and fix Edit Server Detox on iOS

Address review feedback around migration markers, credential errors, and
keeping re-login secrets out of nav params. Focus the empty Authentication
secret field via Display Name return so iOS Detox can type into it.

Co-authored-by: Cursor <cursoragent@cursor.com>

* [MM-70605] Fix lines-around-comment in Edit Server Detox helper

Co-authored-by: Cursor <cursoragent@cursor.com>

* [MM-70605] Roll back preauth keychain when Edit Server client sync fails

After the secret is stored, header apply or createClient failures left the
new value in secure storage while UI state still held the old baseline.
Restore the previous secret (and live header) before surfacing the error.

Co-authored-by: Cursor <cursoragent@cursor.com>

* [MM-70605] Preserve exact preauth secret on Edit Server rollback

Avoid trimming during keychain restore so boundary whitespace from the
previously stored value is not altered.

Co-authored-by: Cursor <cursoragent@cursor.com>

* [MM-70605] Harden preauth migration ownership and secret handoff

Adopt the legacy secret only when a single server exists in the app DB,
keep add-server candidates in EphemeralStore instead of nav params, and
resync the live client to stored credentials when keychain rollback fails.

Co-authored-by: Cursor <cursoragent@cursor.com>

* [MM-70605] Discard the legacy preauth secret when no server can own it

* [MM-70605] Shorten the preauth migration docblock

* [MM-70605] Skip the Authorization header when there is no bearer token

* [MM-70605] Surface preauth secret rejections with a specific error message

* [MM-70605] Mock clearPendingPreauthSecret in session action tests

* [MM-70605] Remove the unreachable catch from restorePreviousPreauthSecret

setPreauthSecret and removePreauthSecret never reject, and the returned promise was not awaited, so the catch could not run.

* [MM-70605] Use network-client fix for the iOS addHeaders crash

Temporary pin to mattermost/react-native-network-client#175 to check CI. Replace with the released version before merge.

* [MM-70605] Bump react-native-network-client to 1.11.5

1.11.5 gives each recreated iOS session its own delegate in addHeaders, which fixes the SIGTRAP on pre-auth secret changes.

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-23 12:02:41 +02:00

161 lines
2.6 KiB
Plaintext

assets/override
dist
build-ios
*.zip
server.PID
mattermost.keystore
tmp/
.env
env.d.ts
*.apk
*.aab
*.ipa
.tsbuildinfo.precommit
*/**/compass-icons.ttf
# OSX
#
.DS_Store
# Xcode
#
ios/build/*
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.xcuserstate
project.xcworkspace
ios/Pods
.podinstall
ios/.xcode.env.local
# Android/IntelliJ
#
.idea
.gradle
local.properties
*.iml
*.hprof
.cxx/
*.keystore
!debug.keystore
android/app/bin
android/app/build
android/build
.settings
.project
.classpath
.kotlin
# node.js
#
node_modules/
npm-debug.log
.npminstall
yarn-error.log
.yarninstall
# Vim
[._]*.s[a-w][a-z]
[._]s[a-w][a-z]
*.un~
Session.vim
.netrwhist
*~
tags
# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/
**/fastlane/report.xml
**/fastlane/Preview.html
**/fastlane/screenshots
**/fastlane/test_output
**/fastlane/.env
# Sentry
android/sentry.properties
ios/sentry.properties
# Testing
.nyc_output
coverage
.tmp
# E2E testing
mattermost-license.txt
*.mattermost-license
detox/artifacts
detox/detox_pixel_*
detox/e2e/support/fixtures/*.tar.gz
mobile-artifacts/
# Bundle artifact
*.jsbundle
.bundle
#editor-settings
.vscode
.scannerwork
launch.json
# Notice.txt generation
!build/notice-file
# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*
libraries/**/**/build
libraries/**/**/.build
# Android sounds
android/app/src/main/res/raw/*
.aider*
# Intune submodule (private repository - internal builds only)
# Track submodule reference but ignore content
libraries/@mattermost/intune/*
!libraries/@mattermost/intune/.gitkeep
# Prevent committing Intune module in node_modules
node_modules/@mattermost/intune
# Claude Code
.claude/settings.local.json
.codex/
.cursor/*
!.cursor/README.md
!.cursor/cursor.md
!.cursor/Dockerfile
!.cursor/environment.json
!.cursor/scripts/
.cursor/scripts/*
!.cursor/scripts/cloud-agent-install.sh
!.cursor/scripts/cloud-agent-start.sh
!.cursor/scripts/cloud-agent-smoke.sh
.planning/
# Local Maestro test env (generated by fixtures/seed.ts)
detox/maestro/.maestro-test-env*.sh
detox/maestro/.maestro-test-env*.bak
.e2e-debug/
.xcodebuildmcp/
# Maestro takeScreenshot output when a flow is run locally without
# --test-output-dir; the name is the flow's own label, so match any of them.
detox/maestro/*.png