mirror of
https://github.com/inventree/InvenTree.git
synced 2026-11-18 14:07:41 +00:00
* Extend SSO auth workflows * SSO e2e testing workflow * Remove orphaned code * Add unit tests for SSO * improved error messaging * Add test for SSO registration disabled * Fix gating on LOGIN_ENABLE_SSO * Adjust UI state management * Add playwright test for SSO disabled * Add backend unit tests * Adjust API version * Additional playwright tests * Retain desired page state on login failure * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Adjust test code * Stricter matcher checking --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
65 lines
1.6 KiB
TypeScript
65 lines
1.6 KiB
TypeScript
export const webUrl = '/web';
|
|
|
|
// Note: API requests are handled by the backend server
|
|
export const apiUrl = 'http://localhost:8000/api/';
|
|
|
|
export const homeUrl = `${webUrl}/home`;
|
|
export const loginUrl = `${webUrl}/login`;
|
|
export const logoutUrl = `${webUrl}/logout`;
|
|
|
|
export type UserType = {
|
|
name?: string;
|
|
username: string;
|
|
testcred: string;
|
|
};
|
|
|
|
export const allaccessuser: UserType = {
|
|
name: 'Ally Access',
|
|
username: 'allaccess',
|
|
testcred: 'nolimits'
|
|
};
|
|
|
|
export const adminuser: UserType = {
|
|
username: 'admin',
|
|
testcred: 'inventree'
|
|
};
|
|
|
|
export const stevenuser: UserType = {
|
|
username: 'steven',
|
|
testcred: 'wizardstaff'
|
|
};
|
|
|
|
export const readeruser: UserType = {
|
|
username: 'reader',
|
|
testcred: 'readonly'
|
|
};
|
|
|
|
export const noaccessuser: UserType = {
|
|
username: 'noaccess',
|
|
testcred: 'youshallnotpass'
|
|
};
|
|
|
|
export const engineeruser: UserType = {
|
|
username: 'engineer',
|
|
testcred: 'partsonly'
|
|
};
|
|
|
|
export const mockOidcPort = 9950;
|
|
export const mockOidcUrl = `http://localhost:${mockOidcPort}`;
|
|
|
|
/*
|
|
* Identity always returned by the mock OIDC provider used in pui_sso.spec.ts
|
|
* (see playwright/mock-oidc-server.mjs). It has no matching InvenTree
|
|
* account, so logging in with it exercises the pending 'provider_signup'
|
|
* flow. Consumed both by playwright.config.ts (to configure the mock
|
|
* server's env and the backend's SSO provider settings) and by the test spec
|
|
* itself, so both sides agree on the same values.
|
|
*/
|
|
export const mockSsoUser = {
|
|
sub: 'mock-oidc-user-1',
|
|
username: 'ssotestuser',
|
|
email: 'ssotestuser@example.org',
|
|
firstName: 'Sso',
|
|
lastName: 'Testuser'
|
|
};
|