Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CU/7433-Dylan-AuthMigration #8192

Open
wants to merge 123 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
547a1b8
first steps
Sparowhawk Mar 15, 2024
36c2cc0
Merge branch 'develop' into CU/7433-Dylan-AuthMigration
Sparowhawk Mar 19, 2024
2248d71
all but unit tests should be done
Sparowhawk Mar 20, 2024
94330a2
update
Sparowhawk Mar 20, 2024
4c1a1d1
works
Sparowhawk Mar 20, 2024
2636fde
removed auth state from tests
Sparowhawk Mar 21, 2024
304fb9a
Merge branch 'develop' into CU/7433-Dylan-AuthMigration
Sparowhawk Mar 21, 2024
5c0a334
fixed unit tests
Sparowhawk Mar 21, 2024
7c2f755
fixed merge conflicts
Sparowhawk Mar 21, 2024
5621f78
updated
Sparowhawk Mar 21, 2024
c3774c5
Merge branch 'develop' into CU/7433-Dylan-AuthMigration
Sparowhawk Mar 26, 2024
1e84a7a
fixed merge conflicts
Sparowhawk Mar 28, 2024
4d25c1a
updated
Sparowhawk Mar 28, 2024
55ff6ba
Merge branch 'develop' into CU/7433-Dylan-AuthMigration
Sparowhawk Apr 1, 2024
30da55f
fixed merge conflicts
Sparowhawk Apr 24, 2024
2ddce58
fixed merge conflicts
Sparowhawk Apr 24, 2024
ba82b38
merged develop
Sparowhawk May 2, 2024
b1898fe
Merge branch 'develop' into CU/7433-Dylan-AuthMigration
Sparowhawk May 3, 2024
8cab114
fixed merge conflict errors
Sparowhawk May 3, 2024
11c6a60
Merge branch 'develop' into CU/7433-Dylan-AuthMigration
Sparowhawk May 7, 2024
26a9bd3
Merge branch 'develop' into CU/7433-Dylan-AuthMigration
Sparowhawk May 10, 2024
48e8b6b
Merge branch 'develop' into CU/7433-Dylan-AuthMigration
Sparowhawk May 14, 2024
34f1a57
Merge branch 'develop' into CU/7433-Dylan-AuthMigration
Sparowhawk May 21, 2024
320035c
Merge branch 'develop' into CU/7433-Dylan-AuthMigration
Sparowhawk May 24, 2024
bb64a83
Merge branch 'develop' into CU/7433-Dylan-AuthMigration
Sparowhawk May 29, 2024
3068c89
Merge branch 'develop' into CU/7433-Dylan-AuthMigration
Sparowhawk Jun 6, 2024
40fffd8
merged develop
Sparowhawk Jul 10, 2024
f607128
fixed conflict
Sparowhawk Jul 10, 2024
5dd7f77
Add session consts
theodur Jul 16, 2024
f189d3e
Fix broken unit tests
theodur Jul 18, 2024
9dc4e58
Use query hook instead of query client
theodur Jul 18, 2024
e25acee
Merge branch 'develop' into CU/7433-Dylan-AuthMigration
theodur Jul 18, 2024
751d857
Merge branch 'develop' into CU/7433-Dylan-AuthMigration
Sparowhawk Jul 19, 2024
af73fa5
develop merge
Sparowhawk Oct 4, 2024
dce8a4a
fixed unit test
Sparowhawk Oct 4, 2024
4e67d83
update login screen for cerner alert
Sparowhawk Oct 4, 2024
9a1beac
Merge branch 'develop' into CU/7433-Dylan-AuthMigration
Sparowhawk Oct 7, 2024
29b518d
merge develop
Sparowhawk Oct 23, 2024
c7bffc6
added SSO back I think
Sparowhawk Oct 23, 2024
495f08a
Merge branch 'develop' into CU/7433-Dylan-AuthMigration
Sparowhawk Oct 30, 2024
b92ffa9
first round of Theo updates
Sparowhawk Nov 1, 2024
7d5496b
more fixes
Sparowhawk Nov 1, 2024
7d6d2bd
more fixes
Sparowhawk Nov 1, 2024
f0fd9ef
removed code Verifier and Challenge from RQ
Sparowhawk Nov 1, 2024
ddc8e27
fixed linting
Sparowhawk Nov 1, 2024
ef3c213
dev conflicts
Sparowhawk Nov 5, 2024
a11c502
fixed dev changes
Sparowhawk Nov 5, 2024
a361596
pulled out biometrics
Sparowhawk Nov 5, 2024
34e4e32
pulled out biometrics
Sparowhawk Nov 5, 2024
278c2ee
fixed errors
Sparowhawk Nov 5, 2024
d3076a2
try 784
Sparowhawk Nov 5, 2024
6d43f1c
more fixes
Sparowhawk Nov 6, 2024
37d6247
more unit test fixes
Sparowhawk Nov 6, 2024
aa11e2a
unit test test
Sparowhawk Nov 6, 2024
5ddfe4f
removed unit tests
Sparowhawk Nov 6, 2024
6e96423
test
Sparowhawk Nov 6, 2024
4cfc951
migrated back to redux store for necessary variables
Sparowhawk Nov 6, 2024
ba4864c
fixed linting
Sparowhawk Nov 6, 2024
b41363a
more linting
Sparowhawk Nov 6, 2024
9f8cc6b
more linting
Sparowhawk Nov 6, 2024
b98c21e
unit tests
Sparowhawk Nov 6, 2024
b067fe6
Merge branch 'develop' into CU/7433-Dylan-AuthMigration
Sparowhawk Nov 6, 2024
4006668
update demo mode
Sparowhawk Nov 6, 2024
6a0c7c9
develop
Sparowhawk Nov 6, 2024
13d27cc
Merge branch 'develop' into CU/7433-Dylan-AuthMigration
Sparowhawk Nov 8, 2024
d15c130
fixed linting
Sparowhawk Nov 8, 2024
d41e360
updated
Sparowhawk Nov 8, 2024
6900c4d
updated error names
Sparowhawk Nov 12, 2024
fb99516
Merge branch 'develop' into CU/7433-Dylan-AuthMigration
rbontrager Nov 13, 2024
870f655
updated
Sparowhawk Nov 14, 2024
4856aef
added Theo's changes
Sparowhawk Nov 14, 2024
28859a0
updated
Sparowhawk Nov 14, 2024
f7ce1ee
added snackbar
Sparowhawk Nov 14, 2024
87b80d7
keychain theo update
Sparowhawk Nov 14, 2024
a239a2b
added snackbar to login screen
Sparowhawk Nov 15, 2024
a9573a5
fixed crash
Sparowhawk Nov 15, 2024
0e618b5
debug updates
Sparowhawk Nov 20, 2024
5222a23
updated
Sparowhawk Nov 20, 2024
415811d
updated
Sparowhawk Nov 21, 2024
913459e
updated
Sparowhawk Nov 22, 2024
d491021
updated
Sparowhawk Nov 22, 2024
86493dd
Merge branch 'develop' into CU/7433-Dylan-AuthMigration
Sparowhawk Nov 22, 2024
fc68910
fixed linting
Sparowhawk Nov 22, 2024
998c5a9
fixed reset firt time login display biometrics
Sparowhawk Nov 26, 2024
5a41326
updated
Sparowhawk Nov 26, 2024
5fdafe6
updated
Sparowhawk Nov 26, 2024
7b17091
updated
Sparowhawk Nov 27, 2024
21d05be
updated
Sparowhawk Dec 4, 2024
4ab9b94
updated
Sparowhawk Dec 4, 2024
2ecec2c
updated
Sparowhawk Dec 4, 2024
02fbf7b
updated
Sparowhawk Dec 4, 2024
358ae90
updated
Sparowhawk Dec 4, 2024
22819c9
test
Sparowhawk Dec 5, 2024
32b4ac7
updated
Sparowhawk Dec 5, 2024
a307b57
updated
Sparowhawk Dec 5, 2024
bcd8b3c
removed stuff
Sparowhawk Dec 5, 2024
c75da78
updated
Sparowhawk Dec 5, 2024
69de447
update
Sparowhawk Dec 6, 2024
c2769fb
updated
Sparowhawk Dec 6, 2024
0393072
updated
Sparowhawk Dec 6, 2024
748b2de
updated
Sparowhawk Dec 10, 2024
5d0bc4e
updated
Sparowhawk Dec 10, 2024
af0a247
updated
Sparowhawk Dec 10, 2024
da3dd39
updated
Sparowhawk Dec 11, 2024
33553ff
updated
Sparowhawk Dec 11, 2024
acbf5ff
updated
Sparowhawk Dec 11, 2024
a135c34
updated
Sparowhawk Dec 11, 2024
92bf5fd
updated
Sparowhawk Dec 11, 2024
a13df1c
updated
Sparowhawk Dec 12, 2024
a6ea1f7
updated
Sparowhawk Dec 12, 2024
5211e61
Merge branch 'develop' into CU/7433-Dylan-AuthMigration
Sparowhawk Dec 12, 2024
4c1f0fb
updated
Sparowhawk Dec 12, 2024
753cbde
unit tests
Sparowhawk Dec 12, 2024
c4368ae
unit tests
Sparowhawk Dec 12, 2024
a9b21e1
linting
Sparowhawk Dec 12, 2024
9a18f8b
updated
Sparowhawk Dec 12, 2024
c5887e7
updated
Sparowhawk Dec 12, 2024
943b69c
updated
Sparowhawk Dec 12, 2024
ad53bfb
updated
Sparowhawk Dec 12, 2024
b986847
updated
Sparowhawk Dec 12, 2024
8110d24
updated
Sparowhawk Dec 12, 2024
f7aefa2
updated
Sparowhawk Dec 13, 2024
85c7a8a
updated
Sparowhawk Dec 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 29 additions & 10 deletions VAMobile/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1425,7 +1425,7 @@ PODS:
- React-Core
- react-native-safe-area-context (4.10.9):
- React-Core
- react-native-webview (13.10.4):
- react-native-webview (13.12.3):
- DoubleConversion
- glog
- hermes-engine
Expand Down Expand Up @@ -1763,9 +1763,28 @@ PODS:
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- RNKeychain (8.2.0):
- RNKeychain (9.1.0):
- DoubleConversion
- glog
- hermes-engine
- RCT-Folly (= 2024.01.01.00)
- RCTRequired
- RCTTypeSafety
- React-Core
- RNLocalize (3.2.1):
- React-debug
- React-Fabric
- React-featureflags
- React-graphics
- React-ImageManager
- React-NativeModulesApple
- React-RCTFabric
- React-rendererdebug
- React-utils
- ReactCodegen
- ReactCommon/turbomodule/bridging
- ReactCommon/turbomodule/core
- Yoga
- RNLocalize (3.3.0):
- React-Core
- RNReactNativeHapticFeedback (2.3.3):
- DoubleConversion
Expand Down Expand Up @@ -2121,7 +2140,7 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
boost: 4cb898d0bf20404aab1850c656dcea009429d6c1
DoubleConversion: fea03f2699887d960129cc54bba7e52542b6f953
DoubleConversion: 76ab83afb40bddeeee456813d9c04f67f78771b5
FBLazyVector: 7b438dceb9f904bd85ca3c31d64cce32a035472b
Firebase: 10c8cb12fb7ad2ae0c09ffc86cd9c1ab392a0031
FirebaseABTesting: d87f56707159bae64e269757a6e963d490f2eebe
Expand All @@ -2137,7 +2156,7 @@ SPEC CHECKSUMS:
FirebaseSessions: dbd14adac65ce996228652c1fc3a3f576bdf3ecc
FirebaseSharedSwift: 20530f495084b8d840f78a100d8c5ee613375f6e
fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120
glog: c5d68082e772fa1c511173d6b30a9de2c05a69a2
glog: 69ef571f3de08433d766d614c73a9838a06bf7eb
GoogleAppMeasurement: bb3c564c3efb933136af0e94899e0a46167466a8
GoogleDataTransport: 6c09b596d841063d76d4288cc2d2f42cc36e1e2a
GoogleUtilities: ea963c370a38a8069cc5f7ba4ca849a60b6d7d15
Expand Down Expand Up @@ -2184,7 +2203,7 @@ SPEC CHECKSUMS:
react-native-image-picker: 2fbbafdae7a7c6db9d25df2f2b1db4442d2ca2ad
react-native-notifications: 4601a5a8db4ced6ae7cfc43b44d35fe437ac50c4
react-native-safe-area-context: ab8f4a3d8180913bd78ae75dd599c94cce3d5e9a
react-native-webview: fbafd1591cd068bd599f0d1afb0ddc19718908fa
react-native-webview: 926d2665cf3196e39c4449a72d136d0a53b9df8a
React-nativeconfig: 4a9543185905fe41014c06776bf126083795aed9
React-NativeModulesApple: 0506da59fc40d2e1e6e12a233db5e81c46face27
React-perflogger: 3bbb82f18e9ac29a1a6931568e99d6305ef4403b
Expand Down Expand Up @@ -2222,16 +2241,16 @@ SPEC CHECKSUMS:
RNFBRemoteConfig: bfb9f6a04a0269038a352d8386e5c77f4ff98125
RNFileViewer: ce7ca3ac370e18554d35d6355cffd7c30437c592
RNGestureHandler: 939f21fabf5d45a725c0bf175eb819dd25cf2e70
RNKeychain: bfe3d12bf4620fe488771c414530bf16e88f3678
RNLocalize: 4f22418187ecd5ca693231093ff1d912d1b3c9bc
RNKeychain: 958a200b26c2df5036222105550290ac0ed98c90
RNLocalize: 298e85ce16540a11de40c1a588ead39fc5e9a072
RNReactNativeHapticFeedback: 0d591ea1e150f36cb96d868d4e8d77272243d78a
RNScreens: 19719a9c326e925498ac3b2d35c4e50fe87afc06
RNSVG: 963a95f1f5d512a13d11ffd50d351c87fb5c6890
SDWebImage: 8a6b7b160b4d710e2a22b6900e25301075c34cb3
SDWebImageWebPCoder: e38c0a70396191361d60c092933e22c20d5b1380
SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d
Yoga: 1354c027ab07c7736f99a3bef16172d6f1b12b47
Yoga: 4ef80d96a5534f0e01b3055f17d1e19a9fc61b63

