| |
| module.exports = { |
| Issuer: { |
| discover: jest.fn().mockResolvedValue({ |
| Client: jest.fn().mockImplementation(() => ({ |
| authorizationUrl: jest.fn().mockReturnValue('mock_auth_url'), |
| callback: jest.fn().mockResolvedValue({ |
| access_token: 'mock_access_token', |
| id_token: 'mock_id_token', |
| claims: () => ({ |
| sub: 'mock_sub', |
| email: 'mock@example.com', |
| }), |
| }), |
| userinfo: jest.fn().mockResolvedValue({ |
| sub: 'mock_sub', |
| email: 'mock@example.com', |
| }), |
| })), |
| }), |
| }, |
| Strategy: jest.fn().mockImplementation((options, verify) => { |
| |
| return { name: 'openid-mock-strategy' }; |
| }), |
| custom: { |
| setHttpOptionsDefaults: jest.fn(), |
| }, |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| |
| discovery: jest.fn().mockResolvedValue({ |
| clientId: 'fake_client_id', |
| clientSecret: 'fake_client_secret', |
| issuer: 'https://fake-issuer.com', |
| serverMetadata: jest.fn().mockReturnValue({ |
| jwks_uri: 'https://fake-issuer.com/.well-known/jwks.json', |
| end_session_endpoint: 'https://fake-issuer.com/logout', |
| }), |
| Client: jest.fn().mockImplementation(() => ({ |
| authorizationUrl: jest.fn().mockReturnValue('mock_auth_url'), |
| callback: jest.fn().mockResolvedValue({ |
| access_token: 'mock_access_token', |
| id_token: 'mock_id_token', |
| claims: () => ({ |
| sub: 'mock_sub', |
| email: 'mock@example.com', |
| }), |
| }), |
| userinfo: jest.fn().mockResolvedValue({ |
| sub: 'mock_sub', |
| email: 'mock@example.com', |
| }), |
| grant: jest.fn().mockResolvedValue({ access_token: 'mock_grant_token' }), |
| })), |
| }), |
| fetchUserInfo: jest.fn().mockResolvedValue({ |
| preferred_username: 'preferred_username', |
| }), |
| genericGrantRequest: jest |
| .fn() |
| .mockResolvedValue({ access_token: 'mock_grant_access_token', expires_in: 3600 }), |
| customFetch: Symbol('customFetch'), |
| }; |
|
|