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

STCOR-875 merge eureka work to mainline #1532

Merged
merged 66 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
e5953fb
STCOR-769 Utilize the 'tenant' procured through the SSO login process…
usavkov-epam Mar 14, 2024
2bea8b0
leverage keycloak (authn) and kong (discovery) endpoints
zburke Dec 8, 2023
be61b76
test cleanup
zburke Dec 13, 2023
e22b146
backwards compatibility with non-keycloak environments
zburke Dec 14, 2023
20e689b
lint cleanup, console.log cleanup
zburke Dec 14, 2023
131317e
Update PreLoginLanding.js
ryandberger May 15, 2024
5139ff9
Add back button support to multi-tenant workflow (#1381)
ryandberger Dec 22, 2023
cb1a703
STCOR-773 show legacy or application-based discovery info (#1385)
zburke Jan 4, 2024
1bf2d1e
Graceful handling when provides array is null in API response (#1388)
ryandberger Jan 10, 2024
dfc2796
STCOR-790: check parsed client id, if undefined use clientId defined …
aidynoJ Jan 15, 2024
c4179dd
STCOR-795 optionally use users-keycloak endpoint for password reset (…
zburke Jan 22, 2024
08924af
STCOR-794: Disable Continue button when no tenant selected (#1400)
ryandberger Jan 22, 2024
30fb38b
STCOR-796 replace x-okapi-token credentials with RTR and cookies (#1410)
zburke Jan 31, 2024
58de751
Add opt-in "Really logout?" stripes.config.js option (#1420)
ryandberger Feb 13, 2024
a884e19
STCOR-798 Add Jest tests for SSO Landing - remove BTOG tests for the …
zburke Feb 14, 2024
f0519e5
STCOR-811 parse /authn/token response for AT/RT expirations (#1417)
zburke Feb 14, 2024
9ab368f
STCOR-812 include X-Okapi-Tenant header in /authn/logout requests (#1…
zburke Feb 14, 2024
cc558af
STCOR-813 correctly parse .../_self permissions (#1421)
zburke Feb 14, 2024
96c61d3
STCOR-770: Export getEventHandler to be able to create events in othe…
zburke Feb 14, 2024
7f8b167
STCOR-810 cleanup deprecated entitlement params (#1418)
zburke Feb 16, 2024
6ef610c
[STCOR-803] Simplify logout workflow to bypass keycloak confirmation …
ryandberger Feb 16, 2024
7e7a87c
Revert "STCOR-810 cleanup deprecated entitlement params (#1418)" (#1427)
zburke Feb 18, 2024
6ac81a5
STCOR-810 CORRECTLY clean up deprecated entitlement params (#1429)
zburke Feb 19, 2024
3d422d4
STCOR-816 only fetch /saml/check when login-saml is present (#1432)
zburke Feb 26, 2024
0a2db9d
STCOR-776 show "Keep working?" prompt when session ages (#1431)
zburke Feb 27, 2024
8eb82e7
Revert "STCOR-776 show "Keep working?" prompt when session ages (#143…
zburke Feb 29, 2024
d473e15
STCOR-821 Add `idName` and `limit` as passable props to `useChunkedCQ…
ryandberger Mar 6, 2024
9776a6a
STCOR-789: Restore original URL on login (#1442)
aidynoJ Mar 18, 2024
198d379
STCOR-820 For the /reset-password route, allow token to be specified …
ryandberger Mar 22, 2024
f0a1fdc
rebase cleanup: missed a few things along the way
zburke Mar 28, 2024
e005c51
STCOR-820 Use isEureka config value (#1450)
ryandberger Apr 5, 2024
defb2d9
STCOR-789-follow-up: Include /authn/token on the list of always-permi…
aidynoJ Apr 9, 2024
681abf1
STCOR-712 Refactor tagname selectors used in Auth-related forms. (#1449)
JohnC-80 Apr 3, 2024
75772fd
STCOR-830 user-tenant-permissions hooks/functions (#1453)
zburke Apr 11, 2024
393aea3
STCOR-769 Utilize the 'tenant' procured through the SSO login process…
usavkov-epam Mar 14, 2024
b8a39ac
STCOR-845 Redirect correctly after changing password (#1462)
ryandberger May 7, 2024
a9b860d
rebase-cleanup: the STCOR-776 rebase was a doozy
zburke May 17, 2024
eeaa34a
rebase-cleanup: restore logout
zburke May 20, 2024
5bc64ce
rebase-cleanup: restore logout AND ITS TESTS (#1479)
zburke May 23, 2024
92e6926
STCOR-853 do not include credential in /authn/token request (#1480)
zburke May 23, 2024
91ae4f9
Revert "STCOR-853 do not include credential in /authn/token request (…
zburke May 30, 2024
e738a2f
[STCOR-787] Always retrieve clientId and tenant values from config.te…
ryandberger Jun 10, 2024
cc773c6
STCOR-859 list UI apps under apps/modules/interfaces column (#1489)
zburke Jun 10, 2024
2e162f6
STCOR-776 RTR adjustments for keycloak (#1490)
zburke Jun 11, 2024
eed1ba5
STCOR-787 Fix tenant and clientId references (#1492)
ryandberger Jun 24, 2024
6201292
STCOR-864 correctly evaluate typeof stripes.okapi (#1498)
zburke Jun 25, 2024
8daa267
STCOR-865 call logout() exclusively from logout-* routes (#1500)
zburke Jul 8, 2024
bec39d5
STCOR-834: refactor useUserTenantPermissions to use _self endpoint pe…
aidynoJ Jul 15, 2024
f93f21d
STCOR-866 include `/users-keycloak/_self` in auth-n requests (#1502)
zburke Jul 16, 2024
f150e29
STCOR-867 Add permission display names lookup table to Redux (#1505)
ryandberger Jul 22, 2024
8b5274e
STCOR-862 terminate session when fixed-length session expires (#1503)
zburke Jul 22, 2024
48ca517
Add back missing reference to state (#1506)
ryandberger Jul 23, 2024
c25e068
STCOR-869 do not store /logout as a "return-to" URL (#1510)
zburke Jul 26, 2024
da01a6a
[STCOR-869] Add small margin to ensure /logout is called before cooki…
ryandberger Aug 8, 2024
3ecfebc
STCOR-872: expose queryKeys from useChunkedCQLFetch hook (#1520)
aidynoJ Aug 16, 2024
859a520
STCOR-874 provide "key" prop to SessionEventContainer elements (#1521…
zburke Aug 16, 2024
54e5eff
STCOR-873 Ensure support for the passed `tenantId` value by `useChunk…
usavkov-epam Aug 19, 2024
d3f2c20
[STCOR-876] Remember requested URL path on Login (Regression bug) (#…
ryandberger Aug 23, 2024
f694821
[STCOR-885] Clear saved entry path so that subsequent logins will use…
ryandberger Sep 9, 2024
4176fde
Merge branch 'master' into keycloak-ramsons
zburke Sep 12, 2024
2106d9c
STCOR-875 sync to master
zburke Sep 12, 2024
e08f5de
additional test corrections
zburke Sep 13, 2024
7a368e6
Merge branch 'keycloak-ramsons' into STCOR-875
zburke Sep 13, 2024
28845c3
STCOR-875 restore the simplicity of logout in STCOR-865
zburke Sep 17, 2024
5d30376
Merge pull request #1534 from folio-org/STCOR-875
zburke Sep 20, 2024
a59cfad
STCOR-889 include all reference interfaces in optionalOkapiInterfaces…
zburke Sep 20, 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ artifacts
dist
junit.xml
.vscode/launch.json
.idea
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,28 @@
* Update session data with values from `_self` request on reload. Refs STCOR-846.
* Avoid deprecated `getChildContext`. Refs STCOR-842.
* Read locale from stripes-config before defaulting to `en-US`. Refs STCOR-851.
* Use keycloak URLs in place of users-bl for tenant-switch. Refs US1153537.
* Fix 404 error page when logging in after changing password in Eureka. Refs STCOR-845.
* Always retrieve `clientId` and `tenant` values from `config.tenantOptions` in stripes.config.js. Retires `okapi.tenant`, `okapi.clientId`, and `config.isSingleTenant`. Refs STCOR-787.
* List UI apps in "Applications/modules/interfaces" column. STCOR-773
* Correctly evaluate `stripes.okapi` before rendering `<RootWithIntl>`. Refs STCOR-864.
* `/users-keycloak/_self` is an authentication request. Refs STCOR-866.
* Terminate the session when the fixed-length session expires. Refs STCOR-862.
* Ensure support for the passed `tenantId` value by `useChunkedCQLFetch` for manipulations in the context of a specific tenant. Refs STCOR-873.
* Provide `key` to elements in `<SessionEventContainer>`. Refs STCOR-874.
* Correctly populate `stripes.user.user` on reload. Refs STCOR-860.
* Correctly evaluate `stripes.okapi` before rendering `<RootWithIntl>`. Refs STCOR-864.
* Change main navigation's skip link label to "Skip to main content". Refs STCOR-863.
* Invalidate `QueryClient` cache on login/logout. Refs STCOR-832.
* Ensure support for the passed `tenantId` value by `useChunkedCQLFetch` for manipulations in the context of a specific tenant. Refs STCOR-873.
* When re-authenticating after logout timeout, return to previous location. Refs STCOR-849.
* Add `nl` (Dutch, Flemish) to the supported locales. Refs STCOR-878.
* Include optional okapi interfaces, `consortia`, `roles`, `users-keycloak`. Refs STCOR-889.

## [10.1.1](https://github.com/folio-org/stripes-core/tree/v10.1.1) (2024-03-25)
[Full Changelog](https://github.com/folio-org/stripes-core/compare/v10.1.0...v10.1.1)

* Utilize the `tenant` procured through the SSO login process. Refs STCOR-769.

## [10.1.0](https://github.com/folio-org/stripes-core/tree/v10.1.0) (2024-03-12)
[Full Changelog](https://github.com/folio-org/stripes-core/compare/v10.0.0...v10.1.0)
Expand Down Expand Up @@ -63,6 +78,17 @@
[Full Changelog](https://github.com/folio-org/stripes-core/compare/v10.0.0...v10.0.1)

* Export `validateUser`. Refs STCOR-749.
* Opt-in: handle access-control via cookies. Refs STCOR-671.
* Opt-in: disable login when cookies are disabled. Refs STCOR-762.
* Convert `<SSOLanding />` tests to jest. STCOR-798.
* Parse response from `/authn/token` to immediately store AT/RT expiration values. Refs STCOR-811.
* Include `X-Okapi-Tenant` header in `/authn/logout` calls. Refs STCOR-812.
* Correctly parse `.../_self` permissions object. Refs STCOR-813.
* Export `getEventHandler` to be able to create events in other modules. Refs STCOR-770.
* Simplify logout workflow to bypass keycloak confirmation page. Refs STCOR-803.
* After login, only check SSO endpoints when `login-saml` interface is present. Refs STCOR-816.
* Add `idName` and `limit` as passable props to `useChunkedCQLFetch`. Refs STCOR-821.
* For the `/reset-password` route, allow token to be specified in the path or query arguments. Refs STCOR-820.

## [10.0.0](https://github.com/folio-org/stripes-core/tree/v10.0.0) (2023-10-11)
[Full Changelog](https://github.com/folio-org/stripes-core/compare/v9.0.0...v10.0.0)
Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@
"configuration": "2.0"
},
"optionalOkapiInterfaces": {
"login-saml": "2.0"
"consortia": "1.0",
"login-saml": "2.0",
"roles": "1.1",
"users-keycloak": "1.0"
},
"permissionSets": [
{
Expand Down
7 changes: 5 additions & 2 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,11 @@ export default class StripesCore extends Component {
constructor(props) {
super(props);

const storedTenant = localStorage.getItem('tenant');
const parsedTenant = storedTenant ? JSON.parse(storedTenant) : undefined;

const okapi = (typeof okapiConfig === 'object' && Object.keys(okapiConfig).length > 0)
? okapiConfig : { withoutOkapi: true };
? { ...okapiConfig, tenant: parsedTenant?.tenantName || okapiConfig.tenant, clientId: parsedTenant?.clientId || okapiConfig.clientId } : { withoutOkapi: true };

const initialState = merge({}, { okapi }, props.initialState);

Expand All @@ -61,7 +64,7 @@ export default class StripesCore extends Component {
logger={this.logger}
config={config}
actionNames={this.actionNames}
disableAuth={(config && config.disableAuth) || false}
disableAuth={(config?.disableAuth) || false}
{...props}
/>
</StrictWrapper>
Expand Down
25 changes: 18 additions & 7 deletions src/RootWithIntl.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ import {
ModuleTranslator,
TitledRoute,
Front,
OIDCRedirect,
OIDCLanding,
SSOLanding,
SSORedirect,
Settings,
HandlerManager,
TitleManager,
Login,
Logout,
LogoutTimeout,
OverlayContainer,
Expand All @@ -39,6 +40,7 @@ import {
import StaleBundleWarning from './components/StaleBundleWarning';
import { StripesContext } from './StripesContext';
import { CalloutContext } from './CalloutContext';
import AuthnLogin from './components/AuthnLogin';

const RootWithIntl = ({ stripes, token = '', isAuthenticated = false, disableAuth, history = {}, queryClient }) => {
const connect = connectFor('@folio/core', stripes.epics, stripes.logger);
Expand Down Expand Up @@ -88,6 +90,12 @@ const RootWithIntl = ({ stripes, token = '', isAuthenticated = false, disableAut
key="sso-landing"
component={<SSORedirect stripes={connectedStripes} />}
/>
<TitledRoute
name="oidcRedirect"
path="/oidc-landing"
key="oidc-landing"
component={<OIDCRedirect stripes={stripes} />}
/>
<TitledRoute
name="logoutTimeout"
path="/logout-timeout"
Expand Down Expand Up @@ -126,6 +134,13 @@ const RootWithIntl = ({ stripes, token = '', isAuthenticated = false, disableAut
component={<CookiesProvider><SSOLanding stripes={connectedStripes} /></CookiesProvider>}
key="sso-landing"
/>
<TitledRoute
name="oidcLanding"
exact
path="/oidc-landing"
component={<CookiesProvider><OIDCLanding stripes={stripes} /></CookiesProvider>}
key="oidc-landing"
/>
<TitledRoute
name="forgotPassword"
path="/forgot-password"
Expand All @@ -148,11 +163,8 @@ const RootWithIntl = ({ stripes, token = '', isAuthenticated = false, disableAut
/>
<TitledRoute
name="login"
component={
<Login
autoLogin={connectedStripes.config.autoLogin}
stripes={connectedStripes}
/>}
path="*"
component={<AuthnLogin stripes={connectedStripes} />}
/>
</Switch>
}
Expand Down Expand Up @@ -183,4 +195,3 @@ RootWithIntl.propTypes = {
};

export default RootWithIntl;

10 changes: 6 additions & 4 deletions src/RootWithIntl.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { render, screen } from '@folio/jest-config-stripes/testing-library/react
import { Router as DefaultRouter } from 'react-router-dom';
import { createMemoryHistory } from 'history';

import AuthnLogin from './components/AuthnLogin';
import {
Login,
MainNav,
Expand All @@ -18,6 +19,7 @@ import {
import RootWithIntl from './RootWithIntl';
import Stripes from './Stripes';

jest.mock('./components/AuthnLogin', () => () => '<AuthnLogin>');
jest.mock('./components/Login', () => () => '<Login>');
jest.mock('./components/MainNav', () => () => '<MainNav>');
jest.mock('./components/OverlayContainer', () => () => '<OverlayContainer>');
Expand Down Expand Up @@ -56,7 +58,7 @@ describe('RootWithIntl', () => {
const stripes = new Stripes({ epics: {}, logger: {}, bindings: {}, config: {}, store, discovery: { isFinished: false } });
await render(<Harness><RootWithIntl stripes={stripes} history={defaultHistory} isAuthenticated={false} /></Harness>);

expect(screen.getByText(/<Login>/)).toBeInTheDocument();
expect(screen.getByText(/<AuthnLogin>/)).toBeInTheDocument();
expect(screen.queryByText(/<MainNav>/)).toBeNull();
});

Expand All @@ -65,23 +67,23 @@ describe('RootWithIntl', () => {
const stripes = new Stripes({ epics: {}, logger: {}, bindings: {}, config: {}, store, discovery: { isFinished: false } });
await render(<Harness><RootWithIntl stripes={stripes} history={defaultHistory} isAuthenticated /></Harness>);

expect(screen.queryByText(/<Login>/)).toBeNull();
expect(screen.queryByText(/<AuthnLogin>/)).toBeNull();
expect(screen.queryByText(/<MainNav>/)).toBeInTheDocument();
});

it('given token', async () => {
const stripes = new Stripes({ epics: {}, logger: {}, bindings: {}, config: {}, store, discovery: { isFinished: false } });
await render(<Harness><RootWithIntl stripes={stripes} history={defaultHistory} token /></Harness>);

expect(screen.queryByText(/<Login>/)).toBeNull();
expect(screen.queryByText(/<AuthnLogin>/)).toBeNull();
expect(screen.queryByText(/<MainNav>/)).toBeInTheDocument();
});

it('given disableAuth', async () => {
const stripes = new Stripes({ epics: {}, logger: {}, bindings: {}, config: {}, store, discovery: { isFinished: false } });
await render(<Harness><RootWithIntl stripes={stripes} history={defaultHistory} disableAuth /></Harness>);

expect(screen.queryByText(/<Login>/)).toBeNull();
expect(screen.queryByText(/<AuthnLogin>/)).toBeNull();
expect(screen.queryByText(/<MainNav>/)).toBeInTheDocument();
});
});
Expand Down
1 change: 1 addition & 0 deletions src/Stripes.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const stripesShape = PropTypes.shape({
logTimestamp: PropTypes.bool,
showHomeLink: PropTypes.bool,
showPerms: PropTypes.bool,
tenantOptions: PropTypes.object,
}).isRequired,
connect: PropTypes.func.isRequired,
currency: PropTypes.string,
Expand Down
4 changes: 4 additions & 0 deletions src/components/About/About.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@
.incompatible {
color: orange;
}

.paddingLeftOfListItems {
padding-left: 14px;
}
Loading
Loading