PODFILE CHECKSUM: 528e5ac3a06c35c8645d8271610e36fdcca33735

COCOAPODS: 1.15.2
COCOAPODS: 1.16.2
4 changes: 4 additions & 0 deletions VAMobile/ios/VAMobile.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -495,6 +495,7 @@
"${PODS_CONFIGURATION_BUILD_DIR}/React-cxxreact/React-cxxreact_privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage/SDWebImage.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/boost/boost_privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/glog/glog_privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/react-native-blob-util/ReactNativeBlobUtilPrivacyInfo.bundle",
);
name = "[CP] Copy Pods Resources";
Expand All @@ -512,6 +513,7 @@
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/React-cxxreact_privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SDWebImage.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/boost_privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/glog_privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ReactNativeBlobUtilPrivacyInfo.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -552,6 +554,7 @@
"${PODS_CONFIGURATION_BUILD_DIR}/React-cxxreact/React-cxxreact_privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage/SDWebImage.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/boost/boost_privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/glog/glog_privacy.bundle",
"${PODS_CONFIGURATION_BUILD_DIR}/react-native-blob-util/ReactNativeBlobUtilPrivacyInfo.bundle",
);
name = "[CP] Copy Pods Resources";
Expand All @@ -569,6 +572,7 @@
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/React-cxxreact_privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/SDWebImage.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/boost_privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/glog_privacy.bundle",
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/ReactNativeBlobUtilPrivacyInfo.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down
2 changes: 2 additions & 0 deletions VAMobile/jest/testSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ jest.mock('../src/store/api', () => ({
setAccessToken: jest.fn(),
getAccessToken: jest.fn(),
setRefreshToken: jest.fn(),
setlogout: jest.fn(),
setRefreshAccessToken: jest.fn(),
}))

jest.mock('../src/utils/hooks', () => {
Expand Down
115 changes: 55 additions & 60 deletions VAMobile/src/App.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { Linking } from 'react-native'

import { screen } from '@testing-library/react-native'

import { handleTokenCallbackUrl, initialAuthState } from 'store/slices'
import { context, render } from 'testUtils'
import { authKeys } from 'api/auth'
import { QueriesData, context, render } from 'testUtils'

import { AuthGuard } from './App'

Expand All @@ -13,15 +13,6 @@ jest.mock('./utils/remoteConfig', () => ({
featureEnabled: jest.fn(() => false),
}))

jest.mock('./store/slices', () => {
const original = jest.requireActual('./store/slices')
return {
...original,
handleTokenCallbackUrl: jest.fn(() => ({ type: 'FOO' })),
initializeAuth: jest.fn(() => ({ type: 'FOO' })),
}
})

jest.mock('react-native-keyboard-manager', () => ({
setEnable: jest.fn(() => {}),
setKeyboardDistanceFromTextField: jest.fn(() => {}),
Expand All @@ -43,63 +34,48 @@ context('App', () => {
it('should render loading spinner while initializing', () => {
render(<AuthGuard />, {
preloadedState: {
auth: { ...initialAuthState, initializing: true },
settings: {
loadingRemoteConfig: true,
},
},
})

expect(screen.getByTestId('Splash-page')).toBeTruthy()
})

it('should initilize by registering for linking', () => {
render(<AuthGuard />, {
preloadedState: {
auth: { ...initialAuthState },
it('should render Login when not authorized', () => {
const queriesData: QueriesData = [
{
queryKey: authKeys.settings,
data: {
firstTimeLogin: false,
},
},
})
expect(Linking.addEventListener).toHaveBeenCalled()
})

it('should dispatch handleTokenCallbackUrl when auth token result comes back', () => {
render(<AuthGuard />, {
preloadedState: {
auth: { ...initialAuthState, initializing: false },
{
queryKey: authKeys.biometrics,
data: {
canStoreWithBiometric: false,
displayBiometricsPreferenceScreen: false,
shouldStoreWithBiometric: false,
supportedBiometric: undefined,
},
},
})

const spy = Linking.addEventListener as jest.Mock
const listeners = spy.mock.calls
listeners.forEach((k) => {
const listener = k[1]
listener({ url: 'vamobile://login-success?code=123&state=5434' })
})
expect(Linking.addEventListener).toHaveBeenCalled()
expect(handleTokenCallbackUrl).toHaveBeenCalled()
})

it('should not dispatch handleTokenCallbackUrl when not an auth result url', () => {
]
render(<AuthGuard />, {
preloadedState: {
auth: { ...initialAuthState, initializing: false },
settings: {
loadingRemoteConfig: false,
},
auth: {
loading: false,
loggedIn: false,
loggingOut: false,
syncing: false,
},
},
queriesData: queriesData,
})

expect(Linking.addEventListener).toHaveBeenCalled()
const spy = Linking.addEventListener as jest.Mock
const listeners = spy.mock.calls
listeners.forEach((k) => {
const listener = k[1]
listener({ url: 'vamobile://foo?code=123&state=5434' })
})

expect(handleTokenCallbackUrl).not.toHaveBeenCalled()
})

it('should render Login when not authorized', () => {
render(<AuthGuard />, {
preloadedState: {
auth: { ...initialAuthState, initializing: false },
},
})
expect(screen.queryByText('Profile')).toBeFalsy()
expect(screen.queryByText('Home')).toBeFalsy()
expect(screen.queryByText('Benefits')).toBeFalsy()
Expand All @@ -108,17 +84,36 @@ context('App', () => {
})

it('should render AuthedApp when authorized', () => {
const queriesData: QueriesData = [
{
queryKey: authKeys.settings,
data: {
firstTimeLogin: false,
},
},
{
queryKey: authKeys.biometrics,
data: {
canStoreWithBiometric: false,
displayBiometricsPreferenceScreen: false,
shouldStoreWithBiometric: false,
supportedBiometric: undefined,
},
},
]
render(<AuthGuard />, {
preloadedState: {
auth: {
...initialAuthState,
initializing: false,
loggedIn: true,
},
settings: {
remoteConfigActivated: true,
},
auth: {
loading: false,
loggedIn: true,
loggingOut: false,
syncing: false,
},
},
queriesData: queriesData,
})

expect(screen.getByText('Profile')).toBeTruthy()
Expand Down
Loading
Loading